@@ -187,6 +187,10 @@ local TIMERS = {
187187 }
188188}
189189
190+ local IND_REASONS = {
191+ SOUL_EATER_CAUGHT = 1 ,
192+ }
193+
190194local ROOM_CENTER = Vector3 .New (- 723.717773 , 186.834915 , - 265.187195 )
191195
192196local CARDINAL_MARKERS = {
456460function mod :OnSoulEaterCreated (id , unit , name )
457461 soulEaters [id ] = {
458462 id = id ,
459- orbit = currentSoulEater ,
463+ index = currentSoulEater ,
460464 unit = unit
461465 }
462466
@@ -472,10 +476,23 @@ function mod:OnSoulEaterCreated(id, unit, name)
472476end
473477
474478function mod :OnSoulEaterDestroyed (id , unit , name )
475- mod :RemoveSoulEaterOrbit (soulEaters [id ].orbit )
476479 soulEaters [id ] = nil
477480end
478481
482+ function mod :OnSoulEaterCaught (id , spellId , stacks , timeRemaining , name , unitCaster )
483+ if unitCaster and unitCaster :IsValid () then
484+ local index = soulEaters [unitCaster :GetId ()].index
485+ mod :RemoveSoulEaterOrbit (index )
486+ mod :SendIndMessage (IND_REASONS .SOUL_EATER_CAUGHT , index )
487+ end
488+ end
489+
490+ function mod :ReceiveIndMessage (from , reason , data )
491+ if reason == IND_REASONS .SOUL_EATER_CAUGHT then
492+ mod :RemoveSoulEaterOrbit (data )
493+ end
494+ end
495+
479496function mod :OnDevourSoulsStop ()
480497 soulEatersActive = false
481498 mod :RemoveSoulEaterOrbits ()
@@ -660,6 +677,9 @@ mod:RegisterUnitEvents(core.E.ALL_UNITS,{
660677 [core .E .DEBUFF_ADD ] = mod .OnSoulfireAdd ,
661678 [core .E .DEBUFF_REMOVE ] = mod .OnSoulfireRemove ,
662679 },
680+ [DEBUFFS .SOUL_EATER ] = {
681+ [core .E .DEBUFF_ADD ] = mod .OnSoulEaterCaught ,
682+ },
663683 [DEBUFFS .EXPULSION_OF_SOULS ] = {
664684 [core .E .DEBUFF_ADD ] = mod .OnExpulsionAdd ,
665685 },
0 commit comments