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

Please Help with Ultimate healing rune.lua

Ljnus

Xozé
Joined
Feb 14, 2009
Messages
8
Reaction score
0
Location
Sweden
How do i change how much ultimate healing will heal when using it?
This is my ultimate healing rune.lua
Code:
--Calculed by ta4e--
--For tibia 8.22--
--Made in 12/09/08--
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function getCombatFormulas(cid, lv, maglv)
	local formula_min = ((lv*0.25 + maglv*3) * 3.8)
	local formula_max = ((lv*0.25 + maglv*3) * 4.2)

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")


function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
This is what it will heal minimum. level * 0.25 + magic level * 3 = x * 3.8

(Level * 0.25 + magic level * 3) = x

So if hes level 100 and m lvl 10 then he will heal 209hp as minimum
PHP:
local formula_min = ((lv*0.25 + maglv*3) * 3.8)

This is what it will heal maximum. Level * 0.25 + magic level * 3 = x * 4.2

(Level * 0.25 + magic level * 3) = x

so if hes level 100 and m lvl 10 then he will heal 231 as maximum.

PHP:
local formula_max = ((lv*0.25 + maglv*3) * 4.2)

Hope it helped.
 
It's all about maths.

Minimum healing = (lv*0.25 + maglv*3) * 3.8)

If you want them to heal more becuse of their level then you change

"0.25" to a higher number.

If you want them to heal more becuse of their magic level then you change "3" to a higher number.
 
I don't understand, how do you get 231 as maximum and 209 as minimum?

Well, its exactly as Elaney said in his posts.

Lets make it easier, lets say (only as example) you want UHs to heal minimum 2x of your lvl and maximum 3x, then you would write this on the script:

Code:
	local formula_min = (lv*2)
	local formula_max = (lv*3)

By doing that, a lvl 100 character would heal minimum 200 (100 * 2) and maximum 300 (100 * 3).

If you want it more "complicated", like making it depend on lvl and magic lvl, for example, if you want the minimum to be 1.5x of your lvl plus(+) 2x of your magic lvl, and maximum 2x of your lvl + 3x of your magic lvl, you would type it like this:

Code:
	local formula_min = (lv*1.5 + maglv*2)
	local formula_max = (lv*2 + maglv*3)

So in this case, a lvl 100 character with magic lvl 10 would heal minimum 170 (100 * 1.5 = 150, and 10 * 2 = 20; then 150 + 20 = 170) and maximum 230 (100 * 2 = 200, and 10 * 3 = 30; then 200 + 30 = 230).

And if you want it even more advanced/complicated (like it comes default on your script):

Code:
	local formula_min = ((lv*0.25 + maglv*3) * 3.8)
	local formula_max = ((lv*0.25 + maglv*3) * 4.2)

That means the minimum that it will heal will be your lvl * 0.25, summed(+) to your magic level * 3, and the result of that multiplied by 3.8, so a lvl 100 with magic lvl 10 would heal:

Lvl: (100 * 0.25 = 25)
+
MagLvl: (10 * 3 = 30)

Then 25 + 30 = 55.

So multiplying it now by 3.8 it would be:
55 * 3.8 = 209

So 209 is the minimum you would heal at lvl 100 with magic lvl 3, if you leave that script as it comes default. If you make the same calculations with the "local formula_max", the result will be 231.

You can edit any of those values to your needs on your server, just like I told you above.

If this post helped you out, click HERE to give +Rep to Elaney. I didnt do more than just "explain his explanation" a bit further.

Cheers~
 
Back
Top