Mercurial > wow > wowdb-profiler
comparison Main.lua @ 76:5c42e26ae1fc
Re-add object/action quantifier. Minor cleanup.
author | James D. Callahan III <jcallahan@curse.com> |
---|---|
date | Tue, 21 Aug 2012 15:56:41 -0500 |
parents | a034bfa8982b |
children | c483513c7299 |
comparison
equal
deleted
inserted
replaced
75:a034bfa8982b | 76:5c42e26ae1fc |
---|---|
919 -- print(("GUID: %s - Type:ID: %s - Amount: %d"):format(sources[source_index], source_key, source_count)) | 919 -- print(("GUID: %s - Type:ID: %s - Amount: %d"):format(sources[source_index], source_key, source_count)) |
920 | 920 |
921 -- Items return the player as the source, so we need to replace the nil ID with the item's ID (disenchant, milling, etc) | 921 -- Items return the player as the source, so we need to replace the nil ID with the item's ID (disenchant, milling, etc) |
922 if not source_id then | 922 if not source_id then |
923 source_id = action_data.identifier | 923 source_id = action_data.identifier |
924 elseif action_data.type == AF.OBJECT then | |
925 source_id = ("%s:%s"):format(action_data.spell_label, source_id) | |
924 end | 926 end |
925 action_data.loot_sources[source_id] = action_data.loot_sources[source_id] or {} | 927 action_data.loot_sources[source_id] = action_data.loot_sources[source_id] or {} |
926 | 928 |
927 if slot_type == _G.LOOT_SLOT_ITEM then | 929 if slot_type == _G.LOOT_SLOT_ITEM then |
928 local item_id = ItemLinkToID(_G.GetLootSlotLink(loot_slot)) | 930 local item_id = ItemLinkToID(_G.GetLootSlotLink(loot_slot)) |
1289 action_data.instance_token = instance_token | 1291 action_data.instance_token = instance_token |
1290 action_data.map_level = map_level | 1292 action_data.map_level = map_level |
1291 action_data.x = x | 1293 action_data.x = x |
1292 action_data.y = y | 1294 action_data.y = y |
1293 action_data.zone = ("%s:%d"):format(zone_name, area_id) | 1295 action_data.zone = ("%s:%d"):format(zone_name, area_id) |
1296 action_data.spell_label = spell_label | |
1297 action_data.label = spell_label:lower() | |
1294 | 1298 |
1295 if tt_unit_name and not tt_item_name then | 1299 if tt_unit_name and not tt_item_name then |
1296 if bit.band(spell_flags, AF.NPC) == AF.NPC then | 1300 if bit.band(spell_flags, AF.NPC) == AF.NPC then |
1297 if not tt_unit_id or tt_unit_name ~= target_name then | 1301 if not tt_unit_id or tt_unit_name ~= target_name then |
1298 return | 1302 return |
1299 end | 1303 end |
1300 action_data.type = AF.NPC | 1304 action_data.type = AF.NPC |
1301 action_data.label = spell_label:lower() | |
1302 action_data.unit_name = tt_unit_name | 1305 action_data.unit_name = tt_unit_name |
1303 end | 1306 end |
1304 elseif bit.band(spell_flags, AF.ITEM) == AF.ITEM then | 1307 elseif bit.band(spell_flags, AF.ITEM) == AF.ITEM then |
1305 action_data.type = AF.ITEM | 1308 action_data.type = AF.ITEM |
1306 action_data.label = spell_label:lower() | |
1307 | 1309 |
1308 if tt_item_name and tt_item_name == target_name then | 1310 if tt_item_name and tt_item_name == target_name then |
1309 action_data.identifier = ItemLinkToID(tt_item_link) | 1311 action_data.identifier = ItemLinkToID(tt_item_link) |
1310 elseif target_name and target_name ~= "" then | 1312 elseif target_name and target_name ~= "" then |
1311 local _, target_item_link = _G.GetItemInfo(target_name) | 1313 local _, target_item_link = _G.GetItemInfo(target_name) |
1322 elseif bit.band(spell_flags, AF.ZONE) == AF.ZONE then | 1324 elseif bit.band(spell_flags, AF.ZONE) == AF.ZONE then |
1323 local identifier = ("%s:%s"):format(spell_label, _G["GameTooltipTextLeft1"]:GetText() or "NONE") -- Possible fishing pool name. | 1325 local identifier = ("%s:%s"):format(spell_label, _G["GameTooltipTextLeft1"]:GetText() or "NONE") -- Possible fishing pool name. |
1324 action_data.zone_data = UpdateDBEntryLocation("zones", identifier) | 1326 action_data.zone_data = UpdateDBEntryLocation("zones", identifier) |
1325 action_data.type = AF.ZONE | 1327 action_data.type = AF.ZONE |
1326 action_data.identifier = identifier | 1328 action_data.identifier = identifier |
1327 action_data.spell_label = spell_label | |
1328 end | 1329 end |
1329 end | 1330 end |
1330 private.tracked_line = spell_line | 1331 private.tracked_line = spell_line |
1331 end | 1332 end |
1332 | 1333 |