woops on my part. ninjaweps and spellhelper multi checks.

This commit is contained in:
xavier 2011-01-23 14:33:58 +00:00
parent b56f20b39f
commit 07e45156e5
5 changed files with 15 additions and 12 deletions

View file

@ -94,8 +94,8 @@ namespace Server.Items
if ( IsChildOf( from ) ) if ( IsChildOf( from ) )
{ {
list.Add(new NinjaWeapon.LoadEntry(this)); list.Add(new NinjaWeapon.LoadEntry(this, 6224));
list.Add(new NinjaWeapon.UnloadEntry(this)); list.Add(new NinjaWeapon.UnloadEntry(this, 6225));
} }
} }

View file

@ -107,8 +107,8 @@ namespace Server.Items
if ( IsChildOf( from ) ) if ( IsChildOf( from ) )
{ {
list.Add( new NinjaWeapon.LoadEntry( this ) ); list.Add(new NinjaWeapon.LoadEntry(this, 6222));
list.Add( new NinjaWeapon.UnloadEntry( this ) ); list.Add(new NinjaWeapon.UnloadEntry(this, 6222));
} }
} }

View file

@ -346,8 +346,8 @@ namespace Server.Items
{ {
private INinjaWeapon weapon; private INinjaWeapon weapon;
public LoadEntry(INinjaWeapon wep) public LoadEntry(INinjaWeapon wep, int entry)
: base(6222, 0) : base(entry, 0)
{ {
weapon = wep; weapon = wep;
} }
@ -365,10 +365,10 @@ namespace Server.Items
{ {
private INinjaWeapon weapon; private INinjaWeapon weapon;
public UnloadEntry(INinjaWeapon belt) public UnloadEntry(INinjaWeapon wep, int entry)
: base(6223, 0) : base(entry, 0)
{ {
weapon = belt; weapon = wep;
Enabled = (weapon.UsesRemaining > 0); Enabled = (weapon.UsesRemaining > 0);
} }

View file

@ -75,10 +75,12 @@ namespace Server.Spells
{ {
return CheckMulti( p, map, true, 0); 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); return CheckMulti(p, map, houses, 0);
} }
public static bool CheckMulti( Point3D p, Map map, bool houses, int housingrange ) public static bool CheckMulti( Point3D p, Map map, bool houses, int housingrange )
{ {
if( map == null || map == Map.Internal ) if( map == null || map == Map.Internal )
@ -90,11 +92,11 @@ namespace Server.Spells
{ {
BaseMulti multi = sector.Multis[i]; BaseMulti multi = sector.Multis[i];
if( houses && multi is BaseHouse ) if( multi is BaseHouse )
{ {
BaseHouse bh = (BaseHouse)multi; BaseHouse bh = (BaseHouse)multi;
if(bh.IsInside( p, 16 ) || (housingrange > 0 && bh.InRange(p, housingrange))) if( ( houses && bh.IsInside( p, 16 ) ) || ( housingrange > 0 && bh.InRange( p, housingrange ) ) )
return true; return true;
} }
else if( multi.Contains( p )) else if( multi.Contains( p ))
@ -102,6 +104,7 @@ namespace Server.Spells
return true; return true;
} }
} }
return false; return false;
} }

View file

@ -77,7 +77,7 @@ namespace Server.Spells.Ninjitsu
{ {
Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot. Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot.
} }
else if (SpellHelper.CheckMulti( Caster.Location, Caster.Map, true, 5 )) else if ( SpellHelper.CheckMulti( new Point3D( p ), map, true, 5 ) )
{ {
Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot. Caster.SendLocalizedMessage( 502831 ); // Cannot teleport to that spot.
} }