MoveEvent Experience Rate Ring

Status
Not open for further replies.

barker

HHHHH
Joined
Nov 23, 2007
Messages
1,298
Best answers
0
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:

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
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
 
OP
barker

barker

HHHHH
Joined
Nov 23, 2007
Messages
1,298
Best answers
0
Reaction score
24
Hmm.. Duno, test it! xP
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
851
Location
Caribbean Sea
i don't think those + and - will work fine
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
851
Location
Caribbean Sea
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
 

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,772
Best answers
1
Reaction score
210
Location
Chile, Santiago
If you use experience stages, it will give more experience based on the stage?
 
OP
barker

barker

HHHHH
Joined
Nov 23, 2007
Messages
1,298
Best answers
0
Reaction score
24
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
 

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,772
Best answers
1
Reaction score
210
Location
Chile, Santiago
If I set a ring with time, and it dissapears when equiped, the exp rate will be normal?
 

armitxe

New Member
Joined
Feb 15, 2009
Messages
65
Best answers
0
Reaction score
1
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!
 
OP
barker

barker

HHHHH
Joined
Nov 23, 2007
Messages
1,298
Best answers
0
Reaction score
24
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
 

armitxe

New Member
Joined
Feb 15, 2009
Messages
65
Best answers
0
Reaction score
1
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:

swistak92

New Member
Joined
Dec 30, 2009
Messages
2
Best answers
0
Reaction score
0
when i create the ring with my admin the server just crashes tfs 0.3.6 any idea why? pls help
 

Zyntax

*WannaBe Scripter*
Joined
Jan 27, 2010
Messages
533
Best answers
0
Reaction score
36
Location
Lua & XML Section
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.
Top