Thread Tools Display Modes
09-30-20, 05:59 PM   #1
krel666
A Murloc Raider
Join Date: Sep 2020
Posts: 5
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.
  Reply With Quote
09-30-20, 08:53 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
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.
__________________
  Reply With Quote
10-01-20, 04:26 AM   #3
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
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...
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Yield xp/honor

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off