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

_Aion_

Nothing Else
Joined
Jan 19, 2010
Messages
400
Solutions
4
Reaction score
10
Location
Jequie,Bahia,Brazil
Hello.
Someone Can help me?
In my Server, all spells cause lags, my CPU go to 110%.
Im using 8Gb RAM, 4 VCPUS, Ubuntu 14.04.
Whats wrong in this scripts? for causing lag?

Lua:
-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Brush = createCombatObject()
setCombatParam(combat0_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat0_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat0_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 100ms
local combat1_Brush = createCombatObject()
setCombatParam(combat1_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat1_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat1_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat1_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 200ms
local combat2_Brush = createCombatObject()
setCombatParam(combat2_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat2_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat2_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat2_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 300ms
local combat3_Brush = createCombatObject()
setCombatParam(combat3_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat3_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat3_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat3_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 400ms
local combat4_Brush = createCombatObject()
setCombatParam(combat4_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat4_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat4_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat4_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 500ms
local combat5_Brush = createCombatObject()
setCombatParam(combat5_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat5_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat5_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat5_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 600ms
local combat6_Brush = createCombatObject()
setCombatParam(combat6_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat6_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat6_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat6_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 700ms
local combat7_Brush = createCombatObject()
setCombatParam(combat7_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat7_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat7_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat7_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 800ms
local combat8_Brush = createCombatObject()
setCombatParam(combat8_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat8_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat8_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat8_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 900ms
local combat9_Brush = createCombatObject()
setCombatParam(combat9_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat9_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat9_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat9_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1000ms
local combat10_Brush = createCombatObject()
setCombatParam(combat10_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat10_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat10_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat10_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1100ms
local combat11_Brush = createCombatObject()
setCombatParam(combat11_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat11_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat11_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat11_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1200ms
local combat12_Brush = createCombatObject()
setCombatParam(combat12_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat12_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat12_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat12_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1300ms
local combat13_Brush = createCombatObject()
setCombatParam(combat13_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat13_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat13_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat13_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1400ms
local combat14_Brush = createCombatObject()
setCombatParam(combat14_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat14_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat14_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat14_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1500ms
local combat15_Brush = createCombatObject()
setCombatParam(combat15_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat15_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat15_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat15_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1600ms
local combat16_Brush = createCombatObject()
setCombatParam(combat16_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat16_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat16_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat16_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1700ms
local combat17_Brush = createCombatObject()
setCombatParam(combat17_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat17_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat17_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat17_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1800ms
local combat18_Brush = createCombatObject()
setCombatParam(combat18_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat18_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat18_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat18_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 1900ms
local combat19_Brush = createCombatObject()
setCombatParam(combat19_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat19_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat19_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat19_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat20_Brush = createCombatObject()
setCombatParam(combat20_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat20_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat20_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat20_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat21_Brush = createCombatObject()
setCombatParam(combat21_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat21_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat21_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat21_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat22_Brush = createCombatObject()
setCombatParam(combat22_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat22_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat22_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat22_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat23_Brush = createCombatObject()
setCombatParam(combat23_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat23_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat23_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat23_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat24_Brush = createCombatObject()
setCombatParam(combat24_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat24_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat24_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat24_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat25_Brush = createCombatObject()
setCombatParam(combat25_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat25_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat25_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat25_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat26_Brush = createCombatObject()
setCombatParam(combat26_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat26_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat26_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat26_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat27_Brush = createCombatObject()
setCombatParam(combat27_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat27_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat27_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat27_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat28_Brush = createCombatObject()
setCombatParam(combat28_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat28_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat28_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat28_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat29_Brush = createCombatObject()
setCombatParam(combat29_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat29_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat29_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat29_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- Areas/Combat for 2000ms
local combat30_Brush = createCombatObject()
setCombatParam(combat30_Brush, COMBAT_PARAM_DISTANCEEFFECT, math.random(1, 168))
setCombatParam(combat30_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatArea(combat30_Brush,createCombatArea({{3}}))
function onTargetCreature(cid, target)
             if isMonster(cid) then return true end min = (getPlayerLevel(cid) * 5 + getPlayerMagLevel(cid) * 50) * 8
         doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -min, CONST_ME_BLOCKHIT)
     return true
end
setCombatCallback(combat30_Brush, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
    if (isCreature(cid)) then
        doCombat(cid, c, var)
        if (dirList ~= nil) then -- Emit distance effects
            local i = 2;
            while (i < #dirList) do
                doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
                i = i + 2
            end       
        end
    end
end

function onCastSpell(cid, var)
if BlockSpellsInArea(cid) then doPlayerSendCancel(cid, "Nao pode usar Spells neste local..") return false end

    if exhaustion.check(cid, 0005) == TRUE then
        doPlayerSendCancel(cid, "You are exhauted.")
        doSendMagicEffect(getCreaturePosition(cid), 2)
        return false end
    local startPos = getCreaturePosition(cid)
    RunPart(combat0_Brush,cid,var)
    exhaustion.set(cid, 0005, 0.75)
    addEvent(RunPart,100,combat1_Brush,cid,var)
    addEvent(RunPart,200,combat2_Brush,cid,var)
    addEvent(RunPart,300,combat3_Brush,cid,var)
    addEvent(RunPart,400,combat4_Brush,cid,var)
    addEvent(RunPart,500,combat5_Brush,cid,var)
    --addEvent(RunPart,600,combat6_Brush,cid,var)
    --addEvent(RunPart,700,combat7_Brush,cid,var)
    --addEvent(RunPart,800,combat8_Brush,cid,var)
    --addEvent(RunPart,900,combat9_Brush,cid,var)
    --addEvent(RunPart,1000,combat10_Brush,cid,var)
    --addEvent(RunPart,1100,combat11_Brush,cid,var)
    --addEvent(RunPart,1200,combat12_Brush,cid,var)
    --addEvent(RunPart,1300,combat13_Brush,cid,var)
    --addEvent(RunPart,1400,combat14_Brush,cid,var)
    --addEvent(RunPart,1500,combat15_Brush,cid,var)
    --addEvent(RunPart,1600,combat16_Brush,cid,var)
    --addEvent(RunPart,1700,combat17_Brush,cid,var)
    --addEvent(RunPart,1800,combat18_Brush,cid,var)
    --addEvent(RunPart,1900,combat19_Brush,cid,var)
    --addEvent(RunPart,2000,combat20_Brush,cid,var)
    --addEvent(RunPart,2000,combat21_Brush,cid,var)
    --addEvent(RunPart,2000,combat22_Brush,cid,var)
    --addEvent(RunPart,2000,combat23_Brush,cid,var)
    --addEvent(RunPart,2000,combat24_Brush,cid,var)
    --addEvent(RunPart,2000,combat25_Brush,cid,var)
    --addEvent(RunPart,2000,combat26_Brush,cid,var)
    --addEvent(RunPart,2000,combat27_Brush,cid,var)
    --addEvent(RunPart,2000,combat28_Brush,cid,var)
    --addEvent(RunPart,2000,combat29_Brush,cid,var)
    --addEvent(RunPart,2000,combat30_Brush,cid,var)
    return true
end
 
Back
Top