Ir para conteúdo
  • 0

[Spell] Lich


Vorkhon

Pergunta

Eu quero saber se tem como adicionar esse Creature Script em uma Magia. A ideia seria o player usar a magia e se ele morrer dentro de 20 segundos ele vira um monstro, e esse monstro dura 1 minuto.

 

Aqui vai a base que eu achei em outro post, mas sem a condição de tempo:

 

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

 

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...