function getTime(s)
local n = math.floor(s / 60)
s = s - (60 * n)
return n, s
end
CreatureEventChecker = function(event, ...) -- Colex
if isCreature(arg[1]) then
event(unpack(arg))
end
end
creatureEvent = function(event, delay, ...) -- Colex
addEvent(CreatureEventChecker, delay, event, unpack(arg))
end
function onUse(cid,item,frompos,item2,topos)
------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE
configs = {
time = 15, ---- TIME IN MINUTES
needpa = FALSE,
needlvl = {FALSE, level = 50},
costmana = {FALSE, mana = 300},
removeonuse = TRUE
}
----------------------------------
--------- Nao Mude --------------
if getPlayerStorageValue(cid, 62164) >= 1 then
return doPlayerSendCancel(cid, "Voc? j? est? sobre o efeito deste item.")
end
if configs.needpa and not isPremium(cid) then
return doPlayerSendCancel(cid, "Voc? precisa ser premium account para usar esse item.")
end
if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then
return doPlayerSendCancel(cid, "Voc? precisa ter level " .. configs.needlvl.level .. " para usar este item.")
end
if configs.costmana[1] then
if getCreatureMana(cid) < configs.costmana.mana then
return doPlayerSendCancel(cid, "Voc? precisa de " .. configs.costmana.mana .. " de mana para usar este item.")
else
doCreatureAddMana(cid, -configs.costmana.mana)
end
end
if configs.removeonuse then
doRemoveItem(item.uid, 1)
end
for i = configs.time*60, 1, -1 do
local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))
if #a < 4 then
a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)
end
if i == configs.time*60 then
creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "O efeito da Potion de Double EXP terminou.")
end
creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "O efeito da Potion de Double EXP ser? finalizado em "..a..".")
end
doPlayerSetExperienceRate(cid, 2)
creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1)
doSendMagicEffect(getPlayerPosition(cid), 28)
doCreatureSay(cid,'Potion de Double EXP ativada!', TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 62164, os.time())
creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62164, 0)
return TRUE
end
taki skrypt mam tylko ?e by? sobie przet?umaczy? musia? xd