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

Eat food - Instantly heals

  • Thread starter Deleted member 49793
  • Start date
D

Deleted member 49793

Guest
Hey i know this was released but cant find it... Could someone link me OR post a new script for it :)

Basicly just when player eats fish, instantly restores 50 mana and 50 health

AND

when eat cod instnatly restores 5% max hp and 5% max mana (No cooldown plz)
 
Try ..
Lua:
local t = {
    [2667] = {'Munch.', hp=50, mp=50},
    [cod??] = {'Munch.', hppc=5, mppc=5},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local v = t[item.itemid]

    doCreatureSay(cid, v[1], TALKTYPE_ORANGE_1)
    doRemoveItem(item.uid, 1)
    if v.hp then
        doCreatureAddHealth(cid, v.hp)
    elseif v.hppc then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) * v.hppc / 100)
    end

    if v.mp then
        doCreatureAddMana(cid, v.mp)
    elseif v.mppc then
        doCreatureAddMana(cid, getCreatureMaxMana(cid) * v.mppc / 100)
    end
    return true
end
You'll have to change the script these items are binded to, in actions.xml.

For example,
Code:
    <action fromid="2666" toid="2691" event="script" value="other/food.lua"/>
to:
Code:
    <action itemid="2666" event="script" value="other/food.lua"/>
[B]    <action itemid="[COLOR="red"]2667[/COLOR]" event="script" value="other/[COLOR="red"]name_of_this_script.lua[/COLOR]"/>[/B]
    <action fromid="2668" toid="2691" event="script" value="other/food.lua"/>
I would love to add the condition 'if player have maxhealth can't use + message'
Anyways, thank you man, very kind of you for posting the script. Working perfectly!
 
Back
Top