Ir para conteúdo
  • 0

[DESESPERADO AJUDA?] Cooldown


joisman

Pergunta

Preciso que alguém me ajude a colocar cool down nessa magia aqui..

Já vi uns 10 tutoriais, e são bons.. só que pra mim poder usar eles eu teria que refazer todas minhas magias dai fica foda

se alguma boa alma poder me ajudar!

 

OBS: o problema está sendo aqui

 

function onCastSpell(cid, var)
doCreatureSay(cid,"", TALKTYPE_ORANGE_1)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 350, parameters)
addEvent(onCastSpell3, 700, parameters)
addEvent(onCastSpell4, 1050, parameters)

 

 

edit

AQUI A SPELL COMPLETA

 

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

local combat2 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)


local combat3 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

local combat4 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4, 0, -5, 0)


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,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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, 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)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)
setCombatArea(combat3, area3)
setCombatArea(combat4, area4)

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 area = createCombatArea(AREA_BEAM7, AREADIAGONAL_BEAM7)
setCombatArea(combat, area)

function onCastSpell(cid, var)
doCreatureSay(cid,"", TALKTYPE_ORANGE_1)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 350, parameters)
addEvent(onCastSpell3, 700, parameters)
addEvent(onCastSpell4, 1050, parameters)

return TRUE
end

 

Editado por joisman
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

local combat2 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)


local combat3 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

local combat4 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4, 0, -5, 0)


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, 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},
}

arr3 = {
{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},
}

arr4 = {
{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},
}

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

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 area = createCombatArea(AREA_BEAM7, AREADIAGONAL_BEAM7)
setCombatArea(combat, area)

function onCastSpell(cid, var)
doCreatureSay(cid,"", TALKTYPE_ORANGE_1)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 350, parameters)
addEvent(onCastSpell3, 700, parameters)
addEvent(onCastSpell4, 1050, parameters)

return TRUE
end

 

Prontinho (:

REP+?

Editado por IgorSilveira
Link para o comentário
Compartilhar em outros sites

  • 0


local combat1 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

 

local combat2 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

 

 

local combat3 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

 

local combat4 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 26)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -4, 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, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

}

 

arr4 = {

{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},

}

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

local area4 = createCombatArea(arr4)

setCombatArea(combat1, area1)

setCombatArea(combat2, area2)

setCombatArea(combat3, area3)

setCombatArea(combat4, area4)

 

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 area = createCombatArea(AREA_BEAM7, AREADIAGONAL_BEAM7)

setCombatArea(combat, area)

 

function onCastSpell(cid, var)

if exhaustion.check(cid, 23006) == false then

exhaustion.set(cid, 23006, 5)

return doCombat(cid, combat, var)

else

doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]")

end

end

Editado por RUKlA
Link para o comentário
Compartilhar em outros sites

  • 0

Não deu certo também.. quando tira o

function onCastSpell(cid, var)
doCreatureSay(cid,"", TALKTYPE_ORANGE_1)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 100, parameters)
addEvent(onCastSpell2, 350, parameters)
addEvent(onCastSpell3, 700, parameters)
addEvent(onCastSpell4, 1050, parameters)

 

 

magia para de funcionar por isso não tá dando de adicionar o cooldown, já to a mais de três dias atrás disso.. será que ninguém pode me ajudar? :S

Link para o comentário
Compartilhar em outros sites

  • 0

Testa esse ai

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)
local arr = {
{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}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onCastSpell(cid, var)
 if exhaustion.check(cid, 23006) == false then
                exhaustion.set(cid, 23006, 5)
return doCombat(cid, combat, var)
    else
                doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23006).."]")
        end
return false
end
Editado por RUKlA
Link para o comentário
Compartilhar em outros sites

  • 0


-- SCRIPT BY IGOR SILVEIRA

 

local combat = createCombatObject()

 

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)

setCombatParam(combat, COMBAT_PARAM_EFFECT, 26)

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)

local arr = {

{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}

}

local area = createCombatArea(arr)

setCombatArea(combat, area)

function onCastSpell(cid, var)

if exhaustion.check(cid, 23006) == false then

exhaustion.set(cid, 23006, 5)

return doCombat(cid, combat, var)

else

doPlayerSendCancel(cid, "CD:[" ..exhaustion.get(cid, 23006).."]")

end

 

return doCombat(cid, combat, var)

end

Link para o comentário
Compartilhar em outros sites

  • 0

Você colocar cooldown para os player soltar tipo em 2 a 2 seg certo? se for não seria na tag em spell.xml?

interval="2000"

foi oque eu entendi se não pode me explica dnovo?

Link para o comentário
Compartilhar em outros sites

  • 0

Você colocar cooldown para os player soltar tipo em 2 a 2 seg certo? se for não seria na tag em spell.xml?

interval="2000"

foi oque eu entendi se não pode me explica dnovo?

 

sim é um cooldown pra por em 1 só magia, no spells.cml tem só o "exhaustion" só que ele é o tempo entre todas as magias! ai se eu puder exhaustion 50000, fica 50segundos sem soltar nenhuma magia, por isso queria cooldown só na spell .--.

Rukia, não deu certo.. ele não da é o cd..

Link para o comentário
Compartilhar em outros sites

  • 0

/\ nao tas testando com GOD/GM neh? ;x

 

 

é capaz dele ta testando com o god ou o cm, pq nenhum script acima funciono ;x

 

Não é porque eu não esteja conseguindo fazer o script que eu seja burro né?

Link para o comentário
Compartilhar em outros sites

  • 0

como o autor disse, ele quer um cooldown alto, e se por através de exhaustion padrão das magias, todas as magias vão ficar congeladas por muito tempo, usa o script assim (basta modificar a primeira linha para ajustar o tempo de exhaustion):

 

 

local tempo = 50 -- em segundos
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 26)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -4.0, 0, -5, 0)
 
local area = createCombatArea({
{0, 1, 0},
{1, 2, 1},
{0, 1, 0},
})
 
setCombatArea(combat, area)
 
local function onCastSpell(parameters)
    if not isCreature(parameters.cid) then return end
    doCombat(parameters.cid, combat1, parameters.var)
end
 
local exhaustion = {}
 
function onCastSpell(cid, var)
    local guid = getPlayerGUID(cid)
    if exhaustion[guid] and exhaustion[guid] - os.clock() > 0 then
        return not doPlayerSendCancel(cid, "You are still exhausted from this spell.")
    end
    exhaustion[guid] = os.clock() + tempo
    local parameters = {cid = cid, var = var}
    local times = {100, 350, 700, 1050}
    for _, delay in pairs (times) do
        addEvent(onCastSpell, delay, parameters)
    end
return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Obg, deu certo!

E se a magia tiver mais de 1 efeito tipo, essa você consegue fazer?

 

MAGIA

 

local spellConfig = {
{effect = 41,
area = createCombatArea({
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0},
{0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 1},
{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0},
{0, 0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0, 1, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}})
},
{effect = 41,
area = createCombatArea({
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0},
{0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 2, 0, 1, 0, 1, 0},
{0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}})
},
{effect = 43,
area = createCombatArea({
{1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1},
{0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0},
{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0},
{0, 0, 0, 1, 1, 2, 1, 0, 0, 0, 0},
{1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}})
}
}


local combats = {}
for k, config in ipairs(spellConfig) do
combats[k] = createCombatObject()
onTargetTile = function(cid, pos)
local basePos = getThingPosition(cid)
local fromPos = {x=basePos.x-1, y=basePos.y-19, z=basePos.z}
doSendDistanceShoot(fromPos, pos, 28)
end
setCombatCallback(combats[k], CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatParam(combats[k], COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combats[k], COMBAT_PARAM_EFFECT, config.effect)
setCombatFormula(combats[k], COMBAT_FORMULA_LEVELMAGIC, -10, -25, -10, -30)
setCombatArea(combats[k], config.area)
end


local function castingSpellTime(p)
if(isCreature(p[1]) == TRUE) then
doCombat(unpack(p))
end
end

function onCastSpell(cid, var)
doCreatureSay(cid,"", TALKTYPE_ORANGE_1)
for k, combat in ipairs(combats) do
addEvent(castingSpellTime, (250*k), {cid, combat, var})
end
return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0


local spellConfig = {

{effect = 41,

area = createCombatArea({

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},

{0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0},

{0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 1},

{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0},

{0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0},

{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}})

},

{effect = 43,

area = createCombatArea({

{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, 1, 1, 0, 0, 0, 0, 0, 0},

{0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0},

{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},

{0, 0, 0, 1, 0, 2, 1, 1, 0, 0, 0},

{0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},

{0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}})

},

{effect = 41,

area = createCombatArea({

{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, 1, 0, 0, 0, 1, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0},

{0, 0, 0, 1, 1, 2, 1, 0, 0, 0, 0},

{0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0},

{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 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}})

},

{effect = 43,

area = createCombatArea({

{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, 0, 0, 0, 1},

{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0},

{0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},

{0, 0, 0, 0, 1, 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, 1, 0}})

},

{effect = 41,

area = createCombatArea({

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},

{0, 0, 1, 0, 1, 2, 1, 0, 0, 1, 0},

{0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0},

{0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0},

{0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}})

},

{effect = 43,

area = createCombatArea({

{0, 0, 0, 0, 1, 0, 0, 0, 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, 1, 0, 0, 0},

{0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 0},

{0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0},

{0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0},

{0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}})

},

{effect = 41,

area = createCombatArea({

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0},

{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0},

{0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 2, 0, 1, 0, 1, 0},

{0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0},

{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}})

},

{effect = 43,

area = createCombatArea({

{1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1},

{0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0},

{0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0},

{0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0},

{0, 0, 0, 1, 1, 2, 1, 0, 0, 0, 0},

{1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0},

{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},

{0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0},

{0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},

{0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1}})

}

}

 

 

local combats = {}

for k, config in ipairs(spellConfig) do

combats[k] = createCombatObject()

onTargetTile = function(cid, pos)

local basePos = getThingPosition(cid)

local fromPos = {x=basePos.x-1, y=basePos.y-19, z=basePos.z}

doSendDistanceShoot(fromPos, pos, 28)

end

setCombatCallback(combats[k], CALLBACK_PARAM_TARGETTILE, "onTargetTile")

setCombatParam(combats[k], COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)

setCombatParam(combats[k], COMBAT_PARAM_EFFECT, config.effect)

setCombatFormula(combats[k], COMBAT_FORMULA_LEVELMAGIC, -10, -25, -10, -30)

setCombatArea(combats[k], config.area)

end

 

 

local function castingSpellTime(p)

if(isCreature(p[1]) == TRUE) then

doCombat(unpack(p))

end

end

 

function onCastSpell(cid, var)

if exhaustion.check(cid, 23007) == false then

exhaustion.set(cid, 23007, 70)

else

doPlayerSendCancel(cid, "Cooldown[" ..exhaustion.get(cid, 23007).."]")

return false

end

doCreatureSay(cid,"", TALKTYPE_ORANGE_1)

for k, combat in ipairs(combats) do

addEvent(castingSpellTime, (250*k), {cid, combat, var})

end

return true

end

 

Editado por RUKlA
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...