Script: Monstro após a morte
Função: Ao morrer o cadaver do player se torna em um zombie!
(ps. Você pode configurar o monstro que ele vai se tornar, e talz)
Print:

Script:
Primeiro vai em creaturescripts/creaturescript.xml e dentro coloque isso:
<event type="death" name="Zombie" event="script" value="zombiedeath.lua"/>
<event type="look" name="ZombieLook" event="script" value="zombiedeath.lua"/>
Depois, em creaturescript, crie um arquivo chamado zombiedeath.lua e dentro coloque isso:
local monsters = {"zombie", "ghoul", "ghost", "spectre"} --Aqui você configura os monstros
local storage = 325
function onDeath(cid, corpse, deathList)
local outfit = getCreatureOutfit(cid)
local health = getCreatureMaxHealth(cid)
local pos = getThingPos(cid)
local name = getCreatureName(cid)
local sex = getPlayerSex(cid)
local voc = getPlayerVocationName(cid)
doRemoveItem(corpse.uid)
x = doCreateMonster(monsters[math.random(#monsters)], pos)
doPlayerSetStorageValue(x, storage, name.."'s "..getCreatureName(x)..". "..(sex == 0 and "She" or "He").." was a "..voc)
setCreatureMaxHealth(x, health)
doCreatureAddHealth(x, health - getCreatureHealth(x))
doSendMagicEffect(pos, CONST_ME_SMALLCLOUDS)
doCreatureChangeOutfit(x, outfit)
return false
end
function onLook(cid, thing, position, lookDistance)
if (isMonster(thing.uid) and getPlayerStorageValue(thing.uid, storage) ~= -1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see "..getPlayerStorageValue(thing.uid, storage))
return false
end
return true
end
Após feito isso, registre o script em login.lua:
registerCreatureEvent(cid, "Zombie")
registerCreatureEvent(cid, "ZombieLook")
Antes que venha esta pergunta, que eu sei que viria:
- O que aconteçe se morrer envenenado na protection zone?
Simplesmente o monstro não irá nascer.