This site makes extensive use of JavaScript.
Please
enable JavaScript
in your browser.
Classic Theme
Thottbot Theme
Addon help, Kills and XP
Post Reply
Return to board index
Post by
Damiens
I am writing an addon to tell if I am getting experience for kills but cant seem to find the right event.
UNIT_DIED event fires before CHAT_MSG_COMBAT_XP_GAIN and PLAYER_XP_UPDATE so not sure how to go about programming this.
Basically I want to know if I get to far away from my party member and I am no longer getting experience from his kills.
Post by
TheReal
local x = UnitXP("player") -- Define the experience baseline
local function InRange(event) -- Define the function and pass it the event
if event == "UNIT_DIED" then
if UnitXP("player") ~= x then -- Compare exp before and after kill
fireAlert() -- Whatever your alert function is
end
end
x = UnitXP("player") -- Reset the experience baseline
end
Just how I would do it. I'm sure there are a hundred or more ways and several better than my own, but I'm pretty sure this would work.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.