Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <mod name="Booster De Exp" version="1.0" author="none" contact="none.com" enabled="yes">
- <config name="exppotion"><![CDATA[
- exp_info = {rate = 1, storage = {354870,354871,354872}, minutes = 120} -- rate 1 eh 50%
- function convertTime(a)
- if(type(tonumber(a)) == "number" and a > 0) then
- if (a <= 3599) then
- local minute = math.floor(a/60)
- local second = a - (60 * minute)
- if(second == 0) then
- return ((minute)..((minute > 1) and " minutos" or " minuto"))
- else
- return ((minute ~= 0) and ((minute>1) and minute.." minutos e " or minute.." minuto e ").. ((second>1) and second.." segundos" or second.." segundo") or ((second>1) and second.." segundos" or second.. " segundo"))
- end
- else
- local hour = math.floor(a/3600)
- local minute = math.floor((a - (hour * 3600))/60)
- local second = (a - (3600 * hour) - (minute * 60))
- if (minute == 0 and second > 0) then
- return (hour..((hour > 1) and " horas e " or " hora e "))..(second..((second > 1) and " segundos" or " segundo"))
- elseif (second == 0 and minute > 0) then
- return (hour..((hour > 1) and " horas e " or " hora e "))..(minute..((minute > 1) and " minutos" or " minuto"))
- elseif (second == 0 and minute == 0) then
- return (hour..((hour > 1) and " horas" or " hora"))
- end
- return (hour..((hour > 1) and " horas, " or " hora, "))..(minute..((minute > 1) and " minutos e " or " minuto e "))..(second..((second > 1) and " segundos" or " segundo"))
- end
- end
- end
- ]]></config>
- <event type="login" name="ExpPotionLogin" event="script"><![CDATA[
- domodlib('exppotion')
- function onLogin(cid)
- if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then
- registerCreatureEvent(cid, "ExpPotionThink")
- local rates = getPlayerRates(cid)
- doCreatureSay(cid, "Voce ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Booster De Exp", TALKTYPE_ORANGE_1, true, cid)
- doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate)
- setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro
- end
- return true
- end]]></event>
- <event type="think" name="ExpPotionThink" event="script"><![CDATA[
- domodlib('exppotion')
- function onThink(cid, interval)
- if getPlayerStorageValue(cid, exp_info.storage[3]) > 0 and getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 then
- doCreatureSay(cid, "Seu booster de exp acabou!", TALKTYPE_ORANGE_1, true, cid)
- doPlayerSetExperienceRate(cid, getPlayerStorageValue(cid, exp_info.storage[2]))
- setPlayerStorageValue(cid, exp_info.storage[3], 0) -- registro
- end
- return true
- end]]></event>
- <talkaction words="!boosterexp" event="buffer"><![CDATA[
- domodlib('exppotion')
- return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() <= 0 and "Nenhum Booster De Exp ativa" or "Voce tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Booster De Exp")]]></talkaction>
- <action itemid="15876" event="script"><![CDATA[
- domodlib('exppotion')
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if getPlayerStorageValue(cid, exp_info.storage[1]) - os.time() > 0 then
- doCreatureSay(cid, "Voce ainda tem "..convertTime(getPlayerStorageValue(cid, exp_info.storage[1]) - os.time()).." de Booster De Exp", TALKTYPE_ORANGE_1, true, cid) return true
- end
- local rates = getPlayerRates(cid)
- setPlayerStorageValue(cid, exp_info.storage[2], rates[SKILL__LEVEL])
- doCreatureSay(cid, "Booster De Exp de ["..exp_info.minutes.." min] foi ativado!", TALKTYPE_ORANGE_1, true, cid)
- setPlayerStorageValue(cid, exp_info.storage[1], os.time()+exp_info.minutes*60)
- setPlayerStorageValue(cid, exp_info.storage[3], 1) -- registro
- doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]+exp_info.rate)
- registerCreatureEvent(cid, "ExpPotionThink")
- doRemoveItem(item.uid,1)
- return true
- end]]></action>
- </mod>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement