Right now it seems popular to have several spells in one .lua file.
A spell might look like this:
See the numbers I marked out in bold text?
That number changes what the spell will look like.
Ice, fire, electricity and so on.
It might be difficult to know what number causes what effect, so I made a chart so you can choose numbers more easily.
It's really easy to use.
If you want to use the first animation on the chart, blood stains, you use the number 0. If you want to use the second animation, the water circles, you use the number two.
Animations was taken from The Forgotten Server, version 0.3.5 (Crying Damson), don't know how it will work on other servers.
A spell might look like this:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 54)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -0.8, 0, -1.3, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 0)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -0.8, 0, -1.3, 0)
arr1 = {
{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, 3, 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},
}
arr2 = {
{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, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 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},
}
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
local function onCastSpell1(parameters)
doCombat(parameters.cid, combat1, parameters.var)
end
local function onCastSpell2(parameters)
doCombat(parameters.cid, combat2, parameters.var)
end
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 1000, parameters)
return TRUE
end
See the numbers I marked out in bold text?
That number changes what the spell will look like.
Ice, fire, electricity and so on.
It might be difficult to know what number causes what effect, so I made a chart so you can choose numbers more easily.
It's really easy to use.
If you want to use the first animation on the chart, blood stains, you use the number 0. If you want to use the second animation, the water circles, you use the number two.
Animations was taken from The Forgotten Server, version 0.3.5 (Crying Damson), don't know how it will work on other servers.