added maelstrom alerts

René Welbers [01-26-16 - 12:18]
added maelstrom alerts
Filename
BuffsDebuffs.lua
RaidNotifier.lua
RaidNotifier.txt
lang/de.lua
lang/en.lua
diff --git a/BuffsDebuffs.lua b/BuffsDebuffs.lua
index 8796451..39e43d4 100644
--- a/BuffsDebuffs.lua
+++ b/BuffsDebuffs.lua
@@ -52,6 +52,20 @@ hel_ra.jump[33686] = true
 hel_ra.jump[33686] = true
 hel_ra.jump[33686] = true

+-- ---------------------------------------------------
+-- Veteran Maelstrom Arena ---------------------------
+-- ---------------------------------------------------
+local maelstrom = {}
+maelstrom.stage7_poison = {}
+maelstrom.stage7_poison[68871] = true
+maelstrom.stage7_poison[68909] = true
+maelstrom.stage7_poison[68910] = true
+maelstrom.stage7_poison[69855] = true
+maelstrom.stage7_poison[69854] = true -- poison explode
+maelstrom.stage7_poison[73866] = true -- poison explode
+
+maelstrom.stage9_synergy = 67359
+

 -- add ids back to global
 RaidNotifier.BuffsDebuffs.hel_ra = hel_ra
diff --git a/RaidNotifier.lua b/RaidNotifier.lua
index f3dff7e..09aa492 100644
--- a/RaidNotifier.lua
+++ b/RaidNotifier.lua
@@ -3,19 +3,24 @@ local LAM = LibStub:GetLibrary("LibAddonMenu-2.0")

 RaidNotifier = RaidNotifier or {}

-RaidNotifier.name		= 'RaidNotifier'
-RaidNotifier.slash		= '/rn'
-RaidNotifier.version	= '1.3.0'
-RaidNotifier.versionDB	= 1
-RaidNotifier.loaded	    = false
-RaidNotifier.author     = 'silentgecko'
-RaidNotifier.savedVarsName  = 'RNVars'
+RaidNotifier.name		   = 'RaidNotifier'
+RaidNotifier.slash		   = '/rn'
+RaidNotifier.version	   = '1.3.1'
+RaidNotifier.versionDB	   = 1
+RaidNotifier.loaded	       = false
+RaidNotifier.author        = 'silentgecko'
+RaidNotifier.savedVarsName = 'RNVars'
+
 RaidNotifier.variables = {
     sanctum_ophidia = {
         magicka_deto      = true,
         poison            = true,
         mantikora_spear   = true,
     },
+    maelstrom = {
+        stage7_poison  = true,
+        stage9_synergy = true,
+    },
     general = {
         buffFood_reminder = true,
     },
@@ -30,6 +35,10 @@ RaidNotifier.tempVars = {
         },
         general = {
             buffFood_reminder = 0,
+        },
+        maelstrom = {
+            stage7_poison  = 0,
+            stage9_synergy = 0,
         }
     },
 }
@@ -96,6 +105,28 @@ local function CreateSettingsMenu()
         },
         {
             type = "header",
+            name = GetString(RAIDNOTIFIER_SETTINGS_MAELSTROM_HEADER),
+        },
+        {
+            type = "checkbox",
+            name = GetString(RAIDNOTIFIER_SETTINGS_MAELSTROM_STAGE7_POISON),
+            tooltip = GetString(RAIDNOTIFIER_SETTINGS_MAELSTROM_STAGE7_POISON_TT),
+            getFunc = function() return RaidNotifier.savedVariables.maelstrom.stage7_poison end,
+            setFunc = function(value)
+                RaidNotifier.savedVariables.maelstrom.stage7_poison = value
+            end,
+        },
+        {
+            type = "checkbox",
+            name = GetString(RAIDNOTIFIER_SETTINGS_MAELSTROM_STAGE9_SYNERGY),
+            tooltip = GetString(RAIDNOTIFIER_SETTINGS_MAELSTROM_STAGE9_SYNERGY_TT),
+            getFunc = function() return RaidNotifier.savedVariables.maelstrom.stage9_synergy end,
+            setFunc = function(value)
+                RaidNotifier.savedVariables.maelstrom.stage9_synergy = value
+            end,
+        },
+        {
+            type = "header",
             name = GetString(RAIDNOTIFIER_SETTINGS_DEBUG_HEADER),
         },
         {
@@ -151,15 +182,20 @@ function RaidNotifier.addEventListeners()
     if raidId == 3 then
         EVENT_MANAGER:RegisterForEvent(self.name .. "_SANCTUM", EVENT_EFFECT_CHANGED, self.sanctumDebuffs)
     end
+
+    -- add maelstrom
+    if raidId == 6 then
+        EVENT_MANAGER:RegisterForEvent(self.name .. "_MAELSTROM", EVENT_EFFECT_CHANGED, self.maelstromDebuffs)
+    end
 end

 -- Remove all Events
 function RaidNotifier.removeEventListeners()
     local self   = RaidNotifier
-    local raidId = GetCurrentParticipatingRaidId()

     EVENT_MANAGER:UnregisterForEvent(self.name .. "_BUFFFOOD", EVENT_EFFECT_CHANGED)
     EVENT_MANAGER:UnregisterForEvent(self.name .. "_SANCTUM", EVENT_EFFECT_CHANGED)
+    EVENT_MANAGER:UnregisterForEvent(self.name .. "_MAELSTROM", EVENT_EFFECT_CHANGED)
 end

 function RaidNotifier.sanctumDebuffs(_, change, _, name, unit, _, _, _, _, _, _, _, _, _, _, abilityId)
@@ -223,6 +259,43 @@ function RaidNotifier.sanctumDebuffs(_, change, _, name, unit, _, _, _, _, _, _,
     end
 end

+
+function RaidNotifier.maelstromDebuffs(_, change, _, name, unit, _, _, _, _, _, _, _, _, _, _, abilityId)
+    -- only take care of player
+    if (unit ~= 'player') then return end
+
+    local self = RaidNotifier
+    local buffsDebuffs = self.BuffsDebuffs.maelstrom
+
+    -- only notice on effect added
+    if (change == EFFECT_RESULT_GAINED) then
+
+        -- Maelstrom Poison Alert
+        if self.savedVariables.maelstrom.stage7_poison then
+            -- only notify when the last one is at least 15 seconds ago and it is poison
+            local currentTime = GetTimeStamp()
+            local lastNotify  = self.tempVars.last_notify.maelstrom.stage7_poison
+            local timeDiff = GetDiffBetweenTimeStamps(currentTime, lastNotify)
+            if (buffsDebuffs.stage7_poison[abilityId]) and timeDiff > 15 then
+                self.tempVars.last_notify.maelstrom.stage7_poison = currentTime
+                CENTER_SCREEN_ANNOUNCE:AddMessage(2, CSA_EVENT_COMBINED_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, GetString(RAIDNOTIFIER_ALERTS_MAELSTROM_STAGE7_POISON), nil, nil, nil, nil, nil, 2000)
+            end
+        end
+
+        -- Maelstrom Stage 9 Synergy Alert
+        if self.savedVariables.sanctum_ophidia.mantikora_spear then
+            -- only notify when the last one is at least 15 seconds ago and it is the synergy
+            local currentTime = GetTimeStamp()
+            local lastNotify  = self.tempVars.last_notify.maelstrom.stage9_synergy
+            local timeDiff = GetDiffBetweenTimeStamps(currentTime, lastNotify)
+            if (buffsDebuffs.stage9_synergy == abilityId) and timeDiff > 15 then
+                self.tempVars.last_notify.maelstrom.stage9_synergy = currentTime
+                CENTER_SCREEN_ANNOUNCE:AddMessage(2, CSA_EVENT_SMALL_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, GetString(RAIDNOTIFIER_ALERTS_MAELSTROM_STAGE9_SYNERGY), nil, nil, nil, nil, nil, 2000)
+            end
+        end
+    end
+end
+
 function RaidNotifier.generalBuffFoodReminder(_, _, _, _, unit, _, _, _, _, _, _, _, _, _, _, abilityId)
     -- only take care of player
     if (unit ~= 'player') then return end
diff --git a/RaidNotifier.txt b/RaidNotifier.txt
index 1bd0b90..44e1f9e 100644
--- a/RaidNotifier.txt
+++ b/RaidNotifier.txt
@@ -1,7 +1,7 @@
 ## Title: |cEFEBBERaidNotifier|r
 ## Description: Displays on-screen notifications on different events during trials.
 ## Author: |c009ad6silentgecko|r
-## Version: 1.3.0
+## Version: 1.3.1
 ## APIVersion: 100013
 ## SavedVariables: RNVars
 ## OptionalDependsOn: LibAddonMenu-2.0
diff --git a/lang/de.lua b/lang/de.lua
index a79c86f..f32fab6 100644
--- a/lang/de.lua
+++ b/lang/de.lua
@@ -16,6 +16,12 @@ L.Settings_Sanctum_Poison_TT             = 'Zeigt dir eine Benachrichtigung auf
 L.Settings_Sanctum_Mantikora_Spear       = 'Mantikora Speerwurf'
 L.Settings_Sanctum_Mantikora_Spear_TT    = 'Benachrichtigt dich, wenn du den Mantikor Speerwurf abbekommst.'

+L.Settings_Maelstrom_Header              = 'Veteranen Mahlstrom Arena'
+L.Settings_Maelstrom_Stage7_Poison       = 'Ebene 7: Gift'
+L.Settings_Maelstrom_Stage7_Poison_TT    = 'Zeigt dir eine Benachrichtigung, wenn du in Ebene 7 (Gewölbe des Anstoßes) vergiftet wirst.'
+L.Settings_Maelstrom_Stage9_Synergy      = 'Ebene 9: Spektrale Explosion (Synergie)'
+L.Settings_Maelstrom_Stage9_Synergy_TT   = 'Zeigt dir eine Benachrichtigung, wenn du in Ebene 9 (Theater der Verzweiflung) 3 (goldene) Geister gesammelt und die Synergie auslösen kannst.'
+
 L.Settings_Debug_Header                  = 'Debug'
 L.Settings_Debug                         = 'Debug einschalten'
 L.Settings_Debug_TT                      = 'Zeigt an bestimmten Stellen Debug Informationen im Chat an.'
@@ -27,6 +33,9 @@ L.Alerts_Sanctum_Poison             = '|c39942eGift|r! Zusammen stehen!'
 L.Alerts_Sanctum_Magicka_Detonation = '|c234afaMagicka Detonation|r! Verbrenn dein gesamtes Magicka!'
 L.Alerts_Sanctum_Mantikora_Spear    = 'Mantikor |ccde846Speer|r auf dir! Raus da!'

+L.Alerts_Maelstrom_Stage7_Poison    = '|c39942eVergiftet|r! Nutze eine der beiden Flächen am Rand um dich zu reinigen!'
+L.Alerts_Maelstrom_Stage9_Synergy   = '|c23afe7Spektrale Explosion|r bereit! Synergie nutzen!'
+
 L.Alerts_General_No_Bufffood        = 'Du hast kein Bufffood genommen!'
 L.Alerts_General_Bufffood_Minutes   = 'Dein Bufffood "<<1>>" läuft in |cbd0000<<2>>|r Minuten aus!'

diff --git a/lang/en.lua b/lang/en.lua
index df0e573..390eec2 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -16,6 +16,12 @@ L.Settings_Sanctum_Poison_TT             = 'Alerts for the poison phase during t
 L.Settings_Sanctum_Mantikora_Spear       = 'Mantikora Spear'
 L.Settings_Sanctum_Mantikora_Spear_TT    = 'Alerts you when you will get the Mantikora Spear.'

+L.Settings_Maelstrom_Header              = 'Veteran Maelstrom Arena'
+L.Settings_Maelstrom_Stage7_Poison       = 'Stage 7: Poison'
+L.Settings_Maelstrom_Stage7_Poison_TT    = 'Alerts you when you got poisoned in Stage 7 (Vault of Umbrage).'
+L.Settings_Maelstrom_Stage9_Synergy      = 'Stage 9: Spectral Explosion (Synergy)'
+L.Settings_Maelstrom_Stage9_Synergy_TT   = 'Alerts you when you got the Synergy in Stage 9 (Theater of Despair) after you picked ab 3 (golden) Ghosts.'
+
 L.Settings_Debug_Header                  = 'Debug'
 L.Settings_Debug                         = 'Turn debug on'
 L.Settings_Debug_TT                      = 'Turns on debugging output in chatwindow'
@@ -27,6 +33,9 @@ L.Alerts_Sanctum_Poison             = '|c39942ePoison|r! Stack together!'
 L.Alerts_Sanctum_Magicka_Detonation = '|c234afaMagicka Detonation|r! Burn all your Magicka!'
 L.Alerts_Sanctum_Mantikora_Spear    = 'Mantikora |ccde846Spear|r on you! Move out!'

+L.Alerts_Maelstrom_Stage7_Poison    = '|c39942ePoisoned|r! Use one of the two areas to purge!'
+L.Alerts_Maelstrom_Stage9_Synergy   = '|c23afe7Spectral Explosion|r ready! Use the synergy!'
+
 L.Alerts_General_No_Bufffood        = 'You have taken no bufffood!'
 L.Alerts_General_Bufffood_Minutes   = 'Your "<<1>>" bufffood runs out in |cbd0000<<2>>|r minutes!'