function onUse(cid, item, fromPosition, itemEx, toPosition)
--- configuration by notle
local min = 1999 --- minimo que vai curar com menos 1000 de lvl
local max = 2000 --- maximo que vai curar com menos 1000 de lvl
local min300 = 3999 --- minimo que vai curar com lvl 2000
local max300 = 4000 --- maximo que vai curar com lvl 2000
local min500 = 5999 --- minimo que vai curar com lvl 3000
local max500 = 6000 --- maximo que vai curar com lvl 3000
local exhaust = 1100 -- Tempo para player poder se curar novamente! (1000 por segundos)
local lvl1,lvl2,lvl3 = 1999,2999,3000 -- modificação de level
--- configuration by notle
if (getPlayerStorageValue(cid, 14725) <= os.time()) then
if getPlayerLevel(cid) <= lvl1 then
doPlayerAddMana(itemEx.uid, math.random(min, max))
elseif getPlayerLevel(cid) >= lvl1+1 and getPlayerLevel(cid) <= lvl2 then
doPlayerAddMana(itemEx.uid, math.random(min300, max300))
elseif getPlayerLevel(cid) >= lvl3 then
doPlayerAddMana(itemEx.uid, math.random(min500, max500))
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 14722, os.time()+exhaust/1000)
else
doPlayerSendCancel(cid, "Desculpe, você só pode se curar novamente depois de "..exhaust.." segundos.")
end
end
end
lvl 1000 cura 1999 a 2000
lvl 2000 cura 3999 a 4000
lvl 3000 cura 5999 a 6000
function onUse(cid, item, fromPosition, itemEx, toPosition)
--- configuration by notle
local config = {
level = 1000, min = 1000, max = 2000, -- fico mais facil pra vc editar :D
level2 = 2000, min2 = 3000, max2 = 4000, -- fico mais facil pra vc editar :D
level3 = 3000, min3 = 5000, max3 = 6000, -- fico mais facil pra vc editar :D
level4 = 4000, min4 = 7000, max4 = 8000} -- fico mais facil pra vc editar :D
local exhaust = 1100 -- Tempo para player poder se curar novamente! (1000 por segundos)
--- configuration by notle
if (getPlayerStorageValue(cid, 14725) <= os.time()) then
if getPlayerLevel(cid) <= config.level and doPlayerAddMana(itemEx.uid, math.random(config.min, config.max)) or getPlayerLevel(cid) <= config.level2 and doPlayerAddMana(itemEx.uid, math.random(config.min2, config.max2)) or getPlayerLevel(cid) <= config.level3 and doPlayerAddMana(itemEx.uid, math.random(config.min3, config.max3))or getPlayerLevel(cid) >= config.level4 and doPlayerAddMana(itemEx.uid, math.random(config.min4, config.max4)) then
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 14725, os.time()+exhaust/1000)
return true
end
end
end
ambos funcionam e apenas um é menor que o outro,
fica a seu critério qual usar.
OBS: na hora de coloca id do potion
tem que ver se não já tem em
actions.xml
se não vai da erro
pq ja vai ter ID ligados em outros arquivos
só tirar deixa só nesse novo.







info
Grupo: Campones
Registrado: 27/08/12
Posts: 18
Reputação: 0
Alguém teria um script de potions que almenta o heal de acordo com o lvl do player por exemplo :
lvl 1k - heala 3k de mana
lvl 2k - heala 6k
E assim por diante ...
Se alguém tiver esse script me ajudaria muito , já tentei uns 2 scripts assim mas nenhum funcionou .