public static void AGGRESSIVEACTION(TriggerObject trigObject, Mobile from, Mobile to) { if (from != null && to != null) { AGGRESSIVEACTION(trigObject, from, to, from.IsHarmfulCriminal(to)); } }
public static bool ISHARMFULCRIMINAL(TriggerObject trigObject, Mobile from, Mobile to) { return from != null && to != null && from.IsHarmfulCriminal(to); }
public void DoFireEffect(IPoint3D target, Mobile from) { Map map = Map; if (target == null || map == null) { return; } var startloc = new Point3D(Location); IPoint3D point = target; switch (Facing) { case 3: { Effects.SendLocationEffect(new Point3D(X, Y + 1, Z - 2), map, Utility.RandomList(0x3728), 16, 1); break; } case 1: { Effects.SendLocationEffect(new Point3D(X, Y - 1, Z - 2), map, Utility.RandomList(0x3728), 16, 1); break; } case 2: { Effects.SendLocationEffect(new Point3D(X + 1, Y, Z - 2), map, Utility.RandomList(0x3728), 16, 1); break; } case 0: { Effects.SendLocationEffect(new Point3D(X - 1, Y + 1, Z - 2), map, Utility.RandomList(0x3728), 16, 1); break; } } Effects.PlaySound(target, map, Utility.RandomList(0x11B, 0x11C, 0x11D)); var queue = new EffectQueue(); queue.Deferred = false; queue.Add( new MovingEffectInfo( startloc, point, Map, m_Projectile.AnimationID, m_Projectile.AnimationHue > 0 ? m_Projectile.AnimationHue-1 : 0, 10, EffectRender.Normal, TimeSpan.FromSeconds(0.1), () => { if (Projectile.ShipDamage > 0) { for (int count = 8; count > 0; count--) { IPoint3D location = new Point3D(target.X + Utility.RandomMinMax(-1, 1), target.Y + Utility.RandomMinMax(-1, 1), target.Z); int effect = Utility.RandomList(0x36B0); Effects.SendLocationEffect(location, map, effect, 25, 1); Effects.PlaySound(target, map, Utility.RandomList(0x11B, 0x11C, 0x11D)); } } foreach (Mobile mob in AcquireAllTargets(new Point3D(point), Projectile.DamageRange)) { if (from.CanBeHarmful(mob)) { mob.Damage(Projectile.PlayerDamage, from); if (from.IsHarmfulCriminal(mob) && !from.Criminal) from.CriminalAction(true); else if (from.IsHarmfulCriminal(mob)) from.CriminalAction(false); } } foreach (Item item in from.Map.GetItemsInRange(new Point3D(point), Projectile.DamageRange)) { if (item is MainMast) { var mast = item as MainMast; if (mast.HullDurability < Projectile.ShipDamage) mast.HullDurability = 0; else { mast.HullDurability -= (ushort)Projectile.ShipDamage; } mast.PublicOverheadMessage(MessageType.Label, 61, true, mast.HullDurability + "/" + mast.MaxHullDurability); } if (item is BaseShipWeapon) { var cannon = item as BaseShipWeapon; if (cannon.Durability < Projectile.ShipDamage) cannon.Durability = 0; else { cannon.Durability -= Projectile.ShipDamage; } } if (item is NewBaseBoat) { var boat = item as NewBaseBoat; if (boat.HullDurability < Projectile.ShipDamage) boat.HullDurability = 0; else { boat.HullDurability -= (ushort)Projectile.ShipDamage; } boat.PublicOverheadMessage(MessageType.Label, 61, true, boat.HullDurability + "/" + boat.MaxHullDurability); } } })); queue.Process(); Projectile.Delete(); Projectile = null; this.m_NextFiringTime = DateTime.UtcNow + TimeSpan.FromSeconds(15); }