• 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 Ice Cyclone Error

Joined
May 23, 2010
Messages
185
Reaction score
23
I got and error when i try this script

Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 18, 5, 24)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local arr1 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local arr2 = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}

local arr3 = {
{1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1}
}

local arr4 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}

local arr5 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)

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

local function onCastSpell4(parameters)
    doCombat(parameters.cid, parameters.combat4, parameters.var)
end

local function onCastSpell5(parameters)
    doCombat(parameters.cid, parameters.combat5, parameters.var)
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 23000) == false then
                exhaustion.set(cid, 23000, 5)
        if getPlayerMana(cid) >= 115 then
        doPlayerAddMana(cid, -115)
                doPlayerSendCancel(cid, "Now you have to wait five seconds to use this kind of spell again.")
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 300, parameters) 
addEvent(onCastSpell3, 500, parameters) 
addEvent(onCastSpell4, 700, parameters) 
addEvent(onCastSpell5, 900, parameters) 
doCombat(cid, combat, var)
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end
end
end



THE RROR
[27/12/2010 20:30:32] [Error - Spell Interface]
[27/12/2010 20:30:32] In a timer event called from:
[27/12/2010 20:30:32] data/spells/scripts/druid/ice cyc.lua:onCastSpell
[27/12/2010 20:30:32] Description:
[27/12/2010 20:30:32] (luaDoCombat) Combat not found
 
I may be wrong... but try this:
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 18, 5, 24)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local arr1 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local arr2 = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}

local arr3 = {
{1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1}
}

local arr4 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}

local arr5 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)

local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
end

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

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

local function onCastSpell4(parameters)
    doCombat(parameters.cid, combat4, parameters.var)
end

local function onCastSpell5(parameters)
    doCombat(parameters.cid, combat5, parameters.var)
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 23000) == false then
                exhaustion.set(cid, 23000, 5)
        if getPlayerMana(cid) >= 115 then
        doPlayerAddMana(cid, -115)
                doPlayerSendCancel(cid, "Now you have to wait five seconds to use this kind of spell again.")
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 300, parameters) 
addEvent(onCastSpell3, 500, parameters) 
addEvent(onCastSpell4, 700, parameters) 
addEvent(onCastSpell5, 900, parameters) 
doCombat(cid, combat, var)
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end
end
end

you had parameters.combat1 etc, but they were pre-stored before the events were called, so you're basically trying to get data that doesn't exist =)
if it works you know where the +rep button is =P
 
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 18, 5, 24)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local arr1 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local arr2 = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}

local arr3 = {
{1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1}
}

local arr4 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}

local arr5 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)

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

local function onCastSpell4(parameters)
    doCombat(parameters.cid, parameters.combat4, parameters.var)
end

local function onCastSpell5(parameters)
    doCombat(parameters.cid, parameters.combat5, parameters.var)
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 23000) == false then
                exhaustion.set(cid, 23000, 5)
        if getPlayerMana(cid) >= 115 then
        doPlayerAddMana(cid, -115)
                doPlayerSendCancel(cid, "Now you have to wait five seconds to use this kind of spell again.")
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 }
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 300, parameters) 
addEvent(onCastSpell3, 500, parameters) 
addEvent(onCastSpell4, 700, parameters) 
addEvent(onCastSpell5, 900, parameters) 
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end
end
end

try now
 
PHP:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 18, 5, 24)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local arr1 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local arr2 = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}

local arr3 = {
{1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1}
}

local arr4 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 3, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}

local arr5 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)

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

local function onCastSpell4(parameters)
    doCombat(parameters.cid, parameters.combat4, parameters.var)
end

local function onCastSpell5(parameters)
    doCombat(parameters.cid, parameters.combat5, parameters.var)
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 23000) == false then
                exhaustion.set(cid, 23000, 5)
        if getPlayerMana(cid) >= 115 then
        doPlayerAddMana(cid, -115)
                doPlayerSendCancel(cid, "Now you have to wait five seconds to use this kind of spell again.")
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 }
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 300, parameters) 
addEvent(onCastSpell3, 500, parameters) 
addEvent(onCastSpell4, 700, parameters) 
addEvent(onCastSpell5, 900, parameters) 
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end
end
end
 
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 18, 5, 24)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local arr1 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local arr2 = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}

local arr3 = {
{1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1}
}

local arr4 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 2, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}

local arr5 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 2, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)

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

local function onCastSpell4(parameters)
    doCombat(parameters.cid, parameters.combat4, parameters.var)
end

local function onCastSpell5(parameters)
    doCombat(parameters.cid, parameters.combat5, parameters.var)
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 23000) == false then
                exhaustion.set(cid, 23000, 5)
        if getPlayerMana(cid) >= 115 then
        doPlayerAddMana(cid, -115)
                doPlayerSendCancel(cid, "Now you have to wait five seconds to use this kind of spell again.")
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 }
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 300, parameters) 
addEvent(onCastSpell3, 500, parameters) 
addEvent(onCastSpell4, 700, parameters) 
addEvent(onCastSpell5, 900, parameters) 
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end
end
end

try now

PHP:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, 5, 18, 5, 24)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 41)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, 5, 15, 5, 24)

local arr1 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local arr2 = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}

local arr3 = {
{1, 1, 0, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 1, 1}
}

local arr4 = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 3, 1, 1, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}

local arr5 = {
{0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 3, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 1, 0, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0}
}

local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)
setCombatArea(combat5, area5)

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

local function onCastSpell4(parameters)
    doCombat(parameters.cid, parameters.combat4, parameters.var)
end

local function onCastSpell5(parameters)
    doCombat(parameters.cid, parameters.combat5, parameters.var)
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 23000) == false then
                exhaustion.set(cid, 23000, 5)
        if getPlayerMana(cid) >= 115 then
        doPlayerAddMana(cid, -115)
                doPlayerSendCancel(cid, "Now you have to wait five seconds to use this kind of spell again.")
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3, combat4 = combat4, combat5 = combat5 }
addEvent(onCastSpell1, 100, parameters) 
addEvent(onCastSpell2, 300, parameters) 
addEvent(onCastSpell3, 500, parameters) 
addEvent(onCastSpell4, 700, parameters) 
addEvent(onCastSpell5, 900, parameters) 
        else
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end
end
end

correct me if i'm wrong, but haven't you just re-defined the parameters for no reason and made the script longer?
 
Back
Top