This commit is contained in:
tercio
2014-04-01 21:20:43 -03:00
parent fcf9d7a2ed
commit 36e7b26b30
30 changed files with 3039 additions and 1851 deletions
+42 -9
View File
@@ -87,6 +87,19 @@
return --no need to check
end
if (_detalhes.encounter_table.name) then
_detalhes.tabela_vigente.is_boss = {
index = _detalhes.encounter_table.index,
name = _detalhes.encounter_table.name,
zone = _detalhes.encounter_table.zone,
mapid = _detalhes.encounter_table.mapid,
encounter = _detalhes.encounter_table.name,
diff = _detalhes.encounter_table.diff
}
_detalhes:SendEvent ("COMBAT_BOSS_FOUND", nil, _detalhes.tabela_vigente.is_boss.index, _detalhes.tabela_vigente.is_boss.name)
return _detalhes.tabela_vigente.is_boss
end
for index = 1, 5, 1 do
if (_UnitExists ("boss"..index)) then
local guid = _UnitGUID ("boss"..index)
@@ -169,10 +182,21 @@
--try to get the encounter name after the encounter (can be called during the combat as well)
function _detalhes:FindBoss()
if (_detalhes.encounter_table.name) then
return {
index = _detalhes.encounter_table.index,
name = _detalhes.encounter_table.name,
zone = _detalhes.encounter_table.zone,
mapid = _detalhes.encounter_table.mapid,
encounter = _detalhes.encounter_table.name,
diff = _detalhes.encounter_table.diff
}
end
local ZoneName, _, DifficultyID, _, _, _, _, ZoneMapID = _GetInstanceInfo()
local BossIds = _detalhes:GetBossIds (ZoneMapID)
if (BossIds) then
if (BossIds) then
local BossIndex = nil
local ActorsContainer = _detalhes.tabela_vigente [class_type_dano]._ActorTable
@@ -340,7 +364,7 @@
end
end
function _detalhes:SairDoCombate (bossKilled)
function _detalhes:SairDoCombate (bossKilled, from_encounter_end)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) ended a combat.")
@@ -392,6 +416,14 @@
_detalhes.tabela_vigente.verifica_combate = nil
end
--> lock timers
_detalhes.tabela_vigente:TravarTempos()
_detalhes.tabela_vigente:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) --> salva hora, minuto, segundo do fim da luta
_detalhes.tabela_overall:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) --> salva hora, minuto, segundo do fim da luta
_detalhes.tabela_vigente:seta_tempo_decorrido() --> salva o end_time
_detalhes.tabela_overall:seta_tempo_decorrido() --seta o end_time
if (not _detalhes.tabela_vigente.is_boss) then
local inimigo = _detalhes:FindEnemy()
@@ -424,6 +456,13 @@
if (bossKilled) then
_detalhes.tabela_vigente.is_boss.killed = true
end
if (from_encounter_end) then
--_detalhes.tabela_vigente.start_time = _detalhes.encounter_table ["start"]
_detalhes.tabela_vigente.end_time = _detalhes.encounter_table ["end"]
end
--> encounter boss function
local bossFunction, bossFunctionType = _detalhes:GetBossFunction (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)
@@ -456,13 +495,7 @@
end
end
--> lock timers
_detalhes.tabela_vigente:TravarTempos()
_detalhes.tabela_vigente:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) --> salva hora, minuto, segundo do fim da luta
_detalhes.tabela_overall:seta_data (_detalhes._detalhes_props.DATA_TYPE_END) --> salva hora, minuto, segundo do fim da luta
_detalhes.tabela_vigente:seta_tempo_decorrido() --> salva o end_time
_detalhes.tabela_overall:seta_tempo_decorrido() --seta o end_time
if (_detalhes.solo) then
--> debuffs need a checkup, not well functional right now
+94 -8
View File
@@ -21,7 +21,7 @@
local _IsInRaid = IsInRaid --wow api local
local _IsInGroup = IsInGroup --wow api local
local _GetNumGroupMembers = GetNumGroupMembers --wow api local
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned --wow api local
local _cstr = string.format --lua local
local _table_insert = table.insert --lua local
@@ -220,6 +220,10 @@
end
--if (who_name == "Guardian of Ancient Kings") then --remover
-- print ("MELEE GAK 1", meu_dono)
--end
--> damager shadow
local shadow = este_jogador.shadow
local shadow_of_target = jogador_alvo.shadow
@@ -509,9 +513,12 @@
-----------------------------------------------------------------------------------------------------------------------------------------
--> SUMMON serach key: ~summon |
-----------------------------------------------------------------------------------------------------------------------------------------
function parser:summon (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellName)
--if (alvo_name == "Guardian of Ancient Kings") then --remover
-- print ("Summon GAK 1", who_name)
--end
--> pet summon another pet
local sou_pet = _detalhes.tabela_pets.pets [who_serial]
if (sou_pet) then --> okey, ja é um pet
@@ -2214,7 +2221,8 @@
_current_combat.frags_need_refresh = true
_overall_combat.frags_need_refresh = true
--> encounter end
--> encounter end --[[REMOVED]] it's deprecated since encounter end and start replace this
--[[
local encounter_type = _detalhes.encounter.type
if (encounter_type) then
if (encounter_type == 1 or encounter_type == 2) then
@@ -2254,7 +2262,8 @@
end
end
--]]
--> player death
elseif (not _UnitIsFeignDeath (alvo_name)) then
if (
@@ -2376,8 +2385,6 @@
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> core
@@ -2597,6 +2604,85 @@
return
elseif (evento == "ENCOUNTER_START") then
--~encounter
_table_wipe (_detalhes.encounter_table)
local encounterID, encounterName, difficultyID, raidSize = _select (1, ...)
local zoneName, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
_detalhes.encounter_table ["start"] = time()
_detalhes.encounter_table ["end"] = nil
_detalhes.encounter_table.id = encounterID
_detalhes.encounter_table.name = encounterName
_detalhes.encounter_table.diff = difficultyID
_detalhes.encounter_table.size = raidSize
_detalhes.encounter_table.zone = zoneName
_detalhes.encounter_table.mapid = zoneMapID
local encounter_start_table = _detalhes:GetEncounterStartInfo (zoneMapID, encounterID)
if (encounter_start_table) then
if (encounter_start_table.delay) then
if (type (encounter_start_table.delay) == "function") then
local delay = encounter_start_table.delay()
if (delay) then
_detalhes.encounter_table ["start"] = time() + delay
end
else
_detalhes.encounter_table ["start"] = time() + encounter_start_table.delay
end
end
if (encounter_start_table.func) then
encounter_start_table:func()
end
end
local encounter_table, boss_index = _detalhes:GetBossEncounterDetailsFromEncounterId (zoneMapID, encounterID)
if (encounter_table) then
_detalhes.encounter_table.index = boss_index
end
elseif (evento == "ENCOUNTER_END") then
if (not _detalhes.encounter_table.start) then
return
end
_detalhes.encounter_table ["end"] = time()
local encounterID, encounterName, difficultyID, raidSize, endStatus = _select (1, ...)
local _, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
local encounter_end_table = _detalhes:GetEncounterStartInfo (zoneMapID, encounterID)
if (encounter_end_table) then
if (encounter_end_table.delay) then
_detalhes.encounter_table ["end"] = _detalhes.encounter_table ["end"] + encounter_end_table.delay
end
if (encounter_end_table.func) then
encounter_end_table:func (_detalhes.tabela_vigente, endStatus)
end
end
if (_in_combat) then
if (endStatus == 1) then
_detalhes.encounter_table.kill = true
_detalhes:SairDoCombate (true, true) --killed
else
_detalhes.encounter_table.kill = false
_detalhes:SairDoCombate (false, true) --wipe
end
else
if (_detalhes.tabela_vigente.end_time + 2 >= _detalhes.encounter_table ["end"]) then
--_detalhes.tabela_vigente.start_time = _detalhes.encounter_table ["start"]
_detalhes.tabela_vigente.end_time = _detalhes.encounter_table ["end"]
_detalhes:AtualizaGumpPrincipal (-1, true)
end
end
_table_wipe (_detalhes.encounter_table)
elseif (evento == "CHAT_MSG_BG_SYSTEM_NEUTRAL") then
local frase = _select (1, ...)
@@ -2713,7 +2799,7 @@
end
_detalhes.listener:SetScript ("OnEvent", _detalhes.OnEvent)
function _detalhes:OnParserEvent (evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, ...)
local funcao = token_list [token]
if (funcao) then