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

WotLK Classic, Hunter request #22

Open
Road-block opened this issue Nov 15, 2023 · 0 comments
Open

WotLK Classic, Hunter request #22

Road-block opened this issue Nov 15, 2023 · 0 comments

Comments

@Road-block
Copy link

I hope the Hunter "execute" Kill Shot can be added to the base addon.

I edited my local copy with the addition of

AddSpellName("KillShot", 61006, 61005, 53351)
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

and

    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

added to ns.configs.HUNTER function.

Tested it out seems to work fine.

Road-block added a commit to Road-block/ClassicSpellActivations that referenced this issue Mar 18, 2024
Road-block added a commit to Road-block/ClassicSpellActivations that referenced this issue Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant