Ir para conteúdo
  • 0

Configurar Dungeon!


wenderotpoke

Pergunta

Spoiler

local posis= {
    {'Player 01',     {x = 526, y = 183, z = 14}},
    {'Player 02',     {x = 528, y = 183, z = 14}},
}

local config = {
[17000] = {
        nameDz = "Inseto",
        chave = 2155, 
        count = 1, 
        area1 = {fromx = 1657, fromy = 663, fromz = 15, tox = 1920, toy = 760, toz= 15}, 
        area2 = {fromx = 1658, fromy = 760, fromz = 15, tox = 1912, toy = 857, toz= 15}, 
        area3 = {fromx = 1919, fromy = 663, fromz = 15, tox = 2182, toy = 765, toz= 15}, 
        area4 = {fromx = 1924, fromy = 774, fromz = 15, tox = 2182, toy = 857, toz= 15}, 
        tele1 = {x = 1736, y = 753, z = 15},
        tele2 = {x = 1736, y = 850, z = 15},
        tele3 = {x = 1998, y = 753, z = 15},
        tele4 = {x = 1998, y = 850, z = 15},
    }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not config[item.actionid] then
        return true
    end
    local cfg = config[item.actionid]
    local pokes = cfg.poke
    local boss= cfg.last
    if isRiderOrFlyOrSurf(cid) then
        doPlayerSendCancel(cid, "Saia do ride ou fly para poder acessar a Dungeon.")
        return true
    end
    for _, array in ipairs(posis) do
        local p = getRecorderPlayer(array[2])
        if not isPlayer(p) then
            doPlayerSendTextMessage(cid, 20, "Voces nao estao na posicao correta!")
            return true            
    end
end
        if getPlayerItemCount(cid, cfg.chave) >= cfg.count then
            if #getPlayersInArea(cfg.area1) < 1 then

            for _, array in ipairs(posis) do
                local p = getRecorderPlayer(array[2])
                    if isPlayer(p) then
                doTeleportThing(p, cfg.tele1)
                setPlayerStorageValue(p, 2154601, 1)
                setPlayerStorageValue(p, 2254600, 1)                            
                doPlayerRemoveItem(p, cfg.chave, cfg.count)
                addEvent(doTeleportFinish, 30 * 60 * 1000, p)                
                doSendPlayerExtendedOpcode(p, 133, 1800)
                end
            end
            elseif #getPlayersInArea(cfg.area2) < 1 then            
            for _, array in ipairs(posSolo, posDuo, posTrio) do
                local p = getRecorderPlayer(array[2])
                    if isPlayer(p) then
                doTeleportThing(p, cfg.tele1)
                setPlayerStorageValue(p, 2154601, 1)
                setPlayerStorageValue(p, 2254600, 1)                            
                doPlayerRemoveItem(p, cfg.chave, cfg.count)
                addEvent(doTeleportFinish, 30 * 60 * 1000, p)                
                doSendPlayerExtendedOpcode(p, 133, 1800)
                end
            end
            elseif #getPlayersInArea(cfg.area3) < 1 then            
            for _, array in ipairs(posis) do
                local p = getRecorderPlayer(array[2])
                    if isPlayer(p) then
                doTeleportThing(p, cfg.tele1)
                setPlayerStorageValue(p, 2154601, 1)
                setPlayerStorageValue(p, 2254600, 1)                            
                doPlayerRemoveItem(p, cfg.chave, cfg.count)
                addEvent(doTeleportFinish, 30 * 60 * 1000, p)                
                doSendPlayerExtendedOpcode(p, 133, 1800)
                end
            end
            elseif #getPlayersInArea(cfg.area4) < 1 then            
            for _, array in ipairs(posis) do
                local p = getRecorderPlayer(array[2])
                    if isPlayer(p) then
                doTeleportThing(p, cfg.tele1)
                setPlayerStorageValue(p, 2154601, 1)
                setPlayerStorageValue(p, 2254600, 1)                            
                doPlayerRemoveItem(p, cfg.chave, cfg.count)
                addEvent(doTeleportFinish, 30 * 60 * 1000, p)                
                doSendPlayerExtendedOpcode(p, 133, 1800)
                end
            end
            else
                doPlayerSendCancel(cid, "Nao tem Zonas disponiveis no momento, tente mais tarde!")
            end
        else
            doPlayerSendCancel(cid, "Voce precisa de uma Bronze Dimensional Key para acessar essa Dungeon.")        
        end    
    
return true  
end

Salvee, galera seguinte preciso configurar isso pra nascer os mobs nas determinadas areas de 1 a 4, gostaria de que tivesse um meio dos mobs nascerem aleatoriamente dentro da sala da dungeon, por exemplo 

Sala 1 = "Charizard", "Arcanine", Ninetales"

Sala 2 = "Blastosie", "Gyarados", "Kingdra",

Sala 3= "Venusaur", "Tropius", "Exeggutor",

Sala 4 "Shiny Beedrill", "Shiny Butterfree", "Shiny Venomoth"

 

e os locais onde vão nascer dentro da sala na qual tem a area marcada

 

Quem puder me ajudar ficarei grato d+

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...