nope that last thing wasn't right
I mean that max hp get's increase by 15000 hp for 3 hours
<movevent type="Equip" itemid="xxx2" slot="ring" event="function" value="onEquipItem"/>
<movevent type="Equip" itemid="xxx1" slot="ring" event="script" value="hpscript.lua"/>
<movevent type="DeEquip" itemid="xxx2" slot="ring" event="script" value="hpscript.lua"/>
function onDeEquip(cid, item, slot)
doCreatureAddHealth(cid, -15000)
return true
end
function onEquip(cid, item, slot)
doCreatureAddHealth(cid, 15000)
return true
end
<item id="xxx1" article="an" name="hp ring">
<attribute key="weight" value="10"/>
<attribute key="slotType" value="ring"/>
<attribute key="transformEquipTo" value="xxx2"/>
<attribute key="stopduration" value="1"/>
<attribute key="showduration" value="1"/>
</item>
<item id="xxx2" article="an" name="hp ring">
<attribute key="weight" value="10"/>
<attribute key="slotType" value="ring"/>
<attribute key="decayTo" value="0"/>
<attribute key="transformDeEquipTo" value="xxx1"/>
<attribute key="duration" value="10800"/>
<attribute key="showduration" value="1"/>
</item>
Won't work.
You need to set the max hp to something when he uses an item.
with a durability of 3 hours.
BUUUT I made ring... ;(
Lazy to figure out a script for onUse. <,<
_Arthur, it's a onUse script.
Ring seemed funner + easier. XD
function onUse(cid, item, frompos, item2, topos)
local condation = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condation, CONDITION_PARAM_TICKS, 10800000)
setConditionParam(condation, CONDITION_PARAM_STAT_MAXHEALTH, 15000)
doAddCondition(cid, condation)
doRemoveItem(item.uid, 1)
return true
end
local hours = 3
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, hours * 60 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 15000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if hasCondition(cid, CONDITION_ATTRIBUTES) then
doPlayerSendCancel(cid, "You are already boosted.")
else
doAddCondition(cid, condition)
doRemoveItem(item.uid, 1)
end
return true
end
@Spider:
Sry, had to do it.
Code:local hours = 3 local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, hours * 60 * 60 * 1000) setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, 15000) function onUse(cid, item, fromPosition, itemEx, toPosition) if hasCondition(cid, CONDITION_ATTRIBUTES) then doPlayerSendCancel(cid, "You are already boosted.") else doAddCondition(cid, condition) doRemoveItem(item.uid, 1) end return true end
Well anybody? I want an item who I can right-click on and then it will Increase MaxHp by 15000 for 3 hours anybody??