• 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 Balance spells how?

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey i wanna know how i can balance spells for each lvl how can i do that?
what is importen in a spell file?
and if they have diffrent amount of waves how do i do that?
 
Last edited:
you would edit this line in each wave:

setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12)

the underlined numbers are what will change the damage, either raise the number for higher damage or lower the number for lower damage
 
Okey but if i have diffrent amounts of waves then?
1 spell have 4
and the othe have 10
How can i balance it?
and they are on the same lvl
 
Post the script then? ;p

okey sure thing well most of the things when i updated the script as you said thouse dosent work on monsters....

Code:
local formula, area, dmgtype, effect, combat = {
	[1] = {-25.05, -184, -3.66, -133.3},
	[2] = {-25.05, -184, -3.66, -133.3},
	[3] = {-25.05, -184, -3.66, -133.3},
	[4] = {-25.05, -184, -3.66, -133.3},
	[5] = {-25.05, -184, -3.66, -133.3},
	[6] = {-25.05, -184, -3.66, -133.3},
	[7] = {-25.05, -184, -3.66, -133.3},
	[8] = {-25.05, -184, -3.66, -133.3},
	[9] = {-25.05, -184, -3.66, -133.3}
},
{
[1]={
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 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, 1},
		{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1},
		{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1},
		{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1},
		{0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
	}
},
{
	[1] = COMBAT_HOLYDAMAGE,
	[2] = COMBAT_DEATHDAMAGE,
	[3] = COMBAT_FIREDAMAGE,
	[4] = COMBAT_PHYSICALDAMAGE,
	[5] = COMBAT_FIREDAMAGE,
	[6] = COMBAT_POISONDAMAGE,
	[7] = COMBAT_ENERGYDAMAGE,
	[8] = COMBAT_EARTHDAMAGE,
	[9] = COMBAT_LIFEDRAIN
},
{
	[1] = CONST_ME_HOLYDAMAGE,
	[2] = CONST_ME_MORTAREA,
	[3] = CONST_ME_EXPLOSIONAREA,
	[4] = CONST_ME_HITAREA,
	[5] = CONST_ME_FIREAREA,
	[6] = CONST_ME_POISONAREA,
	[7] = CONST_ME_ENERGYAREA,
	[8] = CONST_ME_MAGIC_GREEN,
	[9] = FIREWORK_RED
},
{}
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])
	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], formula[i][9])
	setCombatArea(combat[i], createCombatArea(area[i]))
end

function onCastSpell(cid, var)
        for i = 1, #combat do
                doCombat(cid, combat[i], var)
        end
        return true
end


Code:
local formulas, area, combat = {
	{-22.3, -184, -5, -240},
	{-56.3,  -184, -7, -240},
	{-45.3, -184, -5, -240},
	{-54.3, -184, -7, -240},
	{-47.3, -184, -9, -240}
},
{
	{
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0}
	},
	{
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
	},
	{
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 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, 1, 2, 1, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
		{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}
	}
}, {}
for i = 1, 5 do
	table.insert(combat, createCombatObject())
	setCombatParam(combat[i], COMBAT_PARAM_TYPE, i == 5 and COMBAT_DEATHDAMAGE or COMBAT_PHYSICALDAMAGE)
	setCombatParam(combat[i], COMBAT_PARAM_EFFECT, 3)
	setCombatFormula(combat[i], COMBAT_FORMULA_LEVELMAGIC, formulas[i][1], formulas[i][2], formulas[i][3], formulas[i][4])
	setCombatArea(combat[i], createCombatArea(area[i]))
end

function onCastSpell(cid, var)
	for i = 1, 5 do
		addEvent(function(cid, combat, var) if isPlayer(cid) == TRUE then doCombat(cid, combat, var) end end, i * 200 - 100, cid, combat[i], var)
	end
	return TRUE
end
 
Code:
local formula, area, dmgtype, effect, combat = {
	[1] = {-25.05, -184, -3.66, -133.3},
	[2] = {-25.05, -184, -3.66, -133.3},
	[3] = {-25.05, -184, -3.66, -133.3},
	[4] = {-25.05, -184, -3.66, -133.3},
	[5] = {-25.05, -184, -3.66, -133.3},
	[6] = {-25.05, -184, -3.66, -133.3},
	[7] = {-25.05, -184, -3.66, -133.3},
	[8] = {-25.05, -184, -3.66, -133.3},
	[9] = {-25.05, -184, -3.66, -133.3}
},
you need to change these numbers, but aff they shouldn't be negative and the formula system changed in 0.3.6+ (you're still doing it the old way)
 
Lua:
local formula, area, dmgtype, effect, combat = {
	[1] = {25.05, 184, 3.66, 133.3},
	[2] = {25.05, 184, 3.66, 133.3},
	[3] = {25.05, 184, 3.66, 133.3},
	[4] = {25.05, 184, 3.66, 133.3},
	[5] = {25.05, 184, 3.66, 133.3},
	[6] = {25.05, 184, 3.66, 133.3},
	[7] = {25.05, 184, 3.66, 133.3},
	[8] = {25.05, 184, 3.66, 133.3},
	[9] = {25.05, 184, 3.66, 133.3}
},
 
Well do this help why the spell dose no damage to monsters?
Dint help! it still dosnet do any damage to the monsters...
 
Last edited:
Back
Top