• 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 Spell is bugged doing huge damage...

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey this spell is doing Huge Damage not as before!

Code:
local formula, distEffect, area, dmgtype, effect, combat = {
	[1] = {-34.58, -5.4, -34.9, -10000},
	[2] = {-45.4, -7.5, -44.9, -20000},
	[3] = {-5.8, -0, -14.9, -500000},
	[4] = {-86.82, -5.3, -64.9, -60000},
	[5] = {-82.81, -8.4, -64.9, -70000},
	[6] = {-98.84, -4.3, -44.9, -10000},
	[7] = {-88.8, -9, -36.9, -10000},
	[8] = {-83.87, -9, -36.9, -10000}
},
{
	[1] = CONST_ANI_SMALLHOLY,
	[2] = CONST_ANI_SMALLHOLY,
	[3] = CONST_ANI_SMALLHOLY,
	[4] = CONST_ANI_SMALLHOLY,
	[5] = CONST_ANI_HOLY,
	[6] = CONST_ANI_ETHEREALSPEAR,
	[7] = CONST_ANI_WHIRLWINDCLUB,
	[8] = CONST_ANI_SMALLEARTH

},
{
[1]={
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 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ME_HOLYDAMAGE,
	[7] = CONST_ME_CRAPS,
	[8] = CONST_ME_YELLOWENERGY,

},
{}
for i = 1, #formula do
	table.insert(combat, createCombatObject())
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, dmgtype[i])
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, effect[i])
	setCombatParam(combat[i], COMBAT_PARAM_DISTANCEEFFECT, distEffect[i] or CONST_ANI_NONE)
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, formula[i][1], formula[i][2], formula[i][3], formula[i][4], formula[i][5], formula[i][6], formula[i][7], formula[i][8])
	setCombatArea(combat[i], createCombatArea(area[i]))
end

function onCastSpell(cid, var)
	for i = 1, #formula do
		addEvent(function(cid, combat, var) if isPlayer(cid) == TRUE then doCombat(cid, combat, var) end end, i * 100 + 100, cid, combat[i], var)
	end
	return TRUE
end
 
This
Code:
local formula, distEffect, area, dmgtype, effect, combat = {
	[1] = {-34.58, -5.4, -34.9, -10000},
	[2] = {-45.4, -7.5, -44.9, -20000},
	[3] = {-5.8, -0, -14.9, -500000},
	[4] = {-86.82, -5.3, -64.9, -60000},
	[5] = {-82.81, -8.4, -64.9, -70000},
	[6] = {-98.84, -4.3, -44.9, -10000},
	[7] = {-88.8, -9, -36.9, -10000},
	[8] = {-83.87, -9, -36.9, -10000}

If you want them to shoot lower, make formulas lower.
 
Try this
Code:
local formula, distEffect, area, dmgtype, effect, combat = {
	[1] = {-30.58, -4.4, -30.9, -10000},
	[2] = {-40.4, -6.5, -40.9, -20000},
	[3] = {-5.8, -0, -13.9, -500000},
	[4] = {-80.82, -4.3, -64.9, -60000},
	[5] = {-80.81, -7.0, -64.9, -70000},
	[6] = {-90.84, -3.0, -44.9, -10000},
	[7] = {-80.8, -6, -30.9, -10000},
	[8] = {-80.87, -6, -30.9, -10000}

Does it deal lower now?
 
^You're doing it wrong
Code:
 {minl, maxl, minm, maxm}
&
Code:
min = (int32_t)((player->getLevel() / [B][COLOR="Red"]minl[/COLOR][/B] + player->getMagicLevel() * [B][COLOR="Red"]minm[/COLOR][/B]) * 1. * mina + minb);
max = (int32_t)((player->getLevel() / [B][COLOR="Red"]maxl[/COLOR][/B] + player->getMagicLevel() * [B][COLOR="Red"]maxm[/COLOR][/B]) * 1. * maxa + maxb);
 
Back
Top