Hunter: Only suggest Kill Command if the pet can attack.
Johnny C. Lam [05-12-14 - 16:08]
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
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")