Skip to content

Commit

Permalink
add hunter kill shot to activations, closes rgd87#22
Browse files Browse the repository at this point in the history
  • Loading branch information
Road-block committed Apr 8, 2024
1 parent 4213e3f commit 3e98fa7
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ClassicSpellActivations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ AddSpellName("HealingTouchSoD", 25297, 9889, 9888, 9758, 8903, 6778, 5189, 5188,
AddSpellName("HowlingBlast", 51411, 51410, 51409, 49184)
AddSpellName("FrostStrike", 55268, 51419, 51418, 51417, 51416, 49143)

AddSpellName("KillShot", 61006, 61005, 53351)

AddSpellName("ChainLightning", 408484, 408482, 408481, 408479, 10605, 2860, 930, 421)
AddSpellName("ChainHeal", 416246, 416245, 416244, 10623, 10622, 1064)
AddSpellName("LavaBurst", 408490)
Expand Down Expand Up @@ -684,6 +686,22 @@ end
-- HUNTER
-----------------

function ns.KillShotCheck(self, event, unit)
if UnitExists("target") and not UnitIsFriend("player", "target") then
local h = UnitHealth("target")
local hm = UnitHealthMax("target")
local killshotID = ns.findHighestRank("KillShot")

if h > 0 and (h/hm < 0.2 or IsUsableSpell(killshotID)) then
f:Activate("KillShot", "Health", 10)
else
f:Deactivate("KillShot", "Health")
end
else
f:Deactivate("KillShot", "Health")
end
end

function ns.CheckCounterattack(eventType, isSrcPlayer, isDstPlayer, ...)
if isDstPlayer then
if eventType == "SWING_MISSED" or eventType == "SPELL_MISSED" then
Expand Down Expand Up @@ -776,6 +794,17 @@ ns.configs.HUNTER = function(self)
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:SetScript("OnUpdate", nil)
end

if ns.findHighestRank("KillShot") then
self:RegisterEvent("PLAYER_TARGET_CHANGED")
self:RegisterUnitEvent("UNIT_HEALTH", "target")
self.PLAYER_TARGET_CHANGED = ns.KillShotCheck
self.UNIT_HEALTH = ns.KillShotCheck
else
self:UnregisterEvent("PLAYER_TARGET_CHANGED")
self:UnregisterEvent("UNIT_HEALTH")
end

end

-----------------
Expand Down

0 comments on commit 3e98fa7

Please sign in to comment.