pronto,usa esse que está funfando 100% !
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Exp Amulet" version="1.0" author="vodka" contact="xtibia.com" enabled="yes">
<config name="expamulet"><![CDATA[
info = {
rate = 3,
time = 5, -- Hours
storage = 20013
}
function endExpRate(cid)
if isPlayer(cid) == TRUE then
doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
setPlayerStorageValue(cid, info.storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Your extra experience time has ended.')
end
end
]]></config>
<event type="login" name="check_rate" event="script"><![CDATA[
domodlib('expamulet')
function onLogin(cid)
if getPlayerStorageValue(cid, info.storage) >= os.time() then
doPlayerSetRate(cid, SKILL__LEVEL, info.rate)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. os.date("%H", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ':' .. os.date("%M", math.floor(getPlayerStorageValue(cid, info.storage) - os.time())) .. ' hours.')
addEvent(endExpRate, math.floor(getPlayerStorageValue(cid, info.storage) - os.time())*3600*1000, cid)
end
return true
end]]></event>
<action itemid="10221" event="script"><![CDATA[
domodlib('expamulet')
function onUse(cid, item, frompos, item2, topos)
if (getPlayerStorageValue(cid, info.storage) <= os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Your extra experience rate is now: ' .. info.rate .. '. It will last for '.. info.time ..' hours.')
doPlayerSetRate(cid, SKILL__LEVEL, info.rate)
setPlayerStorageValue(cid, info.storage, os.time()+info.time*3600*1000)
addEvent(endExpRate, info.time *3600*1000, cid)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You still have extra experience time left.')
end
return true
end]]></action>
</mod>