manti spear alert and debug option

René Welbers [01-25-16 - 10:35]
manti spear alert and debug option
Filename
BuffsDebuffs.lua
RaidNotifier.lua
RaidNotifier.txt
lang/de.lua
lang/en.lua
diff --git a/BuffsDebuffs.lua b/BuffsDebuffs.lua
index b43000d..8796451 100644
--- a/BuffsDebuffs.lua
+++ b/BuffsDebuffs.lua
@@ -7,42 +7,56 @@ RaidNotifier.BuffsDebuffs = {}
 -- i don't know which of these debuffs is the correct, so we add all ;-)
 -- Poison
 local sanctum = {}
-sanctum.poison = {}
-sanctum.poison[38965] = true
-sanctum.poison[38968] = true
-sanctum.poison[38969] = true
-sanctum.poison[41822] = true
-sanctum.poison[41823] = true
-sanctum.poison[41824] = true
-sanctum.poison[41826] = true
-sanctum.poison[41827] = true
-sanctum.poison[41829] = true
-sanctum.poison[41830] = true
-sanctum.poison[41832] = true
-sanctum.poison[41833] = true
-sanctum.poison[53782] = true
-sanctum.poison[53786] = true
-sanctum.poison[53792] = true
-sanctum.poison[53799] = true
-sanctum.poison[53815] = true
-sanctum.poison[54476] = true
-sanctum.poison[54692] = true
-sanctum.poison[55085] = true
-sanctum.poison[55086] = true
-sanctum.poison[55089] = true
-sanctum.poison[55148] = true
-sanctum.poison[57989] = true
-sanctum.poison[65779] = true
-sanctum.poison[65780] = true
-sanctum.poison[65781] = true
+sanctum.poison = 54476

 -- Sanctum Magicka Detonation
 sanctum.magicka_deto = 59036

+-- Sanctum Spear (Mantikora)
+sanctum.spear = {}
+sanctum.spear[56324] = true
+sanctum.spear[56338] = true
+sanctum.spear[56339] = true
+sanctum.spear[56340] = true
+sanctum.spear[56342] = true
+sanctum.spear[56351] = true
+
+sanctum.spear[49499] = true
+sanctum.spear[49500] = true
+sanctum.spear[49501] = true
+sanctum.spear[49504] = true
+sanctum.spear[49505] = true
+
+sanctum.spear[53836] = true
+sanctum.spear[56903] = true
+sanctum.spear[56904] = true
+sanctum.spear[56906] = true
+sanctum.spear[56907] = true
+sanctum.spear[56908] = true
+sanctum.spear[56909] = true
+sanctum.spear[57363] = true
+
 -- add ids back to global
 RaidNotifier.BuffsDebuffs.sanctum_ophidia = sanctum

 -- ---------------------------------------------------
+-- Hel Ra  -------------------------------------------
+-- ---------------------------------------------------
+local hel_ra = {}
+hel_ra.jump = {}
+hel_ra.jump[56354] = true
+hel_ra.jump[10583] = true
+hel_ra.jump[33686] = true
+hel_ra.jump[56243] = true
+hel_ra.jump[33686] = true
+hel_ra.jump[33686] = true
+hel_ra.jump[33686] = true
+
+
+-- add ids back to global
+RaidNotifier.BuffsDebuffs.hel_ra = hel_ra
+
+-- ---------------------------------------------------
 -- BuffFood ------------------------------------------
 -- ---------------------------------------------------
 local buffFood = {}
diff --git a/RaidNotifier.lua b/RaidNotifier.lua
index e3b11e3..f3dff7e 100644
--- a/RaidNotifier.lua
+++ b/RaidNotifier.lua
@@ -5,7 +5,7 @@ RaidNotifier = RaidNotifier or {}

 RaidNotifier.name		= 'RaidNotifier'
 RaidNotifier.slash		= '/rn'
-RaidNotifier.version	= '1.2.2'
+RaidNotifier.version	= '1.3.0'
 RaidNotifier.versionDB	= 1
 RaidNotifier.loaded	    = false
 RaidNotifier.author     = 'silentgecko'
@@ -14,16 +14,19 @@ RaidNotifier.variables = {
     sanctum_ophidia = {
         magicka_deto      = true,
         poison            = true,
+        mantikora_spear   = true,
     },
     general = {
         buffFood_reminder = true,
-    }
+    },
+    debug = false
 }
 RaidNotifier.tempVars = {
     last_notify = {
         sanctum_ophidia = {
-            magicka_deto = 0,
-            poison       = 0,
+            magicka_deto    = 0,
+            poison          = 0,
+            mantikora_spear = 0,
         },
         general = {
             buffFood_reminder = 0,
@@ -82,6 +85,28 @@ local function CreateSettingsMenu()
                 RaidNotifier.savedVariables.sanctum_ophidia.poison = value
             end,
         },
+        {
+            type = "checkbox",
+            name = GetString(RAIDNOTIFIER_SETTINGS_SANCTUM_MANTIKORA_SPEAR),
+            tooltip = GetString(RAIDNOTIFIER_SETTINGS_SANCTUM_MANTIKORA_SPEAR_TT),
+            getFunc = function() return RaidNotifier.savedVariables.sanctum_ophidia.mantikora_spear end,
+            setFunc = function(value)
+                RaidNotifier.savedVariables.sanctum_ophidia.mantikora_spear = value
+            end,
+        },
+        {
+            type = "header",
+            name = GetString(RAIDNOTIFIER_SETTINGS_DEBUG_HEADER),
+        },
+        {
+            type = "checkbox",
+            name = GetString(RAIDNOTIFIER_SETTINGS_DEBUG),
+            tooltip = GetString(RAIDNOTIFIER_SETTINGS_DEBUG_TT),
+            getFunc = function() return RaidNotifier.savedVariables.debug end,
+            setFunc = function(value)
+                RaidNotifier.savedVariables.debug = value
+            end,
+        },
     }

     LAM:RegisterAddonPanel("RaidNotifierPanel", self.panelData)
@@ -137,7 +162,7 @@ function RaidNotifier.removeEventListeners()
     EVENT_MANAGER:UnregisterForEvent(self.name .. "_SANCTUM", EVENT_EFFECT_CHANGED)
 end

-function RaidNotifier.sanctumDebuffs(_, change, buff, name, unit, start, finish, stack, icon, _, effectType, abilityType, statusEffectType, unitName, unitId, abilityId)
+function RaidNotifier.sanctumDebuffs(_, change, _, name, unit, _, _, _, _, _, _, _, _, _, _, abilityId)
     -- only take care of player
     if (unit ~= 'player') then return end

@@ -146,17 +171,20 @@ function RaidNotifier.sanctumDebuffs(_, change, buff, name, unit, start, finish,

     -- only notice on effect added
     if (change == EFFECT_RESULT_GAINED) then
+
+        -- Sanctum Serpent Poison Alert
         if self.savedVariables.sanctum_ophidia.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.sanctum_ophidia.poison
             local timeDiff = GetDiffBetweenTimeStamps(currentTime, lastNotify)
-            if (buffsDebuffs.poison[abilityId]) and timeDiff > 15 then
+            if (buffsDebuffs.poison == abilityId) and timeDiff > 15 then
                 self.tempVars.last_notify.sanctum_ophidia.poison = currentTime
                 CENTER_SCREEN_ANNOUNCE:AddMessage(2, CSA_EVENT_COMBINED_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, GetString(RAIDNOTIFIER_ALERTS_SANCTUM_POISON), nil, nil, nil, nil, nil, 2000)
             end
         end

+        -- Sanctum Serpent Magicka Detonation Alert
         if self.savedVariables.sanctum_ophidia.magicka_deto then
             -- only notify when the last one is at least 10 seconds ago and it is poison
             -- debug abilityId: 30255 / Boundless Storm
@@ -177,10 +205,25 @@ function RaidNotifier.sanctumDebuffs(_, change, buff, name, unit, start, finish,
                 end
             end
         end
+
+        -- Sanctum Mantikora Spear Throw Alert
+        if self.savedVariables.sanctum_ophidia.mantikora_spear then
+            -- only notify when the last one is at least 5 seconds ago and it is the spear
+            local currentTime = GetTimeStamp()
+            local lastNotify  = self.tempVars.last_notify.sanctum_ophidia.mantikora_spear
+            local timeDiff = GetDiffBetweenTimeStamps(currentTime, lastNotify)
+            if (buffsDebuffs.spear[abilityId]) and timeDiff > 5 then
+                if self.savedVariables.debug then
+                    RaidNotifier.debug('manti spear ability id', abilityId)
+                end
+                self.tempVars.last_notify.sanctum_ophidia.mantikora_spear = currentTime
+                CENTER_SCREEN_ANNOUNCE:AddMessage(2, CSA_EVENT_SMALL_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, GetString(RAIDNOTIFIER_ALERTS_SANCTUM_MANTIKORA_SPEAR))
+            end
+        end
     end
 end

-function RaidNotifier.generalBuffFoodReminder(_, change, buff, name, unit, start, finish, stack, icon, _, effectType, abilityType, statusEffectType, unitName, unitId, abilityId)
+function RaidNotifier.generalBuffFoodReminder(_, _, _, _, unit, _, _, _, _, _, _, _, _, _, _, abilityId)
     -- only take care of player
     if (unit ~= 'player') then return end

@@ -199,7 +242,7 @@ function RaidNotifier.generalBuffFoodReminder(_, change, buff, name, unit, start
         local currentTime = GetTimeStamp()

         for x = 1, numAuras do
-            local name, start, finish, _, _, _, _, _, _, _, abilityId, _ = GetUnitBuffInfo('player', x)
+            local name, _, finish, _, _, _, _, _, _, _, abilityId, _ = GetUnitBuffInfo('player', x)
             if buffsDebuffs[abilityId] then
                 -- set bufffoodfound to true
                 buffFoodFound = true
@@ -222,6 +265,10 @@ function RaidNotifier.generalBuffFoodReminder(_, change, buff, name, unit, start
                    self.tempVars.last_notify.general.buffFood_reminder = currentTime
                    CENTER_SCREEN_ANNOUNCE:AddMessage(10, CSA_EVENT_SMALL_TEXT, SOUNDS.CHAMPION_POINTS_COMMITTED, zo_strformat(GetString(RAIDNOTIFIER_ALERTS_GENERAL_BUFFFOOD_MINUTES), name, formatedTime))
                 end
+                if self.savedVariables.debug and buffFoodFound == false then
+                    RaidNotifier.debug('bufffood id forgot?', abilityId)
+                    RaidNotifier.debug('ability name', name)
+                end
             end
         end

@@ -240,5 +287,11 @@ function RaidNotifier.generalBuffFoodReminder(_, change, buff, name, unit, start
     end
 end

+-- debug func
+function RaidNotifier.debug(message, data)
+    d('RaidNotifier Debug:')
+    d(message, data)
+end
+
 ---------Events-------
 EVENT_MANAGER:RegisterForEvent(RaidNotifier.name, EVENT_ADD_ON_LOADED, RaidNotifier.Initialize)
diff --git a/RaidNotifier.txt b/RaidNotifier.txt
index 4212910..1bd0b90 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.2.2
+## Version: 1.3.0
 ## APIVersion: 100013
 ## SavedVariables: RNVars
 ## OptionalDependsOn: LibAddonMenu-2.0
diff --git a/lang/de.lua b/lang/de.lua
index 2b19f24..a79c86f 100644
--- a/lang/de.lua
+++ b/lang/de.lua
@@ -13,12 +13,19 @@ L.Settings_Sanctum_Magicka_Detonation    = 'Magicka Detonation'
 L.Settings_Sanctum_Magicka_Detonation_TT = 'Zeigt dir eine Benachrichtigung auf dem Bildschirm, wenn du den Debuff der Magicka Detonation während des Endbosskampfs hast.'
 L.Settings_Sanctum_Poison                = 'Gift'
 L.Settings_Sanctum_Poison_TT             = 'Zeigt dir eine Benachrichtigung auf dem Bildschirm, wenn die Giftphase während des Endbosskampfs beginnt.'
+L.Settings_Sanctum_Mantikora_Spear       = 'Mantikora Speerwurf'
+L.Settings_Sanctum_Mantikora_Spear_TT    = 'Benachrichtigt dich, wenn du den Mantikor Speerwurf abbekommst.'
+
+L.Settings_Debug_Header                  = 'Debug'
+L.Settings_Debug                         = 'Debug einschalten'
+L.Settings_Debug_TT                      = 'Zeigt an bestimmten Stellen Debug Informationen im Chat an.'

 -- ---------------------------------------------------
 -- Alerts --------------------------------------------
 -- ---------------------------------------------------
 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_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 76b2452..df0e573 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -13,12 +13,19 @@ L.Settings_Sanctum_Magicka_Detonation    = 'Magicka Detonation'
 L.Settings_Sanctum_Magicka_Detonation_TT = 'Alerts when you got the debuff of the magicka detonation during the serpent fight.'
 L.Settings_Sanctum_Poison                = 'Poison'
 L.Settings_Sanctum_Poison_TT             = 'Alerts for the poison phase during the Serpent fight.'
+L.Settings_Sanctum_Mantikora_Spear       = 'Mantikora Spear'
+L.Settings_Sanctum_Mantikora_Spear_TT    = 'Alerts you when you will get the Mantikora Spear.'
+
+L.Settings_Debug_Header                  = 'Debug'
+L.Settings_Debug                         = 'Turn debug on'
+L.Settings_Debug_TT                      = 'Turns on debugging output in chatwindow'

 -- ---------------------------------------------------
 -- Alerts --------------------------------------------
 -- ---------------------------------------------------
 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_General_No_Bufffood        = 'You have taken no bufffood!'
 L.Alerts_General_Bufffood_Minutes   = 'Your "<<1>>" bufffood runs out in |cbd0000<<2>>|r minutes!'