local _FENDA_UID = { [11100] = 01; [11101] = 02; [11102] = 03; [11103] = 04; [11104] = 05; [11105] = 06; [11106] = 07; [11107] = 08; [11108] = 09; [11109] = 10; [11110] = 11; [11111] = 12; [11112] = 13; [11113] = 14; [11114] = 15; [11115] = 16; [11116] = 17; [11117] = 18; [11118] = 19; [11119] = 20; [11120] = 21; [11121] = 22; [11122] = 23; [11123] = 24; [11124] = 25; [11125] = 26; [11126] = 27; [11127] = 28; [11128] = 29; [11129] = 30; [11130] = 31; [11131] = 32; [11132] = 33; [11133] = 34; [11134] = 35; [11135] = 36; [11136] = 37; [11137] = 38; [11138] = 39; [11139] = 40; [11140] = 41; [11141] = 42; [11142] = 43; [11143] = 44; [11144] = 45; [11145] = 46; [11146] = 47; [11147] = 48; [11148] = 49; [11149] = 50; } local FENDA_M, FENDA_S = 0, 0 local function EsquadraoDimensionalQuest(cid, step) local creature = Player(cid) if creature then local SummPos = creature:getSummons() local CHAT_TALK = { [01] = {TALK = 'Outra vez atrasado?', SUM = 03, TIMER = 3000}, [02] = {TALK = 'Villauba...', SUM = 02, TIMER = 4000}, [03] = {TALK = 'Vamos encontrar o Nucleo Dimensional', SUM = 02, TIMER = 4000}, [04] = {TALK = 'Esse nucleo muda sempre que entramos, então é difícil deduzir onde ele possa estar.', SUM = 02, TIMER = 6000}, [05] = {TALK = 'Ainda assim, não vamos nos separar.', SUM = 02, TIMER = 4000}, [06] = {TALK = 'Somos mais fortes juntos, então vamos ficar juntos.', SUM = 02, TIMER = 5000}, [07] = {TALK = 'Entendido?', SUM = 02, TIMER = 3000}, [08] = {TALK = 'Vamos logo!', SUM = 01, TIMER = 3000}, [09] = {TALK = 'Certo. Vamos acabar com isso.', SUM = 02, TIMER = 3000}, [10] = {TALK = '', SUM = nil, TIMER = 0001}, } if CHAT_TALK[step].SUM == nil then addEvent(function() creature:setStorageValue(_QUESTLOG[167].UID_01, 03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você tem 30 minutos para encontrar e destrua o Nucleo Dimensional.\nNão deixe seus companheiros morrer.") end, 3000) return true else if #creature:getSummons() > 0 then local timerDelay = CHAT_TALK[step].TIMER SummPos[CHAT_TALK[step].SUM]:say(CHAT_TALK[step].TALK, TALKTYPE_SAY) step = step + 01 addEvent(function() EsquadraoDimensionalQuest(creature.uid, step) end, timerDelay) end end end end function onStepIn(creature, item, position, fromPosition) if _FENDA_UID[item.uid] then local X = _FENDA_UID[item.uid] if creature:isPlayer() then local party = creature:getParty() if creature:getLevel() >= _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].LEVEL then if party then creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você precisa sair de sua Party para poder entrar.") return false end if creature:getStorageValue(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].DELAY[01]) > 00 then creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Aguarde " ..creature:getStorageValue(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].DELAY[01]).. " segundos para poder tentar novamente.") return false end if PlayerFendasDimensionais(creature, 1000, 02, X) then creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você já selou essa Fenda Dimensional.") return true end if creature:getStorageValue(_QUESTLOG[167].UID_01) == 01 and item.uid == 11119 then creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Fale com Victor, na Base Premium para iniciar essa missão.") return false end local checkArea = 0 local from = _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].POS_INN_X local to = _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].POS_INN_Y for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) if tile then local creature = tile:getTopCreature() if creature and creature:isPlayer() then checkArea = 1 break end end end end end if checkArea == 01 then creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Alguém está tentando selar essa fenda.\nImpossível entrar no momento.") return true end for A = from.x, to.x do for B = from.y, to.y do for C = from.z, to.z do local tile = Tile(A, B, C) if tile then local creature = tile:getTopCreature() if creature and creature:isMonster() then doRemoveCreature(creature:getId()) end end end end end if party then creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você precisa sair de sua Party para poder entrar.") return false end for M = 01, #_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].MON_POS do local MR = math.random(01, #_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].MONSTER) Game.createMonster(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].MONSTER[MR], _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].MON_POS[M]) end local NDR = math.random(01, #_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].NUCLEO_POS) Game.createMonster("Nucleo Dimensional", _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].NUCLEO_POS[NDR]) creature:setStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01], X) creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].INN) creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) FENDA_M = _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].TIMER FENDA_S = 00 creature:sendCancelMessage("@CountTempo 3 0 0 0 0 0") creature:sendCancelMessage("@DGTime 01 00 00 01") addEvent(onFendaTime, 1000, creature.uid) if item.uid == 11108 then local EQUIPE_1 = Game.createMonster('Kanigher', {x=3737, y=1411, z=08}) local EQUIPE_2 = Game.createMonster('Ross', {x=3736, y=1411, z=08}) local EQUIPE_3 = Game.createMonster('Villauba', {x=3735, y=1411, z=08}) EQUIPE_1:setMaster(creature) EQUIPE_2:setMaster(creature) EQUIPE_3:setMaster(creature) addEvent(function() EsquadraoDimensionalQuest(creature.uid, 01) end, 3000) else creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Você tem 30 minutos para encontrar e destrua o Nucleo Dimensional.") end else creature:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) creature:getPosition():sendMagicEffect(03) creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Essa Fenda Dimensional requer level " .._GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].LEVEL.. " ou superior.") return true end end end return true end function onFendaTime(cid) local player = Player(cid) if player then if player:getStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01]) > 00 then if FENDA_M == 0 and FENDA_S == 0 then player:teleportTo({x=3999, y=991, z=7}) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) _GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[00].INN_FENDA_TIMER = nil local X = player:getStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01]) or 0 player:teleportTo(_GLOBAL_RANDOM.FENDAS_DIMENSIONAIS[X].OUT) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:sendTextMessage(MESSAGE_STATUS_WARNING, "Você falhou em selar essa Fenda Dimensional.") player:setStorageValue(_SYSTEM.FENDAS_DIMENSIONAL[01], nil) player:sendCancelMessage("@DGTime 0 0 0") player:setTown(Town(01)) else local M1 = 0 local S1 = 0 local M2 = 0 local S2 = 0 if FENDA_M > 0 and FENDA_S > 0 then FENDA_S = FENDA_S - 1 elseif FENDA_M > 0 and FENDA_S == 0 then FENDA_S = 59 FENDA_M = FENDA_M - 1 elseif FENDA_M == 0 and FENDA_S > 0 then FENDA_S = FENDA_S - 1 end if string.len(FENDA_M) == 2 then M1 = string.sub(FENDA_M, 1, 1) M2 = string.sub(FENDA_M, 2, 2) else M1 = 0 M2 = string.sub(FENDA_M, 1, 1) end if string.len(FENDA_S) == 2 then S1 = string.sub(FENDA_S, 1, 1) S2 = string.sub(FENDA_S, 2, 2) else S1 = 0 S2 = string.sub(FENDA_S, 1, 1) end local party = player:getParty() player:sendCancelMessage("@CountTempo " ..M1.. " " ..M2.." " ..S1.. " " ..S2.." 00 00") addEvent(onFendaTime, 1000, player.uid) end end end end