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

Lua Bug on healing spells :(

Status
Not open for further replies.

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
there is code bugged with example:
exura gran
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)


function getCombatFormulas(cid, lv, maglv)
	local formula_min = -((lv/5) + (maglv*5))
	local formula_max = -((lv/5) + (maglv*6))

	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
and next... see photo:
affv.png


rep+ whos help me please =)
 
spells.xml
Lua:
	<instant name="Intense Healing" words="exura gran" lvl="11" mana="70" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" script="healing/intense healing.lua">
		<vocation name="Sorcerer" />
		<vocation name="Druid" />
		<vocation name="Paladin" />
		<vocation name="Master Sorcerer" />
		<vocation name="Elder Druid" />
		<vocation name="Royal Paladin" />
	</instant>

healing/intense healing.lua
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, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

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

	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
 
Last edited:
Status
Not open for further replies.
Back
Top