local bossForms = {
['ferumbras soul splinter'] = {
text = 'IT\'S NOT THAT EASY MORTALS! FEEL THE POWER OF THE GOD!',
newForm = 'desestabilized ferumbras'
},
['desestabilized ferumbras'] = {
text = 'NOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!',
newForm = 'ferumbras mortal shell'
}
}
function onKill(player, target)
print(1)
local targetMonster = target:getMonster()
if not targetMonster then
print(2)
return true
end
print(3)
if targetMonster:getName():lower() == 'ferumbras mortal shell' then
print(4)
return true
end
print(5)
local name = targetMonster:getName():lower()
local bossConfig = bossForms[name]
if not bossConfig then
print(6)
return true
end
print(7)
local found = false
for k, v in ipairs(Game.getSpectators(targetMonster:getPosition())) do
if v:getName():lower() == bossConfig.newForm then
print(8)
found = true
break
end
end
print(9)
if not found then
print(10)
Game.createMonster(bossConfig.newForm, targetMonster:getPosition(), false, true)
player:say(bossConfig.text, TALKTYPE_MONSTER_SAY)
end
print(11)
return true
end