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
In Movements.xml
In Ring.lua
In Ring2.lua
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