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

Constant Regen based on vocation and level and magic level

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
I need a constant regeneration script, probably creaturescript and it would heal every second and be like this:
Sorcerer and Druid: health = (level*0.5, magic*2), mana = (level*3, magic*3)
Knight: health = (level*5, magic*6), mana = (level*0.5, magic*4)
Paladin: health = (level*2, magic*3), mana = (level*3, magic*3)
MS and ED: health = (level*2, magic*4), mana = (level*5, magic*4)
EK: health = (level*6, magic*7), mana = (level*1, magic*8)
RP: health = (level*3, magic*4), mana = (level*4, magic*4)

If you don't understand just ask
 
Here is my script from my Dragon Ball server.
Just edit the vocations (isGoku) and formulas and you are welcome!
If someone can short that script i was very kind for that!
Dont forget to remove default regeneration of food in vocations.xml

Globalevent
LUA:
function onThink(interval, lastExecution, thinkInterval)
	local players = getPlayersOnline()

	for _, x in pairs(players) do
		----------------------------------------------------------------------------------------------------
			if isGoku(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x))
				end
		----------------------------------------------------------------------------------------------------
			elseif isVegeta(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x))
				end
		----------------------------------------------------------------------------------------------------
			elseif isGohan(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * (3/2))
				end
		----------------------------------------------------------------------------------------------------
			elseif isTrunks(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * (3/2))
				end
		----------------------------------------------------------------------------------------------------
			elseif isBrolly(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x))
				end
		----------------------------------------------------------------------------------------------------
			elseif isPiccolo(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD) / 2)
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * 2)
				end
		----------------------------------------------------------------------------------------------------
			elseif isBuu(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD) * 2)
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x))
				end
		----------------------------------------------------------------------------------------------------
			elseif isJanemba(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, SKILL_SHIELD) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * (3/2))
				end
		----------------------------------------------------------------------------------------------------
			elseif isCell(x) then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, (SKILL_SHIELD)) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * (3/2))
				end
			elseif isFreezer(x) and getPlayerFood(x) > 0 then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, (SKILL_SHIELD)) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * (3/2))
				end
			elseif isTsuful(x) then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, (SKILL_SHIELD)) * (3/2))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x))
				end
			elseif isDende(x) then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, (SKILL_SHIELD)) / 2)
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * 2)
				end				
			elseif isC17(x) then
				if getCreatureHealth(x) < getCreatureMaxHealth(x) then
					doCreatureAddHealth(x, getPlayerSkillLevel(x, (SKILL_SHIELD)))
				end
				if getCreatureMana(x) < getCreatureMaxMana(x) then
					doCreatureAddMana(x, getPlayerMagLevel(x) * (3/2))

					
			end
		end
	end
	return true
end

XML:
	<globalevent name="regeneration" interval="1" event="script" value="regeneration.lua"/>
 
Back
Top