View difference between Paste ID: CyUi36yz and 2Ji70QLn
SHOW: | | - or go back to the newest paste.
1
local config = {
2
3
        rate            = 0.25,  -- 2.0 = 2x faster than normal.
4
        un_equip        = 7697, -- Item ID of the UN-Equipped ring.
5
        equip           = 7708,  -- Item ID of the Equipped ring.
6
		level           = 13
7
       
8
}
9
 
10
function onDeEquip(cid, item, slot)
11
        doPlayerSetExperienceRate(cid, 1.0)
12
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
13
        doSendMagicEffect(getThingPos(cid), 32)
14
        doTransformItem(item.uid, config.un_equip)
15
        return true
16
end
17
 
18
function onEquip(cid, item, slot)
19
if(getPlayerLevel(cid) >= config.level) then
20
        if getConfigValue("experienceStages") == "yes" then
21
           doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*0.001)
22
        else
23
           doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*0.25)
24
        end
25
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.")
26
	    doSendMagicEffect(getThingPos(cid), 29)
27
        doTransformItem(item.uid, config.equip)
28
        doDecayItem(item.uid)
29
        return true
30
else
31
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need " .. config.level .. " level" .. " to wear this item.")
32
		return false
33
end	
34
end