public InternalTarget( LightningSpell owner ) : base( Core.ML ? 10 : 12, false, TargetFlags.Harmful ) { m_Owner = owner; }
public InternalSphereTarget(LightningSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful) { m_Owner = owner; m_Owner.Caster.SendAsciiMessage("Selecione o alvo..."); }
public virtual Spell DoCombo(Mobile c) { Spell spell = null; if (m_ComboType == ComboType.None) m_ComboType = (ComboType)Utility.RandomMinMax(1, 7); if (m_Combo == 1) { switch (m_ComboType) { case ComboType.Exp_FS_Poison: case ComboType.Exp_MB_Poison: case ComboType.Exp_EB_Poison: case ComboType.Exp_FB_MA_Poison: case ComboType.Exp_FB_Poison_Light: case ComboType.Exp_FB_MA_Light: case ComboType.Exp_Poison_FB_Light: spell = new ExplosionSpell(m_Mobile, null); break; } } else if (m_Combo == 2) { switch (m_ComboType) { case ComboType.Exp_FS_Poison: spell = new FlameStrikeSpell(m_Mobile, null); break; case ComboType.Exp_MB_Poison: spell = new MindBlastSpell(m_Mobile, null); break; case ComboType.Exp_EB_Poison: spell = new EnergyBoltSpell(m_Mobile, null); break; case ComboType.Exp_FB_MA_Poison: spell = new FireballSpell(m_Mobile, null); break; case ComboType.Exp_FB_Poison_Light: spell = new FireballSpell(m_Mobile, null); break; case ComboType.Exp_FB_MA_Light: spell = new FireballSpell(m_Mobile, null); break; case ComboType.Exp_Poison_FB_Light: spell = new PoisonSpell(m_Mobile, null); break; } } else if (m_Combo == 3) { switch (m_ComboType) { case ComboType.Exp_FS_Poison: case ComboType.Exp_MB_Poison: case ComboType.Exp_EB_Poison: spell = new PoisonSpell(m_Mobile, null); EndCombo(); return spell; case ComboType.Exp_FB_MA_Poison: spell = new MagicArrowSpell(m_Mobile, null); break; case ComboType.Exp_FB_Poison_Light: spell = new PoisonSpell(m_Mobile, null); break; case ComboType.Exp_FB_MA_Light: spell = new MagicArrowSpell(m_Mobile, null); break; case ComboType.Exp_Poison_FB_Light: spell = new FireballSpell(m_Mobile, null); break; } } else if (m_Combo == 4) { switch (m_ComboType) { case ComboType.Exp_FS_Poison: case ComboType.Exp_MB_Poison: case ComboType.Exp_EB_Poison: spell = new LightningSpell(m_Mobile, null); EndCombo(); return spell; case ComboType.Exp_FB_MA_Poison: spell = new PoisonSpell(m_Mobile, null); break; case ComboType.Exp_FB_Poison_Light: case ComboType.Exp_FB_MA_Light: case ComboType.Exp_Poison_FB_Light: spell = new LightningSpell(m_Mobile, null); EndCombo(); return spell; } } else if (m_Combo == 5) { switch (m_ComboType) { case ComboType.Exp_FS_Poison: case ComboType.Exp_MB_Poison: case ComboType.Exp_EB_Poison: case ComboType.Exp_FB_MA_Poison: case ComboType.Exp_FB_Poison_Light: case ComboType.Exp_FB_MA_Light: case ComboType.Exp_Poison_FB_Light: spell = new LightningSpell(m_Mobile, null); EndCombo(); return spell; } } m_Combo++; // Move to next spell if (spell == null) spell = new PoisonSpell(m_Mobile, null); return spell; }
public InternalTarget(LightningSpell owner) : base(12, false, TargetFlags.Harmful) { m_Owner = owner; }
public virtual Spell DoCombo( Mobile c ) { Spell spell = null; if ( m_Combo == 0 ) { spell = new ExplosionSpell( m_Mobile, null ); ++m_Combo; // Move to next spell } else if ( m_Combo == 1 ) { spell = new WeakenSpell( m_Mobile, null ); ++m_Combo; // Move to next spell } else if ( m_Combo == 2 ) { if ( !c.Poisoned ) spell = new PoisonSpell( m_Mobile, null ); ++m_Combo; // Move to next spell } if ( m_Combo == 3 && spell == null ) { switch ( Utility.Random( 3 ) ) { default: case 0: { if ( c.Int < c.Dex ) spell = new FeeblemindSpell( m_Mobile, null ); else spell = new ClumsySpell( m_Mobile, null ); ++m_Combo; // Move to next spell break; } case 1: { spell = new EnergyBoltSpell( m_Mobile, null ); m_Combo = -1; // Reset combo state break; } case 2: { spell = new FlameStrikeSpell( m_Mobile, null ); m_Combo = -1; // Reset combo state break; } } } else if ( m_Combo == 4 && spell == null ) { spell = new LightningSpell( m_Mobile, null );//MindBlastSpell( m_Mobile, null ); m_Combo = -1; } return spell; }
public virtual Spell DoCombo(Mobile c) { Spell spell = null; if (m_Combo == 0) { //m_Mobile.Say( "combo phase 0" ); spell = new ExplosionSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 1) { //m_Mobile.Say( "combo phase 1" ); spell = new ExplosionSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 2) { //m_Mobile.Say( "combo phase 2" ); if (!c.Poisoned) spell = new PoisonSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 3) { //m_Mobile.Say( "combo phase 3" ); if (c.Poisoned) spell = new WeakenSpell(m_Mobile, null); if (!c.Poisoned) spell = new PoisonSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 4) { // m_Mobile.Say( "combo phase 4 ebolt" ); spell = new EnergyBoltSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 5) { //m_Mobile.Say( "combo phase 5" ); if (c.Poisoned && c.Alive) { spell = new HarmSpell(m_Mobile, null); m_Combo = 5; // Move to next spell } if (!c.Poisoned) { if (m_Mobile.Mana > 20) spell = new EnergyBoltSpell(m_Mobile, null); if (m_Mobile.Mana < 19) spell = new LightningSpell(m_Mobile, null); m_Combo = -1; // Reset combo state } } return spell; }
public InternalTarget(LightningSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful) { this.m_Owner = owner; }
public InternalTarget(LightningSpell owner) : base(owner.Caster.EraML ? 10 : 12, false, TargetFlags.Harmful) { m_Owner = owner; }
public void ChargedAbilityAttack( Mobile attacker, Mobile defender ) { if ( m_AbilityCharges <= 0 ) return; AbilitySpell m_Spell = null; Mobile dummy = DummyCaster; switch ( m_ChargedAbility ) { case WeaponChargedAbility.Clumsiness: m_Spell = new ClumsySpell( dummy, null ); break; case WeaponChargedAbility.Feeblemindedness: m_Spell = new FeeblemindSpell( dummy, null ); break; case WeaponChargedAbility.Weakness: m_Spell = new WeakenSpell( dummy, null ); break; case WeaponChargedAbility.Burning : m_Spell = new MagicArrowSpell( dummy, null ); break; case WeaponChargedAbility.Wounding: m_Spell = new HarmSpell( dummy, null ); break; case WeaponChargedAbility.DragonsBreath: case WeaponChargedAbility.DaemonsBreath: m_Spell = new FireballSpell( dummy, null ); break; case WeaponChargedAbility.Thunder: m_Spell = new LightningSpell( dummy, null ); break; case WeaponChargedAbility.MagesBane: m_Spell = new ManaDrainSpell( dummy, null ); break; case WeaponChargedAbility.GhoulsTouch: m_Spell = new ParalyzeSpell( dummy, null ); break; case WeaponChargedAbility.Evil: m_Spell = new CurseSpell( dummy, null ); break; } if ( m_Spell != null ) { m_Spell.OnHit( attacker, defender ); m_AbilityCharges--; } dummy.Delete(); }
public InternalSphereTarget(LightningSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful) { m_Owner = owner; m_Owner.Caster.SendAsciiMessage("Select target..."); }
public override Spell DoCombo(Mobile c) { //m_Mobile.Say("doing human AI combo"); if (c is PlayerMobile && SmartAI && (c.Spell is MagicTrapSpell || c.Spell is MagicArrowSpell)) { m_EnemyCountersPara = true; } Spell spell = null; if (Combo == 0) { //m_Mobile.Say( "combo phase 1" ); spell = new ExplosionSpell(m_Mobile, null); ++Combo; // Move to next spell } if (Combo == 1) { //m_Mobile.Say( "combo phase 1" ); spell = new ExplosionSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 2) { //m_Mobile.Say( "combo phase 2" ); if (!c.Poisoned && (CheckCanPoison(c))) spell = new PoisonSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 3) { //m_Mobile.Say( "combo phase 3" ); if (c.Poisoned || !CheckCanPoison(c)) spell = new WeakenSpell(m_Mobile, null); if (!c.Poisoned && (CheckCanPoison(c))) spell = new PoisonSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 4) { // m_Mobile.Say( "combo phase 4 ebolt" ); if (!c.Poisoned && (CheckCanPoison(c))) { spell = new PoisonSpell(m_Mobile, null); Combo = 4; } else spell = new EnergyBoltSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 5) { //m_Mobile.Say( "combo phase 5" ); if (c.Poisoned) { if (c.Hits < 20 && m_Mobile.Mana >= 20) spell = new EnergyBoltSpell(m_Mobile, null); else spell = new HarmSpell(m_Mobile, null); Combo = 5; // Move to next spell } if (!c.Poisoned) { if (m_Mobile.Mana > 20) spell = new EnergyBoltSpell(m_Mobile, null); if (m_Mobile.Mana < 19) spell = new LightningSpell(m_Mobile, null); Combo = -1; // Reset combo state } } return spell; }
public override Spell ChooseSpell(Mobile c) { if (c is PlayerMobile && SmartAI && (c.Spell is MagicTrapSpell || c.Spell is MagicArrowSpell)) { m_EnemyCountersPara = true; } if (c.Int > 70 && m_Mobile.MagicDamageAbsorb <= 0 && m_Mobile.Mana > 20 && m_Mobile.Hits > 60 && m_Mobile.CanBeginAction(typeof(DefensiveSpell))) { Spell temp = c.Spell as Spell; if (temp == null || (temp != null && temp.IsCasting && (int)temp.Circle <= (int)SpellCircle.Fourth)) return new MagicReflectSpell(m_Mobile, null); } if (c.Dex > 60 && m_Mobile.MeleeDamageAbsorb <= 0 && m_Mobile.Mana > 20 && m_Mobile.Hits > 30 && m_Mobile.CanBeginAction(typeof(DefensiveSpell))) return new ReactiveArmorSpell(m_Mobile, null); Spell spell = null; int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits)); switch (Utility.Random(1 + healChance)) { default: case 0: // Heal ourself { if (HealPotCount >= 1 && m_Mobile.Hits < (m_Mobile.HitsMax - 30)) DrinkHeal(m_Mobile); else if (m_Mobile.Hits < (m_Mobile.HitsMax - 35) && m_Mobile.Hits >= 45) spell = new GreaterHealSpell(m_Mobile, null); else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10)) spell = new HealSpell(m_Mobile, null); break; } case 1: // Set up a combo { //para them and med up until we have mana for a dump if (m_Mobile.Mana < 85 && m_Mobile.Mana > 2) { m_RegainingMana = true; //if there low on life and we have the mana try an finish them if (m_Mobile.Mana > 20 && c.Hits < 28) spell = new EnergyBoltSpell(m_Mobile, null); if (m_Mobile.Mana > 12 && c.Hits < 15) spell = new LightningSpell(m_Mobile, null); if (c.Paralyzed && !c.Poisoned) { if (c.Hits < 45 && m_Mobile.Mana > 40) spell = new ExplosionSpell(m_Mobile, null); if (c.Hits < 30) spell = new EnergyBoltSpell(m_Mobile, null); m_Mobile.DebugSay("I am going to meditate"); m_Mobile.UseSkill(SkillName.Meditation); } else if (!c.Poisoned && m_EnemyCountersPara == false && m_Mobile.Mana > 40) { spell = new ParalyzeSpell(m_Mobile, null); } else { if (m_Mobile.InRange(c, 4)) RunFrom(c); if (!m_Mobile.InRange(c, 6)) RunTo(c, CanRun); //m_Mobile.UseSkill( SkillName.Meditation ); } } if (m_Mobile.Mana > 85) { m_RegainingMana = false; Combo = 0; } break; } } return spell; }
public override bool DoActionCombat() { Mobile c = m_Mobile.Combatant; m_Mobile.Warmode = true; if (c == null || c.Deleted || !c.Alive || c.IsDeadBondedPet || !m_Mobile.CanSee(c) || !m_Mobile.CanBeHarmful(c, false) || c.Map != m_Mobile.Map) { // Our combatant is deleted, dead, hidden, or we cannot hurt them // Try to find another combatant if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { if (m_Mobile.Debug) m_Mobile.DebugSay("Something happened to my combatant, so I am going to fight {0}", m_Mobile.FocusMob.Name); m_Mobile.Combatant = c = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else { m_Mobile.DebugSay("Something happened to my combatant, and nothing is around. I am on guard."); Action = ActionType.Guard; return true; } } if (!m_Mobile.InLOS(c)) { if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { m_Mobile.Combatant = c = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } } if (SmartAI && (c.Spell is MagicTrapSpell || c.Spell is MagicArrowSpell)) { EnemyCountersPara = true; } if (m_Mobile.Paralyzed) { UseTrapPouch(m_Mobile); } TrapPouch(m_Mobile); if (SmartAI && !m_Mobile.StunReady && m_Mobile.Skills[SkillName.Wrestling].Value >= 80.0 && m_Mobile.Skills[SkillName.Anatomy].Value >= 80.0) EventSink.InvokeStunRequest(new StunRequestEventArgs(m_Mobile)); if (!m_Mobile.InRange(c, m_Mobile.RangePerception)) { // They are somewhat far away, can we find something else? if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { m_Mobile.Combatant = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else if (!m_Mobile.InRange(c, m_Mobile.RangePerception * 3)) { m_Mobile.Combatant = null; } c = m_Mobile.Combatant; if (c == null) { m_Mobile.DebugSay("My combatant has fled, so I am on guard"); Action = ActionType.Guard; return true; } } if (m_Mobile.Hits < m_Mobile.HitsMax * 20 / 100) { // We are low on health, should we flee? bool flee = false; if (m_Mobile.Hits < c.Hits) { // We are more hurt than them int diff = c.Hits - m_Mobile.Hits; flee = (Utility.Random(0, 100) > (10 + diff)); // (10 + diff)% chance to flee } else { flee = Utility.Random(0, 100) > 10; // 10% chance to flee } if (flee) { if (m_Mobile.Debug) m_Mobile.DebugSay("I am going to flee from {0}", c.Name); Action = ActionType.Flee; return true; } } if (m_Mobile.Spell == null && DateTime.Now > m_NextCastTime && m_Mobile.InRange(c, 12)) { // We are ready to cast a spell Spell spell = null; Mobile toDispel = FindDispelTarget(true); Mobile toParalyze = FindParalyzeTarget(true); //try an cure with a pot first if the poison is serious or where in the middle of dumping if (UsesPotions && (m_Mobile.Poisoned && m_Mobile.Poison.Level >= 3) || m_Mobile.Poisoned && Combo != -1) { DrinkCure(m_Mobile); } if (m_Mobile.Poisoned) // Top cast priority is cure { spell = new CureSpell(m_Mobile, null); try { if ((((m_Mobile.Skills[SkillName.Magery].Value / (m_Mobile.Poison.Level + 1)) - 20) * 7.5) > 50) { spell = new CureSpell(m_Mobile, null); } else { spell = new ArchCureSpell(m_Mobile, null); } } catch { spell = new CureSpell(m_Mobile, null); } } else if (toDispel != null) // Something dispellable is attacking us { spell = DoDispel(toDispel); } else if (toParalyze != null) // Something dispellable is attacking us { spell = DoParalyze(toParalyze); } //take down reflect on are enemy if its up else if (c.MagicDamageAbsorb > 5) { m_Mobile.DebugSay("Takeing Down Reflect"); spell = new LightningSpell(m_Mobile, null); } else if (Combo != -1 && !m_Mobile.Paralyzed) // We are doing a spell combo { spell = DoCombo(c); } else { spell = ChooseSpell(c); } if (SmartAI && toDispel != null) { if (m_Mobile.InRange(toDispel, 10)) RunFrom(toDispel); else if (!m_Mobile.InRange(toDispel, 12)) RunTo(toDispel, CanRun); } if (toParalyze != null) { if (m_Mobile.InRange((BaseCreature)toParalyze, 10)) RunFrom(toParalyze); else if (!m_Mobile.InRange((BaseCreature)toParalyze, 12)) RunTo(toParalyze, CanRun); } else { if (RegainingMana == false) RunTo(c, CanRun); } if (spell != null && spell.Cast()) { TimeSpan delay; //spell cast time is equal to the delay for the spells. delay = spell.GetCastDelay() + spell.GetCastRecovery(); m_NextCastTime = DateTime.Now + delay; } } else if ((m_Mobile.Spell == null || !m_Mobile.Spell.IsCasting) && RegainingMana == false) { RunTo(c, CanRun); } return true; }
public override Spell DoCombo(Mobile c) { Spell spell = null; if (Combo == 0) { m_Mobile.DebugSay("I am doing combo part 1"); Map fromMap = m_Mobile.Map; Point3D from = m_Mobile.Location; Map toMap = c.Map; Point3D to = c.Location; if (toMap != null) { for (int i = 0; i < 5; ++i) { Point3D loc = new Point3D(to.X - 4 + Utility.Random(8), to.Y - 4 + Utility.Random(9), to.Z); if (toMap.CanSpawnMobile(loc)) { to = loc; break; } else { loc.Z = toMap.GetAverageZ(loc.X, loc.Y); if (toMap.CanSpawnMobile(loc)) { to = loc; break; } } } m_Mobile.Map = toMap; m_Mobile.Location = to; //poof effect DoParticleEffect(m_Mobile, from, to, fromMap, toMap); } spell = new LightningSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 1) { spell = new ParalyzeSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 2) { m_Mobile.Say("I bet your first wish would be that you had never rubbed the lamp!"); if (!c.Paralyzed) { spell = new ParalyzeSpell(m_Mobile, null); } else spell = new LightningSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 3) { Map fromMap = m_Mobile.Map; Point3D from = m_Mobile.Location; Map toMap = c.Map; Point3D to = c.Location; if (toMap != null) { for (int i = 0; i < 5; ++i) { Point3D loc = new Point3D(to.X - 4 + Utility.Random(8), to.Y - 4 + Utility.Random(9), to.Z); if (toMap.CanSpawnMobile(loc)) { to = loc; break; } else { loc.Z = toMap.GetAverageZ(loc.X, loc.Y); if (toMap.CanSpawnMobile(loc)) { to = loc; break; } } } m_Mobile.Map = toMap; m_Mobile.Location = to; DoParticleEffect(m_Mobile, from, to, fromMap, toMap); } spell = new LightningSpell(m_Mobile, null); ++Combo; // Move to next spell } else if (Combo == 4 && spell == null) { if (!c.Paralyzed) { spell = new ParalyzeSpell(m_Mobile, null); } else spell = new LightningSpell(m_Mobile, null); Combo = -1; // Move to next spell } return spell; }