From 249bd71756e94b4d3663e45201f2111d8003392d Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Mon, 12 May 2014 16:08:51 +0000 Subject: [PATCH] Hunter: Only suggest Kill Command if the pet can attack. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1431 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleSimulationCraft.lua | 1 + scripts/ovale_hunter.lua | 2 +- scripts/ovale_hunter_spells.lua | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/OvaleSimulationCraft.lua b/OvaleSimulationCraft.lua index 0c90e1d..8539001 100644 --- a/OvaleSimulationCraft.lua +++ b/OvaleSimulationCraft.lua @@ -356,6 +356,7 @@ do ["^skull_bash_cat$"] = "FeralInterrupt()", -- Hunter ["^aspect_of_the_"] = function(simc, action) return format("if not Stance(hunter_%s) Spell(%s)", action, action) end, + ["^kill_command$"] = "KillCommand()", ["^kill_shot$"] = "Spell(kill_shot usable=1)", ["^summon_pet$"] = "SummonPet()", -- Mage diff --git a/scripts/ovale_hunter.lua b/scripts/ovale_hunter.lua index 5f030da..ddf63fd 100644 --- a/scripts/ovale_hunter.lua +++ b/scripts/ovale_hunter.lua @@ -36,7 +36,7 @@ AddFunction BeastMasteryDefaultActions #kill_shot Spell(kill_shot usable=1) #kill_command - if pet.Present() Spell(kill_command) + KillCommand() #glaive_toss,if=enabled if TalentPoints(glaive_toss_talent) Spell(glaive_toss) #arcane_shot,if=buff.thrill_of_the_hunt.react|buff.beast_within.up diff --git a/scripts/ovale_hunter_spells.lua b/scripts/ovale_hunter_spells.lua index abd8123..fa61563 100644 --- a/scripts/ovale_hunter_spells.lua +++ b/scripts/ovale_hunter_spells.lua @@ -169,6 +169,12 @@ AddFunction SummonPet if pet.Present(no) Texture(ability_hunter_beastcall help=SummonPet) if pet.IsDead() Spell(revive_pet) } + +AddFunction KillCommand +{ + # Only suggest Kill Command if the pet can attack. + if pet.Present() and pet.IsIncapacitated(no) and pet.IsFeared(no) and pet.IsStunned(no) Spell(kill_command) +} ]] OvaleScripts:RegisterScript("HUNTER", name, desc, code, "include") -- 1.7.9.5