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

Double Exp Ring not working

Freedow

New Member
Joined
Sep 28, 2009
Messages
2
Reaction score
0
Hey guys, i just re-edited a double exp ring, but its not working. When I equip the ring, the first id changes to the second id, but when i DeEquip the second id doesnt change to the first.
Hope u guys understand and heres the script


In Items.xml
Code:
<item id="2123" article="a" name="Experience Ring">
<attribute key="weight" value="40" />
<attribute key="slotType" value="ring" />
<attribute key="transformEquipTo" value="7708"/>
<attribute key="showduration" value="1" />
<attribute key="stopduration" value="1" />
</item>

<item id="7708" article="a" name="Experience Ring">
<attribute key="weight" value="80"/>
<attribute key="slotType" value="ring"/>
<attribute key="decayTo" value="0"/>
<attribute key="transformDeEquipTo" value="2123" />
<attribute key="duration" value="900" />
<attribute key="showduration" value="1" />
</item>


In Movements.xml

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


In Ring.lua

Code:
local rate = 1.2
function onEquip(cid, item, slot)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "xp raise in + "..((rate - 1)*100).."%.")
doPlayerSetExperienceRate(cid, rate)
return true
end

In Ring2.lua
Code:
function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Xp end.")
return true
end
 
Movements.xml
XML:
<movevent type="Equip" itemid="2123" slot="ring" event="script" value="ring.lua"/>
<movevent type="Equip" itemid="7708" slot="ring" event="script" value="ring.lua"/>
<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="ring2.lua"/>

Ring.lua
LUA:
local rate = 1.2
function onEquip(cid, item, slot)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "xp raise in + "..((rate - 1)*100).."%.")
doPlayerSetExperienceRate(cid, rate)
doDecayItem(item.uid)
doTransformItem(item.uid, 7708)
return true
end

Ring2.lua
LUA:
function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Xp end.")
doTransformItem(item.uid, 2123)
return true
end
 
Last edited:
Just tested, its working fine the transform but the action not

22:12 xp raise in + 20%.
22:12 xp raise in + 20%.
22:12 xp raise in + 20%.
22:12 Xp end.

It appears 3 times oO

Btw im using TFS 0.4_SVN
 
Last edited:

Similar threads

Replies
0
Views
186
Back
Top