Skip to content

Commit

Permalink
feat(SplashEnemies): Fix Liquid Magma Totem; Add Tempest
Browse files Browse the repository at this point in the history
- There's probably a better way to handle LMT. Since the damage comes from a non-pet creature, it wasn't being counted. I created a table of override spells that remove the FriendTargetGUID check.
  • Loading branch information
Cilraaz committed Sep 4, 2024
1 parent a5fd4c4 commit 9ef821b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions HeroLib/Events/SplashEnemies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,16 @@ do
-- Stop processing if the event is not corresponding to the type of the NucleusAbility.
if Event ~= "SPELL_DAMAGE" and NucleusAbility.Type ~= "PeriodicDamage" then return end

-- Table of spells to override valid SourceGUID check.
local OverrideSpells = {
192231, -- Liquid Magma Totem
383061, -- Liquid Magma Totem
}
local OverrideSourceGUID = Utils.ValueIsInTable(OverrideSpells, SpellID)

-- Check if the SourceGUID is valid.
local FriendTargetGUID = FriendTargets[SourceGUID]
if not FriendTargetGUID then return end
if not FriendTargetGUID and not OverrideSourceGUID then return end

-- Retrieve the buffer or create it.
local Buffer = TrackerBuffer[SpellID][SourceGUID]
Expand All @@ -155,7 +162,8 @@ do
if Event ~= "SPELL_DAMAGE" and Event ~= "SPELL_PERIODIC_DAMAGE" then return end

-- HL.Print("[SplashEnemies] Creating buffer for SpellID '" .. SpellID .. "' from SourceGUID '" .. SourceGUID .. "'.")
Buffer = { FirstTime = GetTime(), FriendTargetGUID = FriendTargetGUID, FirstDestGUID = DestGUID, Enemies = { { GUID = DestGUID, LastTime = GetTime(), LastSpellID = SpellID } } }
local ValidFriendTarget = (OverrideSourceGUID) and DestGUID or FriendTargetGUID
Buffer = { FirstTime = GetTime(), FriendTargetGUID = ValidFriendTarget, FirstDestGUID = DestGUID, Enemies = { { GUID = DestGUID, LastTime = GetTime(), LastSpellID = SpellID } } }
TrackerBuffer[SpellID][SourceGUID] = Buffer

-- Stop here since we already process the enemy on buffer creation
Expand Down Expand Up @@ -544,7 +552,9 @@ function Splash.RegisterNucleusAbilities()
-- Elemental
RegisterNucleusAbility("DirectDamage", 188443, 10) -- Chain Lightning
RegisterNucleusAbility("DirectDamage", 77478, 8) -- Earthquake
RegisterNucleusAbility("DirectDamage", 192231, 8) -- Liquid Magma Totem
RegisterNucleusAbility("DirectDamage", 192231, 9) -- Liquid Magma Totem
RegisterNucleusAbility("DirectDamage", 383061, 9) -- Liquid Magma Totem 2
RegisterNucleusAbility("DirectDamage", 452201, 8) -- Tempest
-- Enhancement
RegisterNucleusAbility("DirectDamage", 187874, 8) -- Crash Lightning
RegisterNucleusAbility("DirectDamage", 197214, 11) -- Sundering
Expand Down

0 comments on commit 9ef821b

Please sign in to comment.