JO

(Pedido) Uh E Mana Por Actions

Por JohnColner, 25 de mar. de 2012 em Archived

2
618
JohnColnerJ
25 de março de 2012 às 18:37

Da uma força ai .. me ajudem to querendo uma Runa por actions que encha MP e HP.. vlw REP +

jhon992J
26 de março de 2012 às 12:59
function onUse(cid, item, fromPosition, itemEx, toPosition)

local min_hp = 100 -- minimo de life que ira encher
local max_hp = 200 -- maximo de life que ira encher

local min_mana = 100 -- minimo de mana que ira encher
local max_mana = 200 -- maximo de mana que ira encher

local effect = 30 -- efeito no player
local exhaust_sec = 2 -- exausted em segundos

if(exhaustion.check(cid, 34539) == TRUE) then
  doPlayerSendCancel(cid, "Voçê só pode usar após [" .. exhaustion.get(cid, 34539).."] segundos.")
return TRUE
end

doCreatureAddHealth(cid, math.random(min_hp,max_hp))
doCreatureAddMana(cid, math.random(min_mana,max_mana))
exhaustion.set(cid, 34539, exhaust_sec)
doRemoveItem(item.uid, 1)
doSendMagicEffect(getPlayerPosition(cid), effect)

return TRUE
end