public override Spell ChooseSpell(IDamageable c) { var select = 2; if (c == null || !c.Alive) { return(null); } Spell spell = null; switch (Utility.Random(select)) { case 0: spell = new HarmSpell(m_Mobile, null); break; case 1: spell = new CurseSpell(m_Mobile, null); break; } return(spell); }
public virtual Spell GetRandomDamageSpell(Mobile c) { int maxCircle = (int)((m_Mobile.Skills[SkillName.Magery].Value + 20.0) / (100.0 / 7.0)); if (maxCircle < 1) { maxCircle = 1; } Spell spell = null; switch (Utility.Random(maxCircle * 2)) { case 0: case 1: spell = new MagicArrowSpell(m_Mobile, null); break; case 2: case 3: spell = new HarmSpell(m_Mobile, null); break; case 4: case 5: spell = new FireballSpell(m_Mobile, null); break; case 6: case 7: spell = new LightningSpell(m_Mobile, null); break; case 8: case 9: spell = new MindBlastSpell(m_Mobile, null); break; case 10: spell = new EnergyBoltSpell(m_Mobile, null); break; case 11: spell = new ExplosionSpell(m_Mobile, null); break; default: spell = new FlameStrikeSpell(m_Mobile, null); break; } 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 virtual Spell DoCombo(Mobile c) { Spell spell = null; m_Mobile.DebugSay("Doing Combo"); if (m_Combo == 0) { m_Mobile.DebugSay(" Casting Explosion and moving to the next spell "); spell = new ExplosionSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 1) { spell = new FlameStrikeSpell(m_Mobile, null); m_Mobile.DebugSay("Casting Flamestrike and moving to the next spell "); ++m_Combo; // Move to next spell } else if (m_Combo == 2) { m_Mobile.DebugSay("Casting maybe poison and moving to next spell"); if (!c.Poisoned && (!(c is BaseCreature) || (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null && ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) || ((BaseCreature)c).PoisonImmune == null)) { spell = new PoisonSpell(m_Mobile, null); } else { spell = new HarmSpell(m_Mobile, null); } ++m_Combo; // Move to next spell } else if (m_Combo == 3 && spell == null) { switch (Utility.Random(3)) { default: case 0: { m_Mobile.DebugSay("Random small Spell and next spell"); spell = GetSmallDamageSpell(); ++m_Combo; // Move to next spell break; } case 1: { m_Mobile.DebugSay("Random small spell and resetting combo"); spell = GetSmallDamageSpell(); m_Combo = -1; // Reset combo state break; } case 2: { m_Mobile.DebugSay("Random small spell and same state"); spell = GetSmallDamageSpell(); break; } } } else if (m_Combo == 4 && spell == null) { m_Mobile.DebugSay("Casting Flamestrike and resetting combo"); spell = new FlameStrikeSpell(m_Mobile, null); m_Combo = -1; } return(spell); }
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); }