Skip to content

Commit

Permalink
[RG] Added new option: notify about Bahsei curses on self or tanks
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryDragon committed May 18, 2024
1 parent c71b711 commit 982fc39
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion TrialRockgrove.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ RaidNotifier = RaidNotifier or {}
RaidNotifier.RG = {}

local RaidNotifier = RaidNotifier
local Util = RaidNotifier.Util

local function p() end
local function dbg() end
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions Util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 982fc39

Please sign in to comment.