Skip to content

Commit 47a6834

Browse files
[lua] Set fixed spawn position for colonization reive mobs
1 parent 1d48ff9 commit 47a6834

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

scripts/globals/colonization_reives.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ xi.reives.enableReive = function(zoneID, reiveNum)
145145
for _, entryId in pairs(reiveData.mob) do
146146
local mob = GetMobByID(entryId)
147147
if mob then
148+
mob:setFixedSpawnPosition(true)
149+
148150
if not mob:isAlive() then
149151
SpawnMob(entryId) -- Spawn the reive defenders
150152
-- TODO: Set name flags (sword)

scripts/zones/RuAun_Gardens/mobs/Groundskeeper.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ entity.onMobDespawn = function(mob)
2424
local params = {}
2525
params.immediate = true
2626
if xi.mob.phOnDespawn(mob, ID.mob.DESPOT, 5, 7200, params) then -- 2 hours
27-
local phId = mob:getID()
28-
GetMobByID(ID.mob.DESPOT):addListener('SPAWN', 'PH_VAR', function(m)
29-
m:setLocalVar('ph', phId)
30-
end)
27+
local phId = mob:getID()
28+
local despot = GetMobByID(ID.mob.DESPOT)
29+
30+
if despot then
31+
despot:addListener('SPAWN', 'PH_VAR', function(m)
32+
m:setLocalVar('ph', phId)
33+
end)
34+
end
3135
end
3236
end
3337

0 commit comments

Comments
 (0)