public static void AreaDmg(Mobile from, int dmgMin, int dmgMax, int physDmg, int fireDmg, int nrgyDmg, int coldDmg, int poisDmg, int range) { if (from == null || from.Map == Map.Internal || from.Map == null || from.Deleted || from.Blessed) { return; } IPooledEnumerable eable = from.GetMobilesInRange(range); foreach (Mobile m in eable) { if (m is BaseCreature) { BaseCreature b = m as BaseCreature; if (b.Alive && !b.Blessed && !b.IsDeadBondedPet && b.CanBeHarmful(from) && ((BaseCreature)from).IsEnemy(b) && b.Map != null && b.Map != Map.Internal && b != null) { AOS.Damage(b, from, Utility.RandomMinMax(dmgMin, dmgMax), physDmg, fireDmg, coldDmg, poisDmg, nrgyDmg); } } else if (m is PlayerMobile) { PlayerMobile p = m as PlayerMobile; if (p.Alive && !p.Blessed && p.AccessLevel == AccessLevel.Player && p.Map != null && p.Map != Map.Internal && p != null) { AOS.Damage(p, from, Utility.RandomMinMax(dmgMin, dmgMax), physDmg, fireDmg, coldDmg, poisDmg, nrgyDmg); } } } }
public static void IcyWindAttack(BaseCreature from, Mobile target) { if (from.IcyWindAttack < 10 || from == null || target == null) { return; } Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x37CC, 1, 40, 97, 3, 9917, 0); int mindam = from.IcyWindAttack / 3; int maxdam = from.IcyWindAttack / 2; ArrayList targets = new ArrayList(); foreach (Mobile m in from.GetMobilesInRange(from.IcyWindAttack / 10)) { if (m != from && from.CanBeHarmful(m)) { targets.Add(m); } } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; from.Say("Icy Wind Attack"); AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 100, 0, 0); Slow.SlowWalk(m, 10); } }
public static void RoarAttack(BaseCreature from, Mobile target) { if (from.RoarAttack < 10 || from == null || target == null) { return; } int power = from.RoarAttack / 10; int mindam = from.RoarAttack / 3; int maxdam = from.RoarAttack / 2; from.Say("*Roars*"); ArrayList targets = new ArrayList(); foreach (Mobile m in from.GetMobilesInRange(power)) { if (m != from && from.CanBeHarmful(m)) { targets.Add(m); } } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; if (m is BaseCreature) { BaseCreature bc = (BaseCreature)m; // if (bc.Controlled == true && bc.ControlMaster != null) // return;////////////////////////////////////////////////////////////////////////////// // else bc.BeginFlee(TimeSpan.FromSeconds(10.0)); AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 100, 0, 0, 0, 0); } } }