Ir para conteúdo

Featured Replies

Postado
  • Autor
2 horas atrás, Fabi Marzan disse:

Comecei a olhar seu código e você tinha um END demais.

 


local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -135.8, 0, -140.9, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_RED)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -170.8, 0, -175.9, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -150.8, 0, -155.9, 0)

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

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

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

function yagai1(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 1,
            y = getThingPosition(getCreatureTarget(cid)).y,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 399)
    end
end

function yagai2(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 2,
            y = getThingPosition(getCreatureTarget(cid)).y + 2,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 411)
    end
end

function yagai3(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 1,
            y = getThingPosition(getCreatureTarget(cid)).y,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 398)
    end
end

function yagai4(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 2,
            y = getThingPosition(getCreatureTarget(cid)).y + 2,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 396)
    end
end

function yagai5(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 1,
            y = getThingPosition(getCreatureTarget(cid)).y,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 438)
    end
end

function yagai6(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 2,
            y = getThingPosition(getCreatureTarget(cid)).y + 2,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 439)
    end
end

function onCastSpell(cid, var)
    local waittime = 3.0 -- Tempo de exhaustion
    local storage = 143512 -- não mecha
    local storage2 = 55512

    if exhaustion.check(cid, storage) then
        doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
        return false
    end

    local parameters = {cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}

    if getPlayerStorageValue(cid, storage2) == 5 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 4 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 3 then
        addEvent(onCastSpell3, 650, parameters)
        addEvent(yagai5, 50, cid)
        addEvent(yagai6, 650, cid)
    else
        addEvent(onCastSpell1, 650, parameters)
        addEvent(yagai1, 50, cid)
        addEvent(yagai2, 650, cid)
    end
    exhaustion.set(cid, storage, waittime)
    return true
end

 

obrigado funcionou perfeitamente, consegui enteder tambem mais ou menos por cima de como usar o else pois não sabia que existia elseif!

57 minutos atrás, L3K0T disse:

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -135.8, 0, -140.9, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_RED)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -170.8, 0, -175.9, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -150.8, 0, -155.9, 0)

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

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

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

function yagai1(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 399)
    end
end

function yagai2(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 411)
    end
end

function yagai3(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 398)
    end
end

function yagai4(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 396)
    end
end

function yagai5(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 438)
    end
end

function yagai6(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 439)
    end
end

function onCastSpell(cid, var)
    local waittime = 3.0 -- Tempo de exhaustion
    local storage = 143512 -- não mecha
    local storage2 = 55512
    if exhaustion.check(cid, storage) then
        doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
        return false
    end 
    local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}
    if getPlayerStorageValue(cid, storage2) == 5 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 4 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 3 then
        addEvent(onCastSpell3, 650, parameters)
        addEvent(yagai5, 50, cid)
        addEvent(yagai6, 650, cid)
    else
        addEvent(onCastSpell1, 650, parameters)
        addEvent(yagai1, 50, cid)
        addEvent(yagai2, 650, cid)
    end
    exhaustion.set(cid, storage, waittime)
    return true
end

erro: 


function onCastSpell(cid, var) 

não tava fechada

obrigado funcionou perfeitamente! e obrigado por me falar onde estava o erro consegui compreender mais ou menos pois não sabia que existia o elseif!

  • Respostas 5
  • Visualizações 179
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Gabrielx17
    Gabrielx17

    obrigado funcionou perfeitamente, consegui enteder tambem mais ou menos por cima de como usar o else pois não sabia que existia elseif! obrigado funcionou perfeitamente! e obrigado por me falar

  • Fabi Marzan
    Fabi Marzan

    Comecei a olhar seu código e você tinha um END demais.   local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE) setCombatParam(combat1, COMBAT_PARAM

  • local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat1, COMBAT_FOR

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo