comparison Main.lua @ 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
comparison
equal deleted inserted replaced
177:2fdc940c1748 178:ac673d315d61
80 PLAYER_TARGET_CHANGED = true, 80 PLAYER_TARGET_CHANGED = true,
81 QUEST_COMPLETE = true, 81 QUEST_COMPLETE = true,
82 QUEST_DETAIL = true, 82 QUEST_DETAIL = true,
83 QUEST_LOG_UPDATE = true, 83 QUEST_LOG_UPDATE = true,
84 QUEST_PROGRESS = true, 84 QUEST_PROGRESS = true,
85 SHOW_LOOT_TOAST = true,
85 TAXIMAP_OPENED = true, 86 TAXIMAP_OPENED = true,
86 TRADE_SKILL_SHOW = true, 87 TRADE_SKILL_SHOW = true,
87 TRAINER_CLOSED = true, 88 TRAINER_CLOSED = true,
88 TRAINER_SHOW = true, 89 TRAINER_SHOW = true,
89 TRANSMOGRIFY_OPEN = true, 90 TRANSMOGRIFY_OPEN = true,
973 end 974 end
974 end 975 end
975 end 976 end
976 977
977 978
979 function WDP:SHOW_LOOT_TOAST(event_name, loot_type, item_link, quantity)
980 if loot_type ~= "item" then
981 return
982 end
983 local npc = NPCEntry(private.raid_finder_boss_id)
984
985 if not npc then
986 return
987 end
988 local item_id = ItemLinkToID(item_link)
989
990 if not item_id then
991 return
992 end
993 local loot_type = "raid_finder_loot"
994 local encounter_data = npc.encounter_data[InstanceDifficultyToken()]
995 encounter_data[loot_type] = encounter_data[loot_type] or {}
996 encounter_data.loot_counts = encounter_data.loot_counts or {}
997 encounter_data.loot_counts[loot_type] = (encounter_data.loot_counts[loot_type] or 0) + 1
998
999 table.insert(encounter_data[loot_type], ("%d:%d"):format(item_id, quantity))
1000 end
1001
1002
978 local CHAT_MSG_LOOT_UPDATE_FUNCS = { 1003 local CHAT_MSG_LOOT_UPDATE_FUNCS = {
979 [AF.NPC] = function(item_id, quantity) 1004 [AF.NPC] = function(item_id, quantity)
980 local npc = NPCEntry(private.raid_finder_boss_id)
981
982 if not npc then
983 return
984 end
985 local loot_type = "raid_finder_loot"
986 local encounter_data = npc.encounter_data[InstanceDifficultyToken()]
987 encounter_data[loot_type] = encounter_data[loot_type] or {}
988 encounter_data.loot_counts = encounter_data.loot_counts or {}
989 encounter_data.loot_counts[loot_type] = (encounter_data.loot_counts[loot_type] or 0) + 1
990
991 table.insert(encounter_data[loot_type], ("%d:%d"):format(item_id, quantity))
992 end, 1005 end,
993 [AF.ZONE] = function(item_id, quantity) 1006 [AF.ZONE] = function(item_id, quantity)
994 current_loot = { 1007 current_loot = {
995 list = { 1008 list = {
996 ("%d:%d"):format(item_id, quantity) 1009 ("%d:%d"):format(item_id, quantity)