- Internal Changes and Upgrades.

This commit is contained in:
tercio
2014-10-10 18:07:01 -03:00
parent c9f2e89b1b
commit 00c9e4de29
7 changed files with 231 additions and 41 deletions
+36
View File
@@ -452,5 +452,41 @@ function _G._detalhes:Start()
end
end)
--]]
-- test dbm callbacks
if (_G.DBM) then
local dbm_callback_phase = function (event, msg)
local mod = _detalhes.encounter_table.DBM_Mod
if (not mod) then
local id = _detalhes:GetEncounterIdFromBossIndex (_detalhes.encounter_table.mapid, _detalhes.encounter_table.id)
if (id) then
for index, tmod in ipairs (DBM.Mods) do
if (tmod.id == id) then
_detalhes.encounter_table.DBM_Mod = tmod
mod = tmod
end
end
end
end
local phase = mod and mod.vb and mod.vb.phase
if (phase and _detalhes.encounter_table.phase ~= phase) then
--_detalhes:Msg ("Current phase:", phase)
_detalhes.encounter_table.phase = phase
--> do thing when the encounter changes the phase
end
end
local dbm_callback_pull = function (event, mod, delay, synced, startHp)
_detalhes.encounter_table.DBM_Mod = mod
_detalhes.encounter_table.DBM_ModTime = time()
end
DBM:RegisterCallback ("DBM_Announce", dbm_callback_phase)
DBM:RegisterCallback ("pull", dbm_callback_pull)
end
end