Server.Spells.SpellHelper.IsTown C# (CSharp) Method

IsTown() public static method

public static IsTown ( IPoint3D loc, Mobile caster ) : bool
loc IPoint3D
caster Mobile
return bool
		public static bool IsTown( IPoint3D loc, Mobile caster )
		{
			if( loc is Item )
				loc = ((Item)loc).GetWorldLocation();

			return IsTown( new Point3D( loc ), caster );
		}

Same methods

SpellHelper::IsTown ( Point3D loc, Mobile caster ) : bool

Usage Example

示例#1
0
        public virtual bool CheckResisted(Mobile target, double damage)
        {
            bool canattack = false;
            int  noto      = Notoriety.Compute(Caster, target);

            if (noto == Notoriety.Enemy)
            {
                canattack = true;
            }
            else if (((Caster.FindItemOnLayer(Layer.TwoHanded) is OrderShield) && (target.FindItemOnLayer(Layer.TwoHanded) is ChaosShield)) && target is PlayerMobile)
            {
                canattack = true;
            }
            else if (((Caster.FindItemOnLayer(Layer.TwoHanded) is ChaosShield) && (target.FindItemOnLayer(Layer.TwoHanded) is OrderShield)) && target is PlayerMobile)
            {
                canattack = true;
            }

            if (SpellHelper.IsTown(target.Location, Caster) && !canattack)
            {
                damage = 1;
            }

            double sk = damage * 2.5;

            if (sk > 124.9)
            {
                sk = 124.9;
            }
            return(target.CheckSkill(SkillName.MagicResist, sk - 25.0, sk + 25.0));
        }