public static int GetTotalCurses(Mobile m) { int curses = 0; if (EvilOmenSpell.UnderEffects(m)) { curses++; } if (StrangleSpell.UnderEffects(m)) { curses++; } if (CorpseSkinSpell.IsUnderEffects(m)) { curses++; } if (BloodOathSpell.GetBloodOath(m) != null) { curses++; } if (MindRotSpell.HasMindRotScalar(m)) { curses++; } if (SpellPlagueSpell.HasSpellPlague(m)) { curses++; } if (SleepSpell.IsUnderSleepEffects(m)) { curses++; } if (CurseSpell.UnderEffect(m)) { curses++; } if (FeeblemindSpell.IsUnderEffects(m)) { curses++; } if (ClumsySpell.IsUnderEffects(m)) { curses++; } if (WeakenSpell.IsUnderEffects(m)) { curses++; } return(curses); }
public virtual Spell ChooseSpell(Mobile c) { Spell spell = this.CheckCastHealingSpell(); if (spell != null) { return(spell); } double damage = ((this.m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30); if (damage > c.Hits) { return(new PainSpikeSpell(this.m_Mobile, null)); } switch (Utility.Random(25)) { case 0: case 1: case 2: // Poison them { this.m_Mobile.DebugSay("Attempting to poison"); if (!c.Poisoned) { spell = new PoisonSpell(this.m_Mobile, null); } break; } case 3: // Bless ourselves. { this.m_Mobile.DebugSay("Blessing myself"); spell = new BlessSpell(this.m_Mobile, null); break; } case 4: case 5: case 6: // Curse them. { this.m_Mobile.DebugSay("Attempting to curse"); spell = this.GetRandomCurseSpell(); break; } case 7: // Paralyze them. { this.m_Mobile.DebugSay("Attempting to paralyze"); if (this.m_Mobile.Skills[SkillName.Magery].Value > 50.0) { spell = new ParalyzeSpell(this.m_Mobile, null); } break; } case 8: // Drain mana { this.m_Mobile.DebugSay("Attempting to drain mana"); spell = this.GetRandomManaDrainSpell(); break; } case 9: case 10: // Blood oath them { this.m_Mobile.DebugSay("Attempting to blood oath"); if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(c) != this.m_Mobile) { spell = new BloodOathSpell(this.m_Mobile, null); } break; } case 11: case 12: // Animate dead { this.m_Mobile.DebugSay("Attempting to animate dead"); if ((this.m_Animated == null || !this.m_Animated.Alive) && this.m_Mobile.Skills[SkillName.Necromancy].Value > 40) { spell = new AnimateDeadSpell(this.m_Mobile, null); } break; } case 13: case 14: { this.m_Mobile.DebugSay("Attempting to cast vengeful spirit"); if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 80 && (this.m_Mobile.Followers + 3) < this.m_Mobile.FollowersMax) { spell = new VengefulSpiritSpell(this.m_Mobile, null); } break; } default: // Damage them. { this.m_Mobile.DebugSay("Just doing damage"); spell = this.GetRandomDamageSpell(); break; } } return(spell); }
public virtual Spell ChooseSpell(IDamageable c) { Spell spell = this.CheckCastHealingSpell(); if (spell != null) { return(spell); } if (!(c is Mobile)) { return(null); } Mobile mob = c as Mobile; double damage = ((this.m_Mobile.Skills[SkillName.SpiritSpeak].Value - mob.Skills[SkillName.MagicResist].Value) / 10) + (mob.Player ? 18 : 30); if (damage > c.Hits) { spell = new ManaDrainSpell(this.m_Mobile, null); } switch (Utility.Random(16)) { case 0: case 1: case 2: // Poison them { this.m_Mobile.DebugSay("Attempting to BloodOath"); if (!mob.Poisoned) { spell = new BloodOathSpell(this.m_Mobile, null); } break; } case 3: // Bless ourselves. { this.m_Mobile.DebugSay("Blessing myself"); spell = new BlessSpell(this.m_Mobile, null); break; } case 4: case 5: case 6: // Curse them. { this.m_Mobile.DebugSay("Attempting to curse"); spell = this.GetRandomCurseSpell(); break; } case 7: // Paralyze them. { this.m_Mobile.DebugSay("Attempting to paralyze"); if (this.m_Mobile.Skills[SkillName.Magery].Value > 50.0) { spell = new ParalyzeSpell(this.m_Mobile, null); } break; } case 8: // Drain mana { this.m_Mobile.DebugSay("Attempting to drain mana"); spell = this.GetRandomManaDrainSpell(); break; } case 9: // Blood oath them { this.m_Mobile.DebugSay("Attempting to blood oath"); if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(mob) != this.m_Mobile) { spell = new BloodOathSpell(this.m_Mobile, null); } break; } } return(spell); }
public virtual Spell ChooseSpell(Mobile c) { Spell spell = CheckCastHealingSpell(); if (spell != null) { return(spell); } double damage = ((m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30); if (damage > c.Hits) { spell = new PainSpikeSpell(m_Mobile, null); } switch (Utility.Random(16)) { case 0: case 1: case 2: // Poison them { m_Mobile.DebugSay("Attempting to poison"); if (!c.Poisoned) { spell = new PoisonSpell(m_Mobile, null); } break; } case 3: // Bless ourselves. { m_Mobile.DebugSay("Blessing myself"); spell = new BlessSpell(m_Mobile, null); break; } case 4: case 5: case 6: // Curse them. { m_Mobile.DebugSay("Attempting to curse"); spell = GetRandomCurseSpell(); break; } case 7: // Paralyze them. { m_Mobile.DebugSay("Attempting to paralyze"); if (m_Mobile.Skills[SkillName.Magery].Value > 50.0) { spell = new ParalyzeSpell(m_Mobile, null); } break; } case 8: // Drain mana { m_Mobile.DebugSay("Attempting to drain mana"); spell = GetRandomManaDrainSpell(); break; } case 9: // Blood oath them { m_Mobile.DebugSay("Attempting to blood oath"); if (m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(c) != m_Mobile) { spell = new BloodOathSpell(m_Mobile, null); } break; } default: // Damage them. { m_Mobile.DebugSay("Just doing damage"); spell = GetRandomDamageSpell(); break; } } return(spell); }