Mercurial > wow > wowdb-profiler
changeset 178:ac673d315d61
Trying SHOW_LOOT_TOAST instead of CHAT_MSG_LOOT.
author | James D. Callahan III <jcallahan@curse.com> |
---|---|
date | Sat, 03 Nov 2012 22:31:32 -0500 |
parents | 2fdc940c1748 |
children | f5e3662ed5f9 |
files | Main.lua |
diffstat | 1 files changed, 25 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/Main.lua Sat Nov 03 16:39:07 2012 -0500 +++ b/Main.lua Sat Nov 03 22:31:32 2012 -0500 @@ -82,6 +82,7 @@ QUEST_DETAIL = true, QUEST_LOG_UPDATE = true, QUEST_PROGRESS = true, + SHOW_LOOT_TOAST = true, TAXIMAP_OPENED = true, TRADE_SKILL_SHOW = true, TRAINER_CLOSED = true, @@ -975,20 +976,32 @@ end +function WDP:SHOW_LOOT_TOAST(event_name, loot_type, item_link, quantity) + if loot_type ~= "item" then + return + end + local npc = NPCEntry(private.raid_finder_boss_id) + + if not npc then + return + end + local item_id = ItemLinkToID(item_link) + + if not item_id then + return + end + local loot_type = "raid_finder_loot" + local encounter_data = npc.encounter_data[InstanceDifficultyToken()] + encounter_data[loot_type] = encounter_data[loot_type] or {} + encounter_data.loot_counts = encounter_data.loot_counts or {} + encounter_data.loot_counts[loot_type] = (encounter_data.loot_counts[loot_type] or 0) + 1 + + table.insert(encounter_data[loot_type], ("%d:%d"):format(item_id, quantity)) +end + + local CHAT_MSG_LOOT_UPDATE_FUNCS = { [AF.NPC] = function(item_id, quantity) - local npc = NPCEntry(private.raid_finder_boss_id) - - if not npc then - return - end - local loot_type = "raid_finder_loot" - local encounter_data = npc.encounter_data[InstanceDifficultyToken()] - encounter_data[loot_type] = encounter_data[loot_type] or {} - encounter_data.loot_counts = encounter_data.loot_counts or {} - encounter_data.loot_counts[loot_type] = (encounter_data.loot_counts[loot_type] or 0) + 1 - - table.insert(encounter_data[loot_type], ("%d:%d"):format(item_id, quantity)) end, [AF.ZONE] = function(item_id, quantity) current_loot = {