• 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 deEquip problems

cheertimmy

New Member
Joined
Aug 11, 2012
Messages
6
Reaction score
0
Was wondering if anyone could help with ring/neck that gives % xp boost.

Server TFS 0.3.6

i have been trying a script and modified a lil, im kinda new to this and go by tons of trial and error with looking at scripts and copy/paste. Anyway problem is it gives xp boost and says words but i can only equip brand new ring. Then if you remove from slot it doesnt deEquip so time runs out and its preventing from placing ring back in slot. Also the exp gain stays with char prob do to ring not deactivating. Here is a script i found and butchered:


--------------------------------------------------------------------------------------------
Code:
local config = {
doubledRate = 20,
normalRate = 10,
doEffect = CONST_ME_MAGIC_RED
}

function onEquip(cid, item, slot)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"DOUBLE EXP.")
doSendMagicEffect(getPlayerPosition(cid), config.doEffect)
doPlayerSetExperienceRate(cid, config.doubledRate)
end

function onDeEquip(cid, item, slot)

doPlayerSetExperienceRate(cid, config.normalRate)

end


i have that in data/movements/script
-------------------------------------------------
Code:
<movevent type="Equip" itemid="2206" slot="ring" event="script" value="expring.lua"/>
<movevent type="DeEquip" itemid="2206" slot="ring" event="function" value="onDeEquipItem"/> <-- ive tried using all with script in all combinations it does nothing
<movevent type="Equip" itemid="2169" slot="ring" event="function" value="onEquipItem"/>

thats my movements.xml

and if it matters the deEquiped id is 2169

Any help would be greatly appreciated =D
tibia ot ring.jpg
 
items.xml? override ?

Lua:
<item id="2206" override="yes" article="a" name="ring experience">
    <attribute key="description" value="Magic ring which accelerates the acquisition of experience." />
    <attribute key="slotType" value="ring" />
    <attribute key="weight" value="50" />
    <attribute key="transformDeEquipTo" value="2169" />
    <attribute key="duration" value="14400" />
</item>
 
@cronox
Still experiencing same problem can equip item 2169 transforms to 2206 does script effects then if you take it off stays item 2206 and active.
 
@cheertimmy

Okay well your problem is probably on item 2206

<attribute key="transformDeEquipTo" value="2169" />
should be there so it should look like this

<item id="2206" article="a" name="Ring of Experience">
<attribute key="weight" value="90" />
<attribute key="slotType" value="ring" />
<attribute key="transformDeEquipTo" value="2169" />


MAKE SURE THERE IS NOT A DUPLICATE ID IN MOVEMENTS WITH THOSE.

- - - Updated - - -

I found a solution to your problem. cheer put this:
<movevent type="Equip" itemid="2206" slot="ring" event="script" value="expring.lua"/>
<movevent type="DeEquip" itemid="2206" slot="ring" event="function" value="onDeEquipItem"/>
<movevent type="Equip" itemid="2169" slot="ring" event="function" value="onEquipItem"/>


And make it look like this:
<movevent type="Equip" itemid="2206" slot="ring" event="function" value="onEquipItem"/>
<movevent type="DeEquip" itemid="2206" slot="ring" event="function" value="onDeEquipItem"/>
<movevent type="Equip" itemid="2169" slot="ring" event="function" value="onEquipItem"/>

And then take your "expring.lua" and put it like this:
local config = {
doubledRate = 20,
normalRate = 10,
doEffect = CONST_ME_MAGIC_RED
}

function onUse(cid,item,frompos,item2,topos)
local playerpos = getPlayerPosition(cid)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"EXP RING ACTIVATED.")
doSendMagicEffect(getPlayerPosition(cid), config.doEffect)
doPlayerSetExperienceRate(cid, config.doubledRate)
end

function onDeEquip(cid, item, slot)

doPlayerSetExperienceRate(cid, config.normalRate)

end

And then place that in your actions/scripts/other, And then put THIS into Actions:
<action itemid="2206" script="other/expring.lua" />
 
Last edited:
Back
Top