Skip to content

Commit

Permalink
Added nameplate aura for haunting shadows, at least for the short ter…
Browse files Browse the repository at this point in the history
…m. This will only work if Haunting Shadows warning is enabled (which it should be, by default)

Added nameplate aura for when S.I. Informants or  K'thir Dominators are casting Touch of the Abyss
Fixed a bug that caused Haunting Shadows warning not to show.
  • Loading branch information
MysticalOS committed Mar 2, 2020
1 parent 9702e9a commit 51bfc3b
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 8 deletions.
43 changes: 39 additions & 4 deletions DBM-Challenges/BfA/NzothVisionOrgrimmar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod:RegisterEventsInCombat(
"SPELL_CAST_SUCCESS 297237",
"SPELL_PERIODIC_DAMAGE 303594 313303",
"SPELL_PERIODIC_MISSED 303594 313303",
"SPELL_INTERRUPT",
"UNIT_DIED",
"ENCOUNTER_START",
"UNIT_AURA player",
Expand Down Expand Up @@ -86,6 +87,8 @@ local timerSurgingFistCD = mod:NewCDTimer(9.7, 300351, nil, nil, nil, 3)
local timerDecimatorCD = mod:NewCDTimer(9.7, 300412, nil, nil, nil, 3)

mod:AddInfoFrameOption(307831, true)
mod:AddNamePlateOption("NPAuraOnHaunting", 306545)
mod:AddNamePlateOption("NPAuraOnAbyss", 298033)

local playerName = UnitName("player")
mod.vb.GnshalCleared = false
Expand All @@ -111,14 +114,21 @@ end
function mod:OnCombatStart(delay)
self.vb.GnshalCleared = false
self.vb.VezokkCleared = false
if self.Options.SpecWarn306545dodge then
if self.Options.SpecWarn306545dodge3 then
--This warning requires friendly nameplates, because it's only way to detect it.
CVAR1, CVAR2 = GetCVar("nameplateShowFriends ") or 0, GetCVar("nameplateShowFriendlyNPCs") or 0
--Check if they were disabled, if disabled, force enable them
if (CVAR1 == 0) or (CVAR2 == 0) then
SetCVar("nameplateShowFriends", 1)
SetCVar("nameplateShowFriendlyNPCs", 1)
end
--Making this option rely on another option is kind of required because this won't work without nameplateShowFriendlyNPCs
if not DBM:HasMapRestrictions() and self.Options.NPAuraOnHaunting then
DBM:FireEvent("BossMod_EnableFriendlyNameplates")
end
end
if self.Options.NPAuraOnAbyss then
DBM:FireEvent("BossMod_EnableHostileNameplates")
end
if self.Options.InfoFrame then
DBM.InfoFrame:SetHeader(DBM:GetSpellInfo(307831))
Expand All @@ -136,6 +146,9 @@ function mod:OnCombatEnd()
SetCVar("nameplateShowFriendlyNPCs", CVAR2)
CVAR1, CVAR2 = nil, nil
end
if self.Options.NPAuraOnAbyss or self.Options.NPAuraOnHaunting then
DBM.Nameplate:Hide(true, nil, nil, nil, true, self.Options.NPAuraOnAbyss, not DBM:HasMapRestrictions())--isGUID, unit, spellId, texture, force, isHostile, isFriendly
end
end

function mod:SPELL_CAST_START(args)
Expand Down Expand Up @@ -223,6 +236,9 @@ function mod:SPELL_CAST_START(args)
else
warnTouchoftheAbyss:Show()
end
if self.Options.NPAuraOnAbyss then
DBM.Nameplate:Show(true, args.sourceGUID, 298033, nil, 7)
end
elseif spellId == 298630 and self:AntiSpam(3, 3) then
specWarnShockwave:Show()
specWarnShockwave:Play("shockwave")
Expand Down Expand Up @@ -286,6 +302,14 @@ function mod:SPELL_PERIODIC_DAMAGE(_, _, _, _, destGUID, _, _, _, spellId, spell
end
mod.SPELL_PERIODIC_MISSED = mod.SPELL_PERIODIC_DAMAGE

function mod:SPELL_INTERRUPT(args)
if type(args.extraSpellId) == "number" and args.extraSpellId == 298033 then
if self.Options.NPAuraOnAbyss then
DBM.Nameplate:Hide(true, args.destGUID, 298033)
end
end
end

function mod:UNIT_DIED(args)
local cid = self:GetCIDFromGUID(args.destGUID)
if cid == 152089 then--Thrall
Expand All @@ -303,6 +327,10 @@ function mod:UNIT_DIED(args)
elseif cid == 153943 then
timerSurgingFistCD:Stop()
timerDecimatorCD:Stop()
elseif cid == 153401 then--K'thir Dominator
if self.Options.NPAuraOnAbyss then
DBM.Nameplate:Hide(true, args.destGUID, 298033)
end
end
end

Expand Down Expand Up @@ -336,9 +364,16 @@ do
end

function mod:NAME_PLATE_UNIT_ADDED(unit)
if unit and UnitName(unit) == playerName and self:AntiSpam(2, 2) then--Throttled because sometimes two spawn at once
specWarnHauntingShadows:Show()
specWarnHauntingShadows:Play("runaway")
if unit and UnitName(unit) == playerName then--Throttled because sometimes two spawn at once
if self:AntiSpam(2, 2) then
specWarnHauntingShadows:Show()
specWarnHauntingShadows:Play("runaway")
end
local guid = UnitGUID(unit)
if not DBM:HasMapRestrictions() and self.Options.NPAuraOnHaunting and guid then
DBM.Nameplate:Show(true, guid, 306545, nil, 5)
end
end
end
mod.FORBIDDEN_NAME_PLATE_UNIT_ADDED = mod.NAME_PLATE_UNIT_ADDED--Just in case blizzard fixes map restrictions

42 changes: 38 additions & 4 deletions DBM-Challenges/BfA/NzothVisionStormwind.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod:RegisterEventsInCombat(
"SPELL_CAST_SUCCESS 309035",
"SPELL_PERIODIC_DAMAGE 312121 296674 308807 313303",
"SPELL_PERIODIC_MISSED 312121 296674 308807 313303",
"SPELL_INTERRUPT",
"UNIT_DIED",
"ENCOUNTER_START",
"UNIT_SPELLCAST_SUCCEEDED",
Expand Down Expand Up @@ -84,6 +85,8 @@ local timerVoidEruptionCD = mod:NewCDTimer(27.9, 309819, nil, nil, nil, 2)
--local timerChainsofServitudeCD = mod:NewCDTimer(32.9, 298691, nil, nil, nil, 2)

mod:AddInfoFrameOption(307831, true)
mod:AddNamePlateOption("NPAuraOnHaunting", 306545)
mod:AddNamePlateOption("NPAuraOnAbyss", 298033)

--Antispam 1: Boss throttles, 2: GTFOs, 3: Dodge stuff on ground. 4: Face Away/special action. 5: Dodge Shockwaves

Expand All @@ -99,14 +102,21 @@ function mod:OnCombatStart(delay)
self.vb.UlrokCleared = false
self.vb.ShawCleared = false
self.vb.UmbricCleared = false
if self.Options.SpecWarn306545dodge then
if self.Options.SpecWarn306545dodge3 then
--This warning requires friendly nameplates, because it's only way to detect it.
CVAR1, CVAR2 = GetCVar("nameplateShowFriends ") or 0, GetCVar("nameplateShowFriendlyNPCs") or 0
--Check if they were disabled, if disabled, force enable them
if (CVAR1 == 0) or (CVAR2 == 0) then
SetCVar("nameplateShowFriends", 1)
SetCVar("nameplateShowFriendlyNPCs", 1)
end
--Making this option rely on another option is kind of required because this won't work without nameplateShowFriendlyNPCs
if not DBM:HasMapRestrictions() and self.Options.NPAuraOnHaunting then
DBM:FireEvent("BossMod_EnableFriendlyNameplates")
end
end
if self.Options.NPAuraOnAbyss then
DBM:FireEvent("BossMod_EnableHostileNameplates")
end
if self.Options.InfoFrame then
DBM.InfoFrame:SetHeader(DBM:GetSpellInfo(307831))
Expand All @@ -123,6 +133,9 @@ function mod:OnCombatEnd()
SetCVar("nameplateShowFriendlyNPCs", CVAR2)
CVAR1, CVAR2 = nil, nil
end
if self.Options.NPAuraOnAbyss or self.Options.NPAuraOnHaunting then
DBM.Nameplate:Hide(true, nil, nil, nil, true, self.Options.NPAuraOnAbyss, not DBM:HasMapRestrictions())--isGUID, unit, spellId, texture, force, isHostile, isFriendly
end
end

function mod:SPELL_CAST_START(args)
Expand Down Expand Up @@ -170,6 +183,9 @@ function mod:SPELL_CAST_START(args)
else
warnTouchoftheAbyss:Show()
end
if self.Options.NPAuraOnAbyss then
DBM.Nameplate:Show(true, args.sourceGUID, 298033, nil, 7)
end
elseif spellId == 308406 then
warnEntropicLeap:Show()
elseif spellId == 311456 and self:AntiSpam(3, 5) then
Expand Down Expand Up @@ -256,6 +272,14 @@ function mod:SPELL_PERIODIC_DAMAGE(_, _, _, _, destGUID, _, _, _, spellId, spell
end
mod.SPELL_PERIODIC_MISSED = mod.SPELL_PERIODIC_DAMAGE

function mod:SPELL_INTERRUPT(args)
if type(args.extraSpellId) == "number" and args.extraSpellId == 298033 then
if self.Options.NPAuraOnAbyss then
DBM.Nameplate:Hide(true, args.destGUID, 298033)
end
end
end

function mod:UNIT_DIED(args)
local cid = self:GetCIDFromGUID(args.destGUID)
if cid == 152718 then--Alleria Windrunner
Expand All @@ -276,6 +300,10 @@ function mod:UNIT_DIED(args)
elseif cid == 158035 then--Magister Umbric
--timerTaintedPolymorphCD:Stop()
self.vb.UmbricCleared = true
elseif cid == 156795 then--S.I. Informant
if self.Options.NPAuraOnAbyss then
DBM.Nameplate:Hide(true, args.destGUID, 298033)
end
end
end

Expand Down Expand Up @@ -324,9 +352,15 @@ do
end

function mod:NAME_PLATE_UNIT_ADDED(unit)
if unit and UnitName(unit) == playerName and self:AntiSpam(2, 2) then--Throttled because sometimes two spawn at once
specWarnHauntingShadows:Show()
specWarnHauntingShadows:Play("runaway")
if unit and UnitName(unit) == playerName then--Throttled because sometimes two spawn at once
if self:AntiSpam(2, 2) then
specWarnHauntingShadows:Show()
specWarnHauntingShadows:Play("runaway")
end
local guid = UnitGUID(unit)
if not DBM:HasMapRestrictions() and self.Options.NPAuraOnHaunting and guid then
DBM.Nameplate:Show(true, guid, 306545, nil, 5)
end
end
end
mod.FORBIDDEN_NAME_PLATE_UNIT_ADDED = mod.NAME_PLATE_UNIT_ADDED--Just in case blizzard fixes map restrictions
Expand Down

0 comments on commit 51bfc3b

Please sign in to comment.