Quantcast

Hunter: Don't suggest summoning a pet when using the Lone Wolf talent.

Johnny C. Lam [12-11-14 - 19:32]
Hunter: Don't suggest summoning a pet when using the Lone Wolf talent.

Fixes ticket 496 by @Necroskillz.
Filename
SimulationCraft.lua
scripts/ovale_hunter.lua
scripts/ovale_hunter_spells.lua
scripts/simulationcraft_hunter_bm.lua
scripts/simulationcraft_hunter_mm.lua
scripts/simulationcraft_hunter_sv.lua
diff --git a/SimulationCraft.lua b/SimulationCraft.lua
index ac1e591..f759917 100644
--- a/SimulationCraft.lua
+++ b/SimulationCraft.lua
@@ -1199,6 +1199,14 @@ EmitAction = function(parseNode, nodeList, annotation)
 		elseif class == "HUNTER" and action == "kill_command" then
 			-- Kill Command requires that a pet that can move freely.
 			conditionCode = "pet.Present() and not pet.IsIncapacitated() and not pet.IsFeared() and not pet.IsStunned()"
+		elseif class == "HUNTER" and action == "summon_pet" then
+			if specialization == "beast_mastery" then
+				bodyCode = "BeastMasterySummonPet()"
+			else
+				bodyCode = "SummonPet()"
+			end
+			annotation[action] = class
+			isSpellAction = false
 		elseif class == "HUNTER" and strsub(action, -5) == "_trap" then
 			annotation.trap_launcher = class
 			conditionCode = "CheckBoxOn(opt_trap_launcher)"
@@ -2977,13 +2985,28 @@ local function InsertSupportingFunctions(child, annotation)
 		count = count + 1
 	end
 	if annotation.summon_pet == "HUNTER" then
-		local code = [[
-			AddFunction SummonPet
-			{
-				if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
-				if pet.IsDead() Spell(revive_pet)
-			}
-		]]
+		local code
+		if annotation.specialization == "beast_mastery" then
+			code = [[
+				AddFunction BeastMasterySummonPet
+				{
+					if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
+					if pet.IsDead() Spell(revive_pet)
+				}
+			]]
+		else
+			code = [[
+				AddFunction SummonPet
+				{
+					if not Talent(lone_wolf_talent)
+					{
+						if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
+						if pet.IsDead() Spell(revive_pet)
+					}
+				}
+			]]
+			AddSymbol(annotation, "lone_wolf_talent")
+		end
 		local node = OvaleAST:ParseCode("add_function", code, nodeList, annotation.astAnnotation)
 		tinsert(child, 1, node)
 		AddSymbol(annotation, "revive_pet")
diff --git a/scripts/ovale_hunter.lua b/scripts/ovale_hunter.lua
index f9817f9..7cecb79 100644
--- a/scripts/ovale_hunter.lua
+++ b/scripts/ovale_hunter.lua
@@ -37,12 +37,21 @@ AddFunction InterruptActions
 	}
 }

-AddFunction SummonPet
+AddFunction BeastMasterySummonPet
 {
 	if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
 	if pet.IsDead() Spell(revive_pet)
 }

+AddFunction SummonPet
+{
+	if not Talent(lone_wolf_talent)
+	{
+		if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
+		if pet.IsDead() Spell(revive_pet)
+	}
+}
+
 ###
 ### Beast Mastery
 ###
@@ -146,7 +155,7 @@ AddFunction BeastMasteryPrecombatActions
 AddFunction BeastMasteryPrecombatShortCdActions
 {
 	#summon_pet
-	SummonPet()
+	BeastMasterySummonPet()
 }

 AddFunction BeastMasteryPrecombatCdActions
diff --git a/scripts/ovale_hunter_spells.lua b/scripts/ovale_hunter_spells.lua
index 18758f8..7eba0dd 100644
--- a/scripts/ovale_hunter_spells.lua
+++ b/scripts/ovale_hunter_spells.lua
@@ -96,6 +96,7 @@ Define(kill_shot 53351)
 	SpellInfo(kill_shot target_health_pct=35 if_spell=enhanced_kill_shot)
 Define(lock_and_load_buff 168980)
 	SpellInfo(lock_and_load_buff duration=15 max_stacks=2)
+Define(lone_wolf_talent 21)
 Define(multishot 2643)
 	SpellInfo(multishot focus=40)
 	SpellInfo(multishot buff_focus=bombardment_buff buff_focus_amount=-25 if_spell=bombardment)
diff --git a/scripts/simulationcraft_hunter_bm.lua b/scripts/simulationcraft_hunter_bm.lua
index e35bb65..89b92bf 100644
--- a/scripts/simulationcraft_hunter_bm.lua
+++ b/scripts/simulationcraft_hunter_bm.lua
@@ -35,7 +35,7 @@ AddFunction InterruptActions
 	}
 }

-AddFunction SummonPet
+AddFunction BeastMasterySummonPet
 {
 	if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
 	if pet.IsDead() Spell(revive_pet)
@@ -101,7 +101,7 @@ AddFunction BeastMasteryPrecombatActions
 	#flask,type=greater_draenic_agility_flask
 	#food,type=blackrock_barbecue
 	#summon_pet
-	SummonPet()
+	BeastMasterySummonPet()
 	#snapshot_stats
 	#exotic_munitions,ammo_type=poisoned,if=active_enemies<3
 	if Enemies() < 3 and BuffRemaining(exotic_munitions_buff) < 1200 Spell(poisoned_ammo)
diff --git a/scripts/simulationcraft_hunter_mm.lua b/scripts/simulationcraft_hunter_mm.lua
index 81fd62c..5fd8188 100644
--- a/scripts/simulationcraft_hunter_mm.lua
+++ b/scripts/simulationcraft_hunter_mm.lua
@@ -44,8 +44,11 @@ AddFunction InterruptActions

 AddFunction SummonPet
 {
-	if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
-	if pet.IsDead() Spell(revive_pet)
+	if not Talent(lone_wolf_talent)
+	{
+		if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
+		if pet.IsDead() Spell(revive_pet)
+	}
 }

 AddFunction MarksmanshipDefaultActions
@@ -167,6 +170,7 @@ AddIcon specialization=marksmanship help=aoe
 # glyph_of_explosive_trap
 # incendiary_ammo
 # kill_shot
+# lone_wolf_talent
 # multishot
 # poisoned_ammo
 # powershot
diff --git a/scripts/simulationcraft_hunter_sv.lua b/scripts/simulationcraft_hunter_sv.lua
index 6904ee3..0162363 100644
--- a/scripts/simulationcraft_hunter_sv.lua
+++ b/scripts/simulationcraft_hunter_sv.lua
@@ -44,8 +44,11 @@ AddFunction InterruptActions

 AddFunction SummonPet
 {
-	if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
-	if pet.IsDead() Spell(revive_pet)
+	if not Talent(lone_wolf_talent)
+	{
+		if not pet.Present() Texture(ability_hunter_beastcall help=L(summon_pet))
+		if pet.IsDead() Spell(revive_pet)
+	}
 }

 AddFunction SurvivalDefaultActions
@@ -178,6 +181,7 @@ AddIcon specialization=survival help=aoe
 # glyph_of_explosive_trap
 # incendiary_ammo
 # lock_and_load_buff
+# lone_wolf_talent
 # multishot
 # poisoned_ammo
 # potion_agility_buff