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
expring.lua
and items.xml:
Help please.
SOLUTION:
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>
SOLUTION:
Oh, there's a missunderstanding!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
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: