Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hunter kill shot to activations, closes #22 #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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