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

Easy item edit help plz...rep++

Silentsniper

New Member
Joined
Sep 20, 2009
Messages
81
Reaction score
0
I need to know the .xml code to add to an item so when you use it it adds 2000 max hp to you, i also need the same code except for mp. Thank youuuu =]
 
Last edited:
I need to know the .xml code to add to an item so when you use it it adds 2000 max hp to you, i also need the same code except for mp. Thank youuuu =]
PHP:
<attribute key="maxhealthpoints" value="2000"/>
PHP:
<attribute key="maxmanapoints" value="2000"/>
Example (ring of health):
in items.xml:
PHP:
	<item id="7708" article="a" name="Ring of Health">
		<attribute key="weight" value="40"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="maxhealthpoints" value="2000"/>
		<attribute key="decayTo" value="0"/>
		<attribute key="transformDeEquipTo" value="7697"/>
		<attribute key="duration" value="36000"/>
		<attribute key="showduration" value="1"/>
	</item>
PHP:
	<item id="7697" article="a" name="Ring of Health">
		<attribute key="weight" value="40"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="transformEquipTo" value="7708"/>
		<attribute key="stopduration" value="1"/>
		<attribute key="showduration" value="1"/>
	</item>
in movements.xml add:
PHP:
	<movevent type="Equip" itemid="7708" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="7708" slot="ring" event="function" value="onDeEquipItem"/>
	<movevent type="Equip" itemid="7697" slot="ring" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="7697" slot="ring" event="function" value="onDeEquipItem"/>
(if you add to any item something like 'max health' or 'gain health' it must be in movements.xml like item above)
 
Thank you!

How do i make it so when i use, an item to make it add to it, like a egg or crystal, when i use it, it dissapears and adds 2000 max hp or mp to you. how would i do that?
 
Last edited by a moderator:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local hp = 2000
	local mp = 2000
	setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+hp)
	setCreatureMaxMana(cid, getCreatureMaxMana(cid)+mp)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
	doRemoveItem(item.uid, 1)
return TRUE
end
 
Back
Top