local configs = {
percent = 1.5, -- percent of max mana that will be added
interval = 1*1000, -- time to add mana again
storage = 12002
}
local function addMana(cid, interval, storage, perc)
if(getPlayerStorageValue(cid,storage) == 1)then
if (getCreatureMana(cid) < getCreatureMaxMana(cid)) then
doCreatureAddMana(cid, getCreatureMaxMana(cid)/100*perc)
end
addEvent(addMana, interval, cid, interval,storage,perc)
end
return true
end
function onEquip(cid, item, slot)
setPlayerStorageValue(cid,configs.storage,1)
addEvent(addMana, 0, cid, configs.interval,configs.storage,configs.percent)
return true
end
function onDeEquip(cid, item, slot)
stopEvent(addMana)
setPlayerStorageValue(cid,configs.storage,0)
return false
end