Full Version : Elf City Heartwood Question
xmlspawner >>Scripting Support >>Elf City Heartwood Question
<< Prev | Next >>
Erica- 04-15-2007
Hi got a question ok on osi you cannot recall out from Elf City which its inside of Heartwood how would i make this work on here runuo im sure has to do with spellhelp script heres what i was looking at

CODE
private static TravelValidator[] m_Validators = new TravelValidator[] { new TravelValidator( IsFeluccaT2A ), 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( IsFactionStronghold ),
new TravelValidator( IsChampionSpawn ),
new TravelValidator( IsTokunoDungeon )
};
private static 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]) */
/* Recall From */ { false, true, true, false, false, true, false, false, false, false, true, true, true },
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, false, true, true, false, true, true },
/* Tele To */ { true, true, true, true, true, true, true, false, true, false, false, true, true },
};
public static bool CheckTravel( Mobile caster, TravelCheckType type )
{
if( CheckTravel( caster, caster.Map, caster.Location, type ) )
return true;
SendInvalidMessage( caster, type );
return false;
}
public static void SendInvalidMessage( Mobile caster, TravelCheckType type )
{
if( type == TravelCheckType.RecallTo || type == TravelCheckType.GateTo )
caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
else if( type == TravelCheckType.TeleportTo )
caster.SendLocalizedMessage( 501035 ); // You cannot teleport from here to the destination.
else
caster.SendLocalizedMessage( 501802 ); // Thy spell doth not appear to work...
}
public static bool CheckTravel( Map map, Point3D loc, TravelCheckType type )

Any idea if it is here and if so what could be added for this.
ArteGordon- 04-15-2007
You would add a new method that returned true if they were in Elf city, like

QUOTE
public static bool IsElfCity( Map map, Point3D loc ) { int x = loc.X, y = loc.Y; return ( map == Map.Felucca && x >= 5120 && y >= 2304 && x < 6144 && y < 4096 ); }

you would have to put in the correct coordinates and such.
Then you would modify this array with your new travel validator

QUOTE
private static TravelValidator[] m_Validators = new TravelValidator[] { new TravelValidator( IsFeluccaT2A ), 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( IsFactionStronghold ),
new TravelValidator( IsChampionSpawn ),
new TravelValidator( IsTokunoDungeon ),
new TravelValidator( IsElfCity)
};

and then add another column to the rules array with your ElfCity settings

QUOTE
private static 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]) ElfCity */
/* Recall From */ { false, true, true, false, false, true, false, false, false, false, true, true, true, false },
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, false, true, true, false, true, true, false },
/* Tele To */ { true, true, true, true, true, true, true, false, true, false, false, true, true, false },
};

Erica- 04-15-2007

QUOTE (ArteGordon @ April 15, 2007 09:21 am)
You would add a new method that returned true if they were in Elf city, like

QUOTE
public static bool IsElfCity( Map map, Point3D loc ) { int x = loc.X, y = loc.Y; return ( map == Map.Felucca && x >= 5120 && y >= 2304 && x < 6144 && y < 4096 ); }

you would have to put in the correct coordinates and such.
Then you would modify this array with your new travel validator

QUOTE
private static TravelValidator[] m_Validators = new TravelValidator[] { new TravelValidator( IsFeluccaT2A ), 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( IsFactionStronghold ),
new TravelValidator( IsChampionSpawn ),
new TravelValidator( IsTokunoDungeon ),
new TravelValidator( IsElfCity)
};

and then add another column to the rules array with your ElfCity settings

QUOTE
private static 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]) ElfCity */
/* Recall From */ { false, true, true, false, false, true, false, false, false, false, true, true, true, false },
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, false, true, true, false, true, true, false },
/* Tele To */ { true, true, true, true, true, true, true, false, true, false, false, true, true, false },
};

this is the region from svn on heartwood is this what your talking about the coordation

CODE
<region type="TownRegion" priority="50" name="Heartwood"> <rect x="6912" y="256" width="255" height="256" /> <rect x="7167" y="512" width="255" height="256" /> <rect x="7167" y="256" width="255" height="256" /> <rect x="6912" y="512" width="255" height="256" />
<go x="7046" y="332" z="10" />
<music name="ElfCity" />
</region>

ArteGordon- 04-15-2007
since you already have a region defined for it you could probably just check the region name then like this

QUOTE
public static bool IsElfCity( Map map, Point3D loc ) { Region region = Region.Find( loc, map ); return (region != null && region.Name == "Heartwood"); }

Erica- 04-15-2007

QUOTE (ArteGordon @ April 15, 2007 10:02 am)
since you already have a region defined for it you could probably just check the region name then like this

QUOTE
public static bool IsElfCity( Map map, Point3D loc ) { Region region = Region.Find( loc, map ); return (region != null && region.Name == "Heartwood"); }

Thanks ArteGordon it works.