Convert Regions/Spawns to JSON (#138)
This commit is contained in:
parent
b8316e9202
commit
390f30e706
117 changed files with 97306 additions and 4848 deletions
|
|
@ -411,9 +411,9 @@ namespace Server.Spells
|
|||
{
|
||||
Caster.SendLocalizedMessage(502642); // You are already casting a spell.
|
||||
}
|
||||
else if ((BlockedByHorrificBeast &&
|
||||
TransformationSpellHelper.UnderTransformation(Caster, typeof(HorrificBeastSpell))) ||
|
||||
(BlockedByAnimalForm && AnimalForm.UnderTransformation(Caster)))
|
||||
else if (BlockedByHorrificBeast &&
|
||||
TransformationSpellHelper.UnderTransformation(Caster, typeof(HorrificBeastSpell)) ||
|
||||
BlockedByAnimalForm && AnimalForm.UnderTransformation(Caster))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -591,12 +591,6 @@ namespace Server.Spells
|
|||
return false;
|
||||
}
|
||||
|
||||
if (caster?.AccessLevel == AccessLevel.Player && caster.Region.IsPartOf<Jail>())
|
||||
{
|
||||
caster.SendLocalizedMessage(1114345); // You'll need a better jailbreak plan than that!
|
||||
return false;
|
||||
}
|
||||
|
||||
// Always allow monsters to teleport
|
||||
if (caster is BaseCreature bc && !bc.Controlled && !bc.Summoned && (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom))
|
||||
return true;
|
||||
|
|
@ -607,6 +601,15 @@ namespace Server.Spells
|
|||
int v = (int)type;
|
||||
bool isValid = true;
|
||||
|
||||
if (caster != null)
|
||||
{
|
||||
BaseRegion destination = Region.Find(loc, map) as BaseRegion;
|
||||
BaseRegion current = Region.Find(caster.Location, map) as BaseRegion;
|
||||
|
||||
if (destination?.CheckTravel(caster, loc, type) == false || current?.CheckTravel(caster, loc, type) == false)
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
for (int i = 0; isValid && i < m_Validators.Length; ++i)
|
||||
isValid = m_Rules[v, i] || !m_Validators[i](map, loc);
|
||||
|
||||
|
|
@ -675,15 +678,10 @@ namespace Server.Spells
|
|||
|| (x >= 1188 && y >= 509 && x < 1201 && y < 513);
|
||||
}
|
||||
|
||||
public static bool IsSafeZone(Map map, Point3D loc)
|
||||
{
|
||||
if (Region.Find(loc, map).IsPartOf<SafeZone>() &&
|
||||
(m_TravelType == TravelCheckType.TeleportTo || m_TravelType == TravelCheckType.TeleportFrom)
|
||||
&& (m_TravelCaster as PlayerMobile)?.DuelPlayer?.Eliminated == false)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
public static bool IsSafeZone(Map map, Point3D loc) =>
|
||||
Region.Find(loc, map).IsPartOf<SafeZone>() &&
|
||||
(m_TravelType == TravelCheckType.TeleportTo || m_TravelType == TravelCheckType.TeleportFrom)
|
||||
&& (m_TravelCaster as PlayerMobile)?.DuelPlayer?.Eliminated == false;
|
||||
|
||||
public static bool IsFactionStronghold(Map map, Point3D loc) => Region.Find(loc, map).IsPartOf<StrongholdRegion>();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue