Ir para conteúdo

Featured Replies

Postado
  • Autor

@antharaz

Não Funcionou :( 

Todos jogadores que ja fizeram esta podendo fazer de novo, eles tinha que apenas fazer uma vez e se tentar fazer de novo ia aparecer escrito \/

Um jogador em seu time ja fez a Fishing Rod and Pick Quest!

 

Vou postar uma foto mostrando \/

Citar

 

Bola Preta > aonde fica o Knight

Bola Vermelha > Sorcerer

Bola Azul > Druid

Bola Amarelo > Pally

A Seta Roxa > Aonde os players vai ser teletransportado.

DESERT QUEST1.png

  • Respostas 12
  • Visualizações 596
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
  • Solução

@Joaoafp

 

Spoiler

local level = 130
local redo = {status = false, storageValue = 61111} -- true para ilimitado, false para somente uma vez
 
local config = {
    {
        vocations = {1, 5},
        itemId = 2190,
        playerPos = {x=1117, y=1150, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1117, y=1151, z=6}  -- Position of Spellbook "Sorcerer".
    },
 
    {
        vocations = {2, 6},
        itemId = 2182,
        playerPos = {x=1123, y=1157, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1122, y=1157, z=6} -- Position of Red apple "Druid".
    },
 
    {
        vocations = {3, 7},
        itemId = 2399,
        playerPos = {x=1127, y=1155, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, -- Position of the reward room.
        itemPos = {x=1127, y=1154, z=6} -- Position of Crossbow "Paladin".
    },
 
    {
        vocations = {4, 8},
        itemId = 8602,
        playerPos = {x=1123, y=1147, z=6}, -- Initial position in the Stone tile
        newPos = {x=1122, y=1153, z=6}, --Position of the reward room.
        itemPos = {x=1122, y=1147, z=6} --Position of Sword "Knight".
    }
}

local msgs = {
[1] = "Todos os jogadores devem estar em seus respectivos pisos!",
[2] = "Todos os players devem ser level " .. level .. " ou maior.",
[3] = "Um jogador em seu time ja fez a Fishing Rod and Pick Quest!",
[4] = "Não há jogadores suficientes.",
[5] = "Todos os items devem estar nas posições corretas!"
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local players, msgID = {}, 0
    for i, v in pairs(config) do
        local player = getTopCreature(v.playerPos).uid
        if player ~= 0 and isPlayer(player) then
            if not isInArray(v.vocations, getPlayerVocation(player)) then
                msgID = 1
                break
            elseif getPlayerLevel(player) < level then
                msgID = 2
                break
            elseif not redo.status then
                if getPlayerStorageValue(player, redo.storageValue) ~= -1 then
                    msgID = 3
                    break
                end
            end
            table.insert(players, {player = player, newPos = v.newPos})
        end    
    end
    if msgID ~= 0 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[msgID]) 
        return true
    end    
    if #players ~= #config then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[4]) 
        return true
    end
    if #config ~= getItemsInPos() then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, msgs[5]) 
        return true
    end
    
    for i = 1, #players do
        local p = players[i]
        if not redo.status then
            setPlayerStorageValue(p.player, redo.storageValue, 1)
        end
        doSendMagicEffect(getPlayerPosition(p.player), CONST_ME_POFF)
        doTeleportThing(p.player, p.newPos)
        doSendMagicEffect(p.newPos, CONST_ME_TELEPORT)
    end
    doRemoveItensInPos()
    return true
end

function getItemsInPos()
local check = {}
for i, v in pairs(config) do
    for i = 0, 255 do
        v.itemPos.stackpos = i
        tile = getTileItemById(v.itemPos, v.itemId)
    end
    if tile.uid > 0 then
        table.insert(check, 1)
    end
end
return #check
end

function doRemoveItensInPos()
for k, v in pairs(config) do
doCleanTile(v.itemPos)
end
end

 

 

Contato:

 

Postado
  • Autor

@Dwarfer

Vou testar aqui e te mando a resposta. Ja volto.

@Dwarfer

Valeuu !!, muito obrigado, pegou super bem e melhor que antes rs,

Posso te marcar nos tópicos que eu for criando? que eu precise de ajuda?

Muito obrigado msm. vlw

+REP

Tópico RESOLVIDO!

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.7k

Informação Importante

Confirmação de Termo