From 10e45e08b6fc6c904b0caedd6b4e60dab821b4b8 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sun, 2 Oct 2022 18:11:25 -0300 Subject: [PATCH] WotLK DK spells merge and Encounter Breakdown fix --- core/parser.lua | 49 ++++ .../Details_EncounterDetails-BCC.toc | 5 - .../Details_EncounterDetails-Wrath.toc | 5 - .../Details_EncounterDetails.lua | 210 +++++++++--------- .../Details_EncounterDetails.toc | 5 - 5 files changed, 152 insertions(+), 122 deletions(-) diff --git a/core/parser.lua b/core/parser.lua index bf0fc04d..75d34c56 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -192,6 +192,55 @@ if (isTBC) then override_spellId = {} + elseif (isWOTLK) then + override_spellId = { + --Scourge Strike + [55090] = 55271, + [55265] = 55271, + [55270] = 55271, + [70890] = 55271, --shadow + + --Frost Strike + [49143] = 55268, + [51416] = 55268, + [51417] = 55268, + [51418] = 55268, + [51419] = 55268, + [66196] = 55268, --offhand + + --Obliterate + [49020] = 51425, + [51423] = 51425, + [51424] = 51425, + [66198] = 51425, --offhand + + --Death Strike + [49998] = 49924, + [49999] = 49924, + [45463] = 49924, + [49923] = 49924, + [66188] = 49924, --offhand + + --Blood Strike + [45902] = 49930, + [49926] = 49930, + [49927] = 49930, + [49928] = 49930, + [49929] = 49930, + [66979] = 49930, --offhand + + --Rune Strike + [6621] = 56815, --offhand + + --Plague Strike + [45462] = 49921, + [49917] = 49921, + [49918] = 49921, + [49919] = 49921, + [49920] = 49921, + [66988] = 49921, --offhand + } + else --retail override_spellId = { [184707] = 218617, --warrior rampage diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails-BCC.toc b/plugins/Details_EncounterDetails/Details_EncounterDetails-BCC.toc index 6fbfcd2a..2264e525 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails-BCC.toc +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails-BCC.toc @@ -5,11 +5,6 @@ ## OptionalDeps: Ace3 ## SavedVariablesPerCharacter: EncounterDetailsDB - -#@no-lib-strip@ -embeds.xml -#@end-no-lib-strip@ - enUS.lua ptBR.lua frames.lua diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails-Wrath.toc b/plugins/Details_EncounterDetails/Details_EncounterDetails-Wrath.toc index f74b7652..637b602c 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails-Wrath.toc +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails-Wrath.toc @@ -5,11 +5,6 @@ ## OptionalDeps: Ace3 ## SavedVariablesPerCharacter: EncounterDetailsDB - -#@no-lib-strip@ -embeds.xml -#@end-no-lib-strip@ - enUS.lua ptBR.lua frames.lua diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua index 3660255b..fdfe914e 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.lua +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.lua @@ -98,7 +98,7 @@ local ability_type_table = { local function CreatePluginFrames (data) --> catch Details! main object - local _detalhes = _G._detalhes + local _detalhes = Details local DetailsFrameWork = _detalhes.gump --> saved data if any @@ -2154,112 +2154,108 @@ local CLEvents = function (self, event) end end -function EncounterDetails:OnEvent (_, event, ...) - - if (event == "ENCOUNTER_START") then - --> tracks if a enemy spell is instant cast. - EncounterDetails.CLEvents:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") - - elseif (event == "ENCOUNTER_END") then - EncounterDetails.CLEvents:UnregisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") - - elseif (event == "ADDON_LOADED") then - local AddonName = select (1, ...) - if (AddonName == "Details_EncounterDetails") then - - if (_G._detalhes and _G._detalhes:InstallOkey()) then - - if (DetailsFramework.IsClassicWow()) then - return - end - - --> create widgets - CreatePluginFrames (data) - - local PLUGIN_MINIMAL_DETAILS_VERSION_REQUIRED = 1 - local PLUGIN_TYPE = "TOOLBAR" - local PLUGIN_LOCALIZED_NAME = Loc ["STRING_PLUGIN_NAME"] - local PLUGIN_REAL_NAME = "DETAILS_PLUGIN_ENCOUNTER_DETAILS" - local PLUGIN_ICON = [[Interface\Scenarios\ScenarioIcon-Boss]] - local PLUGIN_AUTHOR = "Terciob" - local PLUGIN_VERSION = "v1.06" - - local default_settings = { - show_icon = 5, --automatic - hide_on_combat = false, --hide the window when a new combat start - max_emote_segments = 3, - opened = 0, - encounter_timers_dbm = {}, - encounter_timers_bw = {}, - window_scale = 1, - last_section_selected = "main", - } - - --> Install - local install, saveddata, is_enabled = _G._detalhes:InstallPlugin ( - PLUGIN_TYPE, - PLUGIN_LOCALIZED_NAME, - PLUGIN_ICON, - EncounterDetails, - PLUGIN_REAL_NAME, - PLUGIN_MINIMAL_DETAILS_VERSION_REQUIRED, - PLUGIN_AUTHOR, - PLUGIN_VERSION, - default_settings - ) - - if (type (install) == "table" and install.error) then - print (install.error) - end --- table.wipe (EncounterDetailsDB.encounter_spells) - EncounterDetails.charsaved = EncounterDetailsDB or {emotes = {}} - EncounterDetailsDB = EncounterDetails.charsaved - - EncounterDetails.charsaved.encounter_spells = EncounterDetails.charsaved.encounter_spells or {} - - EncounterDetails.boss_emotes_table = EncounterDetails.charsaved.emotes - - --> build a table on global saved variables - if (not _detalhes.global_plugin_database ["DETAILS_PLUGIN_ENCOUNTER_DETAILS"]) then - _detalhes.global_plugin_database ["DETAILS_PLUGIN_ENCOUNTER_DETAILS"] = {encounter_timers_dbm = {}, encounter_timers_bw= {}} - end - - --> Register needed events - _G._detalhes:RegisterEvent (EncounterDetails, "COMBAT_PLAYER_ENTER") - _G._detalhes:RegisterEvent (EncounterDetails, "COMBAT_PLAYER_LEAVE") - _G._detalhes:RegisterEvent (EncounterDetails, "COMBAT_BOSS_FOUND") - _G._detalhes:RegisterEvent (EncounterDetails, "DETAILS_DATA_RESET") - - _G._detalhes:RegisterEvent (EncounterDetails, "GROUP_ONENTER") - _G._detalhes:RegisterEvent (EncounterDetails, "GROUP_ONLEAVE") - - _G._detalhes:RegisterEvent (EncounterDetails, "ZONE_TYPE_CHANGED") - - EncounterDetailsFrame:RegisterEvent ("ENCOUNTER_START") - EncounterDetailsFrame:RegisterEvent ("ENCOUNTER_END") - EncounterDetails.EnemySpellPool = EncounterDetails.charsaved.encounter_spells - enemy_spell_pool = EncounterDetails.EnemySpellPool - EncounterDetails.CLEvents = CreateFrame ("frame", nil, UIParent, "BackdropTemplate") - EncounterDetails.CLEvents:SetScript ("OnEvent", CLEvents) - EncounterDetails.CLEvents:Hide() - - EncounterDetails.BossWhispColors = { - [1] = "RAID_BOSS_EMOTE", - [2] = "RAID_BOSS_WHISPER", - [3] = "MONSTER_EMOTE", - [4] = "MONSTER_SAY", - [5] = "MONSTER_WHISPER", - [6] = "MONSTER_PARTY", - [7] = "MONSTER_YELL", - } - - --> embed the plugin into the plugin window - if (DetailsPluginContainerWindow) then - DetailsPluginContainerWindow.EmbedPlugin (EncounterDetails, EncounterDetails.Frame) - end - - end +local installPluginFunc = function() + if (Details and Details.InstallOkey and Details:InstallOkey()) then + if (DetailsFramework.IsClassicWow()) then + return + end + + --create widgets + CreatePluginFrames(data) + + local PLUGIN_MINIMAL_DETAILS_VERSION_REQUIRED = 1 + local PLUGIN_TYPE = "TOOLBAR" + local PLUGIN_LOCALIZED_NAME = Loc ["STRING_PLUGIN_NAME"] + local PLUGIN_REAL_NAME = "DETAILS_PLUGIN_ENCOUNTER_DETAILS" + local PLUGIN_ICON = [[Interface\Scenarios\ScenarioIcon-Boss]] + local PLUGIN_AUTHOR = "Terciob" + local PLUGIN_VERSION = "v1.06" + + local defaultSettings = { + show_icon = 5, --automatic + hide_on_combat = false, --hide the window when a new combat start + max_emote_segments = 3, + opened = 0, + encounter_timers_dbm = {}, + encounter_timers_bw = {}, + window_scale = 1, + last_section_selected = "main", + } + + --install + local install, saveddata, isEnabled = Details:InstallPlugin( + PLUGIN_TYPE, + PLUGIN_LOCALIZED_NAME, + PLUGIN_ICON, + EncounterDetails, + PLUGIN_REAL_NAME, + PLUGIN_MINIMAL_DETAILS_VERSION_REQUIRED, + PLUGIN_AUTHOR, + PLUGIN_VERSION, + defaultSettings + ) + + if (type(install) == "table" and install.error) then + print(install.error) + end + + --table.wipe(EncounterDetailsDB.encounter_spells) + EncounterDetails.charsaved = EncounterDetailsDB or {emotes = {}} + EncounterDetailsDB = EncounterDetails.charsaved + EncounterDetails.charsaved.encounter_spells = EncounterDetails.charsaved.encounter_spells or {} + EncounterDetails.boss_emotes_table = EncounterDetails.charsaved.emotes + + --build a table on global saved variables + if (not _detalhes.global_plugin_database["DETAILS_PLUGIN_ENCOUNTER_DETAILS"]) then + _detalhes.global_plugin_database["DETAILS_PLUGIN_ENCOUNTER_DETAILS"] = {encounter_timers_dbm = {}, encounter_timers_bw= {}} + end + + --Register needed events + Details:RegisterEvent(EncounterDetails, "COMBAT_PLAYER_ENTER") + Details:RegisterEvent(EncounterDetails, "COMBAT_PLAYER_LEAVE") + Details:RegisterEvent(EncounterDetails, "COMBAT_BOSS_FOUND") + Details:RegisterEvent(EncounterDetails, "DETAILS_DATA_RESET") + Details:RegisterEvent(EncounterDetails, "GROUP_ONENTER") + Details:RegisterEvent(EncounterDetails, "GROUP_ONLEAVE") + Details:RegisterEvent(EncounterDetails, "ZONE_TYPE_CHANGED") + + EncounterDetailsFrame:RegisterEvent("ENCOUNTER_START") + EncounterDetailsFrame:RegisterEvent("ENCOUNTER_END") + EncounterDetails.EnemySpellPool = EncounterDetails.charsaved.encounter_spells + enemy_spell_pool = EncounterDetails.EnemySpellPool + EncounterDetails.CLEvents = CreateFrame("frame", nil, UIParent, "BackdropTemplate") + EncounterDetails.CLEvents:SetScript("OnEvent", CLEvents) + EncounterDetails.CLEvents:Hide() + + EncounterDetails.BossWhispColors = { + [1] = "RAID_BOSS_EMOTE", + [2] = "RAID_BOSS_WHISPER", + [3] = "MONSTER_EMOTE", + [4] = "MONSTER_SAY", + [5] = "MONSTER_WHISPER", + [6] = "MONSTER_PARTY", + [7] = "MONSTER_YELL", + } + + --embed the plugin into the plugin window + if (DetailsPluginContainerWindow) then + DetailsPluginContainerWindow.EmbedPlugin(EncounterDetails, EncounterDetails.Frame) + end + end +end + +function EncounterDetails:OnEvent(self, event, ...) + if (event == "ENCOUNTER_START") then + --tracks if a enemy spell is instant cast + EncounterDetails.CLEvents:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + + elseif (event == "ENCOUNTER_END") then + EncounterDetails.CLEvents:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + + elseif (event == "ADDON_LOADED") then + local addonName = select(1, ...) + if (addonName == "Details_EncounterDetails") then + C_Timer.After(1, installPluginFunc) end - end end diff --git a/plugins/Details_EncounterDetails/Details_EncounterDetails.toc b/plugins/Details_EncounterDetails/Details_EncounterDetails.toc index 02cbf81d..937acae6 100644 --- a/plugins/Details_EncounterDetails/Details_EncounterDetails.toc +++ b/plugins/Details_EncounterDetails/Details_EncounterDetails.toc @@ -5,11 +5,6 @@ ## OptionalDeps: Ace3 ## SavedVariablesPerCharacter: EncounterDetailsDB - -#@no-lib-strip@ -embeds.xml -#@end-no-lib-strip@ - enUS.lua ptBR.lua frames.lua