• 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 UH and Manarune, need to fix their regeneration for specefic vocation

flaxe

the one and only
Joined
Jun 12, 2009
Messages
336
Reaction score
2
Location
Sweden
Hello, I would like to have a special script for UH (nevermind about the manarune, I'm skipping it for now). :P
I want it to be so that knights heal more with it, so you should write "10.8" and "13.2" instead of "1.8" and "3.2" (but it should only work for knights to have the higher values. Is this possible or do I have to make a whole new UH for just knights that only they can use? Below is my current UH:

Code:
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) * 1.8)
	local formula_max = ((lv*0.25 + maglv*3) * 3.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

Hope you understand what I wanna do with it, if not, please tell me what you dont understand and I will try to explain it better ^^ Thanks!
 
Last edited:
This should make the UH rune do what you want:

LUA:
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) * 1.8)
	local formula_max = ((lv*0.25 + maglv*3) * 3.2)
	local knight_form_min = ((lv*0.25 + maglv*3) * 10.8)
	local knight_form_max = ((lv*0.25 + maglv*3) * 13.2)
	
	if(knight_form_max < knight_form_min) then
		local tmp = knight_form_max
		knight_form_max = knight_form_min
		knight_form_min = tmp
	end

	if(formula_max < formula_min) then
		local tmp = formula_max
		formula_max = formula_min
		formula_min = tmp
	end
	
	if isKnight(cid) then
		return knight_form_min, knight_form_max
	else
		return formula_min, formula_max
	end
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")


function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Back
Top