D
Deleted member 141899
Guest
Hi friends,
Have a problem with this script here on the last boss of wote in which to kill the "Snake God Essence" it will summoning new forms ..
The problem is that it seems that onKill function is not correctly running "LastHit" I think there is no such parameter in tfs 1.1 ... that is, if two people kill the boss, the event runs twice, leading to summon multiple bosses : S ..
Already I tried to change the function to onDeath and onPrepareDeath but as I am not very experienced in lua it still fails ..
can someone help me please?
Have a problem with this script here on the last boss of wote in which to kill the "Snake God Essence" it will summoning new forms ..
The problem is that it seems that onKill function is not correctly running "LastHit" I think there is no such parameter in tfs 1.1 ... that is, if two people kill the boss, the event runs twice, leading to summon multiple bosses : S ..
Already I tried to change the function to onDeath and onPrepareDeath but as I am not very experienced in lua it still fails ..
Code:
local bossForms = {
['snake god essence'] = {
text = 'IT\'S NOT THAT EASY MORTALS! FEEL THE POWER OF THE GOD!',
newForm = 'snake thing'
},
['snake thing'] = {
text = 'NOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!',
newForm = 'lizard abomination'
},
['lizard abomination'] = {
text = 'YOU ... WILL ... PAY WITH ETERNITY ... OF AGONY!',
newForm = 'mutated zalamon'
}
}
function onKill(player, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
if targetMonster:getName():lower() == 'mutated zalamon' then
Game.setStorageValue(Storage.WrathoftheEmperor.Mission11, -1)
return true
end
local bossConfig = bossForms[targetMonster:getName():lower()]
if not bossConfig then
return true
end
Game.createMonster(bossConfig.newForm, targetMonster:getPosition(), false, true)
player:say(bossConfig.text, TALKTYPE_MONSTER_SAY)
return true
end
can someone help me please?