# LuaSpell 8 hits/8 effect would that be possible?

#### Daniel Braga

##### New Member
the spell would work as follows, the caster would launch a ball of energy, and in sequence the target would take 8 hits with 8 different effects, each hit 1 different effect in sequence.

giving the appearance that the caster is sort of controlling the energy ball

each effect with function to change position x.y

Solution
the spell would work as follows, the caster would launch a ball of energy, and in sequence the target would take 8 hits with 8 different effects, each hit 1 different effect in sequence.

giving the appearance that the caster is sort of controlling the energy ball

each effect with function to change position x.y
You can get the idea from here if that's what you want
Lua:
``````local acombat = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 17)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.5, -65, -4.5, -0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE...``````

#### abdala ragab

##### Banned User
the spell would work as follows, the caster would launch a ball of energy, and in sequence the target would take 8 hits with 8 different effects, each hit 1 different effect in sequence.

giving the appearance that the caster is sort of controlling the energy ball

each effect with function to change position x.y
You can get the idea from here if that's what you want
Lua:
``````local acombat = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 17)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.5, -65, -4.5, -0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 35)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -4.5, -65, -4.5, -0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 1)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -4.5, -65, -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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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function onCastSpell(cid, var)
local parameters = {cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3,}
end

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 90732) == 1 then
strg = getPlayerStorageValue(cid, 90732)
doCombat(cid, acombat, var)
local parameters = {cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3,}
else
doPlayerSendCancel(cid,"You Must Do The Q Before Casting This Spell.")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return true
end``````

Replies
2
Views
118
TFS 1.X+ Teleport spell
Replies
6
Views
432
Replies
0
Views
199
Replies
0
Views
211
Replies
2
Views
414
Replies
5
Views
256
Replies
2
Views
139