WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Yield xp/honor (https://www.wowinterface.com/forums/showthread.php?t=58235)

krel666 09-30-20 05:59 PM

Yield xp/honor
 
Are there any API calls that can tell you if the killed target yielded xp/honor? Also, is there anyway to check if you have the 'tag' on a target you kill?

Currently the only way I can think of doing it is checking the targets level. In the case of honor checking level and if guid includes player.

Xrystal 09-30-20 08:53 PM

There is : UnitIsTapDenied(..)
I would assume you pass the unit in question and it will return whether it has been tapped, or maybe tap info as to why it is denied. But I could see nothing else that appear to work after it is tapped.

The honor/xp values you may have to go via the Combat Log event tracking. But you could use UnitIsTrivial(unit) to check if you will get something however little.

glupikreten 10-01-20 04:26 AM

Regarding gaining xp couldnt you do:

Code:

...

local function calculate(event, isInitialLogin, isReloadingUi)
        if event == "PLAYER_ENTERING_WORLD" and (isInitialLogin or isReloadingUi) then
                maxxp = UnitXPMax("player")
                currentxp = UnitXP("player")
        else
                newxp = UnitXP("player")
                if event == "PLAYER_LEVEL_UP" then
                        gained = maxxp - currentxp + newxp
                        maxxp = UnitXPMax("player")
                else
                        gained = newxp - currentxp
                end
               
                print(gained)

                currentxp = newxp
        end
end

local f = CreateFrame("FRAME")
f:RegisterEvent("PLAYER_XP_UPDATE")
f:RegisterEvent("PLAYER_LEVEL_UP")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript(
        "OnEvent",
        function(self, event, isInitialLogin, isReloadingUi)
                calculate(event, isInitialLogin, isReloadingUi)
        end
)


something similar but due to blizzards honor calculation a little bit more complicated for honor aswell...


All times are GMT -6. The time now is 05:21 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI