- Deprecated rules for friendly fire has been removed, this might fix some random issues with mind controlled players in the Lord Stormsong encounter in the Shrine of the Storm dungeon.

- Fixed DBM/BigWigs aura creation from the Spell List panel.
- Chart scripts now receives the envTable, use local envTable = ... .
- Polymorth (Black Cat) and Between the Eyes got added to Crowd Control list.
- Fixed Timeline plugin not showing the cooldown panel.
- Overall data setting won't reset on every logout.
- Slash command '/details merge' won't flag the merged combat as a trash segment anymore.
- Added function to use on macros to open the Player Details Window: /script Details:OpenPlayerDetails(1).
- Done more improvements on the Death Recap window.
This commit is contained in:
Tercio
2018-09-25 20:21:13 -03:00
parent d8134d51f1
commit 7b3078ae39
11 changed files with 195 additions and 88 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
local dversion = 107
local dversion = 108
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
+2 -1
View File
@@ -4892,9 +4892,10 @@ DF.IconRowFunctions = {
if (self.options.show_text) then
iconFrame.CountdownText:Show()
iconFrame.CountdownText:SetText (floor (startTime + duration - GetTime()))
iconFrame.Cooldown:SetHideCountdownNumbers (true)
else
iconFrame.CountdownText:Hide()
iconFrame.Cooldown:SetHideCountdownNumbers (false)
end
else
iconFrame.CountdownText:Hide()
+12 -14
View File
File diff suppressed because one or more lines are too long
+36 -8
View File
@@ -3407,6 +3407,16 @@ function _detalhes:envia_relatorio (linhas, custom)
local channel = to_who:find ("CHANNEL")
local is_btag = to_who:find ("REALID")
local send_report_channel = function (timerObject)
_SendChatMessage (timerObject.Arg1, timerObject.Arg2, timerObject.Arg3, timerObject.Arg4)
end
local send_report_bnet = function (timerObject)
BNSendWhisper (timerObject.Arg1, timerObject.Arg2)
end
local delay = 200
if (channel) then
channel = to_who:gsub ((".*|"), "")
@@ -3415,8 +3425,13 @@ function _detalhes:envia_relatorio (linhas, custom)
if (channel == "Trade") then
channel = "Trade - City"
end
local channelName = GetChannelName (channel)
_SendChatMessage (linhas[i], "CHANNEL", nil, channelName)
local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel)
timer.Arg1 = linhas[i]
timer.Arg2 = "CHANNEL"
timer.Arg3 = nil
timer.Arg4 = channelName
end
return
@@ -3426,8 +3441,10 @@ function _detalhes:envia_relatorio (linhas, custom)
local id = to_who:gsub ((".*|"), "")
local presenceID = tonumber (id)
for i = 1, #linhas do
BNSendWhisper (presenceID, linhas[i])
for i = 1, #linhas do
local timer = C_Timer.NewTimer (i * delay / 1000, send_report_bnet)
timer.Arg1 = presenceID
timer.Arg2 = linhas[i]
end
return
@@ -3442,7 +3459,11 @@ function _detalhes:envia_relatorio (linhas, custom)
end
for i = 1, #linhas do
_SendChatMessage (linhas[i], to_who, nil, alvo)
local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel)
timer.Arg1 = linhas[i]
timer.Arg2 = to_who
timer.Arg3 = nil
timer.Arg4 = alvo
end
return
@@ -3467,22 +3488,29 @@ function _detalhes:envia_relatorio (linhas, custom)
end
for i = 1, #linhas do
_SendChatMessage (linhas[i], to_who, nil, alvo)
local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel)
timer.Arg1 = linhas[i]
timer.Arg2 = to_who
timer.Arg3 = nil
timer.Arg4 = alvo
end
return
end
if (to_who == "RAID" or to_who == "PARTY") then
--LE_PARTY_CATEGORY_HOME - default
--LE_PARTY_CATEGORY_INSTANCE - player's automatic group
if (GetNumGroupMembers (LE_PARTY_CATEGORY_INSTANCE) > 0) then
to_who = "INSTANCE_CHAT"
end
end
for i = 1, #linhas do
_SendChatMessage (linhas[i], to_who)
local timer = C_Timer.NewTimer (i * delay / 1000, send_report_channel)
timer.Arg1 = linhas[i]
timer.Arg2 = to_who
timer.Arg3 = nil
timer.Arg4 = nil
end
end
+3
View File
@@ -697,6 +697,9 @@
end
if (from_encounter_end) then
if (_detalhes.encounter_table.start) then
_detalhes.tabela_vigente:SetStartTime (_detalhes.encounter_table.start)
end
_detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"] or GetTime())
end
+54 -40
View File
@@ -20,6 +20,8 @@
local _GetNumGroupMembers = GetNumGroupMembers --wow api local
local _UnitGroupRolesAssigned = UnitGroupRolesAssigned --wow api local
local _GetTime = GetTime
local _CombatLogGetCurrentEventInfo = CombatLogGetCurrentEventInfo
local _cstr = string.format --lua local
local _table_insert = table.insert --lua local
@@ -184,6 +186,13 @@
[SPELLID_MONK_STAGGER] = true, --> Stagger
}
--> damage spells to ignore
local damage_spells_to_ignore = {
--the damage that the warlock apply to its pet through soullink is ignored
--it is not useful for damage done or friendly fire
[SPELLID_WARLOCK_SOULLINK] = true,
}
--> is parser allowed to replace spellIDs?
local is_using_spellId_override = false
@@ -340,6 +349,11 @@
who_serial = ""
end
--> check if the spell isn't in the backlist
if (damage_spells_to_ignore [spellid]) then
return
end
--if (alvo_serial:match ("^Creature%-0%-%d+%-%d+%-%d+%-76933%-%w+$")) then --prismatic crystal (mage)
--if (alvo_serial:match ("^Creature%-0%-%d+%-%d+%-%d+%-103679%-%w+$")) then --soul effigy (warlock)
-- return
@@ -649,26 +663,27 @@
------------------------------------------------------------------------------------------------
--> firendly fire
if (
if (
--removed deprecated friendly fire rules (25/09/2018)
--general rules for friendly fire
(
(_bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (who_flags, REACTION_FRIENDLY) ~= 0) or --ajdt d' brx
(raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find ("Player") and who_serial:find ("Player")) --amrl
--rule 1: if the source and target are friedly to each other
(_bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (who_flags, REACTION_FRIENDLY) ~= 0) --or --ajdt d' brx
--rule 2
--(raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find ("Player") and who_serial:find ("Player")) --amrl
)
--rule 3
and
(
true
--> if the target isn't a pvp duel target
not jogador_alvo.enemy and not este_jogador.enemy and
--not jogador_alvo.enemy and not este_jogador.enemy
--> specific rules for encounters
_current_encounter_id ~= 2113 and --Waycrest Manor HeartsbaneTriad boss (it has mind control)
_current_encounter_id ~= 2132 -- Shrine of the Storms Lord Stormsong (it has mind control)
--_current_encounter_id ~= 2113 and --Waycrest Manor HeartsbaneTriad boss (it has mind control)
--_current_encounter_id ~= 2132 -- Shrine of the Storms Lord Stormsong (it has mind control)
)
) then
if (spellid == SPELLID_WARLOCK_SOULLINK) then
return
end
--> record death log (o erro era o pet, n�o tinha tabela ent�o dava erro)
if (este_jogador.grupo) then --> se tiver ele n�o adiciona o evento l� em cima
local t = last_events_cache [alvo_name]
@@ -1405,19 +1420,19 @@
------------------------------------------------------------------------------------------------
--> get actors
local este_jogador, meu_dono = healing_cache [who_name]
local este_jogador, meu_dono = healing_cache [who_serial]
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (not meu_dono and who_flags) then --> se n�o for um pet, adicionar no cache
healing_cache [who_name] = este_jogador
if (not meu_dono and who_flags and who_serial ~= "") then --> se n�o for um pet, adicionar no cache
healing_cache [who_serial] = este_jogador
end
end
local jogador_alvo, alvo_dono = healing_cache [alvo_name]
local jogador_alvo, alvo_dono = healing_cache [alvo_serial]
if (not jogador_alvo) then
jogador_alvo, alvo_dono, alvo_name = _current_heal_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
if (not alvo_dono and alvo_flags) then
healing_cache [alvo_name] = jogador_alvo
if (not alvo_dono and alvo_flags and alvo_serial ~= "") then
healing_cache [alvo_serial] = jogador_alvo
end
end
@@ -1574,19 +1589,19 @@
function parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield)
--> get actors
local este_jogador, meu_dono = healing_cache [who_name]
local este_jogador, meu_dono = healing_cache [who_serial]
if (not este_jogador) then --> pode ser um desconhecido ou um pet
este_jogador, meu_dono, who_name = _current_heal_container:PegarCombatente (who_serial, who_name, who_flags, true)
if (not meu_dono and who_flags) then --> se n�o for um pet, adicionar no cache
healing_cache [who_name] = este_jogador
healing_cache [who_serial] = este_jogador
end
end
local jogador_alvo, alvo_dono = healing_cache [alvo_name]
local jogador_alvo, alvo_dono = healing_cache [alvo_serial]
if (not jogador_alvo) then
jogador_alvo, alvo_dono, alvo_name = _current_heal_container:PegarCombatente (alvo_serial, alvo_name, alvo_flags, true)
if (not alvo_dono and alvo_flags) then
healing_cache [alvo_name] = jogador_alvo
healing_cache [alvo_serial] = jogador_alvo
end
end
@@ -1856,7 +1871,7 @@
if (damager_object and (damager_object.classe ~= "UNKNOW" and damager_object.classe ~= "UNGROUPPLAYER")) then
este_jogador.classe = damager_object.classe
else
local healing_object = healing_cache [who_name]
local healing_object = healing_cache [who_serial]
if (healing_object and (healing_object.classe ~= "UNKNOW" and healing_object.classe ~= "UNGROUPPLAYER")) then
este_jogador.classe = healing_object.classe
end
@@ -3920,7 +3935,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--print (encounterID, encounterName, difficultyID, raidSize)
_detalhes.encounter_table.phase = 1
--_detalhes.encounter_table ["start"] = time()
--store the encounter time inside the encounter table for the encounter plugin
_detalhes.encounter_table ["start"] = _GetTime()
_detalhes.encounter_table ["end"] = nil
@@ -3991,8 +4006,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
--_detalhes.latest_ENCOUNTER_END = _detalhes._tempo
_detalhes.latest_ENCOUNTER_END = _GetTime()
--_detalhes.encounter_table ["end"] = time() - 0.4
_detalhes.encounter_table ["end"] = _GetTime() -- 0.351
local _, _, _, _, _, _, _, zoneMapID = _GetInstanceInfo()
@@ -4007,6 +4020,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
else
if ((_detalhes.tabela_vigente:GetEndTime() or 0) + 2 >= _detalhes.encounter_table ["end"]) then
_detalhes.tabela_vigente:SetStartTime (_detalhes.encounter_table ["start"])
_detalhes.tabela_vigente:SetEndTime (_detalhes.encounter_table ["end"])
_detalhes:AtualizaGumpPrincipal (-1, true)
end
@@ -4033,7 +4047,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (not _detalhes:CaptureGet ("damage")) then
_detalhes:EntrarEmCombate()
end
--> essa parte do solo mode ainda sera usada?
if (_detalhes.solo and _detalhes.PluginCount.SOLO > 0) then --> solo mode
local esta_instancia = _detalhes.tabela_instancias[_detalhes.solo]
@@ -4047,11 +4061,16 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
_detalhes:DispatchAutoRunCode ("on_entercombat")
_detalhes.tabela_vigente.CombatStartedAt = GetTime()
end
function _detalhes.parser_functions:PLAYER_REGEN_ENABLED (...)
--elapsed combat time
_detalhes.LatestCombatDone = GetTime()
_detalhes.tabela_vigente.CombatEndedAt = GetTime()
_detalhes.tabela_vigente.TotalElapsedCombatTime = _detalhes.tabela_vigente.CombatEndedAt - (_detalhes.tabela_vigente.CombatStartedAt or 0)
_current_encounter_id = nil
@@ -4522,25 +4541,19 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--> end
-- ~parserstart ~startparser
function _detalhes.OnParserEvent()
-- 8.0 changed
local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo()
local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = _CombatLogGetCurrentEventInfo()
local funcao = token_list [token]
if (funcao) then
--if (token ~= "SPELL_AURA_REFRESH" and token ~= "SPELL_AURA_REMOVED" and token ~= "SPELL_AURA_APPLIED") then
-- print ("running func:", token)
--end
return funcao (nil, token, time, who_serial, who_name, who_flags, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)
else
return
end
end
_detalhes.parser_frame:SetScript ("OnEvent", _detalhes.OnParserEvent)
function _detalhes:UpdateParser()
@@ -4629,7 +4642,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
damage_cache [actor_name] = nil
damage_cache_pets [actor_name] = nil
damage_cache_petsOwners [actor_name] = nil
healing_cache [actor_name] = nil
healing_cache [actor_serial] = nil
energy_cache [actor_name] = nil
misc_cache [actor_name] = nil
misc_cache_pets [actor_name] = nil
@@ -4927,7 +4940,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
actor.total = damageDone
actor.classe = classToken or "UNKNOW"
elseif (name ~= "Unknown") then
elseif (name ~= "Unknown" and type (name) == "string" and string.len (name) > 1) then
local guid = _UnitGUID (name)
if (guid) then
local flag
@@ -4949,8 +4962,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
actor.total = healingDone
actor.classe = classToken or "UNKNOW"
elseif (name ~= "Unknown") then
elseif (name ~= "Unknown" and type (name) == "string" and string.len (name) > 1) then
--elseif (name ~= "Unknown") then
local guid = _UnitGUID (name)
if (guid) then
local flag
+82 -19
View File
@@ -3679,7 +3679,7 @@
-----------------------------------------------
local dbm_open_aura_creator = function (row)
local data = all_modules [3].data [row]
local data = all_modules [4].data [row]
local spellname, spellicon, _
if (type (data [7]) == "number") then
@@ -3809,7 +3809,7 @@
local bw_open_aura_creator = function (row)
local data = all_modules [4].data [row]
local data = all_modules [5].data [row]
local spellname, spellicon, _
local spellid = tonumber (data [2])
@@ -4155,7 +4155,7 @@ local create_deathrecap_line = function (parent, n)
--text setup
amount:SetWidth (85)
amount:SetJustifyH ("right")
lifePercent:SetWidth (36)
lifePercent:SetWidth (42)
lifePercent:SetJustifyH ("right")
--background
@@ -4189,8 +4189,8 @@ local create_deathrecap_line = function (parent, n)
backgroundTexture2:SetHeight (32)
--_detalhes.gump:SetFontColor (amount, "red")
_detalhes.gump:SetFontSize (amount, 16)
_detalhes.gump:SetFontSize (lifePercent, 16)
_detalhes.gump:SetFontSize (amount, 14)
_detalhes.gump:SetFontSize (lifePercent, 14)
backgroundTexture:SetVertexColor (.2, .1, .1, .3)
end
@@ -4266,7 +4266,8 @@ function _detalhes.BuildDeathTableFromRecap (recapID)
evtData.absorbed or 0,
evtData.school or 0,
false,
evtData.overkill
evtData.overkill,
not spellId and {spellId, spellName, texture},
}
tinsert (ArtificialDeathLog[1], ev)
@@ -4276,8 +4277,35 @@ function _detalhes.BuildDeathTableFromRecap (recapID)
return ArtificialDeathLog
end
function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
function _detalhes.GetDeathRecapFromChat()
-- /dump ChatFrame1:GetMessageInfo (i)
-- /dump ChatFrame1:GetNumMessages()
local chat1 = ChatFrame1
local recapIDFromChat
if (chat1) then
local numLines = chat1:GetNumMessages()
for i = numLines, 1, -1 do
local text = chat1:GetMessageInfo (i)
if (text) then
if (text:find ("Hdeath:%d")) then
local recapID = text:match ("|Hdeath:(%d+)|h")
if (recapID) then
recapIDFromChat = tonumber (recapID)
end
break
end
end
end
end
if (recapIDFromChat) then
_detalhes.OpenDetailsDeathRecap (nil, recapIDFromChat, true)
return
end
end
function _detalhes.OpenDetailsDeathRecap (segment, RecapID, fromChat)
if (not _detalhes.death_recap.enabled) then
if (Details.DeathRecap and Details.DeathRecap.Lines) then
for i = 1, 10 do
@@ -4287,6 +4315,7 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
button:Hide()
end
end
return
end
@@ -4405,8 +4434,7 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
DeathRecapFrame.Unavailable:Show()
return
end
--get the death events from the blizzard's recap
ArtificialDeathLog = _detalhes.BuildDeathTableFromRecap (RecapID)
end
@@ -4499,7 +4527,14 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
tremove (BiggestDamageHits, 11)
end
end
if (#BiggestDamageHits == 0) then
if (not fromChat) then
_detalhes.GetDeathRecapFromChat()
return
end
end
table.sort (BiggestDamageHits, function (t1, t2)
return t1[4] > t2[4]
end)
@@ -4521,6 +4556,8 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
local source = event [6]
local overkill = event [10] or 0
local customSpellInfo = event [11]
--print ("3 loop", i, type (evType), evType)
if (type (evType) == "boolean" and evType) then
@@ -4529,7 +4566,7 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
--print ("4 loop", i, line)
if (line) then
line.timeAt:SetText (format ("%.1f", eventTime - timeOfDeath) .. "s")
line.spellIcon:SetTexture (spellIcon)
line.spellIcon:SetTexture (spellIcon or customSpellInfo and customSpellInfo [3] or "")
line.TopFader:Hide()
--line.spellIcon:SetTexCoord (.1, .9, .1, .9)
--line.sourceName:SetText ("|cFFC6B0D9" .. source .. "|r")
@@ -4574,9 +4611,20 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
--> remove the dot signal from the spell name
if (not spellName) then
spellName = "*?*"
spellName = customSpellInfo and customSpellInfo [2] or "*?*"
if (spellName:find (STRING_ENVIRONMENTAL_DAMAGE_FALLING)) then
if (UnitName ("player") == "Elphaba") then
spellName = "Gravity Won!, Elphaba..."
source = ""
else
source = "Gravity"
end
--/run for a,b in pairs (_G) do if (type (b)=="string" and b:find ("Falling")) then print (a,b) end end
end
end
spellName = spellName:gsub (L["STRING_DOT"], "")
source = source or ""
line.sourceName:SetText (spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
@@ -4613,6 +4661,10 @@ function _detalhes.OpenDetailsDeathRecap (segment, RecapID)
end
DeathRecapFrame.Unavailable:Hide()
else
if (not fromChat) then
_detalhes.GetDeathRecapFromChat()
end
end
end
@@ -4785,13 +4837,24 @@ function Details:RefreshPlaterIntegration()
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> general macros
function _detalhes:OpenPlayerDetails (window)
window = window or 1
local instance = _detalhes:GetInstance (window)
if (instance) then
local display, subDisplay = instance:GetDisplay()
if (display == 1) then
instance:AbreJanelaInfo (Details:GetPlayer (false, 1))
elseif (display == 2) then
instance:AbreJanelaInfo (Details:GetPlayer (false, 2))
end
end
end
--endd
+1 -1
View File
@@ -211,7 +211,7 @@
local exec_user_func = function (func, attributes, data, this_second)
local okey, result = _pcall (func)
local okey, result = _pcall (func, attributes)
if (not okey) then
_detalhes:Msg ("|cFFFF9900error on chart script function|r:", result)
result = 0
+1 -1
View File
@@ -5,7 +5,7 @@ if (not Loc) then
end
Loc ["STRING_PLUGIN_NAME"] = "Encounter Details"
Loc ["STRING_WINDOW_TITLE"] = "Encounter Details"
Loc ["STRING_WINDOW_TITLE"] = "Details! Encounter Info"
Loc ["STRING_TOTAL_DAMAGE"] = "Total Damage"
Loc ["STRING_TOTAL_HEAL"] = "Total Heal"
Loc ["STRING_SHOW_ALL_DATA"] = "Show overall data"
@@ -576,7 +576,7 @@ end
local talentsTable = _detalhes:GetTalents (unitSerial)
--> order by class > alphabetically by the unit name
unitClassID = ((unitClassID + 128) ^ 4) + tonumber (string.byte (unitName, 1) .. "" .. string.byte (unitName, 2))
unitClassID = (((unitClassID or 0) + 128) ^ 4) + tonumber (string.byte (unitName, 1) .. "" .. string.byte (unitName, 2))
tinsert (PlayerData, {unitName, unitClassID,
Name = unitName,
+2 -2
View File
@@ -1849,8 +1849,8 @@ function _G._detalhes:Start()
_detalhes:RefreshPlaterIntegration()
end)
--> override the overall data flag on this release only (remove on the release)
Details.overall_flag = 0x10
--> override the overall data flag on this release only (remove on the next release)
--Details.overall_flag = 0x10
end