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

[creaturescript] Monster restore full health

Knight God

Member
Joined
Oct 19, 2008
Messages
1,180
Reaction score
21
Greetings!
Well first of all let me know if you may be a monster with a critical amount of hp this make a max heal, as well as Ghaz'haragot.
 
You can use the script of this ot land friend, see the thread.
https://otland.net/threads/monsterp...ibia-10-7-tfs-1-1-based-on-real-tibia.215685/

1. Create a file in '/data/creaturescripts/scripts' called 'fullHealth.lua'.

Code:
local condition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_SUBID, 88888)
condition:setParameter(CONDITION_PARAM_TICKS, 7 * 1000)
condition:setParameter(CONDITION_PARAM_HEALTHGAIN, 0.01)
condition:setParameter(CONDITION_PARAM_HEALTHTICKS, 7 * 1000)

function onThink(creature)
local hp = (creature:getHealth()/creature:getMaxHealth())*100
  if (hp < 12.5 and not creature:getCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT, 88888)) then
  creature:addCondition(condition)
  creature:say("yourMONSTERNAME begins to draw on the nightmares to HEAL himself!", TALKTYPE_ORANGE_2)
  creature:addHealth(300000)
  creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
  return true
  end
end

2. Add this line in 'creaturescripts.xml'.

<event type="think" name="fullHealth" script="fullHealth.lua"/>
 
If you are using TFS 1.2 OR 1.1 with get debug with this line:
Code:
creature:say("yourMONSTERNAME begins to draw on the nightmares to HEAL himself!", TALKTYPE_ORANGE_2)
change it to:
Code:
creature:say("yourMONSTERNAME begins to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_YELL)
 
Back
Top