evil-morfar/RCLootCouncil2

Usage of event "ENCOUNTER_LOOT_RECEIVED"

Closed this issue · 2 comments

It is now confirmed that master loot is gone in BFA

Can you help me to figure out the usage of the event ENCOUNTER_LOOT_RECEIVED?
What I already known is that this event fires in personal loot, so other people can know what has dropped. Though the game does not show the loot banner in the interface if the loot is done late, it does not mean this event is not fired. Read the code at the bottom for more details.

Return value for "ENCOUNTER_LOOT_RECEIVED":
encounterID, itemID, itemLink, quantity, playerName, className

My current plan to use this event:

  1. All items returned by "ENCOUNTER_LOOT_RECEIVED" will be added to the session frame.
  2. The group leader will wait for several seconds for RC addon message after "ENCOUNTER_LOOT_RECEIVED" to determine whether the item is tradable. During this time, the session cannot be started.
  3. Item not trabable will still be added to the lootTable/votingframe, to give council a complete view what has dropped. Should give an option for this.

Can you help me to figure out the following? I will test it myself in LFR when I get time.

  1. Does ENCOUNTER_LOOT_RECEIVED fire if loot is done a while after boss's death (~30s)?
  2. Does it fire if loot is done after the next boss is dead?
  3. Does it fire for other player if other player is in the different wing in the instance?
  4. The time difference between ITEM_PUSH and ENCOUNTER_LOOT_RECEIVED. And which one fires first.
// FrameXML/LevelUpDisplay.lua
function BossBanner_OnEvent(self, event, ...)
	if ( event == "BOSS_KILL" ) then
		wipe(self.pendingLoot);
		local encounterID, name = ...;
		TopBannerManager_Show(self, { encounterID = encounterID, name = name, mode = "KILL" });
	elseif ( event == "ENCOUNTER_LOOT_RECEIVED" ) then
		local encounterID, itemID, itemLink, quantity, playerName, className = ...;
		local _, instanceType = GetInstanceInfo();
		if ( encounterID == self.encounterID and (instanceType == "party" or instanceType == "raid") ) then
			-- add loot to pending list
			local data = { itemID = itemID, quantity = quantity, playerName = playerName, className = className, itemLink = itemLink };
			tinsert(self.pendingLoot, data);
			-- check state
			if ( self.animState == BB_STATE_LOOT_INSERT and self.lootShown < BB_MAX_LOOT ) then
				-- show it now
				BossBanner_SetAnimState(self, BB_STATE_LOOT_EXPAND);
			elseif ( not self.animState and self.lootShown == 0 ) then
				-- banner is not displaying and have not done loot for this encounter yet
				-- TODO: animate in kill banner
				TopBannerManager_Show(self, { encounterID = encounterID, name = nil, mode = "LOOT" });
			end		
		end
	end
end

Do you have a source for that? I've yet to see anything confirming it's removal.

Yes I'll help, but I can't say when as I'm still pressed for time.

Do you know when exactly the event fires? Shortly after the kill, or only when players pick up their items?

Regarding ENCOUNTER_LOOT_RECEIVED here's a dump from a LFR:

"19:18:37 - Event: (ENCOUNTER_END) (2073) (The Coven of Shivarra) (17) (25) (1)", -- [270]
"19:18:45 - NonHandled Event: (ENCOUNTER_LOOT_RECEIVED) (2073) (152040) (|cffa335ee|Hitem:152040::::::::110:256::4:3:3613:1457:3528:::|h[Frigid Gloomstone]|h|r) (1) (Fordrake-ArgentDawn) (DEATHKNIGHT)", -- [271]
"19:18:46 - Event: (LOOT_OPENED) (true)", -- [272]
"19:18:46 - GetUnitName: (Asara, Mother of Night)", -- [273]
"19:18:47 - Event: (LOOT_CLOSED)", -- [274]
"19:18:47 - NonHandled Event: (ENCOUNTER_LOOT_RECEIVED) (2073) (151971) (|cffa335ee|Hitem:151971::::::::110:256::4:3:3613:1457:3528:::|h[Sheath of Asara]|h|r) (1) (Potdisc) (PRIEST)", -- [275]
"19:18:47 - NonHandled Event: (ENCOUNTER_LOOT_RECEIVED) (2073) (152010) (|cffa335ee|Hitem:152010::::::::110:256::4:3:3613:1472:3337:::|h[Burning Coven Sabatons]|h|r) (1) (Celestinia-Shadowsong) (PALADIN)", -- [276]
"19:18:48 - NonHandled Event: (ENCOUNTER_LOOT_RECEIVED) (2073) (152135) (|cffa335ee|Hitem:152135::::::::110:256::4:3:3613:1467:3336:::|h[Serpentstalker Mantle]|h|r) (1) (Miths-AeriePeak) (HUNTER)", -- [277]
"19:18:48 - NonHandled Event: (ENCOUNTER_LOOT_RECEIVED) (2073) (152177) (|cffa335ee|Hitem:152177::::::::110:256::4:3:3613:1457:3528:::|h[Grim Inquisitor's Shoulderguards]|h|r) (1) (Jèbbz-Silvermoon) (WARLOCK)", -- [278]
"19:18:49 - NonHandled Event: (ENCOUNTER_LOOT_RECEIVED) (2073) (152284) (|cffa335ee|Hitem:152284::::::::110:256::4:3:3613:1462:3336:::|h[Zealous Tormentor's Ring]|h|r) (1) (Lyanie-Sylvanas) (SHAMAN)", -- [279]