- Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.

This commit is contained in:
Tercio
2015-07-29 21:28:31 -03:00
parent 6a977a4f43
commit ac57e570a9
5 changed files with 98 additions and 25 deletions
+6 -13
View File
File diff suppressed because one or more lines are too long
+12 -3
View File
@@ -1538,7 +1538,10 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for playername, potspellid in _pairs (pot_usage) do
local name, _, icon = _GetSpellInfo (potspellid)
local _, class = UnitClass (playername)
local class_color = RAID_CLASS_COLORS [class].colorStr
local class_color = ""
if (class and RAID_CLASS_COLORS [class]) then
class_color = RAID_CLASS_COLORS [class].colorStr
end
string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t "
end
@@ -1604,7 +1607,10 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for playername, potspellid in _pairs (pot_usage) do
local name, _, icon = _GetSpellInfo (potspellid)
local _, class = UnitClass (playername)
local class_color = RAID_CLASS_COLORS [class].colorStr
local class_color = ""
if (class and RAID_CLASS_COLORS [class]) then
class_color = RAID_CLASS_COLORS [class].colorStr
end
string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t "
end
@@ -1644,7 +1650,10 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for playername, potspellid in _pairs (pot_usage) do
local name, _, icon = _GetSpellInfo (potspellid)
local _, class = UnitClass (playername)
local class_color = RAID_CLASS_COLORS [class].colorStr
local class_color = ""
if (class and RAID_CLASS_COLORS [class]) then
class_color = RAID_CLASS_COLORS [class].colorStr
end
string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t "
end
+42 -4
View File
@@ -111,8 +111,38 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags)
return
end
--> ao ter raid roster update, precisa dar foreach no container de pets e verificar as flags
--> o mesmo precisa ser feito com as tabelas de combate
function container_pets:Unpet (...)
local unitid = ...
local owner_serial = _UnitGUID (unitid)
if (owner_serial) then
--tira o pet existente da tabela de pets e do cache do core
local existing_pet_serial = _detalhes.pets_players [owner_serial]
if (existing_pet_serial) then
_detalhes.parser:RevomeActorFromCache (existing_pet_serial)
container_pets:Remover (existing_pet_serial)
_detalhes.pets_players [owner_serial] = nil
end
--verifica se há um pet novo deste jogador
local pet_serial = _UnitGUID (unitid .. "pet")
if (pet_serial) then
if (not _detalhes.tabela_pets.pets [pet_serial]) then
local nome, realm = _UnitName (unitid)
if (realm and realm ~= "") then
nome = nome.."-"..realm
end
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName (unitid .. "pet"), 0x1114, owner_serial, nome, 0x514)
end
_detalhes.parser:RevomeActorFromCache (pet_serial)
container_pets:PlayerPet (owner_serial, pet_serial)
end
end
end
function container_pets:PlayerPet (player_serial, pet_serial)
_detalhes.pets_players [player_serial] = pet_serial
end
function container_pets:BuscarPets()
if (_IsInRaid()) then
@@ -124,7 +154,10 @@ function container_pets:BuscarPets()
if (realm and realm ~= "") then
nome = nome.."-"..realm
end
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, _UnitGUID ("raid"..i), nome, 0x514)
local owner_serial = _UnitGUID ("raid"..i)
_detalhes.tabela_pets:Adicionar (pet_serial, _UnitName ("raidpet"..i), 0x1114, owner_serial, nome, 0x514)
_detalhes.parser:RevomeActorFromCache (pet_serial)
container_pets:PlayerPet (owner_serial, pet_serial)
end
end
end
@@ -162,7 +195,12 @@ function container_pets:BuscarPets()
end
end
-- 4372 = 1114 -> pet control player -> friendly -> aff raid
function container_pets:Remover (pet_serial)
if (_detalhes.tabela_pets.pets [pet_serial]) then
table.wipe (_detalhes.tabela_pets.pets [pet_serial])
end
_detalhes.tabela_pets.pets [pet_serial] = nil
end
function container_pets:Adicionar (pet_serial, pet_nome, pet_flags, dono_serial, dono_nome, dono_flags)
+21 -1
View File
@@ -1206,7 +1206,7 @@
parser:dead ("UNIT_DIED", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags)
ignore_death [who_name] = true
return
elseif (spellid == 184293) then --> WOD trinket: Soul Capacitor T18
elseif (spellid == 184293) then --> WOD trinket: Soul Capacitor T18 (soul eruption 184559)
soul_capacitor [who_serial] = _tempo
end
@@ -3192,6 +3192,7 @@
end
function _detalhes.parser_functions:UNIT_PET (...)
_detalhes.container_pets:Unpet (...)
_detalhes:SchedulePetUpdate (1)
end
@@ -3609,6 +3610,25 @@
misc_cache = setmetatable ({}, _detalhes.weaktable)
end
function parser:RevomeActorFromCache (actor_serial, actor_name)
if (actor_name) then
damage_cache [actor_name] = nil
damage_cache_pets [actor_name] = nil
damage_cache_petsOwners [actor_name] = nil
healing_cache [actor_name] = nil
energy_cache [actor_name] = nil
misc_cache [actor_name] = nil
end
if (actor_serial) then
damage_cache [actor_serial] = nil
damage_cache_pets [actor_serial] = nil
damage_cache_petsOwners [actor_serial] = nil
healing_cache [actor_serial] = nil
energy_cache [actor_serial] = nil
misc_cache [actor_serial] = nil
end
end
function _detalhes:UptadeRaidMembersCache()
+17 -4
View File
@@ -901,8 +901,8 @@
function _detalhes:BossModsLink()
if (_G.DBM) then
local dbm_callback_phase = function (event, msg)
local dbm_callback_phase = function (event, msg, ...)
local mod = _detalhes.encounter_table.DBM_Mod
if (not mod) then
@@ -942,15 +942,23 @@
DBM:RegisterCallback ("DBM_Announce", dbm_callback_phase)
DBM:RegisterCallback ("pull", dbm_callback_pull)
--DBM:RegisterCallback ("DBM_TimerStart", function (a, b, c, d, e, f, g)
-- print (a, b, c, d, e, f, g)
--end)
end
LoadAddOn ("BigWigs_Core")
if (BigWigs and not _G.DBM) then
BigWigs:Enable()
function _detalhes:BigWigs_Message (event, module, key, text)
--print ("new bigwigs message...")
function _detalhes:BigWigs_Message (event, module, key, text, ...)
--print (event, module, key, text, ...)
if (key == "stages") then
local phase = text:gsub (".*%s", "")
phase = tonumber (phase)
@@ -976,6 +984,11 @@
end
BigWigs.RegisterMessage (_detalhes, "BigWigs_Message")
--function _detalhes:BigWigs_StartBar (...)
-- print (...)
--end
--BigWigs.RegisterMessage (_detalhes, "BigWigs_StartBar")
end
end