public static void Emergency(WowPlayer player) { if (!player.IsCasting("Holy Light") && !player.IsCasting("Flash of Light")) { if (!player.HasBuff("Forbearance")) { if (player.CanCast("Divine Protection")) { if (player.CanCast("Divine Shield") && divineShield) { player.SpellStopCasting(); player.CastSpellByName("Divine Shield"); } else { player.SpellStopCasting(); player.CastSpellByName("Divine Protection"); } HealSystem(player); } else if (player.CanCast("Blessing of Protection")) { player.SpellStopCasting(); player.CastSpellByName("Blessing of Protection"); HealSystem(player); } } if (!player.HasBuff(emBless) && player.CanCast(emBless) && emergBless) { player.CastSpellByName(emBless); } if (player.CanCast("Lay on Hands") && !player.HasBuff("Forbearance")) { player.SpellStopCasting(); player.CastSpellByName("Lay on Hands"); } if (player.HasBuff("Forbearance")) { if (player.CanCast("Lay on Hands") && player.HpPct < 24) { player.SpellStopCasting(); player.CastSpellByName("Lay on Hands"); } } if (player.HpPct < MinHPPct) { HealSystem(player); } } }
public override bool NeedRest(WowPlayer player) { if (player.IsDead) { return false; } if (player.IsInCombat()) { return false; } if (player.HasBuff("Resurrection Sickness")) { return true; } if (player.MpPct < RestMana && !player.IsCasting() && !player.HasBuff("Drink")) { Output.Instance.Script("Resting for mana", this); return true; } if (player.MpPct < MinMPPct && player.HasBuff("Drink")) { Output.Instance.Script("Resting to continue drinking", this); return true; } if (player.HpPct < RestHp && !player.IsCasting() && !player.HasBuff("Drink")) { Output.Instance.Script("Resting for health", this); return true; } return false; }
/// <summary> /// This is the routine called when we need resting /// This should be implemented in the spcific class script /// </summary> protected override void DoExecute(WowPlayer player) { Output.Instance.Script("OnRest()", this); if (player.IsCasting() && player.HpPct > 90) { // we don't need to finish casting a healing spell, let's stop it player.SpellStopCasting(); } if (player.IsMoving()) { // If we're still moving, let's stop player.Stop(); } if (player.HasDebuff("Resurrection Sickness") && !player.IsSitting) { GlobalBaseBotState.Sit(player); Output.Instance.Script("OnRest() - We have resurrection sickness. We stay put.", this); return; } Core.DebuffAll(); if (Core.scrollSpam && GlobalBaseBotState.CanUseScroll(player)) { GlobalBaseBotState.UseScroll(player); } if (!Core.debuffStatus) { if (player.MpPct >= Core.RestMana && player.HpPct <= GlobalBaseBotState.MinHPPct && GlobalBaseBotState.Consumable.HasBandage() && Core.useBandage) { GlobalBaseBotState.Consumable.UseBandage(); } } if (player.HpPct >= GlobalBaseBotState.MinHPPct && player.MpPct >= GlobalBaseBotState.MinMPPct) { GlobalBaseBotState.Stand(player); return; } if (player.HpPct <= Core.RestHp && player.MpPct > 10 && !player.HasBuff("Drink") && !player.IsCasting()) { if (player.IsSitting) { GlobalBaseBotState.Stand(player); } if (!player.IsCasting()) { Core.HealSystem(player); return; } } if (!player.HasBuff("Drink") && player.MpPct <= Core.RestMana && !player.IsCasting()) { if (GlobalBaseBotState.Consumable.HasDrink()) { GlobalBaseBotState.Consumable.UseDrink(); } else { player.CastSpellByName("Blessing of Wisdom"); } } }