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

Item onEquip gives attributes.

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Hi there, well I need a script that when you equip a certain item, it heal your hp/mp every 5 seconds give 2 points of each, also increase your speed in 15... Could this be possible? I have been thinking on how to do the loop while player is online, but I can't manage how.
 
What you do, is.

Go to your items.xml (find the ID/name) of item you want to add, then

<attribute key="manaGain" value="60000"/>
<attribute key="manaTicks" value="15"/>

Basically 'manaGain' is how much mana you get.
In this case it'll be 2.

'manaTicks' will be the timing the mana gets regenerated.

(for health it'll just be healthGain/healthTicks).

For speed, it'll just be speed..

Then go to movements.xml and type in ->

<movevent event="Equip" itemid="***ID OF YOUR ITEM***" slot="***SLOT WHERE IT HAS TO BE***" function="onEquipItem" />
<movevent event="DeEquip" itemid="***ID OF YOUR ITEM***" slot="***SLOT WHERE IT HAS TO BE***" function="onDeEquipItem" />

Then save them both, restart/reload your server and enjoy your working item :)
 
If someone want this:

local condition1 = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition1, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition1, CONDITION_PARAM_BUFF, true)
setConditionParam(condition1, CONDITION_PARAM_TICKS, 2 * 60 * 1000)
setConditionParam(condition1, CONDITION_PARAM_HEALTHGAIN, 20)
setConditionParam(condition1, CONDITION_PARAM_HEALTHTICKS, 2000)
setConditionParam(condition1, CONDITION_PARAM_MANAGAIN, 20)
setConditionParam(condition1, CONDITION_PARAM_MANATICKS, 2000)

local speed = getCreatureSpeed(cid)
doChangeSpeed(cid, speed + 200)
doAddCondition(cid, condition1)

This will give heal your hp/mp every 2 seconds by 20 for 2 minutes and will increase your speed by 200, now use your imagination.
 
Back
Top