From 2f189e478577eadddd1d349ab321722f415c716f Mon Sep 17 00:00:00 2001 From: xavier Date: Sat, 11 Dec 2010 17:20:56 +0000 Subject: [PATCH] Destination of shadow jump should not be within 5 tiles of a house. --- Scripts/Spells/Base/SpellHelper.cs | 18 +++++++++++------- Scripts/Spells/Ninjitsu/ShadowJump.cs | 4 +--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Scripts/Spells/Base/SpellHelper.cs b/Scripts/Spells/Base/SpellHelper.cs index aa2174775..832505ff7 100644 --- a/Scripts/Spells/Base/SpellHelper.cs +++ b/Scripts/Spells/Base/SpellHelper.cs @@ -73,10 +73,13 @@ namespace Server.Spells public static bool CheckMulti( Point3D p, Map map ) { - return CheckMulti( p, map, true ); + return CheckMulti( p, map, true, 0); } - - public static bool CheckMulti( Point3D p, Map map, bool houses ) + public static bool CheckMulti(Point3D p, Map map, bool houses) + { + return CheckMulti(p, map, houses, 0); + } + public static bool CheckMulti( Point3D p, Map map, bool houses, int housingrange ) { if( map == null || map == Map.Internal ) return false; @@ -87,17 +90,18 @@ namespace Server.Spells { BaseMulti multi = sector.Multis[i]; - if( multi is BaseHouse ) + if( houses && multi is BaseHouse ) { - if( houses && ((BaseHouse)multi).IsInside( p, 16 ) ) + BaseHouse bh = (BaseHouse)multi; + + if(bh.IsInside( p, 16 ) || (housingrange > 0 && bh.InRange(p, housingrange))) return true; } - else if( multi.Contains( p ) ) + else if( multi.Contains( p )) { return true; } } - return false; } diff --git a/Scripts/Spells/Ninjitsu/ShadowJump.cs b/Scripts/Spells/Ninjitsu/ShadowJump.cs index 4561e82fa..2002b6c2e 100644 --- a/Scripts/Spells/Ninjitsu/ShadowJump.cs +++ b/Scripts/Spells/Ninjitsu/ShadowJump.cs @@ -77,9 +77,8 @@ namespace Server.Spells.Ninjitsu { Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot. } - else if ( SpellHelper.CheckMulti( new Point3D( p ), map ) ) + else if (SpellHelper.CheckMulti( Caster.Location, Caster.Map, true, 5 )) { - // TODO: Cannot shadowjump within 5 tiles from any house. Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot. } else if ( CheckSequence() ) @@ -103,7 +102,6 @@ namespace Server.Spells.Ninjitsu FinishSequence(); } - public class InternalTarget : Target { private Shadowjump m_Owner;