• 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 converting spell to tfs 1.x

rudger

Active Member
Joined
Oct 1, 2010
Messages
251
Solutions
1
Reaction score
32
Location
The Netherlands
I'm using tfs 1.2, version 8.6.
Can someone tell me how I can convert this script to tfs 1.x?

Code:
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()
local acombat5 = createCombatObject()
local acombat6 = createCombatObject()
local acombat7 = createCombatObject()
 
 
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.7, -84, -2.4, -108)
 
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat5 = createCombatObject()
setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat5, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat5, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat6 = createCombatObject()
setCombatParam(combat6, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat6, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat6, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat6, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat7 = createCombatObject()
setCombatParam(combat7, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat7, COMBAT_PARAM_EFFECT, 47)
setCombatParam(combat7, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatFormula(combat7, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat8 = createCombatObject()
setCombatParam(combat8, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat8, COMBAT_PARAM_EFFECT, 47)
setCombatFormula(combat8, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat9 = createCombatObject()
setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat9, COMBAT_PARAM_EFFECT, 48)
setCombatFormula(combat9, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat10 = createCombatObject()
setCombatParam(combat10, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat10, COMBAT_PARAM_EFFECT, 48)
setCombatFormula(combat10, COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
 
local combat11 = createCombatObject()
setCombatParam(combat11, CO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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, 0, 0}
}
 
 
 
local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
local area5 = createCombatArea(arr5)
local area6 = createCombatArea(arr6)
local area7 = createCombatArea(arr7)
local area8 = createCombatArea(arr8)
local area9 = createCombatArea(arr9)
local area10 = createCombatArea(arr10)
local area11 = createCombatArea(arr11)
 
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
setCombatArea(acombat4, area4)
setCombatArea(acombat5, area5)
setCombatArea(acombat6, area6)
setCombatArea(acombat7, area7)
setCombatArea(combat8, area8)
setCombatArea(combat9, area9)
setCombatArea(combat10, area10)
setCombatArea(combat11, area11)
 
 
function onTargetTile1(cid, pos)
   doCombat(cid,combat1,positionToVariant(pos))
end
 
function onTargetTile2(cid, pos)
   doCombat(cid,combat2,positionToVariant(pos))
end
 
function onTargetTile3(cid, pos)
   doCombat(cid,combat3,positionToVariant(pos))
end
 
function onTargetTile4(cid, pos)
   doCombat(cid,combat4,positionToVariant(pos))
end
 
function onTargetTile5(cid, pos)
   doCombat(cid,combat5,positionToVariant(pos))
end
 
function onTargetTile6(cid, pos)
   doCombat(cid,combat6,positionToVariant(pos))
end
 
function onTargetTile7(cid, pos)
   doCombat(cid,combat7,positionToVariant(pos))
end
 
 
 
setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, "onTargetTile1")
 
setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, "onTargetTile2")
 
setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")
 
setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")
 
setCombatCallback(acombat5, CALLBACK_PARAM_TARGETTILE, "onTargetTile5")
 
setCombatCallback(acombat6, CALLBACK_PARAM_TARGETTILE, "onTargetTile6")
 
setCombatCallback(acombat7, CALLBACK_PARAM_TARGETTILE, "onTargetTile7")
 
 
local function onCastSpell1(parameters)
    doCombat(parameters.cid, acombat1, parameters.var)
end
 
local function onCastSpell2(parameters)
    doCombat(parameters.cid, acombat2, parameters.var)
end
 
local function onCastSpell3(parameters)
    doCombat(parameters.cid, acombat3, parameters.var)
end
 
local function onCastSpell4(parameters)
    doCombat(parameters.cid, acombat4, parameters.var)
end
 
local function onCastSpell5(parameters)
    doCombat(parameters.cid, acombat5, parameters.var)
end
 
local function onCastSpell6(parameters)
    doCombat(parameters.cid, acombat6, parameters.var)
end
 
local function onCastSpell7(parameters)
    doCombat(parameters.cid, acombat7, parameters.var)
end
 
local function onCastSpell8(parameters)
    doCombat(parameters.cid, combat8, parameters.var)
end
 
local function onCastSpell9(parameters)
    doCombat(parameters.cid, combat9, parameters.var)
end
 
local function onCastSpell10(parameters)
    doCombat(parameters.cid, combat10, parameters.var)
end
 
local function onCastSpell11(parameters)
    doCombat(parameters.cid, combat11, parameters.var)
end
 
 
 
function onCastSpell(cid, var)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 0, parameters)
addEvent(onCastSpell2, 100, parameters)
addEvent(onCastSpell3, 200, parameters)
addEvent(onCastSpell4, 300, parameters)
addEvent(onCastSpell5, 400, parameters)
addEvent(onCastSpell6, 500, parameters)
addEvent(onCastSpell7, 600, parameters)
addEvent(onCastSpell8, 900, parameters)
addEvent(onCastSpell9, 1200, parameters)
addEvent(onCastSpell10, 1500, parameters)
addEvent(onCastSpell11, 1500, parameters)
return TRUE
end
 
Solution
Give this a try;
Lua:
local interval, area, combat = { 1, 100, 200, 300, 400, 500, 600, 900, 1200, 1500, 1500 },
{
    {
        { 0, 1, 0 },
        { 1, 2, 1 },
        { 0, 1, 0 },
    }, {
        { 0, 0, 1, 0, 0 },
        { 0, 0, 0, 0, 0 },
        { 1, 0, 2, 0, 1 },
        { 0, 0, 0, 0, 0 },
        { 0, 0, 1, 0, 0 }
    }, {
        { 0, 0, 0, 1, 0 },
        { 1, 0, 0, 0, 0 },
        { 0, 0, 2, 0, 0 },
        { 0, 0, 0, 0, 1 },
        { 0, 1, 0, 0, 0 }
    }, {
        { 0, 0, 0, 0, 1, 0, 0 },
        { 0, 0, 0, 0, 0, 0, 0 },
        { 1, 0, 0, 0, 0, 0, 0 },
        { 0, 0, 0, 2, 0, 0, 0 },
        { 0, 0, 0, 0, 0, 0, 1 },
        { 0, 0, 0, 0, 0, 0, 0 },
        { 0, 0, 1, 0, 0, 0, 0 }
    }, {
        { 0, 0, 0, 1, 0, 0, 0...
Give this a try;
Lua:
local interval, area, combat = { 1, 100, 200, 300, 400, 500, 600, 900, 1200, 1500, 1500 },
{
    {
        { 0, 1, 0 },
        { 1, 2, 1 },
        { 0, 1, 0 },
    }, {
        { 0, 0, 1, 0, 0 },
        { 0, 0, 0, 0, 0 },
        { 1, 0, 2, 0, 1 },
        { 0, 0, 0, 0, 0 },
        { 0, 0, 1, 0, 0 }
    }, {
        { 0, 0, 0, 1, 0 },
        { 1, 0, 0, 0, 0 },
        { 0, 0, 2, 0, 0 },
        { 0, 0, 0, 0, 1 },
        { 0, 1, 0, 0, 0 }
    }, {
        { 0, 0, 0, 0, 1, 0, 0 },
        { 0, 0, 0, 0, 0, 0, 0 },
        { 1, 0, 0, 0, 0, 0, 0 },
        { 0, 0, 0, 2, 0, 0, 0 },
        { 0, 0, 0, 0, 0, 0, 1 },
        { 0, 0, 0, 0, 0, 0, 0 },
        { 0, 0, 1, 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 },
        { 1, 0, 0, 2, 0, 0, 1 },
        { 0, 0, 0, 0, 0, 0, 0 },
        { 0, 0, 0, 0, 0, 0, 0 },
        { 0, 0, 0, 1, 0, 0, 0 }
    }, {
        { 0, 0, 0, 1, 0 },
        { 1, 0, 0, 0, 0 },
        { 0, 0, 2, 0, 0 },
        { 0, 0, 0, 0, 1 },
        { 0, 1, 0, 0, 0 }
    }, {
        { 0, 1, 0, 0, 0 },
        { 0, 0, 0, 0, 1 },
        { 0, 0, 2, 0, 0 },
        { 1, 0, 0, 0, 0 },
        { 0, 0, 0, 1, 0 }
    }, {
        { 0, 0, 0, 1, 0, 0, 0 },
        { 0, 0, 1, 0, 1, 0, 0 },
        { 0, 1, 0, 0, 0, 1, 0 },
        { 1, 0, 0, 2, 0, 0, 1 },
        { 0, 1, 0, 0, 0, 1, 0 },
        { 0, 0, 1, 0, 1, 0, 0 },
        { 0, 0, 0, 1, 0, 0, 0 }
    }, {
        { 0, 0, 0, 1, 0, 0, 0 },
        { 0, 0, 1, 0, 1, 0, 0 },
        { 0, 1, 0, 0, 0, 1, 0 },
        { 1, 0, 0, 2, 0, 0, 1 },
        { 0, 1, 0, 0, 0, 1, 0 },
        { 0, 0, 1, 0, 1, 0, 0 },
        { 0, 0, 0, 1, 0, 0, 0 }
    }, {
        { 0, 0, 1, 0, 0 },
        { 0, 1, 0, 1, 0 },
        { 1, 0, 2, 0, 1 },
        { 0, 1, 0, 1, 0 },
        { 0, 0, 1, 0, 0 }
    }, {
        { 0, 1, 0 },
        { 1, 2, 1 },
        { 0, 1, 0 }
    },
}, {}

for i = 1, 11 do
    combat[#combat + 1] = Combat()
    combat[i]:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    combat[i]:setParameter(COMBAT_PARAM_EFFECT, i <= 8 and CONST_ME_CARNIPHILA or CONST_ME_PURPLEENERGY)
    if i <= 7 then
        combat[i]:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SHIVERARROW)
    end
    combat[i]:setFormula(COMBAT_FORMULA_LEVELMAGIC, i == 1 and -1.7, -84, -2.4, -108 or -2.3, -184, -3, -240)
    combat[i]:setArea(createCombatArea(area[i]))
end

local function castSpell(creature, variant, i)
    creature = Creature(creature)
    if creature then
        combat[i]:execute(creature, variant)
    end
end

function onCastSpell(creature, variant)
    for i = 1, 11 do
        addEvent(castSpell, interval[i], creature:getId(), variant, i)
    end
end
 
Solution
This is too advanced for me, how would it work in a more simple way?

Code:
local acombat1 = Combat()
local acombat2 = Combat()
local acombat3 = Combat()
local acombat4 = Combat()
local acombat5 = Combat()
local acombat6 = Combat()
local acombat7 = Combat()
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, 47)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.7, -84, -2.4, -108)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 47)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, 47)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, 47)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, 47)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, 47)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, 47)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, 47)
combat8:setFormula((COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat9 = Combat()
combat9:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat9:setParameter(COMBAT_PARAM_EFFECT, 48)
combat9:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat10 = Combat()
combat10:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat10:setParameter(COMBAT_PARAM_EFFECT, 48)
combat10:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat11 = Combat()
combat11:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat11:setParameter(COMBAT_PARAM_EFFECT, 48)
combat11:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3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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}
}
combat1:setArea(createCombatArea(area1))
combat2:setArea(createCombatArea(area2))
combat3:setArea(createCombatArea(area3))
combat4:setArea(createCombatArea(area4))
combat5:setArea(createCombatArea(area5))
combat6:setArea(createCombatArea(area6))
combat7:setArea(createCombatArea(area7))
combat8:setArea(createCombatArea(area8))
combat9:setArea(createCombatArea(area9))
combat10:setArea(createCombatArea(area10))
combat11:setArea(createCombatArea(area11))
local function castSpell(creature, variant)
    creature = Creature(creature)
    if creature then
        combat1:execute(creature, variant)
   combat2:execute(creature, variant)
   combat3:execute(creature, variant)
   combat4:execute(creature, variant)
   combat5:execute(creature, variant)
   combat6:execute(creature, variant)
   combat7:execute(creature, variant)
   combat8:execute(creature, variant)
   combat9:execute(creature, variant)
   combat10:execute(creature, variant)
   combat11:execute(creature, variant)
    end
end



function onCastSpell(creature, variant)
        addEvent(castSpell1, 0, creature:getId(), variant)
   addEvent(castSpell2, 100, creature:getId(), variant)
   addEvent(castSpell3, 200, creature:getId(), variant)
   addEvent(castSpell4, 300, creature:getId(), variant)
   addEvent(castSpell5, 400, creature:getId(), variant)
   addEvent(castSpell6, 500, creature:getId(), variant)
   addEvent(castSpell7, 600, creature:getId(), variant)
   addEvent(castSpell8, 900, creature:getId(), variant)
   addEvent(castSpell9, 1200, creature:getId(), variant)
   addEvent(castSpell10, 1500, creature:getId(), variant)
   addEvent(castSpell11, 1500, creature:getId(), variant)
end
 
This is too advanced for me, how would it work in a more simple way?

Code:
local acombat1 = Combat()
local acombat2 = Combat()
local acombat3 = Combat()
local acombat4 = Combat()
local acombat5 = Combat()
local acombat6 = Combat()
local acombat7 = Combat()
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, 47)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.7, -84, -2.4, -108)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, 47)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, 47)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, 47)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, 47)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, 47)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, 47)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 35)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, 47)
combat8:setFormula((COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat9 = Combat()
combat9:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat9:setParameter(COMBAT_PARAM_EFFECT, 48)
combat9:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat10 = Combat()
combat10:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat10:setParameter(COMBAT_PARAM_EFFECT, 48)
combat10:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
local combat11 = Combat()
combat11:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat11:setParameter(COMBAT_PARAM_EFFECT, 48)
combat11:setFormula(COMBAT_FORMULA_LEVELMAGIC, -2.3, -184, -3, -240)
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, 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, 0, 0}
}
arr2 = {
{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, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 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}
}
arr11 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 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, 0, 0}
}
combat1:setArea(createCombatArea(area1))
combat2:setArea(createCombatArea(area2))
combat3:setArea(createCombatArea(area3))
combat4:setArea(createCombatArea(area4))
combat5:setArea(createCombatArea(area5))
combat6:setArea(createCombatArea(area6))
combat7:setArea(createCombatArea(area7))
combat8:setArea(createCombatArea(area8))
combat9:setArea(createCombatArea(area9))
combat10:setArea(createCombatArea(area10))
combat11:setArea(createCombatArea(area11))
local function castSpell(creature, variant)
    creature = Creature(creature)
    if creature then
        combat1:execute(creature, variant)
   combat2:execute(creature, variant)
   combat3:execute(creature, variant)
   combat4:execute(creature, variant)
   combat5:execute(creature, variant)
   combat6:execute(creature, variant)
   combat7:execute(creature, variant)
   combat8:execute(creature, variant)
   combat9:execute(creature, variant)
   combat10:execute(creature, variant)
   combat11:execute(creature, variant)
    end
end



function onCastSpell(creature, variant)
        addEvent(castSpell1, 0, creature:getId(), variant)
   addEvent(castSpell2, 100, creature:getId(), variant)
   addEvent(castSpell3, 200, creature:getId(), variant)
   addEvent(castSpell4, 300, creature:getId(), variant)
   addEvent(castSpell5, 400, creature:getId(), variant)
   addEvent(castSpell6, 500, creature:getId(), variant)
   addEvent(castSpell7, 600, creature:getId(), variant)
   addEvent(castSpell8, 900, creature:getId(), variant)
   addEvent(castSpell9, 1200, creature:getId(), variant)
   addEvent(castSpell10, 1500, creature:getId(), variant)
   addEvent(castSpell11, 1500, creature:getId(), variant)
end

The code I posted is as good as it gets pretty much, it just loops everything insted of writing the same crap out 1000 times
 
Back
Top