VO

[PEDIDO] Spell Ressurect

Por Vorkhon, 03 de set. de 2020 em Scripts

1
560
VorkhonV
03 de setembro de 2020 às 08:07

Ola eu me deparei com um creaturescript de que quando o player morre ele vira um zombie. Eu queria saber se é possivel transfromar isso em uma Spell que dure 30 segundos, ai se ele morrer nesse meio tempo ativa esse script.

 

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

 

Editado Setembro 3 por Vorkhon