Code: Select all
--call delayedDeath() when ready
function delayedDeath()
delayedCall(self.go.id, 2, "death")
end
function death()
if vampire_7 then
vampire_7:spawn('wall_fire')
vampire_7.monster:die()
end
end
Alternately:
Code: Select all
--This one can affect any monster
function delayedDeath(monsterId)
local monster = findEntity(monsterId)
if monster then
monster:spawn('wall_fire')
monster.brain:disable()
delayedCall(self.go.id, 5, 'death', monsterId)
end
end
function death(monsterId)
local monster = findEntity(monsterId)
if monster then
monster.monster:die()
monster:playSound('party_fall')
end
end
--call delayedDeath when ready
delayedDeath('vampire_7')