public static bool DoMassiveIceBreathAttack(BaseCreature creature) { if (creature == null) { return(false); } if (creature.Deleted) { return(false); } if (creature.Combatant == null) { return(false); } if (!creature.Combatant.Alive) { return(false); } Direction direction = creature.GetDirectionTo(creature.Combatant); creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*"); SpecialAbilities.DoMassiveBreathAttack(creature, creature.Location, direction, creature.MassiveBreathRange, true, BreathType.Ice, true); return(true); }
public static bool DoMassiveFireBreathAttack(BaseCreature creature) { if (creature == null) { return(false); } if (creature.Combatant == null) { return(false); } if (!creature.Combatant.Alive) { return(false); } Direction direction = creature.GetDirectionTo(creature.Combatant); Point3D newPoint = creature.GetPointByDirection(creature.Location, direction); SpellHelper.AdjustField(ref newPoint, creature.Map, 12, false); creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*"); SpecialAbilities.DoMassiveBreathAttack(creature, creature.Location, direction, creature.MassiveBreathRange, true, BreathType.Fire, true); return(true); }
public bool MoveTo(Item m, bool run, int range) { if (m_Mobile.Deleted || m_Mobile.DisallowAllMoves || m == null || m.Deleted) { return(false); } if (m_Mobile.InRange(m, range)) { m_Path = null; return(true); } if (m_Path != null && m_Path.Goal == m) { //Temrael Fix if (m_Path.Follow(run, 1) == PathFollowerResult.ReachedDestination) { m_Path = null; return(true); } } else if (!m_AI.DoMove(m_Mobile.GetDirectionTo(m), true)) { m_Path = new PathFollower(m_Mobile, m); m_Path.Mover = new MoveMethod(m_AI.DoMoveImpl); //Temrael Fix //if( m_Path.Follow( run, 1 ) ) if (m_Path.Follow(run, 1) == PathFollowerResult.ReachedDestination) { m_Path = null; return(true); } } else { m_Path = null; return(true); } return(false); }
public static bool DoCauseWounds(BaseCreature creature, Mobile target) { if (creature == null || target == null) { return(false); } if (!creature.Alive || !target.Alive) { return(false); } creature.Direction = creature.GetDirectionTo(target); creature.PlaySound(0x605); CastingAnimationInfo.GetCastAnimationForBody(creature); creature.Animate(creature.SpellCastAnimation, creature.SpellCastFrameCount, 1, true, false, 0); double actionsCooldown = 2.0; if (creature.AIObject != null) { creature.AIObject.NextMove = creature.AIObject.NextMove + TimeSpan.FromSeconds(actionsCooldown); } creature.LastSwingTime = creature.LastSwingTime + TimeSpan.FromSeconds(actionsCooldown); creature.NextSpellTime = creature.NextSpellTime + TimeSpan.FromSeconds(actionsCooldown); creature.NextCombatHealActionAllowed = creature.NextCombatHealActionAllowed + TimeSpan.FromSeconds(actionsCooldown); creature.NextCombatSpecialActionAllowed = creature.NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(actionsCooldown); creature.NextCombatEpicActionAllowed = creature.NextCombatEpicActionAllowed + TimeSpan.FromSeconds(actionsCooldown); target.FixedParticles(0x374A, 10, 30, 5038, 1149, 0, EffectLayer.Head); target.PlaySound(0x658); double magerySkill = creature.Skills[SkillName.Magery].Value; int baseDamage = (int)(magerySkill / 5); if (baseDamage < 1) { baseDamage = 1; } AOS.Damage(target, creature, baseDamage, 0, 100, 0, 0, 0); return(true); }
public static bool DoMassivePlantBreathAttack(BaseCreature creature) { if (creature == null) { return(false); } if (creature.Combatant == null) { return(false); } if (!creature.Combatant.Alive) { return(false); } Direction direction = creature.GetDirectionTo(creature.Combatant); creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*gathers nearby plantlife*"); SpecialAbilities.DoMassiveBreathAttack(creature, creature.Location, direction, creature.MassiveBreathRange, true, BreathType.Plant, true); return(true); }
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); } } }); }); }