• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Item regenerate 10% health and mana

adamox223

New Member
Joined
Oct 21, 2017
Messages
100
Reaction score
4
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?
 
Solution
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...
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
that's not what he asked for, he's asking for an action script.

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?
LUA:
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
 
Solution
it isnt working :/
f433wz.png
 
Back
Top