From 982fc395e13d2e9a3854c614cba3129c20cbf2b4 Mon Sep 17 00:00:00 2001 From: Pavel Dovlatov Date: Sat, 18 May 2024 16:06:36 +0300 Subject: [PATCH] [RG] Added new option: notify about Bahsei curses on self or tanks --- Settings.lua | 9 +++++++-- TrialRockgrove.lua | 3 ++- Util.lua | 11 +++++++++++ lang/en.lua | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Settings.lua b/Settings.lua index 1cc8092..1077b82 100644 --- a/Settings.lua +++ b/Settings.lua @@ -579,7 +579,12 @@ function RaidNotifier:CreateSettingsMenu() sulxan_reaver_sundering_strike = off_self_all, oaxiltso_noxious_sludge = off_self_all, oaxiltso_annihilator_cinder_cleave = off_self_all, - bahsei_embrace_of_death = off_self_all, + bahsei_embrace_of_death = { + L.Settings_General_Choices_Off, + L.Settings_General_Choices_Self, + L.Settings_General_Choices_All, + L.Settings_General_Choices_SelfAndTanks, + }, }, dreadsailReef = { dome_type = { @@ -1741,7 +1746,7 @@ function RaidNotifier:CreateSettingsMenu() name = L.Settings_Rockgrove_Embrace_Of_Death, tooltip = L.Settings_Rockgrove_Embrace_Of_Death_TT, choices = choices.rockgrove.bahsei_embrace_of_death, - choicesTooltips = { false, false, L.Settings_Rockgrove_Embrace_Of_Death_TT_All }, + choicesTooltips = { false, false, L.Settings_Rockgrove_Embrace_Of_Death_TT_All, false }, }, "rockgrove", "bahsei_embrace_of_death") MakeControlEntry({ type = "checkbox", diff --git a/TrialRockgrove.lua b/TrialRockgrove.lua index 089303d..8d7608d 100644 --- a/TrialRockgrove.lua +++ b/TrialRockgrove.lua @@ -2,6 +2,7 @@ RaidNotifier = RaidNotifier or {} RaidNotifier.RG = {} local RaidNotifier = RaidNotifier +local Util = RaidNotifier.Util local function p() end local function dbg() end @@ -78,7 +79,7 @@ function RaidNotifier.RG.OnEffectChangedForGroup(eventCode, changeType, eSlot, e if (changeType == EFFECT_RESULT_GAINED) then if (settings.bahsei_embrace_of_death >= 1 and AreUnitsEqual(uTag, "player")) then self:StartCountdown(8000, GetString(RAIDNOTIFIER_ALERTS_ROCKGROVE_EMBRACE_OF_DEATH), "rockgrove", "bahsei_embrace_of_death", true) - elseif (settings.bahsei_embrace_of_death == 2) then + elseif (settings.bahsei_embrace_of_death == 2 or settings.bahsei_embrace_of_death == 3 and Util.isUnitTank(uTag)) then local targetPlayerName = self.UnitIdToString(uId) self:StartCountdown(8000, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_ROCKGROVE_EMBRACE_OF_DEATH_OTHER), targetPlayerName), "rockgrove", "bahsei_embrace_of_death", false) diff --git a/Util.lua b/Util.lua index abcde23..a3dcc11 100644 --- a/Util.lua +++ b/Util.lua @@ -194,3 +194,14 @@ function Util:GetDistance(pX, pY, tX, tY) return dist end +function Util:IsUnitTank(unitTag) + local isTank = false + + if GetGroupSize() > 0 then + isTank = GetGroupMemberSelectedRole(unitTag) == LFG_ROLE_TANK + elseif AreUnitsEqual(unitTag, "player") then + isTank = GetSelectedLFGRole() == LFG_ROLE_TANK + end + + return isTank +end diff --git a/lang/en.lua b/lang/en.lua index 9d6a01f..94e449d 100644 --- a/lang/en.lua +++ b/lang/en.lua @@ -46,6 +46,7 @@ L.Settings_General_Choices_500ms = "0.5s" L.Settings_General_Choices_200ms = "0.2s" L.Settings_General_Choices_Custom = "Custom" L.Settings_General_Choices_Custom_Announcement = "Custom (movable)" +L.Settings_General_Choices_SelfAndTanks = "Self and tanks" L.Settings_General_Choices_OnlyChaurusTotem = "Only Chaurus" -- Specific for Kyne's Aegis L.Settings_DreadsailReef_Choices_OnlyFireDome = "Only Fire Dome" L.Settings_DreadsailReef_Choices_OnlyIceDome = "Only Ice Dome"