private bool CastSpellIfPossible(string spellName, bool needsMana = false) { if (!Spells.ContainsKey(spellName)) { Spells.Add(spellName, CharacterManager.SpellBook.GetSpellByName(spellName)); } if (Spells[spellName] != null && !CooldownManager.IsSpellOnCooldown(spellName) && (!needsMana || Spells[spellName].Costs < ObjectManager.Player.Mana)) { HookManager.CastSpell(spellName); CooldownManager.SetSpellCooldown(spellName, (int)HookManager.GetSpellCooldown(spellName)); return(true); } return(false); }
private bool CastSpellIfPossible(string spellName, bool needsEnergy = false, bool needsCombopoints = false, int requiredCombopoints = 1) { if (!Spells.ContainsKey(spellName)) { Spells.Add(spellName, CharacterManager.SpellBook.GetSpellByName(spellName)); } if (Spells[spellName] != null && !CooldownManager.IsSpellOnCooldown(spellName) && (!needsEnergy || Spells[spellName].Costs < ObjectManager.Player.Energy) && (!needsCombopoints || ObjectManager.Player.ComboPoints >= requiredCombopoints)) { HookManager.CastSpell(spellName); CooldownManager.SetSpellCooldown(spellName, (int)HookManager.GetSpellCooldown(spellName)); return(true); } return(false); }
private bool CastSpellIfPossible(string spellName, bool needsRuneenergy = false, bool needsBloodrune = false, bool needsFrostrune = false, bool needsUnholyrune = false) { if (!Spells.ContainsKey(spellName)) { Spells.Add(spellName, CharacterManager.SpellBook.GetSpellByName(spellName)); } if (Spells[spellName] != null && !CooldownManager.IsSpellOnCooldown(spellName) && (!needsRuneenergy || Spells[spellName].Costs < ObjectManager.Player.Runeenergy) && (!needsBloodrune || (HookManager.IsRuneReady(0) || HookManager.IsRuneReady(1))) && (!needsFrostrune || (HookManager.IsRuneReady(2) || HookManager.IsRuneReady(3))) && (!needsUnholyrune || (HookManager.IsRuneReady(4) || HookManager.IsRuneReady(5)))) { HookManager.CastSpell(spellName); CooldownManager.SetSpellCooldown(spellName, (int)HookManager.GetSpellCooldown(spellName)); return(true); } return(false); }
private void HandleDeadPartymembers() { if (!Spells.ContainsKey(resurrectionSpell)) { Spells.Add(resurrectionSpell, CharacterManager.SpellBook.GetSpellByName(resurrectionSpell)); } if (Spells[resurrectionSpell] != null && !CooldownManager.IsSpellOnCooldown(resurrectionSpell) && Spells[resurrectionSpell].Costs < ObjectManager.Player.Mana) { IEnumerable <WowPlayer> players = ObjectManager.WowObjects.OfType <WowPlayer>(); List <WowPlayer> groupPlayers = players.Where(e => e.IsDead && e.Health == 0 && ObjectManager.PartymemberGuids.Contains(e.Guid)).ToList(); if (groupPlayers.Count > 0) { HookManager.TargetGuid(groupPlayers.First().Guid); HookManager.CastSpell(resurrectionSpell); CooldownManager.SetSpellCooldown(resurrectionSpell, (int)HookManager.GetSpellCooldown(resurrectionSpell)); } } }
private void CastSpell(string spellName) { WowInterface.HookManager.CastSpell(spellName); CooldownManager.SetSpellCooldown(spellName, (int)WowInterface.HookManager.GetSpellCooldown(spellName)); AmeisenLogger.Instance.Log("CombatClass", $"[{Displayname}]: Casting Spell \"{spellName}\" on \"{WowInterface.ObjectManager.Target?.Name}\"", LogLevel.Verbose); }