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

spell bugged

Spo teh pro

New Member
Joined
Jan 3, 2008
Messages
319
Reaction score
1
Hello..
I was fooling around with my energy strike spell because I wanted it to have the old (anything below 8.0 tibia) dmg but now when I do the spell it hits myself

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

function getCombatFormulas(cid, level, magicLevel)
	local formula_min = -(level * 1 + magicLevel * 1) * 0.8
	local formula_max = -(level * 1 + magicLevel * 1) * 1
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

local distanceCombat = createCombatObject()
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

function getCombatFormulas(cid, level, magicLevel)
	local formula_min = -(level * 1 + magicLevel * 1) * 0.8
	local formula_max = -(level * 1 + magicLevel * 1) * 1
	return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

function onCastSpell(cid, var)
	if(variantToNumber(var) ~= 0) then
		return doCombat(cid, distanceCombat, var)
	end
	return doCombat(cid, combat, var)
end

Could anyone fix it so you attack the target that you've chosen? (just like now in tibia)
I just want to keep the dmg formula

Thank you in advance and ofcourse rep+
 
Here it is

Here man, use this... I used mathematics to calculate the minimun and the max of the spell. really don't need that big script that u did and posted here... I tested it here and it went well...

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -8, -1, -16, 7, 3, 1.6, 2.2)

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

Cya!!
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.5, 0, -0.65, 0)

local distanceCombat = createCombatObject()
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(distanceCombat, COMBAT_FORMULA_LEVELMAGIC, -0.45, 0, -0.55, 0)

function onCastSpell(cid, var)
	if(variantToNumber(var) ~= 0) then
		return doCombat(cid, distanceCombat, var)
	end
	return doCombat(cid, combat, var)
end
 
How to calculate the dmg?
could you explain, please?:eek:

Simple. According to the persons magiclevel, it will multiply by 1 plus level times 1, and it all for 0.8. And so, calculating for the minimun level - 8 - and minimun magiclevel - 1 - it will multiply one by another in the reason, so we have a proportion. Believe me, it works acording to your level magiclevel. Mathematics never lie... xD
 
Back
Top Bottom