public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); double spawnPercent = (double)intervalCount / (double)totalIntervals; double creepChance = .20 + (.40 * spawnPercent); if (Utility.RandomDouble() <= creepChance) { Blood creep = new Blood(); creep.Hue = 2597; creep.Name = "creep"; Point3D creepLocation = new Point3D(defender.X, defender.Y, defender.Z + 2); creep.MoveToWorld(creepLocation, defender.Map); int extraCreepCount = Utility.RandomMinMax(1, 2); for (int a = 0; a < extraCreepCount; a++) { Blood extraCreep = new Blood(); extraCreep.Hue = 2597; extraCreep.Name = "creep"; Point3D extraCreepLocation = new Point3D(defender.X + Utility.RandomList(-1, 1), defender.Y + Utility.RandomList(-1, 1), defender.Z + 2); extraCreep.MoveToWorld(extraCreepLocation, defender.Map); } Effects.PlaySound(defender.Location, defender.Map, 0x4F1); defender.FixedParticles(0x374A, 10, 20, 5021, 2597, 0, EffectLayer.Head); defender.SendMessage("You have been covered in creep, slowing your actions!"); SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .50, 15, -1, false, "", "", "-1"); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (Utility.RandomDouble() < .2) { TimedStatic ichor = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); ichor.Hue = 2051; ichor.Name = "ichor"; ichor.MoveToWorld(defender.Location, Map); for (int a = 0; a < 4; a++) { ichor = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); ichor.Hue = 2051; ichor.Name = "ichor"; ichor.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), Map); } Effects.PlaySound(defender.Location, defender.Map, 0x580); defender.FixedParticles(0x374A, 10, 20, 5021, 1107, 0, EffectLayer.Head); defender.SendMessage("You have been covered in an evil ichor!"); SpecialAbilities.EntangleSpecialAbility(1.0, this, defender, 1.0, 3, -1, false, "", "", "-1"); SpecialAbilities.PierceSpecialAbility(1.0, this, defender, 50, 15, -1, false, "", "", "-1"); SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .2, 15, -1, false, "", "", "-1"); SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .10, 15, -1, false, "", "", "-1"); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); double effectChance = .10; SpecialAbilities.CrippleSpecialAbility(effectChance, this, defender, .25, 10, -1, true, "", "The creature has transfixed you with it's gaze, slowing your actions!", "-1"); }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (Utility.RandomDouble() < .25) { SpecialAbilities.EntangleSpecialAbility(1.0, this, defender, 1.0, 3, -1, false, "", "The titan's massive strike stuns you!", "-1"); SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .20, 10, -1, false, "", "", "-1"); SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .10, 10, -1, true, "", "", "-1"); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); if (Utility.RandomDouble() < .25) { Effects.PlaySound(defender.Location, defender.Map, 0x4F1); defender.FixedParticles(0x374A, 10, 20, 5021, 0x110, 0, EffectLayer.Head); defender.SendMessage("You have weakened by the creature's venom!"); SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .25, 10, -1, false, "", "", "-1"); SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .15, 10, -1, false, "", "", "-1"); } }
public override void OnGaveMeleeAttack(Mobile defender) { base.OnGaveMeleeAttack(defender); double effectChance = .25; if (Controlled && ControlMaster != null) { if (ControlMaster is PlayerMobile) { if (defender is PlayerMobile) { effectChance = .01; } } } SpecialAbilities.CrippleSpecialAbility(effectChance, this, defender, .33, 10, -1, true, "", "The creature has transfixed you with it's gaze, slowing your actions!", "-1"); }
public static void DoBreathAttack(BreathAttackType breathType, BaseCreature creature, Mobile target) { if (!SpecialAbilities.Exists(creature)) { return; } if (!SpecialAbilities.Exists(target)) { return; } if (!creature.CanBeHarmful(target)) { return; } creature.DoHarmful(target); creature.Direction = creature.GetDirectionTo(target); if (creature.IsHighSeasBodyType) { creature.Animate(Utility.RandomList(27), 5, 1, true, false, 0); } else { creature.Animate(12, 5, 1, true, false, 0); } SpecialAbilities.HinderSpecialAbility(1.0, null, creature, 1.0, 1.5, true, 0, false, "", "", "-1"); Timer.DelayCall(TimeSpan.FromSeconds(1.3), delegate { if (!SpecialAbilities.Exists(creature)) { return; } switch (breathType) { case BreathAttackType.Fire: Effects.PlaySound(creature.Location, creature.Map, 0x227); Effects.SendMovingEffect(creature, target, 0x36D4, 5, 0, false, false, 0, 0); break; case BreathAttackType.Ice: Effects.PlaySound(creature.Location, creature.Map, 0x64F); Effects.SendMovingEffect(creature, target, 0x36D4, 5, 0, false, false, 1153, 0); break; case BreathAttackType.Poison: Effects.PlaySound(creature.Location, creature.Map, 0x22F); Effects.SendMovingEffect(creature, target, 0x372A, 10, 0, false, false, 2208, 0); break; } Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate { if (creature == null) { return; } if (creature.CanBeHarmful(target)) { double baseDamage = (double)creature.DamageMax; if (creature.Controlled && creature.ControlMaster is PlayerMobile) { if (target is PlayerMobile) { baseDamage *= BaseCreature.BreathDamageToPlayerScalar * creature.PvPAbilityDamageScalar; } if (target is BaseCreature) { baseDamage *= BaseCreature.BreathDamageToCreatureScalar; } } switch (breathType) { case BreathAttackType.Fire: Effects.PlaySound(target.Location, target.Map, 0x208); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.5)), 0x3996, 10, 20, 5029); break; case BreathAttackType.Ice: baseDamage = (double)creature.DamageMax * .75; if (target is PlayerMobile) { SpecialAbilities.CrippleSpecialAbility(1.0, creature, target, .05, 10, -1, true, "", "The blast of ice has slowed your actions!", "-1"); } else { SpecialAbilities.CrippleSpecialAbility(1.0, creature, target, .10, 10, -1, true, "", "The blast of ice has slowed your actions!", "-1"); } Effects.PlaySound(target.Location, target.Map, 0x208); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0); break; case BreathAttackType.Poison: baseDamage = (double)creature.DamageMax * .5; int poisonLevel = 0; if (creature.HitPoison != null) { poisonLevel = creature.HitPoison.Level; } double poisonChance = 1.0; if (creature.IsControlledCreature()) { if (target is PlayerMobile) { poisonChance = .5; poisonLevel--; } if (target is BaseCreature) { BaseCreature bc_Target = target as BaseCreature; if (bc_Target.IsControlledCreature()) { poisonChance = .5; poisonLevel--; } } } if (poisonLevel < 0) { poisonLevel = 0; } int poisonHue = 2208; poisonHue += poisonLevel; if (Utility.RandomDouble() <= poisonChance) { Poison poison = Poison.GetPoison(poisonLevel); target.ApplyPoison(target, poison); } Effects.PlaySound(target.Location, target.Map, 0x22F); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.25)), 0x372A, 10, 20, poisonHue, 0, 5029, 0); break; } int finalDamage = (int)baseDamage; if (target != null) { AOS.Damage(target, creature, finalDamage, 100, 0, 0, 0, 0); } } }); }); }
public void SetTimedEgg(Point3D location, Map map, EggType eggType) { int eggHue = Hue = Utility.RandomMinMax(2, 362); DecoyEasterEgg decoyEasterEgg = new DecoyEasterEgg(); decoyEasterEgg.Hue = eggHue; decoyEasterEgg.MoveToWorld(location, map); int delayTime = Utility.RandomMinMax(1, 10); Effects.SendLocationParticles(EffectItem.Create(location, map, TimeSpan.FromSeconds(0.25)), 0x9B5, 10, delayTime * 25, eggHue, 0, 5029, 0); Timer.DelayCall(TimeSpan.FromSeconds(delayTime), delegate { if (decoyEasterEgg != null) { if (!decoyEasterEgg.Deleted) { if (decoyEasterEgg.ParentEntity is PlayerMobile) { PlayerMobile pm_Owner = decoyEasterEgg.ParentEntity as PlayerMobile; pm_Owner.SendMessage("The eggs you gathered appear to be some sort of decoy, and they crumble in your backpack..."); pm_Owner.SendSound(0x134); } decoyEasterEgg.Delete(); } } int radius = 2; int effectSound = 0; switch (eggType) { case EggType.Explosive: effectSound = 0x359; break; case EggType.Entangle: effectSound = 0x211; break; case EggType.Poison: effectSound = 0x22F; break; case EggType.Ice: effectSound = 0x64F; break; case EggType.Banish: effectSound = 0x655; break; case EggType.Gust: effectSound = 0x64C; break; case EggType.Bloody: effectSound = 0x62B; break; } Effects.PlaySound(location, map, effectSound); Dictionary <Point3D, double> m_ExplosionLocations = new Dictionary <Point3D, double>(); m_ExplosionLocations.Add(location, 0); for (int a = 1; a < radius + 1; a++) { m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y - a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X, location.Y - a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y - a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y + a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X, location.Y + a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y + a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y, location.Z), a); } foreach (KeyValuePair <Point3D, double> pair in m_ExplosionLocations) { Timer.DelayCall(TimeSpan.FromSeconds(pair.Value * .25), delegate { switch (eggType) { case EggType.Explosive: Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 5044); break; case EggType.Entangle: radius = 3; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.5)), 0x3973, 10, 50, 5029); break; case EggType.Poison: Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x372A, 10, 20, 59, 0, 5029, 0); break; case EggType.Ice: radius = 3; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0); break; case EggType.Banish: radius = 3; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x3763, 10, 20, 2199, 0, 5029, 0); break; case EggType.Gust: radius = 4; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x1FB2, 10, 20, 0, 0, 5029, 0); break; case EggType.Bloody: Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 10, 20, 0, 0, 5029, 0); break; } }); } List <Mobile> m_TargetsHit = new List <Mobile>(); IPooledEnumerable eable = map.GetMobilesInRange(location, radius); foreach (Mobile mobile in eable) { if (mobile is EasterBunny) { continue; } if (!mobile.CanBeDamaged()) { continue; } m_TargetsHit.Add(mobile); } eable.Free(); int targets = m_TargetsHit.Count; for (int a = 0; a < targets; a++) { double damage = 0; Mobile mobile = m_TargetsHit[a]; if (mobile == null) { continue; } if (!mobile.Alive || mobile.Deleted) { continue; } switch (eggType) { case EggType.Explosive: damage = (double)(Utility.RandomMinMax(20, 40)); if (mobile is BaseCreature) { damage *= 1.5; } AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0); break; case EggType.Entangle: if (mobile != null) { SpecialAbilities.EntangleSpecialAbility(1.0, null, mobile, 1, 10, -1, true, "", "You are held in place!", "-1"); } break; case EggType.Poison: Poison poison = Poison.GetPoison(Utility.RandomMinMax(2, 4)); mobile.ApplyPoison(mobile, poison); break; case EggType.Ice: damage = (double)(Utility.RandomMinMax(10, 20)); if (mobile is BaseCreature) { damage *= 1.5; } SpecialAbilities.CrippleSpecialAbility(1.0, null, mobile, .5, 10, -1, true, "", "A blast of ice has slowed your actions!", "-1"); AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0); break; case EggType.Gust: SpecialAbilities.KnockbackSpecialAbility(1.0, Location, null, mobile, 40, 8, -1, "", "A gust of wind knocks you off your feet!"); break; case EggType.Banish: SpecialAbilities.HinderSpecialAbility(1.0, null, mobile, 1.0, 5, false, -1, false, "", "You cannot move or speak!", "-1"); mobile.Squelched = true; mobile.Hidden = true; Timer.DelayCall(TimeSpan.FromSeconds(5), delegate { if (mobile == null) { return; } mobile.Squelched = false; mobile.Hidden = false; }); break; case EggType.Bloody: SpecialAbilities.BleedSpecialAbility(1.0, null, mobile, 40, 8.0, 0x44D, true, "", "You begin to bleed!", "-1"); break; } } }); }
public override void OnThink() { base.OnThink(); //Prevent Melee Attacks LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(30); if (DateTime.UtcNow >= m_NextVoidAttackAllowed && AIObject.currentCombatRange != CombatRange.Withdraw && AIObject.Action != ActionType.Flee) { Mobile combatant = Combatant; if (combatant != null && !CantWalk && !Frozen && Alive && !IsDeadPet && !IsDeadBondedPet) { if (combatant.Alive && InLOS(combatant) && GetDistanceToSqrt(combatant) <= 8) { RevealingAction(); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, 1.0, true, 0, false, "", "", "-1"); double entangleDuration = 3; double pierceAmount = .25; double crippleAmount = .20; TimeSpan attackCooldown = NextPvMVoidAttackDelay; double effectChance = .10; double damageScalar = 1.0; if (Controlled && ControlMaster != null) { if (ControlMaster is PlayerMobile) { if (combatant is PlayerMobile) { effectChance = .01; } else { effectChance = .25; } } } if (ControlMaster is PlayerMobile && combatant is PlayerMobile) { entangleDuration = 1; attackCooldown = NextPvPVoidAttackDelay; } m_NextVoidAttackAllowed = DateTime.UtcNow + attackCooldown; Animate(4, 4, 1, true, false, 0); BaseWeapon weapon = Weapon as BaseWeapon; if (weapon == null) { return; } bool hitSuccessful = false; if (weapon.CheckHit(this, combatant)) { hitSuccessful = true; } Effects.PlaySound(Location, Map, 0x5D8); MovingEffect(combatant, 0x573E, 8, 1, false, false, 2200, 0); IEntity startLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 10), Map); double distance = Utility.GetDistanceToSqrt(Location, combatant.Location); double destinationDelay = (double)distance * .08; if (hitSuccessful) { Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (Deleted || !Alive || IsDeadPet || IsDeadBondedPet) { return; } if (!SpecialAbilities.IsDamagable(combatant)) { return; } if (Utility.GetDistance(Location, combatant.Location) >= 20) { return; } TimedStatic voidResidue = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); voidResidue.Hue = 2051; voidResidue.Name = "void residue"; voidResidue.MoveToWorld(new Point3D(combatant.X, combatant.Y, combatant.Z), Map); if (Utility.RandomDouble() <= effectChance) { Effects.PlaySound(combatant.Location, combatant.Map, 0x5DC); for (int a = 0; a < 3; a++) { voidResidue = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); voidResidue.Hue = 2051; voidResidue.Name = "void residue"; Point3D voidResidueLocation = new Point3D(combatant.X + Utility.RandomMinMax(-1, 1), combatant.Y + Utility.RandomMinMax(-1, 1), combatant.Z); SpellHelper.AdjustField(ref voidResidueLocation, combatant.Map, 12, false); voidResidue.MoveToWorld(voidResidueLocation, combatant.Map); } combatant.SendMessage("You have been covered in void residue!"); combatant.FixedParticles(0x374A, 10, 15, 5021, 2051, 0, EffectLayer.Waist); SpecialAbilities.EntangleSpecialAbility(1.0, this, combatant, 1, entangleDuration, 0, false, "", "", "-1"); SpecialAbilities.PierceSpecialAbility(1.0, this, combatant, pierceAmount, 50, 0, false, "", "", "-1"); SpecialAbilities.CrippleSpecialAbility(1.0, this, combatant, crippleAmount, 10, 0, false, "", "", "-1"); } weapon.OnHit(this, combatant, damageScalar); }); } } } } }
public override void OnThink() { base.OnThink(); if (Utility.RandomDouble() < .01 && DateTime.UtcNow > m_NextAIChangeAllowed) { Effects.PlaySound(Location, Map, GetAngerSound()); switch (Utility.RandomMinMax(1, 5)) { case 1: DictCombatTargetingWeight[CombatTargetingWeight.Player] = 0; DictCombatTargetingWeight[CombatTargetingWeight.Closest] = 0; DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0; DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints] = 0; break; case 2: DictCombatTargetingWeight[CombatTargetingWeight.Player] = 10; DictCombatTargetingWeight[CombatTargetingWeight.Closest] = 0; DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0; DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints] = 0; break; case 3: DictCombatTargetingWeight[CombatTargetingWeight.Player] = 0; DictCombatTargetingWeight[CombatTargetingWeight.Closest] = 10; DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0; DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints] = 0; break; case 4: DictCombatTargetingWeight[CombatTargetingWeight.Player] = 0; DictCombatTargetingWeight[CombatTargetingWeight.Closest] = 0; DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 10; DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints] = 0; break; case 5: DictCombatTargetingWeight[CombatTargetingWeight.Player] = 0; DictCombatTargetingWeight[CombatTargetingWeight.Closest] = 0; DictCombatTargetingWeight[CombatTargetingWeight.HighestHitPoints] = 0; DictCombatTargetingWeight[CombatTargetingWeight.LowestHitPoints] = 10; break; } m_NextAIChangeAllowed = DateTime.UtcNow + NextAIChangeDelay; } if (m_NextSnakesAllowed < DateTime.UtcNow && snakeEvents < maxSnakeEvents) { snakeEvents++; PlaySound(GetAngerSound()); PublicOverheadMessage(MessageType.Regular, 0, false, "*snakes emerge from hair*"); for (int a = 0; a < 3; a++) { BaseCreature bc_Creature = null; double creatureResult = Utility.RandomDouble(); if (creatureResult < .01) { bc_Creature = new SilverSerpent(); } else if (creatureResult < .03) { bc_Creature = new IceSerpent(); } else if (creatureResult < .5) { bc_Creature = new LavaSerpent(); } else if (creatureResult < .10) { bc_Creature = new GiantSerpent(); } else if (creatureResult < .25) { bc_Creature = new GiantCoralSnake(); } else if (creatureResult < .50) { bc_Creature = new CoralSnake(); } else { bc_Creature = new Snake(); } if (bc_Creature != null) { bc_Creature.MoveToWorld(Location, Map); bc_Creature.PlaySound(bc_Creature.GetAngerSound()); m_Mobiles.Add(bc_Creature); } } m_NextSnakesAllowed = DateTime.UtcNow + NextSnakeDelay; return; } if (m_NextArrowAllowed < DateTime.UtcNow && AIObject != null && Combatant != null) { if (m_NextArrowStormAllowed < DateTime.UtcNow && !Hidden && AIObject.currentCombatRange != CombatRange.Withdraw) { int attacks = Utility.RandomMinMax(5, 10); double preAttackDelay = .1; double attackInterval = .4; double hitChance = .8; double actionsCooldown = attacks * (preAttackDelay + attackInterval); m_NextArrowAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(actionsCooldown) + NextArrowDelay; m_NextArrowStormAllowed = m_NextArrowAllowed + NextArrowStormDelay; if (AIObject != null) { AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(actionsCooldown); LastSwingTime = LastSwingTime + TimeSpan.FromSeconds(actionsCooldown); NextSpellTime = NextSpellTime + TimeSpan.FromSeconds(actionsCooldown); NextCombatHealActionAllowed = NextCombatHealActionAllowed + TimeSpan.FromSeconds(actionsCooldown); NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(actionsCooldown); NextCombatEpicActionAllowed = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(actionsCooldown); } Point3D location = Location; Map map = Map; for (int a = 0; a < attacks; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * (preAttackDelay + attackInterval)), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } var mobilesNearby = map.GetMobilesInRange(location, 14); List <Mobile> m_MobilesToTarget = new List <Mobile>(); foreach (Mobile mobile in mobilesNearby) { if (mobile == null) { continue; } if (mobile.Deleted || !mobile.Alive) { continue; } if (mobile.AccessLevel > AccessLevel.Player) { continue; } bool validTarget = false; PlayerMobile pm_Mobile = mobile as PlayerMobile; BaseCreature bc_Mobile = mobile as BaseCreature; if (pm_Mobile != null) { validTarget = true; } if (bc_Mobile != null) { if (bc_Mobile.Controlled && bc_Mobile.ControlMaster is PlayerMobile) { validTarget = true; } } if (validTarget) { m_MobilesToTarget.Add(mobile); } } mobilesNearby.Free(); if (m_MobilesToTarget.Count == 0) { return; } Mobile target = m_MobilesToTarget[Utility.RandomMinMax(0, m_MobilesToTarget.Count - 1)]; Direction = GetDirectionTo(target); Effects.PlaySound(location, map, GetAttackSound()); Timer.DelayCall(TimeSpan.FromSeconds(preAttackDelay), delegate { if (this == null) { return; } if (Deleted || !this.Alive) { return; } if (target == null) { return; } if (target.Deleted || !target.Alive) { return; } Animate(Utility.RandomList(4), 5, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(attackInterval), delegate { if (this == null) { return; } if (!this.Alive || this.Deleted) { return; } if (target == null) { return; } if (!target.Alive || target.Deleted) { return; } MovingEffect(target, 0xF42, 18, 1, false, false, 2576, 0); double distance = GetDistanceToSqrt(target.Location); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (target == null) { return; } if (!target.Alive || target.Deleted) { return; } if (Utility.RandomDouble() < hitChance) { Effects.PlaySound(location, map, 0x234); int damage = Utility.RandomMinMax(DamageMin, DamageMax); if (damage < 1) { damage = 1; } //Manual Parry Handling BaseShield shield = target.FindItemOnLayer(Layer.TwoHanded) as BaseShield; if (shield != null) { damage = shield.OnHit(Weapon as BaseWeapon, damage, this); } BaseWeapon weapon = target.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon; if (!(weapon is BaseRanged) && weapon != null) { damage = weapon.WeaponParry(weapon, damage, target); } DoHarmful(target); List <Point3D> m_ExplosionLocations = new List <Point3D>(); Point3D destination = target.Location; m_ExplosionLocations.Add(target.Location); int radius = 1; for (int b = 1; b < radius + 1; b++) { m_ExplosionLocations.Add(new Point3D(destination.X - b, destination.Y - b, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X, destination.Y - b, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X + b, destination.Y - b, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X + b, destination.Y, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X + b, destination.Y + b, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X, destination.Y + b, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X - b, destination.Y + b, destination.Z)); m_ExplosionLocations.Add(new Point3D(destination.X - b, destination.Y, destination.Z)); } foreach (Point3D explosionLocation in m_ExplosionLocations) { Effects.SendLocationParticles(EffectItem.Create(explosionLocation, target.Map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 15, 1153, 0, 5029, 0); } SpecialAbilities.CrippleSpecialAbility(1.0, this, target, .25, 10, 0x64F, false, "", "The medusa's arrow has slowed your actions!", "-1"); new Blood().MoveToWorld(target.Location, target.Map); AOS.Damage(target, this, damage, 100, 0, 0, 0, 0); } else { Effects.PlaySound(location, map, 0x238); } }); }); }); }); } } else { double hitChance = .66; int minDamage = DamageMin; int maxDamage = DamageMax; AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(1.5); LastSwingTime = LastSwingTime + TimeSpan.FromSeconds(3); m_NextArrowAllowed = DateTime.UtcNow + NextArrowDelay; Animate(Utility.RandomList(4), 5, 1, true, false, 0); Effects.PlaySound(Location, Map, this.GetAttackSound()); Point3D location = Location; Map map = Map; Timer.DelayCall(TimeSpan.FromSeconds(.475), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (Combatant == null) { return; } if (!Combatant.Alive || Combatant.Deleted) { return; } MovingEffect(Combatant, 0xF42, 18, 1, false, false, 2576, 0); double distance = GetDistanceToSqrt(Combatant.Location); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (Combatant == null) { return; } if (!Combatant.Alive || Combatant.Deleted) { return; } if (Utility.RandomDouble() < hitChance) { Effects.PlaySound(location, map, 0x234); int damage = Utility.RandomMinMax(minDamage, maxDamage); //Manual Parry Handling BaseShield shield = Combatant.FindItemOnLayer(Layer.TwoHanded) as BaseShield; if (shield != null) { damage = shield.OnHit(Weapon as BaseWeapon, damage, this); } BaseWeapon weapon = Combatant.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon; if (!(weapon is BaseRanged) && weapon != null) { damage = weapon.WeaponParry(weapon, damage, Combatant); } if (damage < 1) { damage = 1; } DoHarmful(Combatant); SpecialAbilities.EntangleSpecialAbility(0.33, this, Combatant, 1.0, 5, -1, true, "", "Their arrow pins you in place!", "-1"); new Blood().MoveToWorld(Combatant.Location, Combatant.Map); AOS.Damage(Combatant, this, damage, 100, 0, 0, 0, 0); } else { Effects.PlaySound(Location, Map, 0x238); } }); }); } } }