Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Cara mudei ali conforme voce falou:

ARENA = {
    WAVES = {
        [1] = {
            monsters = {
                {"Demon", {x = 617, y = 2086, z = 6}},     --{nome_do_monstro, {posição_que_vai_nascer}},
                {"Demon", {x = 617, y = 2089, z = 6}},
                {"Demon", {x = 627, y = 2086, z = 6}},
				{"Demon", {x = 627, y = 2089, z = 6}},
            },
            prize = {
                cash = 500000,                              --Coloque false se não for receber cash nessa wave.
                items = false,                              --Coloque false se não for receber item(s) nessa wave.
            },
        },
        [2] = {
            monsters = {
                {"Hellfire Figher", {x = 617, y = 2086, z = 6}},     --{nome_do_monstro, {posição_que_vai_nascer}},
                {"Hellfire Figher", {x = 617, y = 2089, z = 6}},
                {"Hellfire Figher", {x = 627, y = 2086, z = 6}},
				{"Hellfire Figher", {x = 627, y = 2089, z = 6}},
            },
            prize = {
                cash = 1000000,                           
                items = false,                               
            },
        },
        [3] = {
            monsters = {
                {"Orshabaal", {x = 617, y = 2086, z = 6}},     --{nome_do_monstro, {posição_que_vai_nascer}},
                {"Orshabaal", {x = 617, y = 2089, z = 6}},
                {"Orshabaal", {x = 627, y = 2086, z = 6}},
				{"Orshabaal", {x = 627, y = 2089, z = 6}},
            },
            prize = {
                cash = 1000000,                             
                items = {
                    {2160, 1},                        --{ID do item, quantidade},                  
                    {2160, 1},
                },
            },
        },
    },
    NPC = {
        price = 2000,                                --Preço para entrar na arena.
        position = {x = 623, y = 2084, z = 6},            --Para onde o jogador será teleportado ao falar com o NPC.
    },
    TELEPORT = {
      tpId = 1387,                                 --ID do teleporte.
        tpPos = {x = 622, y = 2084, z = 6},               --Onde o teleporte será criado, ao matar o último boss.
        tpToPos = {x = 622, y = 2081, z = 5},             --Para onde o teleporte levará.
        aid = 1307,
    },
    STORAGES = {
        storage = 90190,
        wave_sto = 90191,
    },
    toPos = {x = 630, y = 2092, z = 6},               --Coordenadas da posição superior esquerda da arena.
    fromPos = {x = 614, y = 2082, z = 6},             --Coordenadas da posição inferior direita da arena.
    delay = 15,                                  --Segundos para o boss aparecer.
    level = 100,                                 --Level mínimo.
}
function doWave(cid, wave)
    if not isPlayer(cid) then
        return true
    elseif not ARENA.WAVES[wave] then
        return true
    elseif getPlayerStorageValue(cid, ARENA.STORAGES.storage) > -1 then
        return true
    end
    local monster = ARENA.WAVES[wave]
    local m = monster.monsters
    doPlayerSendTextMessage(cid, 27, "Em "..ARENA.delay.." segundos, começa seu desafio. [Wave: "..wave.."]")
    addEvent(function()
        for i = 1, #m do
            doCreateMonster(m[i][1], m[i][2])
        end
    end, ARENA.delay * 1000)
end
function clearArena()
    for x = ARENA.fromPos.x, ARENA.toPos.x do
        for y = ARENA.fromPos.y, ARENA.toPos.y do
            for z = ARENA.fromPos.z, ARENA.toPos.z do
                local area = {x = x, y = y, z = z}
                local creature = getTopCreature(area).uid
                if isCreature(creature) then   
                    doRemoveCreature(creature)
                end
            end
        end
    end
end
function newWave()
    for x = ARENA.fromPos.x, ARENA.toPos.x do
        for y = ARENA.fromPos.y, ARENA.toPos.y do
            for z = ARENA.fromPos.z, ARENA.toPos.z do
                local area = {x = x, y = y, z = z}
                local creature = getTopCreature(area).uid
                if isCreature(creature) and not isPlayer(creature) and not isSummon(creature) then   
                    return false
                end
            end
        end
    end
    return true
end

mas agora voltou o problema que tinha sido resolvido antes, eu mato os bixo e eles nao morrem...

 

dJtJny.png

 

O demon da esquerda la eu matei e ele fica la de pé

 

 

Erro na distro:

WsmGUH.png

Editado por glacialot (veja o histórico de edições)

FPCMCUA.jpg

  • Respostas 99
  • Visualizações 3.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • OK. Eu fiz bem rapidamente o sistema aqui, talvez haja algum(s) erro(s). data/lib, crie um arquivo com extensão .lua e coloque o seguinte conteúdo: ARENA = {     WAVES = {         [1] = {"monster_n

  • Ah, isso explica. Você configurou errado. toPos nunca terá valores menores que fromPos.  Provavelmente você inverteu fromPos e toPos. E também deve ser por isso que algumas funções que usei anteriorm

  • OK. Refiz a parte que checa se a wave foi ou não completa. Tanto a maneira antiga quanto a nova funcionaram aqui. Espero que o mesmo aconteça no seu servidor. Troque sua lib por essa: ARENA = {    

Postado

Você não tem a função isSummon.

Em data/lib, abra 050-function.lua e adicione no final do arquivo:

function isSummon(cid)
    if isCreature(cid) and not isPlayer(cid) and not isMonster(cid) and not isNpc(cid) then
        return true
    end
    return false
end

não respondo pms solicitando suporte em programação/scripting

Postado

Certo, agora ele matou todos os demons, porem ele nao passa para a WAVE 2, no caso eu matei os 4 demon da wave 1, dai nao acontece mais nada, e nao ganha o premio tbm

14:36 Vandrigo Ten [9177]: hi
14:36 The Guard of Arena: Olá, Eu vendo Summon Doll, o custo é 50k cada um, para comprar fale: trade. Com ele você poderá Summon um Monstro Aleatório na Maquina de Summon na sala abaixo.
14:36 Em 15 segundos, começa seu desafio. [Wave: 1]
14:37 Você Matou 2281 Demon's.
14:37 Você Matou 2282 Demon's.
14:37 Você Matou 2283 Demon's.
14:37 Você Matou 2284 Demon's.

Editado por glacialot (veja o histórico de edições)

FPCMCUA.jpg

Postado
  • Autor

@zipter98 Opa Brother. Me diz uma coisa, no Login.lua onde você mandou eu colocar aquela "Tag", eu não altero essa não né?:

 

 

registerCreatureEvent(cid, "killBoss")

registerCreatureEvent(cid, "deathBoss")

Eu te Ajudei? Então solta aquele REP+ !!

Meus Tutoriais [Tutorial] Bug "Temple position is wrong" (MySql)

Outros:    [Meu Show OFF | Mapa próprio 8.6] 

Postado

Não, não altera. Só faz aquilo que eu disse.

glacialot, algum erro no console?

Enfim, para ver exatamente onde está o erro, vamos fazer alguns testes.

No creaturescript, troque:

function onKill(cid, target)
    if isPlayer(cid) and getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) > -1 then
        local new_wave = getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) + 1
        if newWave() then
            local reward = ARENA.WAVES[getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto)].prize
            local str = "You won:"
            if reward.cash then
                doPlayerAddMoney(cid, reward.cash)
                str = str.."\n"..reward.cash.."$"
            end
            if reward.items then
                for i = 1, #reward.items do
                    local item = reward.items[i][1]
                    local count = reward.items[i][2]
                    if not isItemStackable(item) and count > 1 then
                        for i = 1, count do
                            doPlayerAddItem(cid, item, 1)
                        end
                    else
                        doPlayerAddItem(cid, item, count)
                    end
                    str = str.."\nItem - "..count.."x "..getItemNameById(item)
                end
            end
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
            if ARENA.WAVES[new_wave] then
                setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, new_wave)
                doWave(cid, new_wave)
            else
                local tp = doCreateTeleport(ARENA.TELEPORT.tpId, ARENA.TELEPORT.tpToPos, ARENA.TELEPORT.tpPos)
                doItemSetAttribute(tp, "aid", ARENA.TELEPORT.aid)
            end
        end
    end
    return true
end
por:
function onKill(cid, target)
    if isPlayer(cid) and getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) > -1 then
        print("test3")
        local new_wave = getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto) + 1
        if newWave() then
            print("test4")
            local reward = ARENA.WAVES[getPlayerStorageValue(cid, ARENA.STORAGES.wave_sto)].prize
            local str = "You won:"
            if reward.cash then
                doPlayerAddMoney(cid, reward.cash)
                str = str.."\n"..reward.cash.."$"
            end
            if reward.items then
                for i = 1, #reward.items do
                    local item = reward.items[i][1]
                    local count = reward.items[i][2]
                    if not isItemStackable(item) and count > 1 then
                        for i = 1, count do
                            doPlayerAddItem(cid, item, 1)
                        end
                    else
                        doPlayerAddItem(cid, item, count)
                    end
                    str = str.."\nItem - "..count.."x "..getItemNameById(item)
                end
            end
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
            if ARENA.WAVES[new_wave] then
                setPlayerStorageValue(cid, ARENA.STORAGES.wave_sto, new_wave)
                doWave(cid, new_wave)
            else
                local tp = doCreateTeleport(ARENA.TELEPORT.tpId, ARENA.TELEPORT.tpToPos, ARENA.TELEPORT.tpPos)
                doItemSetAttribute(tp, "aid", ARENA.TELEPORT.aid)
            end
        end
    end
    return true
end
Na lib, substitua a função newWave() por essa:
function newWave()
    for x = ARENA.fromPos.x, ARENA.toPos.x do
        for y = ARENA.fromPos.y, ARENA.toPos.y do
            for z = ARENA.fromPos.z, ARENA.toPos.z do
                local area = {x = x, y = y, z = z}
                local creature = getTopCreature(area).uid
                if isCreature(creature) then
                    print("test1")
                    if isMonster(creature) then
                        print("test5")
                        return false
                    end
                end
            end
        end
    end
    print("test2")
    return true
end
Envie o que for imprimido no console (test1, test2, test3, test4, test5).

Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

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