Ir para conteúdo

Posts Recomendados

Oque Ele Faz: Quando vc botar o spellbook na mao. Ele vai te dar uma quantidade X de Mana ou Health.

 

~Começando~

Nesse Exemplo eu Utilizei o SpellBook da Inquisition [ spellbook_of_dark_mysteries.gif [iD: 8918] ]

 

Entao vc devera escolher o Item que vc quer usar para dar health ou mana.

Pronto Escolheu ? Agora guarde o ID desse item

~Configurando~

 

Va Para \data\movements\scripts crie um arquivo lua chamado spellbook. Cole isso Dentro

function onEquip(cid, item, slot)

setPlayerStorageValue(cid, 19853, -1)
doHealPlayer(cid)
return TRUE
end

function doHealPlayer(cid)
local delay = 5 --

if getPlayerStorageValue(cid, 19853) == -1 then
doCreatureAddHeatlh(cid, 100)
addEvent(doHealPlayer, delay*1000, cid)
end
return TRUE
end

function onDeEquip(cid, item, slot)

setPlayerStorageValue(cid, 19853, 1)
return TRUE
end

 

Aqui vc Escolhera:

 

doCreatureAddHeatlh(cid, 100) - o Quanto De Health , Se quiser que heale mana: doCreatureAddMana(cid, 100)

local delay = 5 o tempo em segundos.

 

Salve e Feche!

 

Adicione isso em movements.xml

<movevent type="Equip" itemid="8918" slot="shield" event="script" value="spellbook.lua"/>
<movevent type="DeEquip" itemid="8918" slot="shield" event="script" value="spellbook.lua"/>

 

slot="shield": Aqui sera para onde o item sera movido, nesse exemplo Shield

value="spellbook.lua"/>: Nome do Arquivo Lua que Vc Crio.

itemid="8918": ID do seu Item

 

Possiveis Bugs: A mana ou health pode dobrar.

Creditos: Kimoszin - Demonbholder.

 

 

Abraços

Se Gostaram ou Ajudei +REP

Link para o comentário
https://xtibia.com/forum/topic/152325-moveevents-mana-health-em-itens/
Compartilhar em outros sites

×
×
  • Criar Novo...