From bb7f28004e80241cfa4ed1ac9fbc5e1997a053c3 Mon Sep 17 00:00:00 2001 From: rigis1 Date: Mon, 29 Aug 2022 19:47:06 +0200 Subject: [PATCH] Fix lion's rock quest (#771) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Converted scripts from action ids and unique ids to positions --- data/lib/core/quests.lua | 77 +++---- data/lib/core/storages.lua | 23 ++- .../actions/other/others/quest_system2.lua | 39 ++++ .../actions/quests/lions_rock/lions_rock.lua | 188 +++++------------- .../quests/lions_rock/lions_rock.lua | 154 ++++++++------ .../movements/teleport/shrine_entrance.lua | 165 +++++++-------- .../movements/teleport/shrine_exit.lua | 61 +++--- data/scripts/talkactions/god/attributes.lua | 1 + data/startup/tables/item.lua | 24 --- data/startup/tables/tile.lua | 22 -- 10 files changed, 361 insertions(+), 393 deletions(-) diff --git a/data/lib/core/quests.lua b/data/lib/core/quests.lua index bedeaf759..6979d9540 100644 --- a/data/lib/core/quests.lua +++ b/data/lib/core/quests.lua @@ -4514,55 +4514,60 @@ if not Quests then storageId = Storage.LionsRock.Questline, missionId = 10319, startValue = 1, - endValue = 12, + endValue = 11, states = { - [1] = "You have discovered the Lion's Rock. If you pass the following tests you may enter the inner sanctum.\z - \n\nThe Lion's Strength 0/1\nThe Lion's Beauty 0/1\nThe Lion's Tears 0/1", - [2] = "You have discovered the Lion's Rock. If you pass the following tests you may enter the inner sanctum.\z - \n\nThe Lion's Strength 1/1\nThe Lion's Beauty 0/1\nThe Lion's Tears 0/1", - [3] = "You have discovered the Lion's Rock. If you pass the following tests you may enter the inner sanctum.\z - \n\nThe Lion's Strength 1/1\nThe Lion's Beauty 1/1\nThe Lion's Tears 0/1", - [4] = "You have passed the three tests of Lion's Rock and thus lit the three mystical pyramids. You may enter\z - the inner sanctum now. - What other secrets could be hidden down there?", - [5] = "You found a mysterious scroll in the debris of an old amphora. It seems it could help to translate the\z - old temple inscriptions.", + [1] = function(player) + return string.format("You have discovered the Lion's Rock. If you pass the following tests you may enter the inner sanctum.\n\nThe Lion's Strength %d/1\nThe Lion's Beauty %d/1\nThe Lion's Tears %d/1", + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsStrength), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsBeauty), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsTears), 0)) + ) + end, + [2] = function(player) + return string.format("You have discovered the Lion's Rock. If you pass the following tests you may enter the inner sanctum.\n\nThe Lion's Strength %d/1\nThe Lion's Beauty %d/1\nThe Lion's Tears %d/1", + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsStrength), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsBeauty), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsTears), 0)) + ) + end, + [3] = function(player) + return string.format("You have discovered the Lion's Rock. If you pass the following tests you may enter the inner sanctum.\n\nThe Lion's Strength %d/1\nThe Lion's Beauty %d/1\nThe Lion's Tears %d/1", + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsStrength), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsBeauty), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.OuterSanctum.LionsTears), 0)) + ) + end, + [4] = "You have passed the three tests of Lion's Rock and thus lit the three mystical pyramids. You may enter the inner sanctum now. - What other secrets could be hidden down there?", + [5] = "You found a mysterious scroll in the debris of an old amphora. It seems it could help to translate the old temple inscriptions.", [6] = function(player) return string.format( - "lions' enemies in this area of the temple. What could be the resolution?\z - \n\nblood %d/1\negg %d/1\neye %d/1\npoison %d/1", - (math.max(player:getStorageValue(Storage.LionsRock.SnakeSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.LizardSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.ScorpionSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.HyenaSign), 0)) + "lions' enemies in this area of the temple. What could be the resolution?\n\nblood %d/1\negg %d/1\neye %d/1\npoison %d/1", + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.SnakeSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.LizardSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.ScorpionSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.HyenaSign), 0)) ) end, [7] = function(player) return string.format( - "lions' enemies in this area of the temple. What could be the resolution?\z - \n\nblood %d/1\negg %d/1\neye %d/1\npoison %d/1", - (math.max(player:getStorageValue(Storage.LionsRock.SnakeSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.LizardSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.ScorpionSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.HyenaSign), 0)) + "lions' enemies in this area of the temple. What could be the resolution?\n\nblood %d/1\negg %d/1\neye %d/1\npoison %d/1", + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.SnakeSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.LizardSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.ScorpionSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.HyenaSign), 0)) ) end, [8] = function(player) return string.format( - "lions' enemies in this area of the temple. What could be the resolution?\z - \n\nblood %d/1\negg %d/1\neye %d/1\npoison %d/1", - (math.max(player:getStorageValue(Storage.LionsRock.SnakeSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.LizardSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.ScorpionSign), 0)), - (math.max(player:getStorageValue(Storage.LionsRock.HyenaSign), 0)) + "lions' enemies in this area of the temple. What could be the resolution?\n\nblood %d/1\negg %d/1\neye %d/1\npoison %d/1", + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.SnakeSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.LizardSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.ScorpionSign), 0)), + (math.max(player:getStorageValue(Storage.LionsRock.InnerSanctum.HyenaSign), 0)) ) end, - [9] = "lions' enemies in this area of the temple. What could be the resolution?\z - \n\nblood 1/1\negg 1/1\neye 1/1\npoison 1/1", - [10] = 'In the north-west area of the Inner Sanctum, find the southern rectangular room to the south-west. \z - In this room you will find 4 "sun" floor inscriptions as well as a rock in the center. The sun inscriptions \z - represent gem slots.', - [11] = "By solving the gem puzzle you unveiled the last secret of the Lion's Rock. You drew a treasure out \z - of the ornamented fountain in the lower temple areas." + [9] = 'In the north-west area of the Inner Sanctum, find the southern rectangular room to the south-west. In this room you will find 4 "sun" floor inscriptions as well as a rock in the center. The sun inscriptions represent gem slots.', + [11] = "By solving the gem puzzle you unveiled the last secret of the Lion's Rock. You drew a treasure out of the ornamented fountain in the lower temple areas." } }, [4] = { diff --git a/data/lib/core/storages.lua b/data/lib/core/storages.lua index c3ae7eb49..10e6c9e52 100644 --- a/data/lib/core/storages.lua +++ b/data/lib/core/storages.lua @@ -139,6 +139,7 @@ Storage = { FreeQuests = 30057, PremiumAccount = 30058, BattleAxeQuest = 30059, + ShrineEntrance = 30060, --[[ Old storages @@ -1680,15 +1681,19 @@ Storage = { LionsRock = { -- Reserved storage from 52290 - 52309 Questline = 52290, - LionsStrength = 52291, - LionsBeauty = 52292, - LionsTears = 52293, - GetLionsMane = 52294, - GetHolyWater = 52295, - SnakeSign = 52296, - LizardSign = 52297, - ScorpionSign = 52298, - HyenaSign = 52299, + OuterSanctum = { + Skeleton = 52291, + LionsStrength = 52292, + LionsBeauty = 52293, + LionsTears = 52294, + }, + InnerSanctum = { + SnakeSign = 52295, + LizardSign = 52296, + ScorpionSign = 52297, + HyenaSign = 52298, + Message = 52299 + }, Time = 52300 }, GraveDanger = { diff --git a/data/scripts/actions/other/others/quest_system2.lua b/data/scripts/actions/other/others/quest_system2.lua index 20e6dadd5..c3bcdee91 100644 --- a/data/scripts/actions/other/others/quest_system2.lua +++ b/data/scripts/actions/other/others/quest_system2.lua @@ -396,6 +396,45 @@ This page seems to be part of a book about ancient rituals, mystic incantations name = "Falcon Bastion Access"} }, storage = Storage.TheSecretLibrary.FalconBastionAccess + }, + [20002] = { + items = { + {itemId = 21413, text = [[ +"Still it is hard to believe that I finally +found the mystical rock formations near +Darashia, known as Lion's Rock. +According to ancient records there is a +temple for an unknown, probably long +forgotten deity, built in the tunnels deep +below the rock centuries ago. This holy +site was once guarded by mystical lions +and they may still be down there. But +yet I haven't succeeded in entering the +inner sanctum. The entrance to the +lower temple areas is protected by an +old and powerful enchantment. I +studied the inscriptions on the temple +walls and thus learned that the key to +the inner sanctum is the passing of +three tests. The first test is the Lion's +Strength. In order to honour the site's +mystical cats of prey one has to hunt +and slay a cobra. The cobra's tongue +must be laid down at a stone statue as +a sacrifice. The second test is the +Lion's Beauty. One has to burn the +petals of a lion's mane flower on a coal +basin. In the sand at the rock's foot I +saw some dried lion's mane petals. +Maybe these flowers grow somewhere +upwards. The third test is called the +Lion's Tears. It seems one has to purify +an ornamented stone pedestal with ..." +At this point the records end because +the parchment is destroyed. It seems +that is was torn by a big paw ...]]} + }, + storage = Storage.LionsRock.OuterSanctum.Skeleton } -- 65203 reservado } diff --git a/data/scripts/actions/quests/lions_rock/lions_rock.lua b/data/scripts/actions/quests/lions_rock/lions_rock.lua index d7b79e93e..a0711931f 100644 --- a/data/scripts/actions/quests/lions_rock/lions_rock.lua +++ b/data/scripts/actions/quests/lions_rock/lions_rock.lua @@ -10,131 +10,83 @@ local rewards = { 'yellow gem' } -local UniqueTable = { - [40004] = { - storage = Storage.LionsRock.LionsStrength, +local tests = { + { + storage = Storage.LionsRock.OuterSanctum.LionsStrength, itemPosition = {x = 33137, y = 32291, z = 8}, pagodaPosition = { x = 33134, y = 32289, z = 8}, item = 9634, - storage = Storage.LionsRock.Questline, - value = 1, - newValue = 2, - message = "You have sacrificed a cobra tongue at an ancient statue. The light in the small \z - pyramid nearby begins to shine.", - effect = CONST_ME_BLOCKHIT, + message = "You have sacrificed a cobra tongue at an ancient statue. The light in the small pyramid nearby begins to shine.", + effect = CONST_ME_BLOCKHIT }, - [40005] = { - storage = Storage.LionsRock.LionsBeauty, + { + storage = Storage.LionsRock.OuterSanctum.LionsBeauty, itemPosition = {x = 33138, y = 32369, z = 8}, pagodaPosition = { x = 33136, y = 32369, z = 8}, item = 21389, - storage = Storage.LionsRock.Questline, - value = 2, - newValue = 3, message = "You burnt a lion's mane flower. The light in the small pyramid nearby begins to shine.", effect = CONST_ME_REDSMOKE }, - [40006] = { - storage = Storage.LionsRock.LionsTears, + { + storage = Storage.LionsRock.OuterSanctum.LionsTears, itemPosition = {x = 33154, y = 32279, z = 8}, pagodaPosition = { x = 33156, y = 32279, z = 8}, item = 21466, - storage = Storage.LionsRock.Questline, - value = 3, - newValue = 4, message = "You have purified a sacret pedestal with holy water. You have now passed the last test\z to enter thge inner sanctum.", effect = CONST_ME_LOSEENERGY } } --- Lions rock skeleton -local lionsRockSkeleton = Action() - -function lionsRockSkeleton.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local setting = CorpseUnique[item.uid] - if not setting then - return true - end - - if player:getStorageValue(Storage.LionsRock.Questline) < 0 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have discovered a skeleton. It seems to hold an old parchment.') - player:addItem(21413, 1):setAttribute( - ITEM_ATTRIBUTE_TEXT, - "\"Still it is hard to believe that I finally found the mystical rock formations near Darashia, \z - known as Lion's Rock. According to ancient records there is a temple for an unknown, probably long \z - forgotten deity, built in the tunnels deep below the rock centuries ago. This holy site was once guarded \z - by mystical lions and they may still be down there. But yet I haven't succeeded in entering the inner \z - sanctum. The entrance to the lower temple areas is protected by an old and powerful enchantment. I \z - studied the inscriptions on the temple walls and thus learned that the key to the inner sanctum is the \z - passing of three tests. The first test is the Lion's Strength. In order to honour the site's mystical \z - cats of prey one has to hunt and slay a cobra. The cobra's tongue must be laid down at a stone statue as \z - a sacrifice. The second test is the Lion's Beauty. One has to burn the petals of a lion's mane flower on \z - a coal basin. In the sand at the rock's foot I saw some dried lion's mane petals. Maybe these flowers \z - grow somewhere upwards. The third test is called the Lion's Tears. It seems one has to purify an \z - ornamented stone pedestal with ...\" At this point the records end because the parchment is destroyed. \z - It seems that is was torn by a big paw ..." - ) - player:setStorageValue(Storage.LionsRock.Questline, 1) - player:setStorageValue(Storage.TibiaTales.DefaultStart, 1) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) - end - return true -end - -lionsRockSkeleton:uid(20002) -lionsRockSkeleton:register() - -- Lions rock sacrifices local lionsRockSacrificesTest = Action() function lionsRockSacrificesTest.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local setting = UniqueTable[target.uid] - if not setting then - return true - end - - local function reset() - local pagodaLit = Tile(setting.itemPosition):getItemById(2075) + local function reset(setting) + local pagodaLit = Tile(setting.pagodaPosition):getItemById(2075) if pagodaLit then pagodaLit:transform(2074) end end - - if item.itemid == setting.item then - if player:getStorageValue(setting.storage) == setting.value then - local pagoda = Tile(setting.pagodaPosition):getItemById(2074) - if pagoda then - pagoda:transform(2075) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message) - player:setStorageValue(setting.storage, setting.newValue) - player:removeItem(setting.item, 1) - toPosition:sendMagicEffect(setting.effect) - addEvent(reset, 15 * 1000) + local setting + for a = 1, #tests do + setting = tests[a] + if item.itemid == setting.item and target:getPosition() == Position(setting.itemPosition) then + if player:getStorageValue(setting.storage) < 1 then + local pagoda = Tile(setting.pagodaPosition):getItemById(2074) + if pagoda then + pagoda:transform(2075) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message) + player:setStorageValue(setting.storage, 1) + if player:getStorageValue(Storage.LionsRock.Questline) < 1 then + player:setStorageValue(Storage.LionsRock.Questline, math.max(player:getStorageValue(Storage.LionsRock.Questline), 1)) + player:setStorageValue(Storage.LionsRock.Questline, player:getStorageValue(Storage.LionsRock.Questline) + 1) + else + player:setStorageValue(Storage.LionsRock.Questline, player:getStorageValue(Storage.LionsRock.Questline) + 1) + end + player:removeItem(setting.item, 1) + toPosition:sendMagicEffect(setting.effect) + addEvent(reset, 15 * 1000, setting) + end end end end return true end -lionsRockSacrificesTest:id(9634) -lionsRockSacrificesTest:id(21389) -lionsRockSacrificesTest:id(21466) +lionsRockSacrificesTest:id(9634, 21389, 21466) lionsRockSacrificesTest:register() -- Get lions mane local lionsGetLionsMane = Action() function lionsGetLionsMane.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if item.itemid == 21388 then - if player:getStorageValue(Storage.LionsRock.Questline) < 0 then - if player:getStorageValue(Storage.LionsRock.GetLionsMane) < 0 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You picked a beautiful lion's mane flower.") - player:addItem(21389, 1) - player:setStorageValue(Storage.LionsRock.GetLionsMane, 1) - end - end - end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You picked a beautiful lion's mane flower.") + player:addItem(21389, 1) + player:setStorageValue(Storage.LionsRock.Questline, math.max(player:getStorageValue(Storage.LionsRock.Questline), 1)) + player:setStorageValue(Storage.TibiaTales.DefaultStart, 1) + item:transform(21935) + addEvent(function() item:transform(21388) end, 60 * 1000) return true end @@ -145,78 +97,29 @@ lionsGetLionsMane:register() local lionsGetHolyWater = Action() function lionsGetHolyWater.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local setting = ItemUnique[item.uid] - if not setting then - return true - end - - if player:getStorageValue(Storage.LionsRock.GetLionsMane) > 0 then - if player:getStorageValue(Storage.LionsRock.GetHolyWater) < 0 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You took some holy water from the sacred well.') - player:addItem(21466, 1) - player:setStorageValue(Storage.LionsRock.GetHolyWater, 1) - end - end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You took some holy water from the sacred well.') + player:addItem(21466, 1) + player:setStorageValue(Storage.LionsRock.Questline, math.max(player:getStorageValue(Storage.LionsRock.Questline), 1)) + player:setStorageValue(Storage.TibiaTales.DefaultStart, 1) return true end -lionsGetHolyWater:uid(40007) +lionsGetHolyWater:position({x = 33137, y = 32351, z = 6}) lionsGetHolyWater:register() --- Rock translation scroll -local lionsRockTranslationScroll = Action() - -function lionsRockTranslationScroll.onUse(player, item, fromPosition, target, toPosition, isHotkey) - local amphoraPos = Position(33119, 32247, 9) - local amphoraID = 21945 - local amphoraBrokenID = 21946 - - local function reset() - local brokenAmphora = Tile(amphoraPos):getItemById(amphoraBrokenID) - if brokenAmphora then - brokenAmphora:transform(amphoraID) - end - end - - if player:getStorageValue(Storage.LionsRock.Questline) == 4 then - local amphora = Tile(amphoraPos):getItemById(amphoraID) - if amphora then - amphora:transform(amphoraBrokenID) - player:sendTextMessage( - MESSAGE_EVENT_ADVANCE, - 'As you pass incautiously, the ancient amphora crumbles to shards and dust. \z - Amidst the debris you discover an old scroll.' - ) - player:setStorageValue(Storage.LionsRock.Questline, 5) - player:addItem(21467, 1) - toPosition:sendMagicEffect(CONST_ME_GROUNDSHAKER) - addEvent(reset, 15 * 1000) - end - end - return true -end - -lionsRockTranslationScroll:uid(40008) -lionsRockTranslationScroll:register() - -- Lions rock fountain local lionsRockFountain = Action() function lionsRockFountain.onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(Storage.LionsRock.Time) < os.time() then local reward = '' - if (player:hasMount(40)) then + if player:hasMount(40) then repeat reward = math.random(1, #rewards) - until (rewards[reward] ~= "lion's heart") + until rewards[reward] ~= "lion's heart" else reward = math.random(1, #rewards) end - - if (player:getStorageValue(Storage.LionsRock.Questline) == 10) then - player:setStorageValue(Storage.LionsRock.Questline, 11) - end - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Something sparkles in the fountain's water. You draw out a " .. rewards[reward] .. '.') player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) @@ -224,6 +127,7 @@ function lionsRockFountain.onUse(player, item, fromPosition, target, toPosition, item:transform(lionsRockSanctuaryRockId) player:addItem(rewards[reward], 1) player:setStorageValue(Storage.LionsRock.Time, os.time() + 24 * 60 * 60) + player:setStorageValue(Storage.LionsRock.Questline, 11) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'At the moment there is neither a treasure nor anything else in the fountain. Perhaps you might return later.') diff --git a/data/scripts/movements/quests/lions_rock/lions_rock.lua b/data/scripts/movements/quests/lions_rock/lions_rock.lua index 98d903426..a7d18aec3 100644 --- a/data/scripts/movements/quests/lions_rock/lions_rock.lua +++ b/data/scripts/movements/quests/lions_rock/lions_rock.lua @@ -1,43 +1,27 @@ -local UniqueTable = { - [25001] = { - storage = Storage.LionsRock.SnakeSign, - needStorage = Storage.LionsRock.Questline, - value = 5, - item = 21467, - message1 = "With the aid of the old scroll you translate the inscriptions on the floor: \z - And the mighty lion defeated the jealous snake.", - message2 = "As a sign of victory he tooks its eye, yellow as envy and malevolence, and out \z - of a foul creature created a precious treasure." +local signs = { + { + pos = {x = 33095, y = 32244, z = 9}, + storage = Storage.LionsRock.InnerSanctum.SnakeSign, + message1 = "With the aid of the old scroll you translate the inscriptions on the floor: And the mighty lion defeated the jealous snake.", + message2 = "As a sign of victory he tooks its eye, yellow as envy and malevolence, and out of a foul creature created a precious treasure." }, - [25002] = { - storage = Storage.LionsRock.LizardSign, - needStorage = Storage.LionsRock.Questline, - value = 5, - item = 21467, - message1 = "With the aid of the old scroll you translate the inscriptions on the floor: \z - And the mighty lion defeated the lazy lizard.", - message2 = "As a sign of victory he tooks its egg, blue as sloth and conceit, and out \z - of a foul creature created a precious treasure." + { + pos = {x = 33128, y = 32300, z = 9}, + storage = Storage.LionsRock.InnerSanctum.LizardSign, + message1 = "With the aid of the old scroll you translate the inscriptions on the floor: And the mighty lion defeated the lazy lizard.", + message2 = "As a sign of victory he tooks its egg, blue as sloth and conceit, and out of a foul creature created a precious treasure." }, - [25003] = { - storage = Storage.LionsRock.ScorpionSign, - needStorage = Storage.LionsRock.Questline, - value = 5, - item = 21467, - message1 = "With the aid of the old scroll you translate the inscriptions on the golden altar: \z - And the mighty lion defeated the treacherous scorpion.", - message2 = "As a sign of victory he tooks its poison, violet as deceit and betrayal, and \z - created a precious treasure." + { + pos = {x = 33109, y = 32329, z = 9}, + storage = Storage.LionsRock.InnerSanctum.ScorpionSign, + message1 = "With the aid of the old scroll you translate the inscriptions on the golden altar: And the mighty lion defeated the treacherous scorpion.", + message2 = "As a sign of victory he tooks its poison, violet as deceit and betrayal, and created a precious treasure." }, - [25004] = { - storage = Storage.LionsRock.HyenaSign, - needStorage = Storage.LionsRock.Questline, - value = 5, - item = 21467, - message1 = "With the aid of the old scroll you translate the inscriptions on the golden statue: \z - And the mighty lion defeated the greedy hyaena.", - message2 = "As a sign of victory he tooks its blood, red as voracity and lust, and \z - created a precious treasure." + { + pos = {x = 33127, y = 32340, z = 9}, + storage = Storage.LionsRock.InnerSanctum.HyenaSign, + message1 = "With the aid of the old scroll you translate the inscriptions on the golden statue: And the mighty lion defeated the greedy hyaena.", + message2 = "As a sign of victory he tooks its blood, red as voracity and lust, and created a precious treasure." } } @@ -63,9 +47,57 @@ function lionsRockEntrance.onStepIn(creature, item, position, fromPosition) return true end -lionsRockEntrance:uid(35009) +lionsRockEntrance:position({x = 33128, y = 32308, z = 8}) lionsRockEntrance:register() +-- Rock translation scroll +local checkPos = { + {x = 33118, y = 32246, z = 9}, + {x = 33119, y = 32246, z = 9}, + {x = 33120, y = 32246, z = 9}, + {x = 33118, y = 32247, z = 9}, + {x = 33120, y = 32247, z = 9}, + {x = 33118, y = 32248, z = 9}, + {x = 33119, y = 32248, z = 9}, + {x = 33120, y = 32248, z = 9} +} +local lionsRockTranslationScroll = MoveEvent() + +function lionsRockTranslationScroll.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local amphoraPos = Position(33119, 32247, 9) + local amphoraID = 21945 + local amphoraBrokenID = 21946 + local function reset() + local brokenAmphora = Tile(amphoraPos):getItemById(amphoraBrokenID) + if brokenAmphora then + brokenAmphora:transform(amphoraID) + end + end + + if player:getStorageValue(Storage.LionsRock.Questline) == 4 then + local amphora = Tile(amphoraPos):getItemById(amphoraID) + if amphora then + amphora:transform(amphoraBrokenID) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "As you pass incautiously, the ancient amphora crumbles to shards and dust. Amidst the debris you discover an old scroll.") + player:setStorageValue(Storage.LionsRock.Questline, 5) + player:addItem(21467, 1) + amphoraPos:sendMagicEffect(CONST_ME_GROUNDSHAKER) + addEvent(reset, 15 * 1000) + end + end + return true +end + +for a = 1, #checkPos do + lionsRockTranslationScroll:position(checkPos[a]) +end +lionsRockTranslationScroll:register() + -- Lions rock sign local lionsRockSigns = MoveEvent() @@ -74,29 +106,39 @@ function lionsRockSigns.onStepIn(creature, item, position, fromPosition) if not player then return end - - local setting = UniqueTable[item.uid] - if not setting then - return true - end - - local currentStorage = player:getStorageValue(setting.needStorage) - if currentStorage >= setting.value and currentStorage < 10 then - if player:getStorageValue(setting.storage) < 1 then - if player:getItemCount(setting.item) == 1 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message1) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message2) - player:setStorageValue(setting.needStorage, player:getStorageValue(setting.needStorage) + 1) - player:setStorageValue(setting.storage, 1) - end + local setting + for c = 1, #signs do + setting = signs[c] + if player:getStorageValue(setting.storage) < 1 and player:getItemCount(21467) >= 1 and player:getPosition() == Position(setting.pos) then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.message2) + player:setStorageValue(setting.storage, 1) + player:setStorageValue(Storage.LionsRock.Questline, player:getStorageValue(Storage.LionsRock.Questline) + 1) end end - return true end -for index, value in pairs(UniqueTable) do - lionsRockSigns:uid(index) +for b = 1, #signs do + lionsRockSigns:position(signs[b].pos) end lionsRockSigns:register() + +-- Lions rock message +local lionsRockMessage = MoveEvent() + +function lionsRockMessage.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return + end + if player:getStorageValue(Storage.LionsRock.InnerSanctum.Message) < 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You enter a temple area which is gorgeously decorated and mysteriously unaffected by the course of time.") + player:setStorageValue(Storage.LionsRock.InnerSanctum.Message, 1) + end + return true +end + +lionsRockMessage:position({x = 33080, y = 32274, z = 10}) +lionsRockMessage:register() diff --git a/data/scripts/movements/teleport/shrine_entrance.lua b/data/scripts/movements/teleport/shrine_entrance.lua index a49cdb449..3471e2007 100644 --- a/data/scripts/movements/teleport/shrine_entrance.lua +++ b/data/scripts/movements/teleport/shrine_entrance.lua @@ -1,97 +1,104 @@ -local setting = { - --Carlin - [9069] = {position = Position(32192, 31419, 2), storage = 10017}, --ice - [9070] = {position = Position(32972, 32227, 7), storage = 10017}, --earth - [9071] = {position = Position(32911, 32336, 15), storage = 10017}, --fire - [9072] = {position = Position(33059, 32716, 5), storage = 10017}, --electric - --Thais - [9073] = {position = Position(32192, 31419, 2), storage = 10018}, --ice - [9074] = {position = Position(32972, 32227, 7), storage = 10018}, --earth - [9075] = {position = Position(32911, 32336, 15), storage = 10018}, --fire - [9076] = {position = Position(33059, 32716, 5), storage = 10018}, --electric - --Venore - [9077] = {position = Position(32192, 31419, 2), storage = 10019}, --ice - [9078] = {position = Position(32972, 32227, 7), storage = 10019}, --earth - [9079] = {position = Position(32911, 32336, 15), storage = 10019}, --fire - [9080] = {position = Position(33059, 32716, 5), storage = 10019}, --electric - --Ab"Dendriel - [9081] = {position = Position(32192, 31419, 2), storage = 10020}, --ice - [9082] = {position = Position(32972, 32227, 7), storage = 10020}, --earth - [9083] = {position = Position(32911, 32336, 15), storage = 10020}, --fire - [9084] = {position = Position(33059, 32716, 5), storage = 10020}, --electric - --Kazodron - [9085] = {position = Position(32192, 31419, 2), storage = 10021 }, --ice - [9086] = {position = Position(32972, 32227, 7), storage = 10021}, --earth - [9087] = {position = Position(32911, 32336, 15), storage = 10021}, --fire - [9088] = {position = Position(33059, 32716, 5), storage = 10021}, --electric - --Darashia - [9089] = {position = Position(32192, 31419, 2), storage = 10022}, --ice - [9090] = {position = Position(32972, 32227, 7), storage = 10022}, --earth - [9091] = {position = Position(32911, 32336, 15), storage = 10022}, --fire - [9092] = {position = Position(33059, 32716, 5), storage = 10022}, --electric - --Ankrahmun - [9093] = {position = Position(32192, 31419, 2), storage = 10023}, --ice - [9094] = {position = Position(32972, 32227, 7), storage = 10023}, --earth - [9095] = {position = Position(32911, 32336, 15), storage = 10023}, --fire - [9096] = {position = Position(33059, 32716, 5), storage = 10023}, --electric - --Edron - [9097] = {position = Position(32192, 31419, 2), storage = 10024}, --ice - [9098] = {position = Position(32972, 32227, 7), storage = 10024}, --earth - [9099] = {position = Position(32911, 32336, 15), storage = 10024}, --fire - [9100] = {position = Position(33059, 32716, 5), storage = 10024}, --electric - --Liberty Bay - [9101] = {position = Position(32192, 31419, 2), storage = 10025}, --ice - [9102] = {position = Position(32972, 32227, 7), storage = 10025}, --earth - [9103] = {position = Position(32911, 32336, 15), storage = 10025}, --fire - [9104] = {position = Position(33059, 32716, 5), storage = 10025}, --electric - --Port Hope - [9105] = {position = Position(32192, 31419, 2), storage = 10026}, --ice - [9106] = {position = Position(32972, 32227, 7), storage = 10026}, --earth - [9107] = {position = Position(32911, 32336, 15), storage = 10026}, --fire - [9108] = {position = Position(33059, 32716, 5), storage = 10026}, --electric - --Svargrond - [9109] = {position = Position(32192, 31419, 2), storage = 10027}, --ice - [9110] = {position = Position(32972, 32227, 7), storage = 10027}, --earth - [9111] = {position = Position(32911, 32336, 15), storage = 10027}, --fire - [9112] = {position = Position(33059, 32716, 5), storage = 10027}, --electric - --Yalahar - [9113] = {position = Position(32192, 31419, 2), storage = 10028}, --ice - [9114] = {position = Position(32972, 32227, 7), storage = 10028}, --earth - [9115] = {position = Position(32911, 32336, 15), storage = 10028}, --fire - [9116] = {position = Position(33059, 32716, 5), storage = 10028}, --electric - --Oramond - [9117] = {position = Position(32192, 31419, 2), storage = 10029}, --ice - [9118] = {position = Position(32972, 32227, 7), storage = 10029}, --earth - [9119] = {position = Position(32911, 32336, 15), storage = 10029}, --fire - [9120] = {position = Position(33059, 32716, 5), storage = 10029} --electric +local shrinesEntrance = { + ice = { + {x = 32356, y = 31780, z = 9},--Carlin + {x = 32358, y = 32242, z = 6},--Thais + {x = 32954, y = 32076, z = 5},--Venore + {x = 32678, y = 31688, z = 2},--Ab'Dendriel + {x = 32643, y = 31928, z = 11},--Kazodroon + {x = 33229, y = 32389, z = 5},--Darashia + {x = 33126, y = 32812, z = 4},--Ankrahmun + {x = 33264, y = 31837, z = 9},--Edron + {x = 32333, y = 32838, z = 8},--Liberty Bay + {x = 32624, y = 32744, z = 4},--Port Hope + {x = 32212, y = 31130, z = 8},--Svargrond + {x = 32784, y = 31243, z = 5},--Yalahar + {x = 33592, y = 31896, z = 4}--Oramond + }, + earth = { + {x = 32364, y = 31780, z = 9},--Carlin + {x = 32360, y = 32239, z = 6},--Thais + {x = 32958, y = 32079, z = 5},--Venore + {x = 32678, y = 31686, z = 2},--Ab'Dendriel + {x = 32649, y = 31928, z = 11},--Kazodroon + {x = 33232, y = 32389, z = 5},--Darashia + {x = 33131, y = 32806, z = 4},--Ankrahmun + {x = 33266, y = 31831, z = 9},--Edron + {x = 32339, y = 32842, z = 8},--Liberty Bay + {x = 32625, y = 32740, z = 4},--Port Hope + {x = 32215, y = 31130, z = 8},--Svargrond + {x = 32787, y = 31243, z = 5},--Yalahar + {x = 33596, y = 31901, z = 4}--Oramond + }, + fire = { + {x = 32356, y = 31783, z = 9},--Carlin + {x = 32379, y = 32242, z = 6},--Thais + {x = 32961, y = 32076, z = 5},--Venore + {x = 32678, y = 31684, z = 2},--Ab'Dendriel + {x = 32649, y = 31921, z = 11},--Kazodroon + {x = 33235, y = 32389, z = 5},--Darashia + {x = 33126, y = 32820, z = 4},--Ankrahmun + {x = 33271, y = 31831, z = 9},--Edron + {x = 32343, y = 32838, z = 8},--Liberty Bay + {x = 32632, y = 32740, z = 4},--Port Hope + {x = 32208, y = 31133, z = 8},--Svargrond + {x = 32790, y = 31243, z = 5},--Yalahar + {x = 33592, y = 31901, z = 4}--Oramond + }, + energy = { + {x = 32364, y = 31783, z = 9},--Carlin + {x = 32377, y = 32239, z = 6},--Thais + {x = 32958, y = 32072, z = 5},--Venore + {x = 32681, y = 31683, z = 2},--Ab'Dendriel + {x = 32643, y = 31921, z = 11},--Kazodroon + {x = 33226, y = 32389, z = 5},--Darashia + {x = 33131, y = 32823, z = 4},--Ankrahmun + {x = 33271, y = 31837, z = 9},--Edron + {x = 32339, y = 32832, z = 8},--Liberty Bay + {x = 32632, y = 32744, z = 4},--Port Hope + {x = 32209, y = 31130, z = 8},--Svargrond + {x = 32781, y = 31243, z = 5},--Yalahar + {x = 33596, y = 31896, z = 4}--Oramond + } } -local shrineEntrance = MoveEvent() +local function toShrine(player, entrance, destination) + for a = 1, #entrance do + if player:getPosition() == Position(entrance[a]) then + player:teleportTo(destination) + player:setStorageValue(Storage.ShrineEntrance, a) + end + end +end +local shrineEntrance = MoveEvent() function shrineEntrance.onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then return true end - - local portal = setting[item.uid] - if not portal or player:getLevel() < 30 then + if player:getLevel() < 30 then player:teleportTo(fromPosition, true) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) player:say("Only players of level 30 or higher may enter this portal.", TALKTYPE_MONSTER_SAY) return true end - - player:teleportTo(portal.position) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:setStorageValue(portal.storage, 1) + toShrine(player, shrinesEntrance.ice, Position(32192, 31419, 2)) + toShrine(player, shrinesEntrance.earth, Position(32972, 32227, 7)) + toShrine(player, shrinesEntrance.fire, Position(32911, 32336, 15)) + toShrine(player, shrinesEntrance.energy, Position(33059, 32716, 5)) return true end -shrineEntrance:type("stepin") - -for index, value in pairs(setting) do - shrineEntrance:uid(index) +for b = 1, #shrinesEntrance.ice do + shrineEntrance:position(shrinesEntrance.ice[b]) +end +for c = 1, #shrinesEntrance.earth do + shrineEntrance:position(shrinesEntrance.earth[c]) +end +for d = 1, #shrinesEntrance.fire do + shrineEntrance:position(shrinesEntrance.fire[d]) +end +for e = 1, #shrinesEntrance.energy do + shrineEntrance:position(shrinesEntrance.energy[e]) end - shrineEntrance:register() diff --git a/data/scripts/movements/teleport/shrine_exit.lua b/data/scripts/movements/teleport/shrine_exit.lua index 6a2514662..4ecf8ffb6 100644 --- a/data/scripts/movements/teleport/shrine_exit.lua +++ b/data/scripts/movements/teleport/shrine_exit.lua @@ -1,17 +1,32 @@ -local setting = { - {storage = 10017, destination = Position(32360, 31781, 9)}, - {storage = 10018, destination = Position(32369, 32242, 6)}, - {storage = 10019, destination = Position(32958, 32077, 5)}, - {storage = 10020, destination = Position(32681, 31686, 2)}, - {storage = 10021, destination = Position(32646, 31925, 11)}, - {storage = 10022, destination = Position(33230, 32392, 5)}, - {storage = 10023, destination = Position(33130, 32815, 4)}, - {storage = 10024, destination = Position(33266, 31835, 9)}, - {storage = 10025, destination = Position(32337, 32837, 8)}, - {storage = 10026, destination = Position(32628, 32743, 4)}, - {storage = 10027, destination = Position(32213, 31132, 8)}, - {storage = 10028, destination = Position(32786, 31245, 5)}, - {storage = 10029, destination = Position(33594, 31899, 4)} +local exitDestination = { + {x = 32360, y = 31781, z = 9},--Carlin + {x = 32369, y = 32242, z = 6},--Thais + {x = 32958, y = 32077, z = 5},--Venore + {x = 32681, y = 31686, z = 2},--Ab'Dendriel + {x = 32646, y = 31925, z = 11},--Kazodroon + {x = 33230, y = 32392, z = 5},--Darashia + {x = 33130, y = 32815, z = 4},--Ankrahmun + {x = 33266, y = 31835, z = 9},--Edron + {x = 32337, y = 32837, z = 8},--Liberty Bay + {x = 32628, y = 32743, z = 4},--Port Hope + {x = 32213, y = 31132, z = 8},--Svargrond + {x = 32786, y = 31245, z = 5},--Yalahar + {x = 33594, y = 31899, z = 4}--Oramond +} +local exitFlamesPos = { + {x = 32191, y = 31419, z = 2},--ice + {x = 32197, y = 31419, z = 2}, + {x = 32971, y = 32224, z = 7},--earth + {x = 32977, y = 32224, z = 7}, + {x = 32971, y = 32228, z = 7}, + {x = 32977, y = 32228, z = 7}, + {x = 32914, y = 32337, z = 15},--fire + {x = 32914, y = 32342, z = 15}, + {x = 32907, y = 32337, z = 15}, + {x = 32907, y = 32342, z = 15}, + {x = 33063, y = 32711, z = 5},--energy + {x = 33063, y = 32716, z = 5}, + {x = 33059, y = 32717, z = 5} } local shrineExit = MoveEvent() @@ -22,21 +37,17 @@ function shrineExit.onStepIn(creature, item, position, fromPosition) return end - for i = 1, #setting do - local teleport = setting[i] - if player:getStorageValue(teleport.storage) >= 1 then - player:teleportTo(teleport.destination) - teleport.destination:sendMagicEffect(CONST_ME_TELEPORT) - player:setStorageValue(teleport.storage, 0) - return true - end + if player:getStorageValue(Storage.ShrineEntrance) >= 1 then + player:teleportTo(Position(exitDestination[player:getStorageValue(Storage.ShrineEntrance)])) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true end - player:teleportTo(player:getTown():getTemplePosition()) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) return true end -shrineExit:type("stepin") -shrineExit:aid(9117) +for a = 1, #exitFlamesPos do + shrineExit:position(exitFlamesPos[a]) +end shrineExit:register() diff --git a/data/scripts/talkactions/god/attributes.lua b/data/scripts/talkactions/god/attributes.lua index 6bb2f4c50..8204af82b 100644 --- a/data/scripts/talkactions/god/attributes.lua +++ b/data/scripts/talkactions/god/attributes.lua @@ -15,6 +15,7 @@ local itemFunctions = { ["attack"] = { isActive = true, targetFunction = function (item, target) return item:setAttribute(ITEM_ATTRIBUTE_ATTACK, target) end }, ["defense"] = { isActive = true, targetFunction = function (item, target) return item:setAttribute(ITEM_ATTRIBUTE_DEFENSE, target) end }, ["extradefense"] = { isActive = true, targetFunction = function (item, target) return item:setAttribute(ITEM_ATTRIBUTE_EXTRADEFENSE, target) end }, + ["charge"] = { isActive = true, targetFunction = function (item, target) return item:setAttribute(ITEM_ATTRIBUTE_CHARGES, target) end }, ["armor"] = { isActive = true, targetFunction = function (item, target) return item:setAttribute(ITEM_ATTRIBUTE_ARMOR, target) end } } diff --git a/data/startup/tables/item.lua b/data/startup/tables/item.lua index f919a0f87..8628b6910 100644 --- a/data/startup/tables/item.lua +++ b/data/startup/tables/item.lua @@ -310,30 +310,6 @@ ItemUnique = { itemId = 6118, itemPos = {x = 31992, y = 32847, z = 2} }, - -- Lions rock quest - -- data\scripts\actions\quests\lions_rock\lions_rock.lua - [40004] = { - itemId = 21390, - itemPos = {x = 33137, y = 32291, z = 8} - }, - [40005] = { - itemId = 2110, - itemPos = {x = 33138, y = 32369, z = 8} - }, - [40006] = { - itemId = 21391, - itemPos = {x = 33154, y = 32279, z = 8} - }, - -- Lions Rock (holy water and translation scrool) - -- data\scripts\actions\quests\lions_rock\lions_rock.lua - [40007] = { - itemId = 21394, - itemPos = {x = 33137, y = 32351, z = 6} - }, - [40008] = { - itemId = 21945, - itemPos = {x = 33119, y = 32247, z = 9} - }, -- Insectoid cell rewards -- data\scripts\actions\quests\others\gooey_mass.lua [40011] = { diff --git a/data/startup/tables/tile.lua b/data/startup/tables/tile.lua index 847bb50eb..7f8047238 100644 --- a/data/startup/tables/tile.lua +++ b/data/startup/tables/tile.lua @@ -1088,28 +1088,6 @@ TileAction = { } TileUnique = { - -- Lions rock tiles - -- data\scripts\movements\quests\lions_rock\lionsrock.lua - -- snake sign - [25001] = { - itemId = 499, - itemPos = {x = 33095, y = 32244, z = 9} - }, - -- lizard sign - [25002] = { - itemId = 499, - itemPos = {x = 33128, y = 32300, z = 9} - }, - -- scorpion sign - [25003] = { - itemId = 499, - itemPos = {x = 33109, y = 32329, z = 9} - }, - -- hyena sign - [25004] = { - itemId = 499, - itemPos = {x = 33127, y = 32340, z = 9} - }, -- Lions rock quest (gems tile) scripts/actions/other/gems [25006] = { itemId = 21441,