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); } } }
public static void ScreamOfHell(Mobile from, int range, TimeSpan duration) { if (from.Map != Map.Internal && from.Map != null && from != null && !from.Blessed && from.Alive) { IPooledEnumerable eable = from.GetMobilesInRange(range); foreach (Mobile m in eable) { if (m is BaseCreature && !m.Blessed && m.Alive && ((BaseCreature)from).IsEnemy(m) && from.CanBeHarmful(m)) { BaseCreature b = m as BaseCreature; if (b.Controled && b != from) { b.Combatant = from; b.BeginFlee(duration); } } } } }
public static void DoMoves(BaseCreature from, Mobile target) { switch (Utility.Random(3)) { case 0: if (Utility.Random(500) <= from.RoarAttack) { int power; int mindam; int maxdam; if (from.RoarAttack > 3) { mindam = from.RoarAttack / 3; maxdam = from.RoarAttack / 2; } else { mindam = 1; maxdam = 3; } if (from.RoarAttack > 10) { power = from.RoarAttack / 10; } else { power = 1; } ArrayList targets = new ArrayList(); foreach (Mobile m in from.GetMobilesInRange(power)) { if (m != from) { targets.Add(m); } } for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; if (m is BaseCreature) { BaseCreature bc = (BaseCreature)m; bc.BeginFlee(TimeSpan.FromSeconds(30.0)); AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 20, 20, 20, 20, 20); } } } break; case 1: if (Utility.Random(500) <= from.PetPoisonAttack) { Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0); Effects.PlaySound(target.Location, target.Map, 0x229); int mindam; int maxdam; if (from.PetPoisonAttack > 3) { mindam = from.PetPoisonAttack / 3; maxdam = from.PetPoisonAttack / 2; } else { mindam = 1; maxdam = 3; } int level = from.PetPoisonAttack / 20; if (level > 5) { level = 5; } target.ApplyPoison(from.ControlMaster, Poison.GetPoison(level)); AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100); } break; case 2: if (Utility.Random(500) <= from.FireBreathAttack) { int mindam; int maxdam; if (from.PetPoisonAttack > 3) { mindam = from.PetPoisonAttack / 3; maxdam = from.PetPoisonAttack / 2; } else { mindam = 1; maxdam = 3; } from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160); from.PlaySound(Core.AOS ? 0x15E : 0x44B); target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot); target.PlaySound(0x208); AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100); Timer t = new FireBreathDOT(target, from, from.FireBreathAttack); t.Start(); } break; } }