comparison Main.lua @ 412:e2f7f33cf5f7 6.0.3-6

Blacklisted six problematic items for chat-based loot recording. Also, added two more events to cancel recording.
author MMOSimca <MMOSimca@gmail.com>
date Sat, 03 Jan 2015 02:35:00 -0500
parents 4adc1fa4ddba
children d97e37b1e239
comparison
equal deleted inserted replaced
411:4adc1fa4ddba 412:e2f7f33cf5f7
99 CHAT_MSG_SYSTEM = true, 99 CHAT_MSG_SYSTEM = true,
100 COMBAT_LOG_EVENT_UNFILTERED = true, 100 COMBAT_LOG_EVENT_UNFILTERED = true,
101 COMBAT_TEXT_UPDATE = true, 101 COMBAT_TEXT_UPDATE = true,
102 CURSOR_UPDATE = true, 102 CURSOR_UPDATE = true,
103 FORGE_MASTER_OPENED = true, 103 FORGE_MASTER_OPENED = true,
104 GARRISON_MISSION_BONUS_ROLL_COMPLETE = "HandleBadChatLootData",
105 GARRISON_MISSION_COMPLETE_RESPONSE = "HandleBadChatLootData",
104 GOSSIP_SHOW = true, 106 GOSSIP_SHOW = true,
105 GROUP_ROSTER_UPDATE = true, 107 GROUP_ROSTER_UPDATE = true,
106 GUILDBANKFRAME_OPENED = true, 108 GUILDBANKFRAME_OPENED = true,
107 ITEM_TEXT_BEGIN = true, 109 ITEM_TEXT_BEGIN = true,
108 ITEM_UPGRADE_MASTER_OPENED = true, 110 ITEM_UPGRADE_MASTER_OPENED = true,
109 LOOT_CLOSED = true, 111 LOOT_CLOSED = true,
110 LOOT_OPENED = true, 112 LOOT_OPENED = true,
111 LOOT_SLOT_CLEARED = true, 113 LOOT_SLOT_CLEARED = "HandleBadChatLootData",
112 MAIL_SHOW = true, 114 MAIL_SHOW = true,
113 MERCHANT_CLOSED = true, 115 MERCHANT_CLOSED = true,
114 MERCHANT_SHOW = "UpdateMerchantItems", 116 MERCHANT_SHOW = "UpdateMerchantItems",
115 MERCHANT_UPDATE = "UpdateMerchantItems", 117 MERCHANT_UPDATE = "UpdateMerchantItems",
116 PET_BAR_UPDATE = true, 118 PET_BAR_UPDATE = true,
1254 end -- do-block 1256 end -- do-block
1255 1257
1256 1258
1257 -- EVENT HANDLERS ----------------------------------------------------- 1259 -- EVENT HANDLERS -----------------------------------------------------
1258 1260
1259 function WDP:LOOT_SLOT_CLEARED(...) 1261 function WDP:HandleBadChatLootData(...)
1260 ClearChatLootData() 1262 ClearChatLootData()
1261 end 1263 end
1262 1264
1263 1265
1264 -- For now, bonus roll data only pollutes the true drop percentages. We still want to capture the data from SPELL_CONFIRMATION_PROMPT because of legendary quest items though. 1266 -- For now, bonus roll data only pollutes the true drop percentages. We still want to capture the data from SPELL_CONFIRMATION_PROMPT because of legendary quest items though.
1332 1334
1333 -- Need information on the most recent args, so using this complete debug statement for now 1335 -- Need information on the most recent args, so using this complete debug statement for now
1334 Debug("%s: loot_type: %s, item_link: %s, quantity: %s, spec_ID: %s, sex_ID: %s, is_personal: %s, loot_source: %s", event_name, loot_type, item_link, quantity, spec_ID, sex_ID, is_personal, loot_source) 1336 Debug("%s: loot_type: %s, item_link: %s, quantity: %s, spec_ID: %s, sex_ID: %s, is_personal: %s, loot_source: %s", event_name, loot_type, item_link, quantity, spec_ID, sex_ID, is_personal, loot_source)
1335 1337
1336 -- Handle Garrison cache specially 1338 -- Handle Garrison cache specially
1337 if lootSource and last_garrison_cache_object_id and (lootSource == private.GARRISON_CACHE_LOOT_SOURCE_ID) then 1339 if lootSource and (lootSource == private.GARRISON_CACHE_LOOT_SOURCE_ID) and last_garrison_cache_object_id then
1338 -- Record location data for cache 1340 -- Record location data for cache
1339 UpdateDBEntryLocation("objects", ("OPENING:%d"):format(last_garrison_cache_object_id)) 1341 UpdateDBEntryLocation("objects", ("OPENING:%d"):format(last_garrison_cache_object_id))
1340 1342
1341 -- Add drop data 1343 -- Add drop data
1342 local currency_texture = CurrencyLinkToTexture(item_link) 1344 local currency_texture = CurrencyLinkToTexture(item_link)
1521 end 1523 end
1522 update_func(currency_texture, quantity) 1524 update_func(currency_texture, quantity)
1523 end 1525 end
1524 1526
1525 1527
1528 local BLACKLISTED_ITEMS = {
1529 [114116] = true,
1530 [114119] = true,
1531 [114120] = true,
1532 [116980] = true,
1533 [120319] = true,
1534 [120320] = true,
1535 }
1536
1537
1526 local CHAT_MSG_LOOT_UPDATE_FUNCS = { 1538 local CHAT_MSG_LOOT_UPDATE_FUNCS = {
1527 [AF.ITEM] = function(item_id, quantity) 1539 [AF.ITEM] = function(item_id, quantity)
1528 local container_id = current_loot.identifier -- For faster access, since this is going to be called 9 times in the next 3 lines 1540 local container_id = current_loot.identifier -- For faster access, since this is going to be called 9 times in the next 3 lines
1529 -- Verify that we're still assigning data to the right items 1541 -- Verify that we're still assigning data to the right items
1530 if container_id and (private.CONTAINER_ITEM_ID_LIST[container_id] ~= nil) then 1542 if container_id and (private.CONTAINER_ITEM_ID_LIST[container_id] ~= nil) then
1593 -- We still want to record the item's data, even if it doesn't need its drop location recorded 1605 -- We still want to record the item's data, even if it doesn't need its drop location recorded
1594 RecordItemData(item_id, item_link, true) 1606 RecordItemData(item_id, item_link, true)
1595 1607
1596 -- Take action based on update category 1608 -- Take action based on update category
1597 local update_func = CHAT_MSG_LOOT_UPDATE_FUNCS[category] 1609 local update_func = CHAT_MSG_LOOT_UPDATE_FUNCS[category]
1598 if not category or not update_func then 1610 if not category or not update_func or BLACKLISTED_ITEMS[item_id] then
1599 return 1611 return
1600 end 1612 end
1601 update_func(item_id, quantity) 1613 update_func(item_id, quantity)
1602 end 1614 end
1603 end 1615 end