Skip to content

Commit ae64807

Browse files
committed
Add ICComm communication for caught soul eaters
1 parent 781f619 commit ae64807

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Encounters/RMT/Laveka.lua

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ local TIMERS = {
187187
}
188188
}
189189

190+
local IND_REASONS = {
191+
SOUL_EATER_CAUGHT = 1,
192+
}
193+
190194
local ROOM_CENTER = Vector3.New(-723.717773, 186.834915, -265.187195)
191195

192196
local CARDINAL_MARKERS = {
@@ -456,7 +460,7 @@ end
456460
function 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)
472476
end
473477

474478
function mod:OnSoulEaterDestroyed(id, unit, name)
475-
mod:RemoveSoulEaterOrbit(soulEaters[id].orbit)
476479
soulEaters[id] = nil
477480
end
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+
479496
function 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

Comments
 (0)