A questão neste tópico de suporte foi encerrada por falta de resposta. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Dungeon Finder
2
1.5k
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Artesão
Registrado: 28/09/08
Posts: 110
Reputação: +38
Gênero: Masculino
Char no Tibia: ...
TFS 0.3.6
Base: OTX 2
Estou com um problema no Dungeon Finder. Para ver todo o script:
Digito /queue join nos 5 personagens mas após isso, nada acontece (não da erro nenhum no distro).
Quando digito /queue join ele adiciona na DB e aparece a mensagem que estou na QUEUE, até ai tudo certo. O problema acho que está no globalevents, como ele não estivesse dando partida ao ter 5 personagens na queue
local DUNGEONS = { [1] = {NAME = "Serpent Dungeon", LEVEL = 30, POS = {x = 30317, y = 32307, z = 10}}, } local condition = createConditionObject(CONDITION_INFIGHT) setConditionParam(condition, CONDITION_PARAM_TICKS, 15000) function onThink(cid, interval) DUNGEON = DUNGEONS[math.random(1, table.maxn(DUNGEONS))] players = {} for i = 1, 1000 do if(table.maxn(players) == 5) then break end query = db.getResult("SELECT * FROM `dungeon_finder` WHERE `id` = " .. i .. ";") if(query:getID() > -1) then pid = getPlayerByName(getPlayerNameByGUID(query:getDataInt("player_id"))) if(getPlayerStorageValue(pid, CONFIG.DUNGEON_STORAGE) > 1) then return true end if(getPlayerLevel(pid) > DUNGEON.LEVEL and getPlayerLevel(pid) < DUNGEON.LEVEL + 50) then table.insert(players, getPlayerGUID(pid)) end query:free() end end if(table.maxn(players) == 5) then for i = 1, 5 do pid = getPlayerByName(getPlayerNameByGUID(players[i])) if(i == 1) then doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "You were chosen to be a dungeon guide.") addEvent(doCreatureSay, 15200, pid, "You and your team were teleported to the " .. DUNGEON.NAME .. ".", TALKTYPE_ORANGE_1) for j = 2, 5 do lid = getPlayerByName(getPlayerNameByGUID(players[j])) doPlayerInviteToParty(pid, lid) end else doPlayerJoinParty(pid, getPlayerByName(getPlayerNameByGUID(players[1]))) end delay = 0 for i = 1, 15 do addEvent(doPlayerSendTextMessage, delay + 1000, pid, MESSAGE_STATUS_CONSOLE_BLUE, "A dungeon group for you has been found. You'll be teleported to the dungeon in " .. 15 - i .. " seconds.") delay = delay + 1000 end doAddCondition(pid, condition) addEvent(doTeleportThing, 15000, pid, DUNGEON.POS) addEvent(doSendMagicEffect, 15000, DUNGEON.POS, CONST_ME_TELEPORT) db.executeQuery("DELETE FROM `dungeon_finder` WHERE `player_id` = " .. players[i] .. ";") if(CONFIG.QUIT_POS) then setPlayerStorageValue(pid, 42250, getPlayerPosition(pid).x) setPlayerStorageValue(pid, 42251, getPlayerPosition(pid).y) setPlayerStorageValue(pid, 42252, getPlayerPosition(pid).z) end setPlayerStorageValue(pid, CONFIG.DUNGEON_STORAGE, 1) end end return true end