Polat Alemdar
Mapper, Basic Scripter
i want help with my spell
i want one help me to make this spell so when i shoot it i stay in the middle of it!
local area, formula, effect, ctype, combat =
{ -- areas
[1] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0},
{0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},
[2] = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
},
[3] = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}
},
{ -- formulas
[1] = {-2,8 -3.4, -2.9, -3.5},
[2] = {-2,8 -3.4, -2.9, -3.5},
[3] = {-0.5, -0.6, -0.5, -0.6}
},
{ -- effects
[1] = CONST_ME_ENERGYAREA,
[2] = CONST_ME_EXPLOSIONAREA,
[3] = CONST_ME_EXPLOSIONAREA
},
{ -- combat types
[1] = COMBAT_PHYSICALDAMAGE,
[2] = COMBAT_PHYSICALDAMAGE,
[3] = COMBAT_FIREDAMAGE
},
{}
for i = 1, #area do
table.insert(combat, createCombatObject())
setCombatParam(combat, COMBAT_PARAM_TYPE, ctype)
setCombatParam(combat, COMBAT_PARAM_EFFECT, effect)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, formula[1], formula[2], formula[3], formula[4])
setCombatArea(combat, createCombatArea(area))
if isInArray({2, 3}, i) == TRUE then
local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
for i = 1, 6 do addDamageCondition(condition, 1, 7000, i * -100) end
setCombatCondition(combat, condition)
end
end
function onCastSpell(cid, var)
for i = 1, #combat do
doCombat(cid, combat, var)
end
return true
end
i want one help me to make this spell so when i shoot it i stay in the middle of it!
local area, formula, effect, ctype, combat =
{ -- areas
[1] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0},
{0, 0, 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
[3] = {-0.5, -0.6, -0.5, -0.6}
},
{ -- effects
[1] = CONST_ME_ENERGYAREA,
[2] = CONST_ME_EXPLOSIONAREA,
[3] = CONST_ME_EXPLOSIONAREA
},
{ -- combat types
[1] = COMBAT_PHYSICALDAMAGE,
[2] = COMBAT_PHYSICALDAMAGE,
[3] = COMBAT_FIREDAMAGE
},
{}
for i = 1, #area do
table.insert(combat, createCombatObject())
setCombatParam(combat, COMBAT_PARAM_TYPE, ctype)
setCombatParam(combat, COMBAT_PARAM_EFFECT, effect)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, formula[1], formula[2], formula[3], formula[4])
setCombatArea(combat, createCombatArea(area))
if isInArray({2, 3}, i) == TRUE then
local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
for i = 1, 6 do addDamageCondition(condition, 1, 7000, i * -100) end
setCombatCondition(combat, condition)
end
end
function onCastSpell(cid, var)
for i = 1, #combat do
doCombat(cid, combat, var)
end
return true
end