I have customregions in a box but some dungeons are very big, and im not able to cover everytile to prevernt recall or mark.

I added a check from doom, it ONLY WORKS if recalls are from book, recalls from runebook still work, so how can i prevent players to recall from book and recall book to certain places? whats the easiest way to do.

Ive seen checktravel method in spellhelper.cs but im confused.
Code:
public void Target( RecallRune rune )
		{
			if ( !Caster.CanSee( rune ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
			{
                //Caster.SendAsciiMessage("ros");
			}
			else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
			{
				Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
			}
			else if ( !rune.IsChildOf( Caster.Backpack ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
			}
			else if ( CheckSequence() )
			{
                if (Caster.Region is Regions.HouseRegion || (Caster.Region is Regions.CustomRegion && ((Regions.CustomRegion)Caster.Region).Controller.IsRestrictedSpell(this)))
                    Caster.SendAsciiMessage("No puedes Marcar runa aquii.");

////////////////////////////////////no recall doom
				if(Caster.Region.Name == "Doom")
                Caster.SendAsciiMessage("No puedes castear eso aqui!");
///////////////////////////////////////////////// recall doom
                else if (Caster.Region is Regions.GreenAcres && Caster.AccessLevel == AccessLevel.Player)
                    Caster.SendAsciiMessage("Plebeyo!");
                else
                {
                    rune.Mark(Caster);

                    Caster.PlaySound(Sound);
                }
				FinishSequence();
			}
		}

If i modify this method: would i make it?:

Code:
private static readonly bool[,] m_Rules = new bool[,]
            {
                        /*T2A(Fel)    Ilshenar        Wind(Tram),     Wind(Fel),    Dungeons(Fel),    Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),    Gauntlet(Ferry),    Stronghold,        ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom),    GuardianRoom(Doom), Heartwood */
/* Recall From */        { true,        true,            true,            true,        true,            true,            true,        false,                false,                false,                true,            true,            true,                false,                false,              false },
/* Recall To */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Gate From */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Gate To */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Mark In */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Tele From */            { true,        true,            true,            true,        true,            true,            true,        false,                true,                true,                false,            true,            true,                true,                true,               false },
/* Tele To */            { true,        true,            true,            true,        true,            true,            true,        false,                true,                false,                false,             true,            true,                true,                true,               false },
            };

I dont want players go to felucca to malas/ilshenar/ using recall/mark/gatetravel
Thanks
 
Last edited:
Search for Recall.cs

Code:
public override bool CheckCast()
        {
            if (Factions.Sigil.ExistsOn(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return false;
            }
            else if (this.Caster.Criminal)
            {
                this.Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
                return false;
            }
            else if (SpellHelper.CheckCombat(this.Caster))
            {
                this.Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
                return false;
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(this.Caster))
            {
                this.Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
                return false;
            }
// DOOM ADDITION START
	else if(this.Caster.Region.Name == "Doom")
	{
                this. Caster.SendAsciiMessage("No puedes castear eso aqui!");
		return false;
	}
// DOOM ADDITION END

            return SpellHelper.CheckTravel(this.Caster, TravelCheckType.RecallFrom);
}


Let me know if this works.
[doublepost=1476280789][/doublepost]
Code:
private static readonly bool[,] m_Rules = new bool[,]
            {
                        /*T2A(Fel)    Ilshenar        Wind(Tram),     Wind(Fel),    Dungeons(Fel),    Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),    Gauntlet(Ferry),    Stronghold,        ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom),    GuardianRoom(Doom), Heartwood */
/* Recall From */        { true,        true,            true,            true,        true,            true,            true,        false,                false,                false,                true,            true,            true,                false,                false,              false },
/* Recall To */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Gate From */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Gate To */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Mark In */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Tele From */            { true,        true,            true,            true,        true,            true,            true,        false,                true,                true,                false,            true,            true,                true,                true,               false },
/* Tele To */            { true,        true,            true,            true,        true,            true,            true,        false,                true,                false,                false,             true,            true,                true,                true,               false },
            };

Editing this method is the best. You will also need to define them a little further down in the code.
 
My recall doesnt have checkcast:


Code:
using System;
using Server.Items;
using Server.Mobiles;
using Server.Multis;
using Server.Network;
using Server.Spells.Necromancy;
using Server.Targeting;

namespace Server.Spells.Fourth
{
    public class RecallSpell : MagerySpell
    {

        public override bool SpellFizzlesOnHurt { get  { return true; } }
        public override SpellCircle Circle { get { return SpellCircle.Fourth; } }
        public override int Sound { get { return 0x1FC; } }

        private static readonly SpellInfo m_Info = new SpellInfo(
                "Recall", "Kal Ort Por",
                263,
                9031,
                Reagent.BlackPearl,
                Reagent.Bloodmoss,
                Reagent.MandrakeRoot
            );

        private readonly RunebookEntry m_Entry;
        private readonly Runebook m_Book;
        private readonly Item m_Scroll;

        public RecallSpell( Mobile caster, Item scroll ) : this( caster, scroll, null, null )
        {
            m_Scroll = scroll;
        }

        public RecallSpell( Mobile caster, Item scroll, RunebookEntry entry, Runebook book ) : base( caster, scroll, m_Info )
        {
            m_Entry = entry;
            m_Book = book;
            m_Scroll = scroll;
        }

        public override TimeSpan GetCastDelay()
        {
                return TimeSpan.FromSeconds(6.00);
        }

        public override void GetCastSkills( out double min, out double max )
        {
            if ( Spells.TransformationSpellHelper.UnderTransformation( Caster, typeof( WraithFormSpell ) ) )
                min = max = 0;
            else
                base.GetCastSkills( out min, out max );
        }

        public override void OnCast()
        {
            RecallSpell m_Owner = this;
            Mobile from = Caster;

            if (SphereSpellTarget is RecallRune)
            {
                RecallRune rune = (RecallRune) SphereSpellTarget;

                if (Caster.InLOS(rune) || (from.BankBox != null && rune.IsChildOf(from.BankBox)))
                {
                    if (rune.Marked)
                    {
                        if (rune.ChargesLeft == 0)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune's magic has faded");
                            DoFizzle();
                            return;
                        }

                        if (rune.ChargesLeft <= 10 && rune.ChargesLeft >= 1)
                            from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune is starting to fade");

                        m_Owner.Effect(rune.Target, rune.TargetMap, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(501805); // That rune is not yet marked.

                        if (from is PlayerMobile)
                            ((PlayerMobile)from).SpellCheck();
                    }
                }
                else
                {
                    Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501031); // I cannot see that object.

                    if (from is PlayerMobile)
                        ((PlayerMobile) from).SpellCheck();
                }
            }
            else if (SphereSpellTarget is Runebook)
            {
                RunebookEntry e = ((Runebook)SphereSpellTarget).Default;

                if (e != null)
                    m_Owner.Effect(e.Location, e.Map, true);
                else
                    from.SendLocalizedMessage(502354); // Target is not marked.
            }
            else if (SphereSpellTarget is Key && ((Key)SphereSpellTarget).KeyValue != 0 &&
                     ((Key)SphereSpellTarget).Link is BaseBoat)
            {
                BaseBoat boat = ((Key)SphereSpellTarget).Link as BaseBoat;

                if (!boat.Deleted && boat.CheckKey(((Key)SphereSpellTarget).KeyValue))
                {
                    m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false);
                    boat.Refresh();
                }
                else
                    from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object.
            }
            else if (m_Entry != null)
            {
                /*if (m_Entry.ChargesLeft == 0)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 906, true, "The runebook's recall rune's magic has faded");
                    DoFizzle();
                    return;
                }
                else if (m_Entry.ChargesLeft <= 10 && m_Entry.ChargesLeft >= 1)
                    from.LocalOverheadMessage(MessageType.Regular, 906, true, "The recall rune in your runebook is starting to fade");
                */
                m_Owner.Effect(m_Entry.Location, m_Entry.Map, true);
            }
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object.

                if (from is PlayerMobile)
                    ((PlayerMobile)from).SpellCheck();
            }
        }

        public override bool Cast()
        {
            if (m_Entry != null)
                return DirectCast(); // Recall from runebook
            else if (PlayerCaster != null) //Player cast
                return RequestTargetBeforCasting();
            else
                return DirectCast(); //Mobile cast
        }

        public void Effect( Point3D loc, Map map, bool checkMulti )
        {
            if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
            {
            }
            else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
            {
            }
            else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
            {
                Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0 && m_Scroll != null)
            {
                Caster.SendLocalizedMessage( 502412 ); // There are no charges left on that item.
            }
            else if ( CheckSequence() )
            {
                Regions.CustomRegion cR = null;
                ISpell markSpell = new Sixth.MarkSpell(Caster, null);

                if ((cR = Caster.Region as Regions.CustomRegion) != null && cR.Controller.IsRestrictedSpell(this))
                    Caster.SendAsciiMessage("No puedes recalear ahi.");
                if(Caster.Region.Name == "Doom")
                Caster.SendAsciiMessage("No puedes castear eso aqui!");
                else if (Region.Find(loc, map) is Regions.HouseRegion || ((cR = Region.Find(loc, map) as Regions.CustomRegion) != null && (cR.Controller.IsRestrictedSpell(this) || cR.Controller.IsRestrictedSpell(markSpell))))
                    Caster.SendAsciiMessage("No puedes recalear ahi.");
                else if (Region.Find(loc, map) is Regions.GreenAcres && Caster.AccessLevel == AccessLevel.Player)
                    Caster.SendAsciiMessage("Los plebeyos al Green Acres no puedes entrar.");
                else
                {
                    BaseCreature.TeleportPets(Caster, loc, map, true);

                    /*if (m_Entry != null && m_Book != null && m_Scroll == null)
                        --m_Entry.ChargesLeft;
                    else*/
                    if (m_Book != null && m_Scroll != null)
                    {
                        --m_Book.CurCharges;
                        /*--m_Entry.ChargesLeft;*/
                    }

                    if (SphereSpellTarget is RecallRune)
                    {
                        RecallRune rune = (RecallRune) SphereSpellTarget;

                        if (rune.ChargesLeft > 0)
                            --rune.ChargesLeft;
                        else if (rune.ChargesLeft == 0)
                        {
                            FinishSequence();
                            return;
                        }
                    }

                    if (SphereSpellTarget is Runebook)
                    {
                        RunebookEntry e = ((Runebook) SphereSpellTarget).Default;

                        /*if (e.ChargesLeft > 0)
                            --e.ChargesLeft;
                        else*/
                        if (e.ChargesLeft == 0)
                        {
                            FinishSequence();
                            return;
                        }
                    }

                    Caster.MoveToWorld(loc, map);
                    Caster.PlaySound(Sound);
                    Caster.RevealingAction();
                }
            }
            FinishSequence();
        }

        private class InternalTarget : Target
        {
            private readonly RecallSpell m_Owner;

            public InternalTarget( RecallSpell owner ) : base( 12, false, TargetFlags.None )
            {
                m_Owner = owner;

                owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item.
            }

            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is RecallRune )
                {
                    RecallRune rune = (RecallRune)o;

                    if ( rune.Marked )
                        m_Owner.Effect( rune.Target, rune.TargetMap, true );
                    else
                        from.SendLocalizedMessage( 501805 ); // That rune is not yet marked.
                }
                else if ( o is Runebook )
                {
                    RunebookEntry e = ((Runebook)o).Default;

                    if ( e != null )
                        m_Owner.Effect( e.Location, e.Map, true );
                    else
                        from.SendLocalizedMessage( 502354 ); // Target is not marked.
                }
                else if ( o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat )
                {
                    BaseBoat boat = ((Key)o).Link as BaseBoat;

                    if ( !boat.Deleted && boat.CheckKey( ((Key)o).KeyValue ) )
                        m_Owner.Effect( boat.GetMarkedLocation(), boat.Map, false );
                    else
                        from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object.
                }
                else if (o is HouseRaffleDeed && ((HouseRaffleDeed)o).ValidLocation())
                {
                    HouseRaffleDeed deed = (HouseRaffleDeed)o;

                    m_Owner.Effect(deed.PlotLocation, deed.PlotFacet, true);
                }
                else
                    from.LocalOverheadMessage(MessageType.Regular, 906, 502357); // I can not recall from that object.
            }

            protected override void OnNonlocalTarget(Mobile from, object o)
            {
            }

            protected override void OnTargetFinish( Mobile from )
            {
                m_Owner.FinishSequence();
            }
        }
    }
}
 
Try adding it in this method

public void Effect( Point3D loc, Map map, bool checkMulti )
[doublepost=1476280986][/doublepost]
Code:
public void Effect( Point3D loc, Map map, bool checkMulti )
        {
            if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.RecallFrom ) )
            {
            }
            else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.RecallTo ) )
            {
            }
            else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
            {
                Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
            }
	
	// DOOM ADDITION START
   	 else if(Caster.Region.Name == "Doom")
    	{
                Caster.SendAsciiMessage("No puedes castear eso aqui!");
    	}
	// DOOM ADDITION END
[doublepost=1476281316][/doublepost]I am not saying it will work!! It has been a while since I have worked with RunUO. Let me know though.

SpellHelper.cs is the best place if you have some experience and do not wish to edit Recall, Mark, and Gate. (Ilshenar is blocked by default but you would need to code Malas, Tokuno, Termur, so on and so forth)
 
What was the error? Or did it still just let you recall? Where you IN doom when you tried? Also were you in the Gauntlet part of doom? When you say [where what is the region name?
 
No error it just let recall from Gaunlet or any place in doom

where says
You are at 2326 1268 -110 in Malas
Your region is Doom

Btw from recallrune it sent me the ''No puedes castear eso aqui!" message
but i could still recall

From runebook didnt even got the message, should i try edit this?


Code:
private static readonly bool[,] m_Rules = new bool[,]
            {
                        /*T2A(Fel)    Ilshenar        Wind(Tram),     Wind(Fel),    Dungeons(Fel),    Solen(Tram),    Solen(Fel), CrystalCave(Malas),    Gauntlet(Malas),    Gauntlet(Ferry),    Stronghold,        ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom),    GuardianRoom(Doom), Heartwood */
/* Recall From */        { true,        true,            true,            true,        true,            true,            true,        false,                false,                false,                true,            true,            true,                false,                false,              false },
/* Recall To */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Gate From */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Gate To */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Mark In */            { true,        false,            false,            true,        true,            false,            true,        false,                false,                false,                false,            false,            false,                false,                false,              false },
/* Tele From */            { true,        true,            true,            true,        true,            true,            true,        false,                true,                true,                false,            true,            true,                true,                true,               false },
/* Tele To */            { true,        true,            true,            true,        true,            true,            true,        false,                true,                false,                false,             true,            true,                true,                true,               false },
            };
 
Up top try adding

using Server.Regions;
[doublepost=1476281798][/doublepost]I know it is something simply. Probably in the way I worded it.
 
Up top try adding

using Server.Regions;
[doublepost=1476281798][/doublepost]I know it is something simply. Probably in the way I worded it.

It works, all i have to do is add the same method to gatetravel and mark right?

players can recall to doom, but if players cant use mark in doom, they cant recall either, great logic im using

edit: -Hmm i dont know what i messed up, id like players be able to recall inside Doom, i removed the code we added ,stilll cant recall haha
 
Last edited:
So you want them to be able to recall OUT? Just not recall TO DOOM?
[doublepost=1476283723][/doublepost]You are better of editing SpellHelper.cs
 
Exactly recall out, and not recall to doom.

Editing spellhelper might be way too complex for me :p


edit:: inside doom mobs drop daemon bones, is it normal? i would like to turn that off
 
Last edited:
check SpellHelper.cs

TravelValidator should look like this

Code:
private static readonly TravelValidator[] m_Validators = new TravelValidator[]
        {
            new TravelValidator(IsFeluccaT2A),
            new TravelValidator(IsKhaldun),
            new TravelValidator(IsIlshenar),
            new TravelValidator(IsTrammelWind),
            new TravelValidator(IsFeluccaWind),
            new TravelValidator(IsFeluccaDungeon),
            new TravelValidator(IsTrammelSolenHive),
            new TravelValidator(IsFeluccaSolenHive),
            new TravelValidator(IsCrystalCave),
            new TravelValidator(IsDoomGauntlet),
            new TravelValidator(IsDoomFerry),
            new TravelValidator(IsSafeZone),
            new TravelValidator(IsFactionStronghold),
            new TravelValidator(IsChampionSpawn),
            new TravelValidator(IsTokunoDungeon),
            new TravelValidator(IsLampRoom),
            new TravelValidator(IsGuardianRoom),
            new TravelValidator(IsHeartwood),
            new TravelValidator(IsMLDungeon)
};

you can change this section below

public static bool IsDoomGauntlet(Map map, Point3D loc)
{
if (map != Map.Malas)
return false;

int x = loc.X - 256, y = loc.Y - 304;

return (x >= 0 && y >= 0 && x < 256 && y < 256);
}

to box in the max/min x/y of Doom instead of just the gauntlet

like
public static bool IsSolenHiveLoc(Point3D loc)
{
int x = loc.X, y = loc.Y;

return (x >= 5640 && y >= 1776 && x < 5935 && y < 2039);
}
 
Code:
private static readonly TravelValidator[] m_Validators = new TravelValidator[]
            {
                IsFeluccaT2A,
                IsIlshenar,
                IsTrammelWind,
                IsFeluccaWind,
                IsFeluccaDungeon,
                IsTrammelSolenHive,
                IsFeluccaSolenHive,
                IsCrystalCave,
                IsDoomGauntlet,
                IsDoomFerry,
                IsFactionStronghold,
                IsChampionSpawn,
                IsTokunoDungeon,
                IsLampRoom,
                IsGuardianRoom,
                IsHeartwood
            };


You guys know why any mob that i spawn in doom drops daemon bones? around 12, every mob, no matter wich one
 
Last edited:
In BaseCreature.cs

Code:
 if (!NoKillAwards && Region.IsPartOf("Doom"))
            {
                int bones = TheSummoningQuest.GetDaemonBonesFor(this);

                if (bones > 0)
                {
                    PackItem(new DaemonBone(bones));
                }
}
[doublepost=1476288479][/doublepost]If you want to prevent this remove that bit of code.
 
Code:
private static readonly TravelValidator[] m_Validators = new TravelValidator[]
            {
                IsFeluccaT2A,
                IsIlshenar,
                IsTrammelWind,
                IsFeluccaWind,
                IsFeluccaDungeon,
                IsTrammelSolenHive,
                IsFeluccaSolenHive,
                IsCrystalCave,
                IsDoomGauntlet,
                IsDoomFerry,
                IsFactionStronghold,
                IsChampionSpawn,
                IsTokunoDungeon,
                IsLampRoom,
                IsGuardianRoom,
                IsHeartwood
            };


You guys know why any mob that i spawn in doom drops daemon bones? around 12, every mob, no matter wich one

pretty much the same thing, you can either alter the DoomGauntlet x and y locations or you can create a new one that covers all of Doom but the Gauntlet, so players can recall out of it
 
Back