hxzr
New Member
- Joined
- Feb 4, 2010
- Messages
- 156
- Reaction score
- 0
movements.xml
expring.lua
items.xml
If you throw around the ring quite often it will crash the server, I'm not sure if there's a certain pattern but it can also create a VOID(ID:100) inside a backpack and when you click it, the server goes down.
I'm not 100% sure on this thou: This only happens on items created in that session, once the server comes up IF you still have the ring it will not cause any problem.
(TFS 0.3.6pl1 | ubuntu)
Code:
<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="6301" slot="ring" event="script" value="expring.lua"/>
expring.lua
Code:
local config = {
rate = 1.25,
equip = 6301,
unequip = 6300
}
function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You no longer recieve extra experience.")
doTransformItem(item.uid, config.unequip)
return true
end
function onEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, config.rate)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will now recieve " .. config.rate .. "x more experience.")
doTransformItem(item.uid, config.equip)
doDecayItem(item.uid)
return true
end
items.xml
Code:
<item id="6300" article="a" name="Death ring">
<attribute key="weight" value="80" />
<attribute key="slotType" value="ring" />
<attribute key="transformEquipTo" value="6301" />
<attribute key="stopduration" value="1" />
<attribute key="showduration" value="0" />
</item>
<item id="6301" article="a" name="Death 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="3600" />
<attribute key="armor" value="1" />
<attribute key="showduration" value="1" />
</item>
If you throw around the ring quite often it will crash the server, I'm not sure if there's a certain pattern but it can also create a VOID(ID:100) inside a backpack and when you click it, the server goes down.
I'm not 100% sure on this thou: This only happens on items created in that session, once the server comes up IF you still have the ring it will not cause any problem.
(TFS 0.3.6pl1 | ubuntu)