• 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!

Exp Ring

Status
Not open for further replies.

rangoo

New Member
Joined
Jan 9, 2010
Messages
7
Reaction score
0
Hi!
TFS 0.3.6...
I have that script; and i have question: why does not work duration of ring??? I set it to 500 minutes, and it doesn't go down. :/

movement.xml
PHP:
	<!-- Exp Ring -->
	<movevent type="Equip" itemid="6301" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="6300" slot="ring" event="script" value="expring.lua"/>
	<movevent type="DeEquip" itemid="6300" slot="ring" event="function" value="onDeEquipItem"/>
	<movevent type="DeEquip" itemid="6301" slot="ring" event="script" value="expring.lua"/>

expring.lua
PHP:
-- Credits: Slawkens & Barker 
local config = { 
    rate = 2.0, -- 2.0 = 2x faster than normal 
} 

function onDeEquip(cid, item, slot) 
    if(item.itemid == 6301) then 
        doPlayerSetExperienceRate(cid, 1.0) 
		   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.") 
			doTransformItem(item.uid, 6300) 
    end 
end 

function onEquip(cid, item, slot) 

    if(item.itemid == 6300) then 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.") 
		   doPlayerSetExperienceRate(cid, config.rate) 
			doTransformItem(item.uid, 6301)
				return true
    end 
end

and items.xml:
PHP:
	<item id="6300" article="an" name="experience ring">
		<attribute key="transformEquipTo" value="6301" />
		<attribute key="weight" value="80" />
		<attribute key="slotType" value="ring" />
		<attribute key="stopduration" value="1" />
		<attribute key="showduration" value="1" />
	</item>
	<item id="6301" article="an" name="experience ring">
		<attribute key="weight" value="80" />
		<attribute key="slotType" value="ring" />
		<attribute key="decayTo" value="0" />
		<attribute key="transformDeEquipTo" value="6300" />
		<attribute key="duration" value="30000" />
		<attribute key="showduration" value="1" />
	</item>
Help please.

SOLUTION:
Add this script

Lua:
local config = { 
    rate = 2.0, -- 2.0 = 2x faster than normal 
} 

function onDeEquip(cid, item, slot) 
    if(item.itemid == 6301) then 
	doPlayerSetExperienceRate(cid, 1.0) 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.") 
        doTransformItem(item.uid, 6300)
	getConfigValue(key)        --only worked with this line on my server, Delete it to test if it works without it
    end 
	return true
end 

function onEquip(cid, item, slot) 

    if(item.itemid == 6300) then 
	if getConfigValue("experienceStages") == "yes" then
	    doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
	    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, 6301)
	    doDecayItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid)
	else
	    doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2) 
	    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, 6301)
	    doDecayItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid)
	end
	return true
    end
end

Report any bugs
Oh, there's a missunderstanding!

I just added the ExpStage lines.
Original script by barker

But we could close the thread and relink it to this one:

ExpRate Ring
 
Last edited by a moderator:
2x normal than tibia rl?
or for example if my ots is 10x, who wear this ring will have 20x?
really nice script :)
and sorry i dont know how to fix that:S
 
Hi!
TFS 0.3.6...
I have that script; and i have question: why does not work duration of ring??? I set it to 500 minutes, and it doesn't go down. :/

movement.xml
PHP:
	<!-- Exp Ring -->
	<movevent type="Equip" itemid="6301" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="Equip" itemid="6300" slot="ring" event="script" value="expring.lua"/>
	<movevent type="DeEquip" itemid="6300" slot="ring" event="function" value="onDeEquipItem"/>
	<movevent type="DeEquip" itemid="6301" slot="ring" event="script" value="expring.lua"/>

expring.lua
PHP:
-- Credits: Slawkens & Barker 
local config = { 
    rate = 2.0, -- 2.0 = 2x faster than normal 
} 

function onDeEquip(cid, item, slot) 
    if(item.itemid == 6301) then 
        doPlayerSetExperienceRate(cid, 1.0) 
		   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.") 
			doTransformItem(item.uid, 6300) 
    end 
end 

function onEquip(cid, item, slot) 

    if(item.itemid == 6300) then 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.") 
		   doPlayerSetExperienceRate(cid, config.rate) 
			doTransformItem(item.uid, 6301)
				return true
    end 
end

and items.xml:
PHP:
	<item id="6300" article="an" name="experience ring">
		<attribute key="transformEquipTo" value="6301" />
		<attribute key="weight" value="80" />
		<attribute key="slotType" value="ring" />
		<attribute key="stopduration" value="1" />
		<attribute key="showduration" value="1" />
	</item>
	<item id="6301" article="an" name="experience ring">
		<attribute key="weight" value="80" />
		<attribute key="slotType" value="ring" />
		<attribute key="decayTo" value="0" />
		<attribute key="transformDeEquipTo" value="6300" />
		<attribute key="duration" value="30000" />
		<attribute key="showduration" value="1" />
	</item>
Help please.


Try with stop duration 0
 
Add this script

Lua:
local config = { 
    rate = 2.0, -- 2.0 = 2x faster than normal 
} 

function onDeEquip(cid, item, slot) 
    if(item.itemid == 6301) then 
	doPlayerSetExperienceRate(cid, 1.0) 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.") 
        doTransformItem(item.uid, 6300)
	getConfigValue(key)        --only worked with this line on my server, Delete it to test if it works without it
    end 
	return true
end 

function onEquip(cid, item, slot) 

    if(item.itemid == 6300) then 
	if getConfigValue("experienceStages") == "yes" then
	    doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
	    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, 6301)
	    doDecayItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid)
	else
	    doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2) 
	    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, 6301)
	    doDecayItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid)
	end
	return true
    end
end

Report any bugs
 
Last edited:
I tested it.. But my exp is 10x. when i kill a rotworm in my OT server, it give me 300 Exp (Without ring) when i kill a Rotworm with the ring it gives me 3000 exp.. I dont know cuz it should give me 600 Exp :S
 
~Thread moved to request and support~

Zyntax shall decide himself if he wants to officially leak the script in a dedicated thread.
 
As you wish.

If rangoo wants the thread opened again, send me a visitor message linking to this page with a reason.
 
Status
Not open for further replies.
Back
Top