comparison Main.lua @ 516:36a08bd1523b

Updated (and possibly fixed) item container loot extrapolation.
author MMOSimca <mmosimca@gmail.com>
date Tue, 08 Nov 2016 17:47:52 -0500
parents 4a965d3ac13d
children 0ca9202b8d7d
comparison
equal deleted inserted replaced
515:4a965d3ac13d 516:36a08bd1523b
67 local LOOT_SLOT_ITEM = _G.LOOT_SLOT_ITEM 67 local LOOT_SLOT_ITEM = _G.LOOT_SLOT_ITEM
68 local LOOT_SLOT_MONEY = _G.LOOT_SLOT_MONEY 68 local LOOT_SLOT_MONEY = _G.LOOT_SLOT_MONEY
69 69
70 local WORLD_MAP_ID_BROKEN_ISLES = 1007 70 local WORLD_MAP_ID_BROKEN_ISLES = 1007
71 71
72 -- Removed in Legion but still needed 72 -- Removed in Patch 7.0.3; previously used to determine if a system message was a quest reward or not
73 local ERR_QUEST_REWARD_ITEM_MULT_IS = _G.ERR_QUEST_REWARD_ITEM_MULT_IS or "Received %d of item: %s." 73 --local ERR_QUEST_REWARD_ITEM_MULT_IS = _G.ERR_QUEST_REWARD_ITEM_MULT_IS or "Received %d of item: %s."
74 local ERR_QUEST_REWARD_ITEM_S = _G.ERR_QUEST_REWARD_ITEM_S or "Received item: %s." 74 --local ERR_QUEST_REWARD_ITEM_S = _G.ERR_QUEST_REWARD_ITEM_S or "Received item: %s."
75 75
76 local ALLOWED_LOCALES = { 76 local ALLOWED_LOCALES = {
77 enUS = true, 77 enUS = true,
78 enGB = true, 78 enGB = true,
79 enTW = true, 79 enTW = true,
2265 local num_objects = 0 2265 local num_objects = 0
2266 local num_itemcontainers = 0 2266 local num_itemcontainers = 0
2267 2267
2268 for source_guid, guid_data in pairs(extrapolated_guid_registry) do 2268 for source_guid, guid_data in pairs(extrapolated_guid_registry) do
2269 local unit_type = guid_data[1] 2269 local unit_type = guid_data[1]
2270 local loot_label = (unit_type == private.UNIT_TYPES.OBJECT) and "opening" or (UnitTypeIsNPC(unit_type) and "drops") or ((unit_type == private.UNIT_TYPES.PLAYER) and "contains") 2270 local loot_label = (unit_type == private.UNIT_TYPES.OBJECT) and "opening" or (UnitTypeIsNPC(unit_type) and "drops") or ((unit_type == private.UNIT_TYPES.ITEM) and "contains")
2271 2271
2272 if loot_label then 2272 if loot_label then
2273 local unit_idnum = guid_data[2] 2273 local unit_idnum = guid_data[2]
2274 2274
2275 if loot_guid_registry[loot_label] and loot_guid_registry[loot_label][source_guid] then 2275 if loot_guid_registry[loot_label] and loot_guid_registry[loot_label][source_guid] then
2283 elseif UnitTypeIsNPC(unit_type) then 2283 elseif UnitTypeIsNPC(unit_type) then
2284 current_action.loot_label = loot_label 2284 current_action.loot_label = loot_label
2285 current_action.target_type = AF.NPC 2285 current_action.target_type = AF.NPC
2286 current_action.identifier = unit_idnum 2286 current_action.identifier = unit_idnum
2287 num_npcs = num_npcs + 1 2287 num_npcs = num_npcs + 1
2288 elseif unit_type == private.UNIT_TYPES.PLAYER then 2288 elseif unit_type == private.UNIT_TYPES.ITEM then
2289 -- Item container GUIDs are currently of the 'PLAYER' type; this may be unintended and could change in the future.
2290 current_action.loot_label = loot_label 2289 current_action.loot_label = loot_label
2291 current_action.target_type = AF.ITEM 2290 current_action.target_type = AF.ITEM
2292 -- current_action.identifier assigned during loot verification. 2291 -- current_action.identifier assigned during loot verification.
2293 num_itemcontainers = num_itemcontainers + 1 2292 num_itemcontainers = num_itemcontainers + 1
2294 end 2293 end