public InternalTarget(BloodOathSpell owner) : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful) { this.m_Owner = owner; }
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 InternalTarget(BloodOathSpell owner) : base(10, false, TargetFlags.Harmful) { m_Owner = owner; }
public virtual Spell DoCombo(Mobile c) { Spell spell = null; if (m_Combo == 0) { spell = new PoisonStrikeSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 1) { spell = new BloodOathSpell(m_Mobile, null); ++m_Combo; // Move to next spell } else if (m_Combo == 2) { if (!c.Poisoned) spell = new MindRotSpell(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 StrangleSpell(m_Mobile, null); else spell = new EvilOmenSpell(m_Mobile, null); ++m_Combo; // Move to next spell break; } case 1: { spell = new PoisonStrikeSpell(m_Mobile, null); m_Combo = -1; // Reset combo state break; } case 2: { spell = new BloodOathSpell(m_Mobile, null); m_Combo = -1; // Reset combo state break; } } } else if (m_Combo == 4 && spell == null) { spell = new VengefulSpiritSpell(m_Mobile, null); m_Combo = -1; } return spell; }
public Spell GetNecromancerSpell() { Spell spell = null; switch ( Utility.Random( 12 ) ) { case 0: case 1: // Create an army for our ourselves { int whichone = Utility.RandomMinMax( 1, 2 ); if ( whichone == 2 && m_Mobile.Skills[SkillName.Necromancy].Value > 50.0 ) { if ( m_Mobile.Debug ) m_Mobile.Say( 1109, "Undead: Casting Animate Dead" ); spell = new AnimateDeadSpell( m_Mobile, null ); } else if ( m_Mobile.Followers == 0 || m_Mobile.Followers == 3 ) { if ( m_Mobile.Debug ) m_Mobile.Say( 1109, "Undead: Summoning Familiar " ); CreateNecromancerFamiliar(); } else goto default; break; } case 2: case 3: // Curse them { if ( m_Mobile.Debug ) m_Mobile.Say( 1109, "Cursing Them" ); spell = GetNecromancerCurseSpell(); break; } case 4: case 5: // Reverse combat { if ( m_Mobile.Debug ) m_Mobile.Say( 1109, "Casting Blood Oath" ); if ( m_Mobile.Skills[SkillName.Necromancy].Value > 30.0 ) spell = new BloodOathSpell( m_Mobile, null ); break; } case 6: // Shapeshift { if ( m_CanShapeShift ) { if ( m_Mobile.Debug ) m_Mobile.Say( 1109, "Shapechange " ); spell = GetNecromancerShapeshiftSpell(); } else goto case 3; // Curse them break; } default: // Damage them { if ( m_Mobile.Debug ) m_Mobile.Say( 1109, "Random damage spell" ); spell = GetNecromancerDamageSpell(); break; } } return spell; }
public InternalTarget( BloodOathSpell owner ) : base( 12, false, TargetFlags.Harmful ) { m_Owner = owner; }
public override bool DoActionCombat() { Mobile c = this.m_Mobile.Combatant; this.m_Mobile.Warmode = true; if (c == null || c.Deleted || !c.Alive || c.IsDeadBondedPet || !this.m_Mobile.CanSee(c) || !this.m_Mobile.CanBeHarmful(c, false) || c.Map != this.m_Mobile.Map) { // Our combatant is deleted, dead, hidden, or we cannot hurt them // Try to find another combatant if (this.AcquireFocusMob(this.m_Mobile.RangePerception, this.m_Mobile.FightMode, false, false, true)) { if (this.m_Mobile.Debug) this.m_Mobile.DebugSay("Something happened to my combatant, so I am going to fight {0}", this.m_Mobile.FocusMob.Name); this.m_Mobile.Combatant = c = this.m_Mobile.FocusMob; this.m_Mobile.FocusMob = null; } else { this.m_Mobile.DebugSay("Something happened to my combatant, and nothing is around. I am on guard."); this.Action = ActionType.Guard; return true; } } if (!this.m_Mobile.InLOS(c)) { if (this.AcquireFocusMob(this.m_Mobile.RangePerception, this.m_Mobile.FightMode, false, false, true)) { this.m_Mobile.Combatant = c = this.m_Mobile.FocusMob; this.m_Mobile.FocusMob = null; } } if (!this.m_Mobile.StunReady && this.m_Mobile.Skills[SkillName.Wrestling].Value >= 80.0 && this.m_Mobile.Skills[SkillName.Anatomy].Value >= 80.0) EventSink.InvokeStunRequest(new StunRequestEventArgs(this.m_Mobile)); if (!this.m_Mobile.InRange(c, this.m_Mobile.RangePerception)) { // They are somewhat far away, can we find something else? if (this.AcquireFocusMob(this.m_Mobile.RangePerception, this.m_Mobile.FightMode, false, false, true)) { this.m_Mobile.Combatant = this.m_Mobile.FocusMob; this.m_Mobile.FocusMob = null; } else if (!this.m_Mobile.InRange(c, this.m_Mobile.RangePerception * 3)) { this.m_Mobile.Combatant = null; } c = this.m_Mobile.Combatant; if (c == null) { this.m_Mobile.DebugSay("My combatant has fled, so I am on guard"); this.Action = ActionType.Guard; return true; } } if (!this.m_Mobile.Controlled && !this.m_Mobile.Summoned && !this.m_Mobile.IsParagon) { if (this.m_Mobile.Hits < this.m_Mobile.HitsMax * 20 / 100) { // We are low on health, should we flee? bool flee = false; if (this.m_Mobile.Hits < c.Hits) { // We are more hurt than them int diff = c.Hits - this.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 (this.m_Mobile.Debug) this.m_Mobile.DebugSay("I am going to flee from {0}", c.Name); this.Action = ActionType.Flee; return true; } } } if (this.m_Mobile.Spell == null && DateTime.UtcNow > this.m_NextCastTime && this.m_Mobile.InRange(c, 12)) { // We are ready to cast a spell Spell spell = null; Mobile toDispel = this.FindDispelTarget(true); if (this.m_Mobile.Poisoned) // Top cast priority is cure { this.m_Mobile.DebugSay("I am going to cure myself"); spell = new CureSpell(this.m_Mobile, null); } else if (toDispel != null) // Something dispellable is attacking us { this.m_Mobile.DebugSay("I am going to dispel {0}", toDispel); spell = this.DoDispel(toDispel); } else if ((c.Spell is HealSpell || c.Spell is GreaterHealSpell) && !c.Poisoned) // They have a heal spell out { spell = new BloodOathSpell(this.m_Mobile, null); } else { spell = this.ChooseSpell(c); } // Now we have a spell picked // Move first before casting if (toDispel != null) { if (this.m_Mobile.InRange(toDispel, 10)) this.RunFrom(toDispel); else if (!this.m_Mobile.InRange(toDispel, 12)) this.RunTo(toDispel); } else { this.RunTo(c); } if (spell != null) spell.Cast(); TimeSpan delay; if (spell is DispelSpell) delay = TimeSpan.FromSeconds(this.m_Mobile.ActiveSpeed); else delay = this.GetDelay(); this.m_NextCastTime = DateTime.UtcNow + delay; } else if (this.m_Mobile.Spell == null || !this.m_Mobile.Spell.IsCasting) { this.RunTo(c); } return true; }
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) 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 (!c.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(c) != this.m_Mobile) spell = new BloodOathSpell(this.m_Mobile, null); break; } } return spell; }