In Items.xml Register ur Item
To Add 10% More Health and mana you use
LUA:<item id="IDDOITEM" article="a" name="NAMEOFITEM"> <attribute key="description" value="IF YOU NEED DESCRIPTION" /> <attribute key="weight" value="2950" /> <attribute key="maxhitpointspercent" value="105" /> 105 = 5% if you need 10% change to 110 <attribute key="maxmanapointspercent" value="105" /> 105 = 5% if you need 10% change to 110 <attribute key="armor" value="10" /> <attribute key="slotType" value="head" /> <attribute key="imbuingSlots" value="2" /> </item>
To Heal for second you use
LUA:<item id="IDDOITEM" article="a" name="NAMEDOITEM "> <attribute key="description" value="IF...
that's not what he asked for, he's asking for an action script.In Items.xml Register ur Item
To Add 10% More Health and mana you use
LUA:<item id="IDDOITEM" article="a" name="NAMEOFITEM"> <attribute key="description" value="IF YOU NEED DESCRIPTION" /> <attribute key="weight" value="2950" /> <attribute key="maxhitpointspercent" value="105" /> 105 = 5% if you need 10% change to 110 <attribute key="maxmanapointspercent" value="105" /> 105 = 5% if you need 10% change to 110 <attribute key="armor" value="10" /> <attribute key="slotType" value="head" /> <attribute key="imbuingSlots" value="2" /> </item>
To Heal for second you use
LUA:<item id="IDDOITEM" article="a" name="NAMEDOITEM "> <attribute key="description" value="IF YOU NEED DESCRIPTION" /> <attribute key="healthGain" value="10" /> here is value of heal <attribute key="healthTicks" value="2000" /> Here 2000 = 2 seconds <attribute key="manaGain" value="10" /> <attribute key="manaTicks" value="2000" /> Here 2000 = 2 seconds <attribute key="preventDrop" value="1"/>here is value of heal <attribute key="weight" value="420" /> <attribute key="absorbPercentAll" value="7" /> <attribute key="speed" value="40" /> <attribute key="slotType" value="necklace" /> <attribute key="showattributes" value="1" /> </item>
You need register this itens in movements too ok
Hello, i need find action script, when we use item xxxx it add 10% health and mana - like potions.
And with cooldown 2 sec, can you help me?
local cooldown_time = 2000 -- milliseconds (2 seconds)
local cooldowns = {}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local cid = player:getId()
local cooldown = cooldowns[cid]
local current_time = os.mtime()
if cooldown and current_time < cooldown then
local time_left = tonumber(("%.1f"):format(cooldown - current_time / 1000))
player:sendTextMessage("You need to wait ".. time_left .. " more second".. (time_left == 1 and "" or "s") .." to use this.")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
return true
end
item:remove(1)
cooldowns[cid] = current_time + cooldown_time
player:addHealth(player:getMaxHealth() * 0.10)
player:addMana(player:getMaxMana() * 0.10)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
return true
end