diff --git a/boot.lua b/boot.lua index 6103317b..e21d8f10 100644 --- a/boot.lua +++ b/boot.lua @@ -6,8 +6,8 @@ local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 9722 - _detalhes.alpha_build_counter = 9722 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 9735 + _detalhes.alpha_build_counter = 9735 --if this is higher than the regular counter, use it instead _detalhes.bcc_counter = 31 _detalhes.dont_open_news = true _detalhes.game_version = version @@ -33,16 +33,17 @@ do local Loc = _G.LibStub("AceLocale-3.0"):GetLocale( "Details" ) local news = { - {"v9.2.0.9715.146", "April 7th, 2022"}, + {"v9.2.0.9735.146", "April 8th, 2022"}, + "Arena Enemy Player deaths has been greatly improved on this version.", "Added M+ Score into the player info tooltip (hover over the spec icon).", "Fixed windows ungrouping after a /reload (fix by Flamanis).", "Opening a tooltip from a bar or a menu in the title bar will close the All Displays Panel (from right clicking the title bar).", + "[TBC] fixed an error given by users using old versions of Details! in the raid.", {"v9.2.0.9715.146", "March 6th, 2022"}, "More Tiny Threat fixes and implementations (by Treeston)", "Fixed Chinese and Taiwan 'Thousand' abbreviation letter (fix by github user Maioro).", - {"v9.2.0.9699.146", "March 4th, 2022"}, "Align Text Columns now have a warning at the bracket and separators option", "Silence from interrupts shall be counted as a crowd control.", diff --git a/classes/container_actors.lua b/classes/container_actors.lua index 77026182..0916ff3d 100644 --- a/classes/container_actors.lua +++ b/classes/container_actors.lua @@ -295,6 +295,8 @@ actorObject.enemy = true actorObject.arena_enemy = true actorObject.arena_team = 1 -- former my_team_color + + Details:GuessArenaEnemyUnitId(nome) end local arena_props = _detalhes.arena_table [nome] diff --git a/core/control.lua b/core/control.lua index 0ca33448..0edf446b 100644 --- a/core/control.lua +++ b/core/control.lua @@ -941,7 +941,19 @@ end end end - + + --attempt to get the arena unitId for an actor + function Details:GuessArenaEnemyUnitId(unitName) + for i = 1, 5 do + local unitId = "arena" .. i + local enemyName = _G.GetUnitName(unitId, true) + if (enemyName == unitName) then + _detalhes.arena_enemies[enemyName] = unitId + return unitId + end + end + end + local string_arena_enemyteam_damage = [[ local combat = Details:GetCombat ("current") local total = 0 diff --git a/core/network.lua b/core/network.lua index fa3016cd..a6b10537 100644 --- a/core/network.lua +++ b/core/network.lua @@ -420,16 +420,18 @@ print("guid:", guid) --]=] - _detalhes.cached_talents[guid] = talents - if (spec and spec ~= 0) then - _detalhes.cached_specs[guid] = spec + if (guid) then + _detalhes.cached_talents[guid] = talents + if (spec and spec ~= 0) then + _detalhes.cached_specs[guid] = spec + end + _detalhes.cached_roles[guid] = playerRole + _detalhes.item_level_pool[guid] = { + name = player, + ilvl = itemLevel, + time = time() + } end - _detalhes.cached_roles[guid] = playerRole - _detalhes.item_level_pool[guid] = { - name = player, - ilvl = itemLevel, - time = time() - } end --"CIEA" Coach Is Enabled Ask (client > server) diff --git a/core/parser.lua b/core/parser.lua index b0dd416e..fc0d80f3 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -1004,12 +1004,16 @@ end end - if (este_jogador.grupo and not este_jogador.arena_enemy and not este_jogador.enemy) then --> source = friendly player and not an enemy player + if (este_jogador.grupo and not este_jogador.arena_enemy and not este_jogador.enemy and not jogador_alvo.arena_enemy) then --> source = friendly player and not an enemy player --dano to adversario estava caindo aqui por nao estar checando .enemy _current_gtotal [1] = _current_gtotal [1]+amount elseif (jogador_alvo.grupo) then --> source = arena enemy or friendly player + if (jogador_alvo.arena_enemy) then + _current_gtotal [1] = _current_gtotal [1]+amount + end + --> record avoidance only for tank actors if (tanks_members_cache [alvo_serial]) then @@ -1098,9 +1102,13 @@ this_event [4] = time --> parser time --> current unit heal - if (arena_enemies[alvo_name]) then + if (jogador_alvo.arena_enemy) then --this is an arena enemy, get the heal with the unit Id - this_event [5] = _UnitHealth(_detalhes.arena_enemies[alvo_name]) + local unitId = _detalhes.arena_enemies[alvo_name] + if (not unitId) then + unitId = Details:GuessArenaEnemyUnitId(alvo_name) + end + this_event [5] = _UnitHealth(unitId) else this_event [5] = _UnitHealth(alvo_name) end @@ -2187,7 +2195,7 @@ ------------------------------------------------------------------------------------------------ --> group checks - if (este_jogador.grupo) then + if (este_jogador.grupo and not jogador_alvo.arena_enemy) then --_current_combat.totals_grupo[2] = _current_combat.totals_grupo[2] + cura_efetiva _current_gtotal [2] = _current_gtotal [2] + cura_efetiva end @@ -2208,7 +2216,19 @@ this_event [2] = spellid --> spellid || false if this is a battle ress line this_event [3] = amount --> amount of damage or healing this_event [4] = time --> parser time - this_event [5] = _UnitHealth (alvo_name) --> current unit heal + + --current unit heal + if (jogador_alvo.arena_enemy) then + --this is an arena enemy, get the heal with the unit Id + local unitId = _detalhes.arena_enemies[alvo_name] + if (not unitId) then + unitId = Details:GuessArenaEnemyUnitId(alvo_name) + end + this_event [5] = _UnitHealth(unitId) + else + this_event [5] = _UnitHealth(alvo_name) + end + this_event [6] = who_name --> source name this_event [7] = is_shield this_event [8] = absorbed @@ -4263,11 +4283,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 _current_gtotal [4].dead = _current_gtotal [4].dead + 1 --> main actor no container de misc que ir� armazenar a morte - local este_jogador, meu_dono = misc_cache [alvo_name] - if (not este_jogador) then --> pode ser um desconhecido ou um pet - este_jogador, meu_dono, who_name = _current_misc_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) + local thisPlayer, meu_dono = misc_cache [alvo_name] + if (not thisPlayer) then --> pode ser um desconhecido ou um pet + thisPlayer, meu_dono, who_name = _current_misc_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true) if (not meu_dono) then --> se n�o for um pet, adicionar no cache - misc_cache [alvo_name] = este_jogador + misc_cache [alvo_name] = thisPlayer end end @@ -4302,12 +4322,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end - if (este_jogador.last_cooldown) then + if (thisPlayer.last_cooldown) then local t = {} t [1] = 3 --> true if this is a damage || false for healing || 1 for cooldown usage || 2 for last cooldown - t [2] = este_jogador.last_cooldown[2] --> spellid || false if this is a battle ress line + t [2] = thisPlayer.last_cooldown[2] --> spellid || false if this is a battle ress line t [3] = 1 --> amount of damage or healing - t [4] = este_jogador.last_cooldown[1] --> parser time + t [4] = thisPlayer.last_cooldown[1] --> parser time t [5] = 0 --> current unit heal t [6] = alvo_name --> source name esta_morte [#esta_morte+1] = t @@ -4325,46 +4345,63 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 local decorrido = _GetTime() - _current_combat:GetStartTime() local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) - local t = {esta_morte, time, este_jogador.nome, este_jogador.classe, _UnitHealthMax (alvo_name), minutos.."m "..segundos.."s", ["dead"] = true, ["last_cooldown"] = este_jogador.last_cooldown, ["dead_at"] = decorrido} + local maxHealth + if (thisPlayer.arena_enemy) then + --this is an arena enemy, get the heal with the unit Id + local unitId = _detalhes.arena_enemies[thisPlayer.nome] + if (not unitId) then + unitId = Details:GuessArenaEnemyUnitId(thisPlayer.nome) + end + if (unitId) then + maxHealth = UnitHealthMax(unitId) + end + + if (not maxHealth) then + maxHealth = 0 + end + else + maxHealth = UnitHealthMax(thisPlayer.nome) + end + + local t = {esta_morte, time, thisPlayer.nome, thisPlayer.classe, maxHealth, minutos.."m "..segundos.."s", ["dead"] = true, ["last_cooldown"] = thisPlayer.last_cooldown, ["dead_at"] = decorrido} _table_insert (_current_combat.last_events_tables, #_current_combat.last_events_tables+1, t) - + if (_hook_deaths) then --> send event to registred functions - local death_at = _GetTime() - _current_combat:GetStartTime() - local max_health = _UnitHealthMax (alvo_name) + local deathTime = _GetTime() - _current_combat:GetStartTime() for _, func in _ipairs (_hook_deaths_container) do local copiedDeathTable = Details.CopyTable(t) - local successful, errortext = pcall(func, nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, copiedDeathTable, este_jogador.last_cooldown, death_at, max_health) + local successful, errortext = pcall(func, nil, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, copiedDeathTable, thisPlayer.last_cooldown, deathTime, maxHealth) if (not successful) then _detalhes:Msg ("error occurred on a death hook function:", errortext) end end end - --> check if this is a mythic+ run + --check if this is a mythic+ run for overall deaths local mythicLevel = C_ChallengeMode and C_ChallengeMode.GetActiveKeystoneInfo() --classic wow doesn't not have C_ChallengeMode API if (mythicLevel and type (mythicLevel) == "number" and mythicLevel >= 2) then --several checks to be future proof --> more checks for integrity if (_detalhes.tabela_overall and _detalhes.tabela_overall.last_events_tables) then - --> this is a mythi dungeon run, add the death to overall data - --> need to adjust the time of death, since this will show all deaths in the mythic run - --> first copy the table - local overallDeathTable = DetailsFramework.table.copy ({}, t) + --this is a mythic dungeon run, add the death to overall data + --need to adjust the time of death, since this will show all deaths in the mythic run + --first copy the table + local overallDeathTable = DetailsFramework.table.copy({}, t) - --> get the elapsed time - local decorrido = _GetTime() - _detalhes.tabela_overall:GetStartTime() - local minutos, segundos = _math_floor (decorrido/60), _math_floor (decorrido%60) + --get the elapsed time + local timeElapsed = _GetTime() - _detalhes.tabela_overall:GetStartTime() + local minutos, segundos = _math_floor(timeElapsed/60), _math_floor(timeElapsed%60) overallDeathTable [6] = minutos.."m "..segundos.."s" - overallDeathTable.dead_at = decorrido + overallDeathTable.dead_at = timeElapsed - _table_insert (_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables + 1, overallDeathTable) + _table_insert(_detalhes.tabela_overall.last_events_tables, #_detalhes.tabela_overall.last_events_tables + 1, overallDeathTable) end end - --> reseta a pool - last_events_cache [alvo_name] = nil + --remove the player death events from the cache + last_events_cache[alvo_name] = nil end end end