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

Solved easy fix problem heal tile

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
Hi!! well i'm pretty sure this is very easy to fix so plz help me whoever can!
Code:
function onStepIn(cid, item, position)
if getCreatureMana(cid) < getCreatureMaxMana(cid) then
doCreatureAddMana(cid, getCreatureMaxMana(cid), FALSE)
if getCreatureMana(cid) < getCreatureMaxMana(cid) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), FALSE)
doSendAnimatedText(getThingPos(cid), "Refilled!", TEXTCOLOR_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Refilled!")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already refilled!")
end
return true
end

it is a healing tile, it should heal your mana and health, also i would really appreciate that it show the numbers of the amount healed, thanks!!

my tf is 0.3 and tibia version 9.83
 
Code:
function onStepIn(cid, item, position)
    if (getCreatureHealth(cid) < getCreatureMaxHealth(cid)) or (getCreatureMana(cid) < getCreatureMaxMana(cid)) then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
        doSendAnimatedText(getThingPos(cid), "Refilled!", TEXTCOLOR_BLUE)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Refilled!")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already refilled!")
        doSendMagicEffect(getCreaturePosition(cid), 2)
        return false
    end
return true
end
To see healing just make sure showHealingDamage is true in config.lua
 
Code:
function onStepIn(cid, item, position)
    if (getCreatureHealth(cid) < getCreatureMaxHealth(cid)) or (getCreatureMana(cid) < getCreatureMaxMana(cid)) then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
        doSendAnimatedText(getThingPos(cid), "Refilled!", TEXTCOLOR_BLUE)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Refilled!")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already refilled!")
        doSendMagicEffect(getCreaturePosition(cid), 2)
        return false
    end
return true
end
To see healing just make sure showHealingDamage is true in config.lua
thanks again mate!!
 
Back
Top