This commit is contained in:
tercio
2014-03-26 18:24:12 -03:00
parent 8ce50a1f04
commit fcf9d7a2ed
25 changed files with 1557 additions and 194 deletions
+54
View File
@@ -239,7 +239,9 @@
local n_combate = _detalhes:NumeroCombate (1) --aumenta o contador de combates -- combat number up
--> cria a nova tabela de combates -- create new table
local ultimo_combate = _detalhes.tabela_vigente
_detalhes.tabela_vigente = _detalhes.combate:NovaTabela (true, _detalhes.tabela_overall, n_combate, ...) --cria uma nova tabela de combate
_detalhes.tabela_vigente.previous_combat = ultimo_combate
--> verifica se há alguma instância mostrando o segmento atual -- change segment
_detalhes:InstanciaCallFunction (_detalhes.TrocaSegmentoAtual)
@@ -295,6 +297,30 @@
if (instancia.hide_in_combat) then
instancia:SetWindowAlpha (instancia.hide_in_combat_alpha / 100)
end
if (instancia.auto_switch_to) then
--salva o estado atual
instancia.auto_switch_to_old = {instancia.modo, instancia.atributo, instancia.sub_atributo, instancia.segmento, _detalhes.RaidTables.Mode, _detalhes.SoloTables.Mode}
--muda para um plugin de raid
if (instancia.auto_switch_to [1] == "raid") then
for index, ptable in _ipairs (_detalhes.RaidTables.Menu) do
if (ptable[1] == instancia.auto_switch_to [2]) then
if (instancia.modo ~= _detalhes._detalhes_props ["MODO_RAID"]) then
_detalhes:AlteraModo (instancia, _detalhes._detalhes_props ["MODO_RAID"])
end
_detalhes.RaidTables:switch (nil, index)
break
end
end
else
--muda para um atributo normal
if (instancia.modo ~= _detalhes._detalhes_props["MODO_GROUP"]) then
_detalhes:AlteraModo (instancia, _detalhes._detalhes_props["MODO_GROUP"])
end
_detalhes:TrocaTabela (instancia, nil, instancia.auto_switch_to [1], instancia.auto_switch_to [2])
end
end
end
end
@@ -510,11 +536,39 @@
if (instancia.hide_in_combat) then
instancia:SetWindowAlpha (1, true)
end
if (instancia.auto_switch_to_old) then
instancia:SwitchBack()
end
end
end
_detalhes:SendEvent ("COMBAT_PLAYER_LEAVE", nil, _detalhes.tabela_vigente)
end
--backtable indexes: [1]: mode [2]: attribute [3]: sub attribute [4]: segment [5]: raidmode index [6]: solomode index
function _detalhes:SwitchBack()
local backtable = self.auto_switch_to_old
if (not backtable) then
return
end
if (self.modo ~= self.auto_switch_to_old [1]) then
_detalhes:AlteraModo (self, self.auto_switch_to_old [1])
end
if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then
_detalhes.RaidTables:switch (nil, self.auto_switch_to_old [5])
elseif (self.modo == _detalhes._detalhes_props["MODO_ALONE"]) then
_detalhes.SoloTables:switch (nil, self.auto_switch_to_old [6])
else
_detalhes:TrocaTabela (self, self.auto_switch_to_old [4], self.auto_switch_to_old [2], self.auto_switch_to_old [3])
end
self.auto_switch_to_old = nil
end
function _detalhes:MakeEqualizeOnActor (player, realm, receivedActor)
+8
View File
@@ -75,6 +75,11 @@
for _, combat_table in _ipairs (tabelas_do_historico) do
combat_table.__call = _detalhes.call_combate
end
for i = #tabelas_do_historico-1, 1, -1 do
local combat = tabelas_do_historico [i]
combat.previous_combat = tabelas_do_historico [i+1]
end
--> tempo padrao do overall
combate_overall.start_time = _tempo
@@ -198,6 +203,9 @@
if (_detalhes.clear_graphic) then
_combate.TimeData = {}
end
--> limpa a referencia do ultimo combate
_combate.previous_combat = nil
local container_dano = _combate [class_type_dano] or {}
local container_cura = _combate [class_type_cura] or {}
+104 -9
View File
@@ -21,6 +21,7 @@
local _IsInRaid = IsInRaid --wow api local
local _IsInGroup = IsInGroup --wow api local
local _GetNumGroupMembers = GetNumGroupMembers --wow api local
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned
local _cstr = string.format --lua local
local _table_insert = table.insert --lua local
@@ -80,6 +81,8 @@
local misc_cache = setmetatable ({}, _detalhes.weaktable)
--> party & raid members
local raid_members_cache = setmetatable ({}, _detalhes.weaktable)
--> tanks
local tanks_members_cache = setmetatable ({}, _detalhes.weaktable)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> constants
@@ -254,8 +257,45 @@
end
--> record avoidance only for player actors
if (spellid < 3) then --> autoshot melee
jogador_alvo.avoidance ["HITS"] = jogador_alvo.avoidance ["HITS"] + 1
if (tanks_members_cache [alvo_serial]) then --> autoshot or melee hit
--> avoidance
local avoidance = jogador_alvo.avoidance
local overall = avoidance.overall
local mob = avoidance [who_name]
if (not mob) then --> if isn't in the table, build on the fly
mob = _detalhes:CreateActorAvoidanceTable (true)
avoidance [who_name] = mob
end
overall ["ALL"] = overall ["ALL"] + 1 --> qualtipo de hit ou absorb
mob ["ALL"] = mob ["ALL"] + 1 --> qualtipo de hit ou absorb
if (spellid < 3) then
--> overall
overall ["HITS"] = overall ["HITS"] + 1
mob ["HITS"] = mob ["HITS"] + 1
end
--> absorbs status
if (absorbed) then
--> aqui pode ser apenas absorb parcial
overall ["ABSORB"] = overall ["ABSORB"] + 1
overall ["PARTIAL_ABSORBED"] = overall ["PARTIAL_ABSORBED"] + 1
overall ["PARTIAL_ABSORB_AMT"] = overall ["PARTIAL_ABSORB_AMT"] + absorbed
overall ["ABSORB_AMT"] = overall ["ABSORB_AMT"] + absorbed
mob ["ABSORB"] = mob ["ABSORB"] + 1
mob ["PARTIAL_ABSORBED"] = mob ["PARTIAL_ABSORBED"] + 1
mob ["PARTIAL_ABSORB_AMT"] = mob ["PARTIAL_ABSORB_AMT"] + absorbed
mob ["ABSORB_AMT"] = mob ["ABSORB_AMT"] + absorbed
else
--> adicionar aos hits sem absorbs
overall ["FULL_HIT"] = overall ["FULL_HIT"] + 1
overall ["FULL_HIT_AMT"] = overall ["FULL_HIT_AMT"] + amount
mob ["FULL_HIT"] = mob ["FULL_HIT"] + 1
mob ["FULL_HIT_AMT"] = mob ["FULL_HIT_AMT"] + amount
end
end
end
@@ -417,13 +457,41 @@
end
end
--> 'avoider'
--> using this method means avoidance of pets will not be tracked
local TargetActor = damage_cache [alvo_name]
if (TargetActor and TargetActor.grupo) then
local missTable = TargetActor.avoidance [missType]
if (missTable) then
TargetActor.avoidance [missType] = missTable +1
if (tanks_members_cache [alvo_serial]) then --> only track tanks
local TargetActor = damage_cache [alvo_name]
if (TargetActor) then
local avoidance = TargetActor.avoidance
local missTable = avoidance.overall [missType]
if (missTable) then
--> overall
local overall = avoidance.overall
overall [missType] = missTable + 1 --> adicionado a quantidade do miss
--> from this mob
local mob = avoidance [who_name]
if (not mob) then --> if isn't in the table, build on the fly
mob = _detalhes:CreateActorAvoidanceTable (true)
avoidance [who_name] = mob
end
mob [missType] = mob [missType] + 1
if (missType == "ABSORB") then --full absorb
overall ["ALL"] = overall ["ALL"] + 1 --> qualtipo de hit ou absorb
overall ["FULL_ABSORBED"] = overall ["FULL_ABSORBED"] + 1 --amount
overall ["ABSORB_AMT"] = overall ["ABSORB_AMT"] + amountMissed
overall ["FULL_ABSORB_AMT"] = overall ["FULL_ABSORB_AMT"] + amountMissed
mob ["ALL"] = mob ["ALL"] + 1 --> qualtipo de hit ou absorb
mob ["FULL_ABSORBED"] = mob ["FULL_ABSORBED"] + 1 --amount
mob ["ABSORB_AMT"] = mob ["ABSORB_AMT"] + amountMissed
mob ["FULL_ABSORB_AMT"] = mob ["FULL_ABSORB_AMT"] + amountMissed
end
end
end
end
@@ -2726,20 +2794,47 @@
end
function _detalhes:UptadeRaidMembersCache()
_table_wipe (raid_members_cache)
_table_wipe (tanks_members_cache)
if (_IsInRaid()) then
for i = 1, _GetNumGroupMembers() do
raid_members_cache [_UnitGUID ("raid"..i)] = true
local role = _UnitGroupRolesAssigned (GetUnitName ("raid"..i, true))
if (role == "TANK") then
tanks_members_cache [_UnitGUID ("raid"..i)] = true
--print ("tank detected:", GetUnitName ("raid"..i, true))
end
end
elseif (_IsInGroup()) then
for i = 1, _GetNumGroupMembers()-1 do
raid_members_cache [_UnitGUID ("party"..i)] = true
local role = _UnitGroupRolesAssigned (GetUnitName ("party"..i, true))
if (role == "TANK") then
tanks_members_cache [_UnitGUID ("party"..i)] = true
end
end
raid_members_cache [_UnitGUID ("player")] = true
local role = _UnitGroupRolesAssigned (GetUnitName ("player", true))
if (role == "TANK") then
tanks_members_cache [_UnitGUID ("player")] = true
end
else
raid_members_cache [_UnitGUID ("player")] = true
local role = _UnitGroupRolesAssigned (GetUnitName ("player", true))
if (role == "TANK") then
tanks_members_cache [_UnitGUID ("player")] = true
end
end
end
function _detalhes:IsATank (playerguid)
return tanks_members_cache [playerguid]
end
function _detalhes:IsInCache (playerguid)
return raid_members_cache [playerguid]
+7 -1
View File
@@ -573,10 +573,15 @@
if (lower_instance) then
local instance = _detalhes:GetInstance (lower_instance)
_detalhes.times_of_tutorial = _detalhes.times_of_tutorial + 1
if (_detalhes.times_of_tutorial > 20) then
return
end
if (_detalhes.MicroButtonAlert:IsShown()) then
return _detalhes:ScheduleTimer ("delay_tutorial", 2)
end
if (not _detalhes.tutorial.alert_frames [1]) then
_detalhes.MicroButtonAlert.Text:SetText (Loc ["STRING_MINITUTORIAL_1"])
@@ -653,6 +658,7 @@
return _detalhes:ScheduleTimer ("StartTutorial", 10)
end
--
_detalhes.times_of_tutorial = 0
_detalhes:ScheduleTimer ("delay_tutorial", 20)
end