• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Hp and Mana Regeneration

perfection

FATAL DAMAGE
Joined
Aug 27, 2011
Messages
196
Reaction score
8
Lua:
local UID = 60001

function onStepIn(cid, item, position, fromposition)

if item.uid == UID then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doSendMagicEffect(getCreaturePos(cid), 12)
end
return 1
end

and in movements.xml

Lua:
<movevent type="StepIn" uniqueid="60001" event="script" value="Regenerate.lua"/>

this would be best put on temple teleport pos
 
Last edited:
doCreatureAddHealth(cid,getCreatureHealth(cid) + getCreatureMaxHealth(cid))
doCreatureAddMana(cid,getCreatureMana(cid) + getCreatureMaxMana(cid))

wt..

doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
 
doCreatureAddHealth(cid,getCreatureHealth(cid) + getCreatureMaxHealth(cid))
doCreatureAddMana(cid,getCreatureMana(cid) + getCreatureMaxMana(cid))

wt..

doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))

thx for the advice but they are kindof the same :/
 
thx for the advice but they are kindof the same :/
lol?
your script:
it will add the health that the player actually has + the max health.
I.E:
Player has 300 hp atm, and his full hp is 1000
so, the health added will be:
300+1000 = 1300.
my script
Player has 300 hp atm, and his full hp is 1000
so, the health added will be:
1000-300 = 700.
 
lol?
your script:
it will add the health that the player actually has + the max health.
I.E:
Player has 300 hp atm, and his full hp is 1000
so, the health added will be:
300+1000 = 1300.
my script
Player has 300 hp atm, and his full hp is 1000
so, the health added will be:
1000-300 = 700.

should i always say that i test before i post?
 
perfection script works ok cuz it won't add more health than what you have(max), but still it's better to use Bogart's form
 
ye i already edited it but i just wanted to make it clear to bogart that both concepts work :D
 
Back
Top