From 8cc5ff7e94a56110db8852a17ebc0417bbd19efb Mon Sep 17 00:00:00 2001 From: HT Cesta <58153179+htc16@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:19:51 -0300 Subject: [PATCH] Revert "Fix: The Paradox Quest" This reverts commit 2e9fe27ef5d23ba3a64763ed755fdb33fb24b090. --- .../the_paradox_tower/move_let_the _quest.lua | 37 ----------- .../the_paradox_tower/movement-poison.lua | 32 ++++++++++ .../movement-sacrifice_skulls.lua | 63 +++++++++---------- ...ent_strange_carvings_in _the_southeast.lua | 35 ----------- .../the_paradox_tower/trap_in_the_tree.lua | 23 ------- data-otservbr-global/startup/tables/tile.lua | 30 +-------- 6 files changed, 65 insertions(+), 155 deletions(-) delete mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua create mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua delete mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua delete mode 100644 data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua deleted file mode 100644 index 37441b19c55..00000000000 --- a/data-otservbr-global/scripts/quests/the_paradox_tower/move_let_the _quest.lua +++ /dev/null @@ -1,37 +0,0 @@ -local teleportTileBack = MoveEvent() - -function teleportTileBack.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - -- UIDs específicos do tile - local specificUIDs = {25034,25035,25036,25037} - - -- Posições específicas - local specificPositions = { - {x = 32486, y = 31927, z = 7}, - {x = 32487, y = 31927, z = 7}, - {x = 32486, y = 31928, z = 7}, - {x = 32487, y = 31928, z = 7}, - } - - -- Posição de teletransporte - local teleportPosition = {x = 32566, y = 31957, z = 1} - - -- Verifica se a posição, o UID e o itemID coincidem - for _, pos in ipairs(specificPositions) do - if position.x == pos.x and position.y == pos.y and position.z == pos.z and item:getId() == 599 and table.contains(specificUIDs, item.uid) then - player:teleportTo(teleportPosition) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - break - end - end - - return true -end - --- Registra o evento para os UIDs específicos -teleportTileBack:uid(25034,25035,25036,25037) -teleportTileBack:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua new file mode 100644 index 00000000000..565762fa480 --- /dev/null +++ b/data-otservbr-global/scripts/quests/the_paradox_tower/movement-poison.lua @@ -0,0 +1,32 @@ +local positions = { + { x = 32497, y = 31889, z = 7 }, + { x = 32497, y = 31890, z = 7 }, + { x = 32498, y = 31890, z = 7 }, + { x = 32499, y = 31890, z = 7 }, + { x = 32502, y = 31890, z = 7 }, + { x = 32494, y = 31888, z = 7 }, +} + +local poison = MoveEvent() + +function poison.onStepOut(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local removeHealth = Tile({ x = 32497, y = 31889, z = 7 }):getFieldItem() + if not removeHealth then + player:addHealth(-200, COMBAT_EARTHDAMAGE) + for i = 1, #positions do + local tile = Tile(positions[i]):getFieldItem() + if not tile then + Game.createItem(105, 1, Position(positions[i])) + end + end + end + return true +end + +poison:uid(25011) +poison:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua index fea92bafa81..c351bde5c46 100644 --- a/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua +++ b/data-otservbr-global/scripts/quests/the_paradox_tower/movement-sacrifice_skulls.lua @@ -1,42 +1,41 @@ local positions = { - { x = 32563, y = 31957, z = 1 }, - { x = 32565, y = 31957, z = 1 }, - { x = 32567, y = 31957, z = 1 }, - { x = 32569, y = 31957, z = 1 }, + { x = 32563, y = 31957, z = 1 }, + { x = 32565, y = 31957, z = 1 }, + { x = 32567, y = 31957, z = 1 }, + { x = 32569, y = 31957, z = 1 }, } local sacrificeSkulls = MoveEvent() function sacrificeSkulls.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end + local player = creature:getPlayer() + if not player then + return true + end - -- Verifica se há crânios em todas as posições - for i = 1, #positions do - local tile = Tile(positions[i]) - if not tile or not tile:getItemById(3114) then - return true -- Se alguma posição não tiver um crânio, sai da função - end - end - - -- Se todos os crânios estiverem presentes, executa as ações - if player:getStorageValue(FirstParadoxAcess) < 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "One of the toxic salt seas in Krailos carries fresh and clean water again. The ogres' water supply is ensured for now") - player:setStorageValue(FirstParadoxAcess, 1) - end - - for i = 1, #positions do - local skull = Tile(positions[i]):getItemById(3114) - if skull then - Game.createItem(105, 1, positions[i]) - skull:remove(1) - end - end - - player:teleportTo({ x = 32479, y = 31923, z = 7 }) - return true + for i = 4, #positions do + -- Check if have skulls in all positions + local tile = Tile(positions[i]):getItemById(3114) + if tile then + -- Message, only send in the first acess of the paradox tower + if player:getStorageValue(FirstParadoxAcess) < 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "One of the toxic salt seas in Krailos carries fresh and clean water again. The ogres' water supply is ensured for now") + player:setStorageValue(FirstParadoxAcess, 1) + end + -- Remove skulls + for skulls = 1, #positions do + local skull = Tile(positions[skulls]):getItemById(3114) + if skull then + -- Create poison fields from the positions + Game.createItem(105, 1, Position(positions[skulls])) + -- Remove skulls from the positions + skull:remove(1) + end + end + player:teleportTo({ x = 32479, y = 31923, z = 7 }) + end + end + return true end sacrificeSkulls:uid(25012) diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua deleted file mode 100644 index 8740a73aced..00000000000 --- a/data-otservbr-global/scripts/quests/the_paradox_tower/movement_strange_carvings_in _the_southeast.lua +++ /dev/null @@ -1,35 +0,0 @@ -local teleportTile = MoveEvent() - -function teleportTile.onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then - return true - end - - -- UIDs específicos do tile - local specificUIDs = {25031,25032} - - -- Posições específicas - local specificPositions = { - {x = 32477, y = 31905, z = 7}, - {x = 32476, y = 31906, z = 7} - } - - -- Posição de teletransporte - local teleportPosition = {x = 32478, y = 31908, z = 7} - - -- Verifica se a posição, o UID e o itemID coincidem - for _, pos in ipairs(specificPositions) do - if position.x == pos.x and position.y == pos.y and position.z == pos.z and item:getId() == 599 and table.contains(specificUIDs, item.uid) then - player:teleportTo(teleportPosition) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - break - end - end - - return true -end - --- Registra o evento para os UIDs específicos -teleportTile:uid(25031,25032) -teleportTile:register() diff --git a/data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua b/data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua deleted file mode 100644 index 14f43e25f00..00000000000 --- a/data-otservbr-global/scripts/quests/the_paradox_tower/trap_in_the_tree.lua +++ /dev/null @@ -1,23 +0,0 @@ -local trap_in_the_tree = MoveEvent() - -local trapPositions = { - {x = 32497, y = 31889, z = 07}, - {x = 32499, y = 31890, z = 07}, - {x = 32497, y = 31890, z = 07}, - {x = 32498, y = 31890, z = 07}, - {x = 32496, y = 31890, z = 07}, - {x = 32494, y = 31888, z = 07}, - {x = 32502, y = 31890, z = 07} -} - -function trap_in_the_tree.onStepIn(creature, item, toPosition, fromPosition) - if creature:isPlayer() and Tile({x = 32502, y = 31890, z = 07}):getThingCount() == 2 then - doTargetCombatHealth(0, creature, COMBAT_EARTHDAMAGE, -200, -200) - for _, pos in ipairs(trapPositions) do - Game.createItem(2121, 1, pos) - end - end -end - -trap_in_the_tree:uid(25011) -trap_in_the_tree:register() diff --git a/data-otservbr-global/startup/tables/tile.lua b/data-otservbr-global/startup/tables/tile.lua index 399aeb12af1..6e5cb605c24 100644 --- a/data-otservbr-global/startup/tables/tile.lua +++ b/data-otservbr-global/startup/tables/tile.lua @@ -1099,8 +1099,8 @@ TileUnique = { }, -- The paradox tower quest [25011] = { - itemId = 353, - itemPos = { x = 32497, y = 31888, z = 7 }, + itemId = 354, + itemPos = { x = 32497, y = 31889, z = 7 }, }, [25012] = { itemId = 10145, @@ -1191,32 +1191,6 @@ TileUnique = { itemId = 12728, itemPos = { x = 32059, y = 32135, z = 9 }, }, - - -- The Paradox Tower Quest - [25031] = { - itemId = 599, - itemPos = { x = 32477, y = 31905, z = 7 }, - }, - [25032] = { - itemId = 599, - itemPos = { x = 32476, y = 31906, z = 7 }, - }, - [25034] = { - itemId = 599, - itemPos = { x = 32486, y = 31927, z = 7 }, - }, - [25035] = { - itemId = 599, - itemPos = { x = 32487, y = 31927, z = 7 }, - }, - [25036] = { - itemId = 599, - itemPos = { x = 32486, y = 31928, z = 7 }, - }, - [25037] = { - itemId = 599, - itemPos = { x = 32487, y = 31928, z = 7 }, - }, -- Remove/create item on stepIn -- Reserved uniques range from 29001/30000