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

Buff in XML [Help]

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
XML:
	<movevent type="Equip" itemid="7697" slot="ring" event="buffer" value="
		return doPlayerSetExperienceRate(cid, 1.5)"/>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="buffer" value="
		return doPlayerSetExperienceRate(cid, 1.0)"/>
	<movevent type="DeEquip" itemid="7697" slot="ring" event="function" value="onDeEquipItem"/>

It's buffering 100% but it's not removing that buff when DeEquip, why?










I'm using this:

XML:
	<movevent type="Equip" itemid="7697" slot="ring" event="script" value="expring.lua"/>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="expring2.lua"/>

expring
LUA:
function onEquip(cid, item, slot) 
        doPlayerSetExperienceRate(cid, 1.5)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have + 50% of extra experience.") 
	doTransformItem(item.uid, 7708)
doDecayItem(item.uid)
return 1
end

expring2
LUA:
function onDeEquip(cid, item, slot)
	doPlayerSetExperienceRate(cid, 1.0)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
	doTransformItem(item.uid, 7697)
end

PROBLEM1 : When player receive from Shop it go to RING SLOT and OT crash.
PROBLEM2 : When GM create this item using /i it go to RING SLOT and OT crash.
I was thinking if I can do it other way without crash.
 
Last edited:
XML:
	<movevent type="Equip" itemid="7697" slot="ring" event="buffer" value="
		return doPlayerSetExperienceRate(cid, 1.5)"/>
	<movevent type="DeEquip" itemid="7697" slot="ring" event="buffer" value="
		return doPlayerSetExperienceRate(cid, 1.0)"/>

???
 
I'm trying this but not workin'
XML:
	<movevent type="Equip" itemid="7697" slot="ring" event="buffer" value="
		doPlayerSetExperienceRate(cid, 1.5)
		doTransformItem(item.uid, 7708)
		doDecayItem(item.uid)">
	</movevent>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="buffer" value="
		doPlayerSetExperienceRate(cid, 1.0)
		doTransformItem(item.uid, 7697)">
	</movevent>
 
Don't you gotta separate the functions? Like using a comma or anything?
So far you have everything on a straight line, despite visually being on separate lines.
 
Nope, it doesn't work that way, nevermind, I have no idea.
Can't you just use an original script file to do it rather than using the xml file?
 
I'm using this

XML:
	<movevent type="Equip" itemid="7697" slot="ring" event="script" value="expring.lua"/>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="expring2.lua"/>

expring
LUA:
function onEquip(cid, item, slot) 
        doPlayerSetExperienceRate(cid, 1.5)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have + 50% of extra experience.") 
	doTransformItem(item.uid, 7708)
doDecayItem(item.uid)
return 1
end

expring2
LUA:
function onDeEquip(cid, item, slot)
	doPlayerSetExperienceRate(cid, 1.0)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
	doTransformItem(item.uid, 7697)
end

PROBLEM1 : When player receive from Shop it go to RING SLOT and OT crash.
PROBLEM2 : When GM create this item using /i it go to RING SLOT and OT crash.
 
Worked fine for me:

13:45 You have + 50% of extra experience.
13:45 You see a signet ring.
It weighs 0.80 oz.
ItemID: [7708].
Position: [X: 1023] [Y: 1033] [Z: 7].
13:45 Your extra experience rate has ended.
13:46 You see a signet ring.
It weighs 0.80 oz.
ItemID: [7697].
Position: [X: 1023] [Y: 1033] [Z: 7].

What I think happened was you transformed and decayed an item at the same time, I don't think this is alllowed.

So, change:

LUA:
function onEquip(cid, item, slot) 
        doPlayerSetExperienceRate(cid, 1.5)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have + 50% of extra experience.") 
	doTransformItem(item.uid, 7708)
doDecayItem(item.uid)
return 1
end

to

LUA:
function onEquip(cid, item, slot) 
        doPlayerSetExperienceRate(cid, 1.5)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have + 50% of extra experience.") 
	doTransformItem(item.uid, 7708)
return 1
end

Also, keep in mind, when you do /i, you're making 100x of the ring.
 
Back
Top