Ir para conteúdo

NickRider

Membro
  • Registro em

  • Última visita

Solutions

  1. NickRider's post in (Resolvido)SCRIPT SPELL POR REEST was marked as the answer   
    Queria Saber como Resolver esse ERRO!!
    Fala Galera, sou Novo aqui, e nem sei se estou postando certo. Me Corrige se eu estiver errado por favor. Bem, Primeiramente gostaria de saber aonde estou errando nessa script. Ela é uma script de spells por System de Reset, Eu tentei varias formas, quando eu sempre coloco 2 efeitos em uma spell dá erro.
    Porém com 1 efeito funciona normalmente a script, se puderem me ajudar agradeço muito!!
     
     
     
    [Error - Spell Interface]
    data/spells/scripts/attack/Kamikase Attack.lua:onCastSpell
    Description:
    (luaDoCombat) Combat not found
     
     
     
    local spellConfig = {
            {effect = CONST_ME_GIANTICE,
             area = createCombatArea({
                    {1, 1, 1},
                    {1, 3, 1},
                    {1, 1, 1}})
            },
            {effect = CONST_ME_WATERSPLASH,
             area = createCombatArea({
                    {0, 1, 0, 0, 0},
                    {1, 0, 0, 1, 0},
                    {0, 0, 3, 0, 0},
                    {0, 0, 1, 0, 1},
                    {1, 0, 0, 1, 0}})
            },
            {effect = CONST_ME_GIANTICE,
             area = createCombatArea({
                    {0, 0, 1, 0, 1},
                    {1, 0, 0, 0, 1},
                    {0, 0, 3, 1, 0},
                    {0, 1, 0, 0, 1},
                    {1, 0, 1, 0, 0}})
            },
            {effect = CONST_ME_SMOKE,
             area = createCombatArea({
                    {0, 0, 1, 0, 1},
                    {1, 0, 0, 0, 1},
                    {0, 0, 3, 1, 0},
                    {0, 1, 0, 0, 1},
                    {1, 0, 1, 0, 0}})
            },
            {effect = CONST_ME_WATERSPLASH,
             area = createCombatArea({
                    {0, 0, 1, 0, 1, 0, 0},
                    {0, 0, 0, 0, 0, 1, 0},
                    {1, 0, 0, 0, 0, 0, 1},
                    {0, 0, 1, 3, 1, 0, 0},
                    {1, 0, 0, 0, 0, 0, 1},
                    {0, 0, 1, 0, 0, 0, 0},
                    {0, 0, 1, 0, 1, 0, 0}})
            },
            {effect = CONST_ME_SMOKE,
             area = createCombatArea({
                    {0, 0, 1, 0, 1, 0, 0},
                    {0, 1, 0, 1, 0, 1, 0},
                    {1, 0, 1, 0, 0, 0, 1},
                    {0, 0, 0, 3, 1, 0, 0},
                    {0, 1, 0, 0, 0, 0, 1},
                    {1, 0, 0, 1, 0, 1, 0},
                    {0, 0, 1, 0, 1, 0, 0}})
            },
            {effect = CONST_ME_WATERSPLASH,
             area = createCombatArea({
                    {0, 0, 1, 0, 1, 0, 0},
                    {0, 1, 0, 1, 0, 1, 0},
                    {1, 0, 1, 0, 0, 0, 1},
                    {0, 0, 0, 3, 1, 0, 0},
                    {0, 1, 0, 0, 0, 0, 1},
                    {1, 0, 0, 1, 0, 1, 0},
                    {0, 0, 1, 0, 1, 0, 0}})
            }
    }
    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-6, y=basePos.y-8, z=basePos.z}
                            doSendDistanceShoot(fromPos, pos, CONST_ANI_SNOWBALL)
                    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_DAMAGE, -500, -500, -500, -500)
                    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)
            for k, combat in ipairs(combats) do
                    addEvent(castingSpellTime, (250*k), {cid, combat, var})
            end        
            if isMonster(cid) then
            doCreatureSay(cid, "METEORO DE PEGASUS!", TALKTYPE_MONSTER)
        end    
        return true
    end
    local resetmin = 0
    function onCastSpell(cid, var)
    function getResets(cid)
    local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid))
    return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") end
        if getResets(cid) >= resetmin then
            doCombat(cid, combat, var)
        else
            doPlayerSendCancel(cid, "Voce Precisa De ".. resetmin .." Reset Para Usar A spell.") 
            doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        end
    return true
    end

Informação Importante

Confirmação de Termo