comparison Main.lua @ 343:2149753132a1 WoD

Reverted previous WoD change from LOOT_OPENED to LOOT_READY due to ingame changes.
author MMOSimca <MMOSimca@gmail.com>
date Fri, 03 Oct 2014 15:07:30 -0400
parents 2bd9de08833f
children 7bca9a0f9382
comparison
equal deleted inserted replaced
342:2bd9de08833f 343:2149753132a1
99 GROUP_ROSTER_UPDATE = true, 99 GROUP_ROSTER_UPDATE = true,
100 GUILDBANKFRAME_OPENED = true, 100 GUILDBANKFRAME_OPENED = true,
101 ITEM_TEXT_BEGIN = true, 101 ITEM_TEXT_BEGIN = true,
102 ITEM_UPGRADE_MASTER_OPENED = true, 102 ITEM_UPGRADE_MASTER_OPENED = true,
103 LOOT_CLOSED = true, 103 LOOT_CLOSED = true,
104 LOOT_READY = true, 104 LOOT_OPENED = true,
105 MAIL_SHOW = true, 105 MAIL_SHOW = true,
106 MERCHANT_CLOSED = true, 106 MERCHANT_CLOSED = true,
107 MERCHANT_SHOW = "UpdateMerchantItems", 107 MERCHANT_SHOW = "UpdateMerchantItems",
108 MERCHANT_UPDATE = "UpdateMerchantItems", 108 MERCHANT_UPDATE = "UpdateMerchantItems",
109 PET_BAR_UPDATE = true, 109 PET_BAR_UPDATE = true,
1686 UpdateDBEntryLocation("objects", unit_idnum) 1686 UpdateDBEntryLocation("objects", unit_idnum)
1687 end 1687 end
1688 1688
1689 1689
1690 do 1690 do
1691 local LOOT_READY_VERIFY_FUNCS = { 1691 local LOOT_OPENED_VERIFY_FUNCS = {
1692 -- Item containers can be AOE-looted in Patch 5.4.2 if the user clicks fast enough, but this verification still works as long as they both have loot. 1692 -- Item containers can be AOE-looted in Patch 5.4.2 if the user clicks fast enough, but this verification still works as long as they both have loot.
1693 [AF.ITEM] = function() 1693 [AF.ITEM] = function()
1694 local locked_item_id 1694 local locked_item_id
1695 1695
1696 for bag_index = 0, _G.NUM_BAG_FRAMES do 1696 for bag_index = 0, _G.NUM_BAG_FRAMES do
1721 return _G.IsFishingLoot() 1721 return _G.IsFishingLoot()
1722 end, 1722 end,
1723 } 1723 }
1724 1724
1725 1725
1726 local LOOT_READY_UPDATE_FUNCS = { 1726 local LOOT_OPENED_UPDATE_FUNCS = {
1727 [AF.ITEM] = function() 1727 [AF.ITEM] = function()
1728 GenericLootUpdate("items") 1728 GenericLootUpdate("items")
1729 end, 1729 end,
1730 [AF.NPC] = function() 1730 [AF.NPC] = function()
1731 local difficulty_token = InstanceDifficultyToken() 1731 local difficulty_token = InstanceDifficultyToken()
1897 Debug("%s: Successfully extrapolated information for current_action.", log_source) 1897 Debug("%s: Successfully extrapolated information for current_action.", log_source)
1898 return true 1898 return true
1899 end 1899 end
1900 1900
1901 1901
1902 function WDP:LOOT_READY(event_name) 1902 function WDP:LOOT_OPENED(event_name)
1903 if current_loot then 1903 if current_loot then
1904 current_loot = nil 1904 current_loot = nil
1905 Debug("%s: Previous loot did not process in time for this event. Attempting to extrapolate current_action from loot data.", event_name) 1905 Debug("%s: Previous loot did not process in time for this event. Attempting to extrapolate current_action from loot data.", event_name)
1906 1906
1907 if not ExtrapolatedCurrentActionFromLootData(event_name) then 1907 if not ExtrapolatedCurrentActionFromLootData(event_name) then
1916 if not ExtrapolatedCurrentActionFromLootData(event_name) then 1916 if not ExtrapolatedCurrentActionFromLootData(event_name) then
1917 Debug("%s: Unable to extrapolate current_action. Aborting attempts to handle loot for now.", event_name) 1917 Debug("%s: Unable to extrapolate current_action. Aborting attempts to handle loot for now.", event_name)
1918 return 1918 return
1919 end 1919 end
1920 end 1920 end
1921 local verify_func = LOOT_READY_VERIFY_FUNCS[current_action.target_type] 1921 local verify_func = LOOT_OPENED_VERIFY_FUNCS[current_action.target_type]
1922 local update_func = LOOT_READY_UPDATE_FUNCS[current_action.target_type] 1922 local update_func = LOOT_OPENED_UPDATE_FUNCS[current_action.target_type]
1923 1923
1924 if not verify_func or not update_func then 1924 if not verify_func or not update_func then
1925 Debug("%s: The current action's target type is unsupported or nil.", event_name) 1925 Debug("%s: The current action's target type is unsupported or nil.", event_name)
1926 return 1926 return
1927 end 1927 end
2427 2427
2428 if not spell_label then 2428 if not spell_label then
2429 return 2429 return
2430 end 2430 end
2431 2431
2432 Debug("UNIT_SPELLCAST_SENT: %s was cast.", spell_name)
2432 local item_name, item_link = _G.GameTooltip:GetItem() 2433 local item_name, item_link = _G.GameTooltip:GetItem()
2433 local unit_name, unit_id = _G.GameTooltip:GetUnit() 2434 local unit_name, unit_id = _G.GameTooltip:GetUnit()
2434 2435
2435 if not unit_name and _G.UnitName("target") == target_name then 2436 if not unit_name and _G.UnitName("target") == target_name then
2436 unit_name = target_name 2437 unit_name = target_name
2581 UpdateDBEntryLocation("objects", OBJECT_ID_ANVIL) 2582 UpdateDBEntryLocation("objects", OBJECT_ID_ANVIL)
2582 elseif forge_spell_ids[spell_id] then 2583 elseif forge_spell_ids[spell_id] then
2583 UpdateDBEntryLocation("objects", OBJECT_ID_FORGE) 2584 UpdateDBEntryLocation("objects", OBJECT_ID_FORGE)
2584 elseif spell_name:match("^Harvest.+") then 2585 elseif spell_name:match("^Harvest.+") then
2585 killed_npc_id = current_target_id 2586 killed_npc_id = current_target_id
2586 private.harvesting = true 2587 private.harvesting = true -- Used to track which NPCs can be harvested (can we get this from CreatureCache instead?)
2587 end 2588 end
2588 end 2589 end
2589 2590
2590 2591
2591 function WDP:HandleSpellFailure(event_name, unit_id, spell_name, spell_rank, spell_line, spell_id) 2592 function WDP:HandleSpellFailure(event_name, unit_id, spell_name, spell_rank, spell_line, spell_id)