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

amulet that increases the maximum amount of life by 10%

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
Hi, I need a script for an amulet (2131) that when you wear it, you increase you maximun amount of life by 10% (with no charges because it's infinite) if it is no possible to do that that only increase the amount of life by 250 hitpoints.

I'll be very grateful with the one that helps me =)

rep++
 
Movements:
XML:
<movevent event="Equip" itemid="2127" slot="head" function="onEquipItem"/>
	<movevent event="DeEquip" itemid="2127" slot="legs" function="onDeEquipItem"/>
items.xml
XML:
		<attribute key="maxHealthPointsPercent" value="110"/>
 
Try this:
movements.xml
Lua:
<movevent type="Equip" itemid="2131" slot="necklace" function="onEquipItem" script="amulet.lua"/>
<movevent type="DeEquip" itemid="2131" slot="necklace" function="onDeEquipItem" script="amulet.lua"/>
amulet.lua
Lua:
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)            -- the -1 is to allow conditions to run forever -
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 110)  -- add 10% of max health to the player's current hp --
local condition_max_250 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition_max_250, CONDITION_PARAM_TICKS, -1)            -- the -1 is to allow conditions to run forever -
setConditionParam(condition_max_250, CONDITION_PARAM_STAT_MAXHEALTH, 250)  -- add 250 health to the player's current hp --

function onEquip(cid, item, slot)
	if getCreatureMaxHealth(cid) >= 2501 then
		doAddCondition(cid, condition_max_250)
	elseif getCreatureMaxHealth(cid) < 2501 then
		doAddCondition(cid, condition)
	end
	return TRUE
end

function onDeEquip(cid, item, slot)
	doRemoveCondition(cid, CONDITION_ATTRIBUTES)
end
 
Back
Top Bottom