• 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!

Help me with spell tfs 1.3

Slipknt

New Member
Joined
Apr 23, 2021
Messages
6
Reaction score
0
Problem #1
Why can I only cast the spell to target?
How can I use it on myself?

Problem #2
How can I add a distance effect to area 5?

Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat8:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
    }
local area2 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0},
    {0, 0, 2, 1, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area3 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0}
}
local area4 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 1, 2, 0, 0},
    {0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area5 =  {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 0, 0, 3, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area6 =  {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 3, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area7 =  {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
}
local area8 =  {
    {1, 0, 0, 0, 0, 0, 1},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {1, 0, 0, 0, 0, 0, 1}
}

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))

function onCastSpell1(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat1:execute(player, variant)
    end
end

function onCastSpell2(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat2:execute(player, variant)
    end
end

function onCastSpell3(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat3:execute(player, variant)
    end
end

function onCastSpell4(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat4:execute(player, variant)
    end
end

function onCastSpell5(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat5:execute(player, variant)
    end
end

function onCastSpell6(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat6:execute(player, variant)
    end
end

function onCastSpell7(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat7:execute(player, variant)
    end
end

function onCastSpell8(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat8:execute(player, variant)
    end
end

function onCastSpell(creature, variant)
   local player = Player(creature)
    if not player then
        return false
    end
    addEvent(onCastSpell1, 100, player:getId(), variant:getNumber())
    addEvent(onCastSpell2, 300, player:getId(), variant:getNumber())
    addEvent(onCastSpell3, 600, player:getId(), variant:getNumber())
    addEvent(onCastSpell4, 800, player:getId(), variant:getNumber())
    addEvent(onCastSpell5, 1000, player:getId(), variant:getNumber())
    addEvent(onCastSpell6, 1200, player:getId(), variant:getNumber())
    addEvent(onCastSpell7, 1400, player:getId(), variant:getNumber())
    addEvent(onCastSpell8, 1600, player:getId(), variant:getNumber())
    return true
end

Spell.jpg

Lua:
    <instant group="attack" spellid="119" name="Super Spell" words="Super Spell" lvl="1" manapercent="0" prem="0" range="8" needtarget="1" blockwalls="1" cooldown="3000" groupcooldown="500" needlearn="0" script="Custom/Super Spell.lua">
    </instant>
I try change to
Lua:
    <instant group="attack" spellid="119" name="Super Spell" words="Super Spell" lvl="1" manapercent="0" prem="0"  blockwalls="1" cooldown="3000" groupcooldown="500" needlearn="0" script="Custom/Super Spell.lua">
    </instant>
and spell dont work
 
Solution
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)...

M0ustafa

1337
Senator
Joined
Mar 4, 2017
Messages
2,562
Solutions
316
Reaction score
1,137
Location
Egypt
Try this
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat8:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat8:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
    }
local area2 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0},
    {0, 0, 2, 1, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area3 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0}
}
local area4 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 1, 2, 0, 0},
    {0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area5 =  {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 0, 0, 3, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area6 =  {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 3, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area7 =  {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
}
local area8 =  {
    {1, 0, 0, 0, 0, 0, 1},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {1, 0, 0, 0, 0, 0, 1}
}

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))

function onCastSpell1(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat1:execute(player, variant)
    end
end

function onCastSpell2(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat2:execute(player, variant)
    end
end

function onCastSpell3(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat3:execute(player, variant)
    end
end

function onCastSpell4(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat4:execute(player, variant)
    end
end

function onCastSpell5(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat5:execute(player, variant)
    end
end

function onCastSpell6(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat6:execute(player, variant)
    end
end

function onCastSpell7(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat7:execute(player, variant)
    end
end

function onCastSpell8(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat8:execute(player, variant)
    end
end

function onCastSpell(creature, variant)
   local player = Player(creature)
    if not player then
        return false
    end
    addEvent(onCastSpell1, 100, player:getId(), variant:getNumber())
    addEvent(onCastSpell2, 300, player:getId(), variant:getNumber())
    addEvent(onCastSpell3, 600, player:getId(), variant:getNumber())
    addEvent(onCastSpell4, 800, player:getId(), variant:getNumber())
    addEvent(onCastSpell5, 1000, player:getId(), variant:getNumber())
    addEvent(onCastSpell6, 1200, player:getId(), variant:getNumber())
    addEvent(onCastSpell7, 1400, player:getId(), variant:getNumber())
    addEvent(onCastSpell8, 1600, player:getId(), variant:getNumber())
    return true
end
XML:
    <instant group="attack" spellid="119" name="Super Spell" words="Super Spell" lvl="1" manapercent="0" prem="0" range="8" selftarget="1" needtarget="1" blockwalls="1" cooldown="3000" groupcooldown="500" needlearn="0" script="Custom/Super Spell.lua">
 
OP
OP
S

Slipknt

New Member
Joined
Apr 23, 2021
Messages
6
Reaction score
0
Try this
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat8:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat8:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
    }
local area2 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0},
    {0, 0, 2, 1, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area3 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0}
}
local area4 =  {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 1, 2, 0, 0},
    {0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area5 =  {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 0, 0, 3, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area6 =  {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 3, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area7 =  {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
}
local area8 =  {
    {1, 0, 0, 0, 0, 0, 1},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {1, 0, 0, 0, 0, 0, 1}
}

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))

function onCastSpell1(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat1:execute(player, variant)
    end
end

function onCastSpell2(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat2:execute(player, variant)
    end
end

function onCastSpell3(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat3:execute(player, variant)
    end
end

function onCastSpell4(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat4:execute(player, variant)
    end
end

function onCastSpell5(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat5:execute(player, variant)
    end
end

function onCastSpell6(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat6:execute(player, variant)
    end
end

function onCastSpell7(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat7:execute(player, variant)
    end
end

function onCastSpell8(cid, varid)
    local player = Player(cid)
    if not player then
        return
    end
    local variant = Variant(varid)
    if variant then
        combat8:execute(player, variant)
    end
end

function onCastSpell(creature, variant)
   local player = Player(creature)
    if not player then
        return false
    end
    addEvent(onCastSpell1, 100, player:getId(), variant:getNumber())
    addEvent(onCastSpell2, 300, player:getId(), variant:getNumber())
    addEvent(onCastSpell3, 600, player:getId(), variant:getNumber())
    addEvent(onCastSpell4, 800, player:getId(), variant:getNumber())
    addEvent(onCastSpell5, 1000, player:getId(), variant:getNumber())
    addEvent(onCastSpell6, 1200, player:getId(), variant:getNumber())
    addEvent(onCastSpell7, 1400, player:getId(), variant:getNumber())
    addEvent(onCastSpell8, 1600, player:getId(), variant:getNumber())
    return true
end
XML:
    <instant group="attack" spellid="119" name="Super Spell" words="Super Spell" lvl="1" manapercent="0" prem="0" range="8" selftarget="1" needtarget="1" blockwalls="1" cooldown="3000" groupcooldown="500" needlearn="0" script="Custom/Super Spell.lua">
Funciona, pero el spell corre conmigo, como hago que se quede ?
Post automatically merged:

It works, but the spell runs with me, how do I make it stay?
 

M0ustafa

1337
Senator
Joined
Mar 4, 2017
Messages
2,562
Solutions
316
Reaction score
1,137
Location
Egypt
Try this
XML:
<instant group="attack" spellid="119" name="Super Spell" words="Super Spell" lvl="1" manapercent="0" prem="0" range="8" selftarget="1" blockwalls="1" cooldown="3000" groupcooldown="500" needlearn="0" script="Custom/Super Spell.lua">
 

Levi999x

AoT
Joined
Dec 14, 2017
Messages
1,802
Solutions
35
Reaction score
1,002
Location
Germany
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat8:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat8:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
    }
local area2 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0},
    {0, 0, 2, 1, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area3 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0}
}
local area4 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 1, 2, 0, 0},
    {0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area5 = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 0, 0, 3, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area6 = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 3, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area7 = {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
}
local area8 = {
    {1, 0, 0, 0, 0, 0, 1},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {1, 0, 0, 0, 0, 0, 1}
}

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))

local function test1(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat1:execute(caster, target)
end

local function test2(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat2:execute(caster, target)
end

local function test3(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat3:execute(caster, target)
end

local function test4(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat4:execute(caster, target)
end

local function test5(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat5:execute(caster, target)
end

local function test6(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat6:execute(caster, target)
end

local function test7(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat7:execute(caster, target)
end

local function test8(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat8:execute(caster, target)
end

function onCastSpell(caster, target)
    addEvent(test1, 100, caster:getId(), target)
    addEvent(test2, 300, caster:getId(), target)
    addEvent(test3, 500, caster:getId(), target)
    addEvent(test4, 800, caster:getId(), target)
    addEvent(test5, 1000, caster:getId(), target)
    addEvent(test6, 1200, caster:getId(), target)
    addEvent(test7, 1400, caster:getId(), target)
    addEvent(test8, 1600, caster:getId(), target)
    return true
end
 
Solution
OP
OP
S

Slipknt

New Member
Joined
Apr 23, 2021
Messages
6
Reaction score
0
Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat1:setFormula(COMBAT_FORMULA_LEVELMAGIC, -55.2, 1, -55.2, 1)
local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat2:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat3:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat4:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat5:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat6:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat7:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)
local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat8:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
combat8:setFormula(COMBAT_FORMULA_LEVELMAGIC, -1.2, 1, -1.2, 1)

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
    }
local area2 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0},
    {0, 0, 2, 1, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area3 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0}
}
local area4 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 1, 2, 0, 0},
    {0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area5 = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 0, 0, 3, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area6 = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 3, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area7 = {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
}
local area8 = {
    {1, 0, 0, 0, 0, 0, 1},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {1, 0, 0, 0, 0, 0, 1}
}

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))

local function test1(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat1:execute(caster, target)
end

local function test2(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat2:execute(caster, target)
end

local function test3(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat3:execute(caster, target)
end

local function test4(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat4:execute(caster, target)
end

local function test5(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat5:execute(caster, target)
end

local function test6(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat6:execute(caster, target)
end

local function test7(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat7:execute(caster, target)
end

local function test8(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat8:execute(caster, target)
end

function onCastSpell(caster, target)
    addEvent(test1, 100, caster:getId(), target)
    addEvent(test2, 300, caster:getId(), target)
    addEvent(test3, 500, caster:getId(), target)
    addEvent(test4, 800, caster:getId(), target)
    addEvent(test5, 1000, caster:getId(), target)
    addEvent(test6, 1200, caster:getId(), target)
    addEvent(test7, 1400, caster:getId(), target)
    addEvent(test8, 1600, caster:getId(), target)
    return true
end
it works perfectly, Thank you very very very much!!
 
OP
OP
S

Slipknt

New Member
Joined
Apr 23, 2021
Messages
6
Reaction score
0
nice man
mark as solution so other peoples see it
have fun and a great day
How can I add this formula to my spell?
local min = (level * 3) + (maglevel * 100) + 100
local max = (level * 3.5) + (maglevel * 100) + 200

And where do I mark it as a solution?
 

Icaraii

Active Member
Joined
Jan 5, 2020
Messages
295
Solutions
1
Reaction score
37
How can I add this formula to my spell?
local min = (level * 3) + (maglevel * 100) + 100
local max = (level * 3.5) + (maglevel * 100) + 200

And where do I mark it as a solution?
I don't know if you still need it, but someone my need it, so here it is with the formula:

Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues2(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat2:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues2")

local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues3(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat3:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues3")

local combat4 = Combat()
combat4:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat4:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat4:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues4(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat4:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues4")

local combat5 = Combat()
combat5:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat5:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat5:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues5(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

comba5t:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues5")

local combat6 = Combat()
combat6:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat6:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat6:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues6(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat6:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues6")

local combat7 = Combat()
combat7:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat7:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat7:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues7(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat7:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues7")

local combat8 = Combat()
combat8:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat8:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat8:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues8(player, level, magicLevel)
    local min = (level * 3) + (magicLevel * 100) + 100
    local max = (level * 3.5) + (magicLevel * 100) + 200
    return -min, -max
end

combat8:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues8")

local area1 = {
    {0, 0, 0, 0, 0},
    {0, 1, 1, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
    }
local area2 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0},
    {0, 0, 2, 1, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area3 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 0, 2, 0, 0},
    {0, 0, 1, 1, 0},
    {0, 0, 0, 0, 0}
}
local area4 = {
    {0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0},
    {0, 1, 2, 0, 0},
    {0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0}
}
local area5 = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 0, 0, 3, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area6 = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 3, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0}
}
local area7 = {
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
}
local area8 = {
    {1, 0, 0, 0, 0, 0, 1},
    {0, 1, 0, 0, 0, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 1, 3, 1, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 0, 0, 0, 1, 0},
    {1, 0, 0, 0, 0, 0, 1}
}

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))

local function test1(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat1:execute(caster, target)
end

local function test2(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat2:execute(caster, target)
end

local function test3(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat3:execute(caster, target)
end

local function test4(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat4:execute(caster, target)
end

local function test5(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat5:execute(caster, target)
end

local function test6(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat6:execute(caster, target)
end

local function test7(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat7:execute(caster, target)
end

local function test8(cid, target)
    local caster = Player(cid)
    if not caster then return end
    return combat8:execute(caster, target)
end

function onCastSpell(caster, target)
    addEvent(test1, 100, caster:getId(), target)
    addEvent(test2, 300, caster:getId(), target)
    addEvent(test3, 500, caster:getId(), target)
    addEvent(test4, 800, caster:getId(), target)
    addEvent(test5, 1000, caster:getId(), target)
    addEvent(test6, 1200, caster:getId(), target)
    addEvent(test7, 1400, caster:getId(), target)
    addEvent(test8, 1600, caster:getId(), target)
    return true
end
 
Top