• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

MoveEvent Experience Rate Ring

Status
Not open for further replies.

barker

HHHHH
Joined
Nov 23, 2007
Messages
1,298
Reaction score
24
Releasing a experience rate ring:)
Its based on Slawkens exp rate rune but "re-constructured" it to work as a ring instead ;d

script.lua (data/movements/scripts)
Lua:
local config = {

        rate            = 2.0,  -- 2.0 = 2x faster than normal.
        un_equip        = 6300, -- Item ID of the UN-Equipped ring.
        equip           = 6301  -- Item ID of the Equipped ring.
       
}

function onDeEquip(cid, item, slot)
        doPlayerSetExperienceRate(cid, 1.0)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
        doTransformItem(item.uid, config.un_equip)
        return true
end

function onEquip(cid, item, slot)
        if getConfigValue("experienceStages") == "yes" then
           doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
        else
           doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2)
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.")
        doTransformItem(item.uid, config.equip)
        doDecayItem(item.uid)
        return true
end

NOTE: This script was created by barker and updated by Guitar Freak -> credits to both of them![/QUOTE][/CODE]

movements.xml
Code:
<movevent type="Equip" itemid="6301" slot="ring" event="function" value="onEquipItem"/>
<movevent type="Equip" itemid="6300" slot="ring" event="script" value="script.lua"/>
<movevent type="DeEquip" itemid="6301" slot="ring" event="script" value="script.lua"/>

Just change the item id's to the rings of your likings. To edit ring duration, ring name and such, "visit" items.xml.



TESTED OFC AND WORKS ON TFS 0.3.5 PL1
 
Last edited:
Does this work?

Code:
local cfg = {
    rate = 5.0
    ringOn = 6301
    ringOff = 6300
}
	
function onDeEquip(cid, item, slot)
    if (item.itemid == cfg.ringOn) then
        doPlayerSetExperienceRate(cid, - cfg.rate)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ended your extra experience.") 
	doTransformItem(item.uid, cfg.ringOff)
    end 
end 

function onEquip(cid, item, slot) 
    if(item.itemid == cfg.ringOff) then 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated. It is now: " .. cfg.rate .. "x.") 
	doPlayerSetExperienceRate(cid, + cfg.rate)
	doTransformItem(item.uid, cfg.ringOn)
	return true
    end
end
 
i don't think those + and - will work fine
 
what about this one?
Lua:
local cfg = {
    rate = 5.0
    ringOn = 6301
    ringOff = 6300
}
    
function onDeEquip(cid, item, slot)
    if (item.itemid == cfg.ringOn) then
        doPlayerSetExperienceRate(cid, getConfigValue("rateExperience"))
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ended your extra experience.") 
        doTransformItem(item.uid, cfg.ringOff)
    end 
end 

function onEquip(cid, item, slot) 
    if(item.itemid == cfg.ringOff) then 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated. It is now: " .. cfg.rate .. "x.") 
        doPlayerSetExtraExpRate(cid, rate)
        doTransformItem(item.uid, cfg.ringOn)
    end
end
 
If you use experience stages, it will give more experience based on the stage?
 
If you use experience stages, it will give more experience based on the stage?

Yes, doubles ur current exp rate =p or triples.. depending on ur setting.. you can choose urself
 
If I set a ring with time, and it dissapears when equiped, the exp rate will be normal?
 
i got a problem

Hello

Excellent script, but i got a problem...

When i use the ring in my character the ring doesn't put in the ring slot.

The ring says "You canno't dress this here."

I know the problem come from movements.xml but when i try to repair it, using:

Code:
<movevent type="Equip" itemid="7697" slot="ring" event="function" value="onEquipItem"/>

It says that the ID is duplicated.

All what i write in movements.xml is this:

Code:
	<movevent type="Equip" itemid="7708" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="7697" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="7697" slot="ring" event="script" value="anilloexp.lua"/>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="anilloexp.lua"/>

How i can fix it? if i don't write the "onEquipItem" the ring doesn't put in the ring slot so the player have infinite double exp time. But if i write both, only 1 work because is duplicated..

Help Please!

Sorry for my bad english!
 
Hello

Excellent script, but i got a problem...

When i use the ring in my character the ring doesn't put in the ring slot.

The ring says "You canno't dress this here."

I know the problem come from movements.xml but when i try to repair it, using:

Code:
<movevent type="Equip" itemid="7697" slot="ring" event="function" value="onEquipItem"/>

It says that the ID is duplicated.

All what i write in movements.xml is this:

Code:
	<movevent type="Equip" itemid="7708" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="7697" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="7697" slot="ring" event="script" value="anilloexp.lua"/>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="anilloexp.lua"/>

How i can fix it? if i don't write the "onEquipItem" the ring doesn't put in the ring slot so the player have infinite double exp time. But if i write both, only 1 work because is duplicated..

Help Please!

Sorry for my bad english!
Its because your ring has one type only ;p won't work. "signet ring". My proposal is to use death ring, but just change its name and remove it from lootlist in nightmare and so on. Because none uses it anyway xD
 
T.T oks.. Thank you very much! i'll try it

---

I tried but.. it still don't work, i need to have the:

Code:
	<movevent type="Equip" itemid="6300" slot="ring" event="function" value="onEquipItem"/>

But if i write that i the ring don't work beceause it disable

Code:
<movevent type="Equip" itemid="6300" slot="ring" event="script" value="anilloexp.lua"/>

:/!
 
Last edited:
when i create the ring with my admin the server just crashes tfs 0.3.6 any idea why? pls help
 
Maybe you should update your script.

Lua:
local config = {

        rate            = 2.0,  -- 2.0 = 2x faster than normal.
        un_equip        = 6300, -- Item ID of the UN-Equipped ring.
        equip           = 6301  -- Item ID of the Equipped ring.
       
}

function onDeEquip(cid, item, slot)
        doPlayerSetExperienceRate(cid, 1.0)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
        doTransformItem(item.uid, config.un_equip)
        return true
end

function onEquip(cid, item, slot)
        if getConfigValue("experienceStages") == "yes" then
           doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
        else
           doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2)
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.")
        doTransformItem(item.uid, config.equip)
        doDecayItem(item.uid)
        return true
end

NOTE: This script was created by barker and updated by Guitar Freak -> credits to both of them!
 
Last edited:
Status
Not open for further replies.
Back
Top