From 991bdcb6dfa5a8707370fcbf5877b89d1c28113d Mon Sep 17 00:00:00 2001 From: mattyx14 Date: Sun, 10 Nov 2024 16:39:01 -0600 Subject: [PATCH] fixes --- data-otxserver/lib/core/storages.lua | 77 ----------- data-otxserver/lib/quests/soul_war.lua | 6 +- .../actions/other/others/quest_system_old.lua | 11 +- .../others/map_attributes_loader.lua | 2 +- .../the_explorer_society/actions_botanist.lua | 31 +++++ .../actions_butterfly.lua | 26 ++++ .../the_explorer_society/actions_dragon.lua | 13 ++ .../the_explorer_society/actions_findings.lua | 88 ++++++++++++ .../the_explorer_society/actions_icicle.lua | 13 ++ .../actions_resonance.lua | 16 +++ .../the_explorer_society/actions_stone.lua | 26 ++++ .../actions_tracing_paper.lua | 13 ++ .../movements_calassa.lua | 25 ++++ ...movements_carving_teleport_liberty_bay.lua | 36 +++++ .../movements_carvingteleport_port_hope.lua | 36 +++++ .../actions_lair_entrance.lua | 22 +++ .../quests/the_first_dragon/actions_lever.lua | 50 +++++++ .../the_first_dragon/actions_rewards.lua | 81 ++++++++++++ .../actions_sacrifice_items.lua | 47 +++++++ .../actions_treasure_chest.lua | 125 ++++++++++++++++++ .../creaturescripts_death_angry_plant.lua | 10 ++ .../creaturescripts_death_dragon_essence.lua | 16 +++ .../creaturescripts_death_fallen.lua | 18 +++ .../creaturescripts_death_first_dragon.lua | 36 +++++ ...reaturescripts_death_somewhat_beatable.lua | 24 ++++ .../creaturescripts_kill_dragon.lua | 13 ++ .../movements_entrance_teleport.lua | 97 ++++++++++++++ .../movements_exit_teleport.lua | 40 ++++++ .../movements_flower_bowl.lua | 19 +++ .../movements_heaven_blossom.lua | 21 +++ .../movements_last_teleport.lua | 43 ++++++ .../movements_zorvorax_secrets.lua | 42 ++++++ .../actions_treasure.lua | 47 +++++++ .../actions_warrior_skeleton.lua | 22 +++ .../creaturescripts_the_great_dragon_hunt.lua | 29 ++++ .../creaturescripts_magma_bubble_death.lua | 28 ++++ ...eaturescripts_the_primal_menace_killed.lua | 21 +++ .../actions_climbing_vine.lua | 24 ++++ .../actions_dwarf_disguise_kit.lua | 13 ++ .../actions_fish_napping_door.lua | 11 ++ .../actions_fish_napping_key.lua | 17 +++ .../the_thieves_guild_quest/actions_note.lua | 27 ++++ .../creaturescripts_nomad_kill.lua | 11 ++ src/core.hpp | 2 +- 44 files changed, 1290 insertions(+), 85 deletions(-) create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_botanist.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_butterfly.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_dragon.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_findings.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_icicle.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_resonance.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_stone.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/actions_tracing_paper.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/movements_calassa.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua create mode 100644 data-otxserver/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/actions_lair_entrance.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/actions_lever.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/actions_rewards.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/actions_sacrifice_items.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/actions_treasure_chest.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_angry_plant.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_dragon_essence.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_fallen.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_first_dragon.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_somewhat_beatable.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/creaturescripts_kill_dragon.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/movements_entrance_teleport.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/movements_exit_teleport.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/movements_flower_bowl.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/movements_heaven_blossom.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/movements_last_teleport.lua create mode 100644 data-otxserver/scripts/quests/the_first_dragon/movements_zorvorax_secrets.lua create mode 100644 data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_treasure.lua create mode 100644 data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_warrior_skeleton.lua create mode 100644 data-otxserver/scripts/quests/the_great_dragon_hunt_quest/creaturescripts_the_great_dragon_hunt.lua create mode 100644 data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_magma_bubble_death.lua create mode 100644 data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_the_primal_menace_killed.lua create mode 100644 data-otxserver/scripts/quests/the_thieves_guild_quest/actions_climbing_vine.lua create mode 100644 data-otxserver/scripts/quests/the_thieves_guild_quest/actions_dwarf_disguise_kit.lua create mode 100644 data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_door.lua create mode 100644 data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_key.lua create mode 100644 data-otxserver/scripts/quests/the_thieves_guild_quest/actions_note.lua create mode 100644 data-otxserver/scripts/quests/thieves_guild/creaturescripts_nomad_kill.lua diff --git a/data-otxserver/lib/core/storages.lua b/data-otxserver/lib/core/storages.lua index 4529c64f5..06982ee7f 100644 --- a/data-otxserver/lib/core/storages.lua +++ b/data-otxserver/lib/core/storages.lua @@ -1,80 +1,3 @@ ---[[ -Reserved player action storage key ranges (const.h) - It is possible to place the storage in a quest door, so the player who has that storage will go through the door - - Reserved player action storage key ranges (const.h at the source) - [10000000 - 20000000] - [1000 - 1500] - [2001 - 2011] - - Others reserved player action/storages - [100] = unmovable/untrade/unusable items - [101] = use pick floor - [102] = well down action - [103-120] = others keys action - [103] = key 0010 - [303] = key 0303 - [1000] = level door. Here 1 must be used followed by the level. - Example: 1010 = level 10, 1100 = level 100 - - [3001-3008] = key 3001/3008 - [3012] = key 3012 - [3033] = key 3033 - [3100] = key 3100 - [3142] = key 3142 - [3200] = key 3200 - [3301] = key 3301 - [3302] = key 3302 - [3303] = key 3303 - [3304] = key 3304 - [3350] = key 3350 - [3520] = key 3520 - [3600] = key 3600 - [3610] = key 3610 - [3620] = key 3620 - [3650] = key 3650 - [3666] = key 3666 - [3667] = key 3667 - [3700] = key 3700 - [3701/3703] = key 3701/3703 - [3800/3802] = key 3800/3802 - [3899] = key 3899 - [3900] = key 3900 - [3909/3917] = key 3909/3917 - [3923] = key 3923 - [3925] = key 3925 - [3930] = key 3930 - [3932] = key 3932 - [3934] = key 3934 - [3935] = key 3935 - [3936] = key 3936 - [3938] = key 3938 - [3940] = key 3940 - [3950] = key 3950 - [3960] = key 3960 - [3980] = key 3980 - [3988] = key 3988 - [4001] = key 4001 - [4009] = key 4009 - [4022] = key 4022 - [4023] = key 4023 - [4033] = key 4033 - [4037] = key 4037 - [4055] = key 4055 - [4210] = key 4210 - [4501] = key 4501 - [4502] = key 4502 - [4503] = key 4503 - [4600] = key 4600 - [5000] = key 5000 - [5002] = key 5002 - [5010] = key 5010 - [5050] = key 5050 - [6010] = key 6010 - - Questline = Storage through the Quest -]] - Storage = { -- General storages Dragonfetish = 30003, diff --git a/data-otxserver/lib/quests/soul_war.lua b/data-otxserver/lib/quests/soul_war.lua index f5b2d75f5..279c9a65a 100644 --- a/data-otxserver/lib/quests/soul_war.lua +++ b/data-otxserver/lib/quests/soul_war.lua @@ -467,9 +467,9 @@ SoulWarQuest = { { conor = { x = 33899, y = 31064, z = 9 }, teleportPosition = { x = 33904, y = 31082, z = 8 } }, }, mapsPath = { - empty = "data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow-empty.otbm", - inundate = "data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow-inundate.otbm", - ebbFlow = "data-otservbr-global/world/quest/soul_war/ebb_and_flow/ebb-flow.otbm", + empty = "data-otxserver/world/quest/soul_war/ebb_and_flow/ebb-flow-empty.otbm", + inundate = "data-otxserver/world/quest/soul_war/ebb_and_flow/ebb-flow-inundate.otbm", + ebbFlow = "data-otxserver/world/quest/soul_war/ebb_and_flow/ebb-flow.otbm", }, -- In Minutes diff --git a/data-otxserver/scripts/actions/other/others/quest_system_old.lua b/data-otxserver/scripts/actions/other/others/quest_system_old.lua index 7c9502fe8..389110b9c 100644 --- a/data-otxserver/scripts/actions/other/others/quest_system_old.lua +++ b/data-otxserver/scripts/actions/other/others/quest_system_old.lua @@ -1,6 +1,11 @@ local questSystemOld = Action() function questSystemOld.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(storage) > 0 and player:getGroup():getId() < GROUP_TYPE_GAMEMASTER then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. ItemType(item.itemid):getName() .. " is empty.") + return true + end + if item.uid <= 100 or item.uid >= 44613 then return false end @@ -14,14 +19,14 @@ function questSystemOld.onUse(player, item, fromPosition, target, toPosition, is local playerCap = player:getFreeCapacity() if player:getStorageValue(item.uid) == -1 then if playerCap >= itemWeight then - player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. '.') player:addItem(item.uid, 1) player:setStorageValue(item.uid, 1) else - player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.') + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.') end else - player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.") + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.") end return true end diff --git a/data-otxserver/scripts/globalevents/others/map_attributes_loader.lua b/data-otxserver/scripts/globalevents/others/map_attributes_loader.lua index af5b0e80f..21d9c4f9d 100644 --- a/data-otxserver/scripts/globalevents/others/map_attributes_loader.lua +++ b/data-otxserver/scripts/globalevents/others/map_attributes_loader.lua @@ -20,7 +20,7 @@ local function loadMapActionsAndUniques() loadLuaMapUnique(TileUnique) loadLuaMapAction(TilePickAction) CreateMapItem(CreateItemOnMap) - updateKeysStorage(QuestKeysUpdate) + --updateKeysStorage(QuestKeysUpdate) end local function loadMapAttributes() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_botanist.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_botanist.lua new file mode 100644 index 000000000..ee1a6125c --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_botanist.lua @@ -0,0 +1,31 @@ +local explorerSocietyBotanist = Action() + +function explorerSocietyBotanist.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 3874 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 18 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 18 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 19) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 19) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4868) + elseif target.itemid == 3885 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 21 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 21 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 22) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 22) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4869) + elseif target.itemid == 3878 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection) == 24 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 24 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.ThePlantCollection, 25) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 25) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4870) + elseif target.itemid == 5658 and target.uid == 3152 and player:getStorageValue(Storage.Quest.U7_8.DruidOutfits.GriffinclawFlower) ~= 1 then --Mission-independent function that uses the same item + toPosition:sendMagicEffect(CONST_ME_MAGIC_RED) + item:transform(5937) + target:transform(5687) + player:setStorageValue(Storage.Quest.U7_8.DruidOutfits.GriffinclawFlower, 1) + player:say("You successfully took a sample of the rare griffinclaw flower.", TALKTYPE_MONSTER_SAY) + end + + return true +end + +explorerSocietyBotanist:id(4867) +explorerSocietyBotanist:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_butterfly.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_butterfly.lua new file mode 100644 index 000000000..a9238f95f --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_butterfly.lua @@ -0,0 +1,26 @@ +local explorerSocietyButterfly = Action() +function explorerSocietyButterfly.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 4992 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 9 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 9 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 10) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 10) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4864) + target:remove() + elseif target.itemid == 4993 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 12 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 12 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 13) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 13) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4865) + target:remove() + elseif target.itemid == 4991 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt) == 15 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 15 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheButterflyHunt, 16) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 16) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(4866) + target:remove() + end + return true +end + +explorerSocietyButterfly:id(4863) +explorerSocietyButterfly:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_dragon.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_dragon.lua new file mode 100644 index 000000000..90129aeaf --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_dragon.lua @@ -0,0 +1,13 @@ +local explorerSocietyDragon = Action() +function explorerSocietyDragon.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons) == 57 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 57 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIslandofDragons, 58) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 58) + player:addItem(7314, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyDragon:uid(40042) +explorerSocietyDragon:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_findings.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_findings.lua new file mode 100644 index 000000000..c9a7cc8f4 --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_findings.lua @@ -0,0 +1,88 @@ +local UniqueTable = { + -- Chests uniques + [14029] = { + -- Uzgod's Family Brooch + rewardItemId = 4834, + storageMission = Storage.Quest.U7_6.ExplorerSociety.JoiningTheExplorers, + storageMissionValue = 3, + storageQuestlineValue = 3, + }, + [14030] = { + -- Wrinkled parchment + rewardItemId = 173, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheBonelordSecret, + storageMissionValue = 31, + storageQuestlineValue = 30, + }, + [14031] = { + -- Strange powder + rewardItemId = 13974, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheOrcPowder, + storageMissionValue = 34, + storageQuestlineValue = 33, + }, + [14032] = { + -- Elven poetry book + rewardItemId = 4844, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheElvenPoetry, + storageMissionValue = 37, + storageQuestlineValue = 36, + }, + [14033] = { + -- Memory stone + rewardItemId = 4841, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheMemoryStone, + storageMissionValue = 40, + storageQuestlineValue = 39, + }, + [14034] = { + -- Spectral dress + rewardItemId = 4836, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheSpectralDress, + storageMissionValue = 49, + storageQuestlineValue = 48, + }, + [14035] = { + -- Damage logbook + rewardItemId = 21378, + storageMission = Storage.Quest.U7_6.ExplorerSociety.CalassaQuest, + storageMissionValue = 2, + storageQuestlineValue = 0, + }, + -- Others uniques + [40041] = { + -- Funeral urn + rewardItemId = 4847, + storageMission = Storage.Quest.U7_6.ExplorerSociety.TheLizardUrn, + storageMissionValue = 28, + storageQuestlineValue = 27, + }, +} + +local explorerSocietyFindings = Action() +function explorerSocietyFindings.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local uniqueItem = UniqueTable[item.uid] + if not uniqueItem then + return true + end + if player:getStorageValue(item.uid) >= 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. getItemName(uniqueItem.itemId) .. " is empty.") + return true + end + if player:getStorageValue(uniqueItem.storageMission) ~= uniqueItem.storageMissionValue then + player:addItem(uniqueItem.rewardItemId, 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(uniqueItem.rewardItemId) .. ".") + player:setStorageValue(item.uid, 1) + player:setStorageValue(uniqueItem.storageMission, uniqueItem.storageMissionValue) + if uniqueItem.storageQuestlineValue > 0 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, uniqueItem.storageQuestlineValue) + end + return true + end +end + +for index, value in pairs(UniqueTable) do + explorerSocietyFindings:uid(index) +end + +explorerSocietyFindings:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_icicle.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_icicle.lua new file mode 100644 index 000000000..7489727a3 --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_icicle.lua @@ -0,0 +1,13 @@ +local explorerSocietyIcicle = Action() +function explorerSocietyIcicle.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 4994 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery) == 6 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 6 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceDelivery, 7) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 7) + player:addItem(4837, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyIcicle:id(4872) +explorerSocietyIcicle:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_resonance.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_resonance.lua new file mode 100644 index 000000000..172c0acbf --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_resonance.lua @@ -0,0 +1,16 @@ +local explorerSocietyResonance = Action() +function explorerSocietyResonance.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.uid == 40043 then + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic) == 60 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 60 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic, 61) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 61) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + item:transform(7315) + player:say("You recorded the ice music.", TALKTYPE_MONSTER_SAY) + end + end + return true +end + +explorerSocietyResonance:id(7242) +explorerSocietyResonance:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_stone.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_stone.lua new file mode 100644 index 000000000..0852e156e --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_stone.lua @@ -0,0 +1,26 @@ +local explorerSocietyStone = Action() +function explorerSocietyStone.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.uid == 25018 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 54) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 54) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + elseif target.uid == 25019 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 1 then -- mission taken from Angus + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 55) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 55) + player:removeItem(4840, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + elseif target.uid == 25019 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 53 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 54) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 54) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + elseif target.uid == 25018 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 54 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.SpectralStone) == 2 then -- mission taken from Mortimer + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheSpectralStone, 55) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 55) + player:removeItem(4840, 1) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyStone:id(4840) +explorerSocietyStone:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/actions_tracing_paper.lua b/data-otxserver/scripts/quests/the_explorer_society/actions_tracing_paper.lua new file mode 100644 index 000000000..b366671bb --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/actions_tracing_paper.lua @@ -0,0 +1,13 @@ +local explorerSocietyPaper = Action() +function explorerSocietyPaper.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.itemid == 2199 and target.uid == 3010 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings) == 42 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) == 42 then + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheRuneWritings, 43) + player:setStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine, 43) + item:transform(4843) + toPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) + end + return true +end + +explorerSocietyPaper:id(4842) +explorerSocietyPaper:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/movements_calassa.lua b/data-otxserver/scripts/quests/the_explorer_society/movements_calassa.lua new file mode 100644 index 000000000..c589bcd47 --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/movements_calassa.lua @@ -0,0 +1,25 @@ +local calassa = MoveEvent() + +function calassa.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local headItem = player:getSlotItem(CONST_SLOT_HEAD) + if headItem and table.contains({ 5460, 11585, 13995 }, headItem.itemid) then + player:teleportTo(Position(31914, 32713, 12)) + player:getPosition():sendMagicEffect(CONST_ME_WATERSPLASH) + player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You enter the realm of Calassa.") + else + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must wear an underwater exploration helmet in order to dive.") + end + return true +end + +calassa:type("stepin") +calassa:aid(2070) +calassa:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua b/data-otxserver/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua new file mode 100644 index 000000000..5bc03c29b --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/movements_carving_teleport_liberty_bay.lua @@ -0,0 +1,36 @@ +local destination = { + [25020] = { position = Position(32320, 31137, 6) }, + [25021] = { position = Position(32359, 32807, 6) }, +} + +local carvingTeleportLibertyBay = MoveEvent() + +function carvingTeleportLibertyBay.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return + end + + local carvingTP = destination[item.uid] + if not carvingTP then + return + end + + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheIceMusic) >= 62 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 62 and player:removeItem(5021, 1) then + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(carvingTP.position) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:getPosition():sendMagicEffect(CONST_ME_POFF) + player:teleportTo(fromPosition) + end + return true +end + +carvingTeleportLibertyBay:type("stepin") + +for index, value in pairs(destination) do + carvingTeleportLibertyBay:uid(index) +end + +carvingTeleportLibertyBay:register() diff --git a/data-otxserver/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua b/data-otxserver/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua new file mode 100644 index 000000000..b91de8e9f --- /dev/null +++ b/data-otxserver/scripts/quests/the_explorer_society/movements_carvingteleport_port_hope.lua @@ -0,0 +1,36 @@ +local destination = { + [25018] = { position = Position(32498, 31622, 6) }, + [25019] = { position = Position(32665, 32735, 6) }, +} + +local carvingTeleportPortHope = MoveEvent() + +function carvingTeleportPortHope.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return + end + + local carvingTP = destination[item.uid] + if not carvingTP then + return + end + + if player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.TheAstralPortals) >= 56 and player:getStorageValue(Storage.Quest.U7_6.ExplorerSociety.QuestLine) >= 56 and player:removeItem(5021, 1) then + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(carvingTP.position) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:getPosition():sendMagicEffect(CONST_ME_POFF) + player:teleportTo(fromPosition) + end + return true +end + +carvingTeleportPortHope:type("stepin") + +for index, value in pairs(destination) do + carvingTeleportPortHope:uid(index) +end + +carvingTeleportPortHope:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/actions_lair_entrance.lua b/data-otxserver/scripts/quests/the_first_dragon/actions_lair_entrance.lua new file mode 100644 index 000000000..c26663826 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/actions_lair_entrance.lua @@ -0,0 +1,22 @@ +local lairEntrance = Action() + +function lairEntrance.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.AccessCave) <= 3 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are not worthy to enter in The First Dragon's Lair yet.") + return true + end + + if item:getPosition() == Position(33047, 32712, 3) then + player:teleportTo({ x = 31994, y = 32391, z = 9 }) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + elseif item:getPosition() == Position(31994, 32390, 9) then + player:teleportTo({ x = 33047, y = 32713, z = 3 }) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + return false +end + +lairEntrance:id(25160) +lairEntrance:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/actions_lever.lua b/data-otxserver/scripts/quests/the_first_dragon/actions_lever.lua new file mode 100644 index 000000000..ff4c20ff8 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/actions_lever.lua @@ -0,0 +1,50 @@ +local config = { + boss = { + name = "spirit of fertility", + position = Position(33625, 31021, 14), + }, + timeToFightAgain = 20 * 60 * 60, + playerPositions = { + { pos = Position(33583, 30993, 14), teleport = Position(33592, 31017, 14) }, + { pos = Position(33582, 30993, 14), teleport = Position(33574, 31017, 14) }, + { pos = Position(33584, 30993, 14), teleport = Position(33592, 31035, 14) }, + { pos = Position(33582, 30994, 14), teleport = Position(33574, 31035, 14) }, + { pos = Position(33583, 30994, 14), teleport = Position(33583, 31026, 14) }, + { pos = Position(33584, 30994, 14), teleport = Position(33574, 31017, 14) }, + { pos = Position(33582, 30995, 14), teleport = Position(33592, 31017, 14) }, + { pos = Position(33583, 30995, 14), teleport = Position(33592, 31035, 14) }, + { pos = Position(33584, 30995, 14), teleport = Position(33574, 31035, 14) }, + { pos = Position(33582, 30996, 14), teleport = Position(33583, 31026, 14) }, + { pos = Position(33583, 30996, 14), teleport = Position(33574, 31017, 14) }, + { pos = Position(33584, 30996, 14), teleport = Position(33592, 31017, 14) }, + { pos = Position(33582, 30997, 14), teleport = Position(33592, 31035, 14) }, + { pos = Position(33583, 30997, 14), teleport = Position(33574, 31035, 14) }, + { pos = Position(33584, 30997, 14), teleport = Position(33583, 31026, 14) }, + }, + specPos = { + from = Position(33566, 31006, 14), + to = Position(33626, 31032, 14), + }, + monsters = { + { name = "fallen challenger", pos = Position(33592, 31013, 14) }, + { name = "fallen challenger", pos = Position(33583, 31022, 14) }, + { name = "fallen challenger", pos = Position(33574, 31013, 14) }, + { name = "fallen challenger", pos = Position(33574, 31031, 14) }, + { name = "fallen challenger", pos = Position(33592, 31031, 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + { name = "unbeatable dragon", pos = Position(math.random(33610, 33622), math.random(31016, 31030), 14) }, + }, + exit = Position(33597, 30994, 14), + onUseExtra = function(creature) + if creature and creature:isPlayer() then + creature:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable, 0) + end + end, +} + +local leverFirstDragon = BossLever(config) +leverFirstDragon:position(Position(33583, 30992, 14)) +leverFirstDragon:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/actions_rewards.lua b/data-otxserver/scripts/quests/the_first_dragon/actions_rewards.lua new file mode 100644 index 000000000..bbef9b99c --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/actions_rewards.lua @@ -0,0 +1,81 @@ +local bpItems = { + { name = "ancient coin", count = 1 }, + { name = "draken sulphur", count = 1 }, + { name = "seacrest hair", count = 2 }, + { name = "mystical hourglass", count = 2 }, + { name = "gold token", count = 3 }, + { name = "blue gem", count = 1 }, + { name = "yellow gem", count = 1 }, + { name = "red gem", count = 1 }, + { name = "demon horn", count = 2 }, + { name = "slime heart", count = 2 }, + { name = "energy vein", count = 2 }, + { name = "petrified scream", count = 2 }, + { name = "brimstone shell", count = 2 }, + { name = "deepling warts", count = 2 }, + { name = "wyrm scale", count = 2 }, + { name = "hellspawn tail", count = 2 }, +} + +local chests = { + [14021] = { + name = "porcelain mask", + count = 1, + }, + [14022] = { + name = "backpack", + count = 1, + }, + [14023] = { + name = "colourful feathers", + count = 3, + }, +} + +local finalReward = Action() + +function finalReward.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local setting = chests[item.uid] + if not setting then + return true + end + + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.Feathers) ~= 2 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are not eligible to claim these rewards yet.") + return true + end + + if item.uid == 14021 and player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.RewardMask) < os.time() then + player:addItem(setting.name, setting.count, true) + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.RewardMask, os.time() + 60 * 60 * 24 * 5) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You found " .. setting.count .. " " .. setting.name .. ".") + elseif item.uid == 14022 and player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.RewardBackpack) < os.time() then + local bp = Game.createItem("Backpack", 1) + if bp then + for i = 1, #bpItems do + if bpItems[i].id then + bp:addItem(bpItems[i].id, bpItems[i].count) + else + bp:addItem(bpItems[i].name, bpItems[i].count) + end + end + bp:moveTo(player) + end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You found a backpack.") + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.RewardBackpack, os.time() + 60 * 60 * 24 * 365) + elseif item.uid == 14023 and player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.RewardFeather) < os.time() then + player:addItem(setting.name, setting.count, true) + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.RewardFeather, os.time() + 24 * 3600) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You found " .. setting.count .. " " .. setting.name .. ".") + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The chest is empty.") + end + + return true +end + +for uniqueRange = 14021, 14023 do + finalReward:uid(uniqueRange) +end + +finalReward:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/actions_sacrifice_items.lua b/data-otxserver/scripts/quests/the_first_dragon/actions_sacrifice_items.lua new file mode 100644 index 000000000..0a9cd03cc --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/actions_sacrifice_items.lua @@ -0,0 +1,47 @@ +local config = { + [24939] = { storage = Storage.Quest.U11_02.TheFirstDragon.Scale }, + [24940] = { storage = Storage.Quest.U11_02.TheFirstDragon.Tooth }, + [24941] = { storage = Storage.Quest.U11_02.TheFirstDragon.Horn }, + [24942] = { storage = Storage.Quest.U11_02.TheFirstDragon.Bones }, +} + +local sacrificeItems = Action() + +function sacrificeItems.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local setting = config[item.itemid] + if not setting then + return true + end + + if player:getStorageValue(setting.storage) >= 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You already sacrificed this item to pass.") + return true + end + + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.AccessCave) >= 4 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're plunging " .. item:getName() .. " into the lava. You are now worthy to enter The First Dragon's Lair. Touch the lava pool again.") + return true + end + + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.AccessCave) < 0 then + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.AccessCave, 0) + end + local targetPosition = Position(33047, 32712, 3) + if toPosition == targetPosition then + local targetId = Tile(targetPosition):getItemById(25160) + if targetId then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You're plunging " .. item:getName() .. " into the lava.") + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.AccessCave, player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.AccessCave) + 1) + player:setStorageValue(setting.storage, 1) + item:remove(1) + return true + end + end + return false +end + +for itemId, itemInfo in pairs(config) do + sacrificeItems:id(itemId) +end + +sacrificeItems:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/actions_treasure_chest.lua b/data-otxserver/scripts/quests/the_first_dragon/actions_treasure_chest.lua new file mode 100644 index 000000000..edbcba318 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/actions_treasure_chest.lua @@ -0,0 +1,125 @@ +local UniqueTable = { + [14001] = { + name = "giant shimmering pearl", + count = 1, + }, + [14002] = { + -- gold nugget, + itemId = 3040, + count = 2, + }, + [14003] = { + name = "blue crystal shard", + count = 1, + }, + [14004] = { + name = "violet crystal shard", + count = 1, + }, + [14005] = { + name = "green crystal splinter", + count = 2, + }, + [14006] = { + -- red gem + itemId = 3039, + count = 1, + }, + [14007] = { + name = "onyx chip", + count = 3, + }, + [14008] = { + name = "platinum coin", + count = 3, + }, + [14009] = { + name = "red crystal fragment", + count = 2, + }, + [14010] = { + name = "yellow gem", + count = 1, + }, + [14011] = { + name = "talon", + count = 3, + }, + [14012] = { + name = "white pearl", + count = 2, + }, + [14013] = { + name = "gold ingot", + count = 1, + }, + [14014] = { + name = "opal", + count = 3, + }, + [14015] = { + name = "small diamond", + count = 2, + }, + [14016] = { + name = "green crystal shard", + count = 1, + }, + [14017] = { + name = "black pearl", + count = 3, + }, + [14018] = { + name = "emerald bangle", + count = 1, + }, + [14019] = { + name = "green gem", + count = 1, + }, + [14020] = { + name = "giant shimmering pearl", + count = 1, + }, +} + +local treasureChest = Action() + +function treasureChest.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local setting = UniqueTable[item.uid] + if not setting then + return false + end + + local storageValue = player:getStorageValue(item.uid) + if storageValue > 0 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The " .. item:getName() .. " is empty.") + return true + end + + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.ChestCounter) >= 19 then + player:addAchievement("Treasure Hunter") + player:addItem(setting.name or setting.itemId, setting.count, true) + player:setStorageValue(item.uid, 1) + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.ChestCounter, player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.ChestCounter) + 1) + return true + end + + player:setStorageValue(item.uid, 1) + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.ChestCounter, player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.ChestCounter) + 1) + + if setting.name then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You found " .. setting.count .. " " .. setting.name .. ".") + player:addItem(setting.name, setting.count, true) + elseif setting.itemId then + player:addItem(setting.itemId, setting.count, true) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You found " .. setting.count .. " " .. getItemName(setting.itemId) .. ".") + end + return true +end + +for index, value in pairs(UniqueTable) do + treasureChest:uid(index) +end + +treasureChest:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_angry_plant.lua b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_angry_plant.lua new file mode 100644 index 000000000..98ed269bd --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_angry_plant.lua @@ -0,0 +1,10 @@ +local deathAngryPlant = CreatureEvent("AngryPlantDeath") + +function deathAngryPlant.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) + if corpse then + corpse:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 1066) + end + return true +end + +deathAngryPlant:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_dragon_essence.lua b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_dragon_essence.lua new file mode 100644 index 000000000..eb20aa066 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_dragon_essence.lua @@ -0,0 +1,16 @@ +local deathDragonEssence = CreatureEvent("DragonEssenceDeath") + +function deathDragonEssence.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) + local spectators = Game.getSpectators(Position(33617, 31023, 14), false, false, 14, 14, 14, 14) + for i = 1, #spectators do + local spec = spectators[i] + if spec:getName() == "Dragon Essence" then + spec:remove() + end + end + Game.createMonster("The First Dragon", Position(33617, 31023, 14), true, true) + creature:say("BEWARE! THE FIRST DRAGON APROACHES!", TALKTYPE_MONSTER_SAY, false, nil, Position(33617, 31023, 14)) + return true +end + +deathDragonEssence:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_fallen.lua b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_fallen.lua new file mode 100644 index 000000000..d5a0e3d08 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_fallen.lua @@ -0,0 +1,18 @@ +local function removeTp(position, itemid) + local teleport = Tile(position):getItemById(itemid) + if teleport then + teleport:remove() + end +end + +local deathFallen = CreatureEvent("FallenDeath") + +function deathFallen.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) + if corpse then + corpse:setDestination(Position(33621, 31023, 14)) + addEvent(removeTp, 30 * 1000, corpse:getPosition(), 1949) + end + return true +end + +deathFallen:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_first_dragon.lua b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_first_dragon.lua new file mode 100644 index 000000000..c347f907e --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_first_dragon.lua @@ -0,0 +1,36 @@ +local deathFirstDragon = CreatureEvent("FirstDragonDeath") + +local destinations = { + Position(33616, 31020, 13), + Position(33617, 31020, 13), + Position(33618, 31020, 13), + Position(33616, 31021, 13), + Position(33617, 31021, 13), + Position(33618, 31021, 13), + Position(33616, 31022, 13), + Position(33617, 31022, 13), + Position(33618, 31022, 13), + Position(33616, 31023, 13), + Position(33617, 31023, 13), + Position(33618, 31023, 13), + Position(33616, 31024, 13), + Position(33617, 31024, 13), + Position(33618, 31024, 13), +} + +function deathFirstDragon.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) + local spectators = Game.getSpectators(Position(33617, 31023, 14), false, false, 14, 14, 14, 14) + for i = 1, #spectators do + local spec = spectators[i] + if spec:isPlayer() then + spec:teleportTo(Position(33617, 31020, 13)) + spec:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + if spec:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.Feathers) < 1 then + spec:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.Feathers, 1) + end + end + end + return true +end + +deathFirstDragon:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_somewhat_beatable.lua b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_somewhat_beatable.lua new file mode 100644 index 000000000..13308f03d --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_death_somewhat_beatable.lua @@ -0,0 +1,24 @@ +local deathSomewhatBeatable = CreatureEvent("SomewhatBeatableDeath") + +function deathSomewhatBeatable.onDeath(creature, target) + local spectators = Game.getSpectators(Position(33617, 31023, 14), false, false, 14, 14, 14, 14) + for i = 1, #spectators do + local spec = spectators[i] + if spec:isPlayer() then + if creature:getName():lower() == "somewhat beatable" then + if spec:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable) < 5 then + spec:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable, spec:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable) + 1) + end + end + if spec:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable) == 5 then + for b = 1, 6 do + Game.createMonster("dragon essence", Position(math.random(33609, 33624), math.random(31017, 31028), 14), true, true) + end + spec:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.SomewhatBeatable, 0) + end + end + end + return true +end + +deathSomewhatBeatable:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_kill_dragon.lua b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_kill_dragon.lua new file mode 100644 index 000000000..af6bef08e --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/creaturescripts_kill_dragon.lua @@ -0,0 +1,13 @@ +local killDragon = CreatureEvent("TheFirstDragonDragonTaskDeath") + +function killDragon.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + local storage = player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.DragonCounter) + if storage >= 0 and storage < 200 then + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.DragonCounter, player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.DragonCounter) + 1) + end + end) + return true +end + +killDragon:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/movements_entrance_teleport.lua b/data-otxserver/scripts/quests/the_first_dragon/movements_entrance_teleport.lua new file mode 100644 index 000000000..8543eff38 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/movements_entrance_teleport.lua @@ -0,0 +1,97 @@ +local UniqueTable = { + -- Tazhadur entrance + [35001] = { + storage = Storage.Quest.U11_02.TheFirstDragon.DragonCounter, + value = 200, + range = 10, + newPos = { x = 32015, y = 32466, z = 8 }, + bossName = "Tazhadur", + bossPos = { x = 32018, y = 32465, z = 8 }, + }, + -- Kalyassa entrance + [35002] = { + storage = Storage.Quest.U11_02.TheFirstDragon.ChestCounter, + value = 4, + range = 10, + newPos = { x = 32078, y = 32456, z = 8 }, + bossName = "Kalyassa", + bossPos = { x = 32079, y = 32459, z = 8 }, + }, + -- Zorvorax entrance + [35003] = { + storage = Storage.Quest.U11_02.TheFirstDragon.SecretsCounter, + value = 3, + range = 10, + newPos = { x = 32008, y = 32396, z = 8 }, + bossName = "Zorvorax", + bossPos = { x = 32015, y = 32396, z = 8 }, + }, + -- Gelidrazah entrance + [35004] = { + storage = Storage.Quest.U11_02.TheFirstDragon.GelidrazahAccess, + value = 1, + range = 10, + newPos = { x = 32076, y = 32402, z = 8 }, + bossName = "Gelidrazah The Frozen", + bossPos = { x = 32078, y = 32400, z = 8 }, + }, +} + +local entranceTeleport = MoveEvent() +function entranceTeleport.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return + end + + local setting = UniqueTable[item.uid] + if not setting then + return true + end + + if roomIsOccupied(setting.bossPos, false, setting.range, setting.range) then + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("Someone is fighting against the boss! You need wait a while.", TALKTYPE_MONSTER_SAY) + return true + end + + if not player:canFightBoss(setting.bossName) then + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("You have to wait to challenge this enemy again!", TALKTYPE_MONSTER_SAY) + return true + end + + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.Questline) < 1 or player:getStorageValue(setting.storage) < setting.value then + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(fromPosition) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("You don't have permission to use this portal", TALKTYPE_MONSTER_SAY) + return true + end + + if player:getStorageValue(setting.storage) >= setting.value then + local monster = Game.createMonster(setting.bossName, setting.bossPos, true, true) + if not monster then + return true + end + + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(setting.newPos) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("You have ten minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.", TALKTYPE_MONSTER_SAY) + player:setBossCooldown(setting.bossName, os.time() + 2 * 3600) + addEvent(clearBossRoom, 60 * 30 * 1000, player.uid, setting.bossPos, false, setting.range, setting.range, fromPosition) + return true + end + return true +end + +for index, value in pairs(UniqueTable) do + entranceTeleport:uid(index) +end + +entranceTeleport:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/movements_exit_teleport.lua b/data-otxserver/scripts/quests/the_first_dragon/movements_exit_teleport.lua new file mode 100644 index 000000000..666108d36 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/movements_exit_teleport.lua @@ -0,0 +1,40 @@ +local UniqueTable = { + -- Tazhadur exit + [35005] = { + backPos = { x = 33234, y = 32278, z = 12 }, + }, + -- Kalyassa exit + [35006] = { + backPos = { x = 33162, y = 31320, z = 5 }, + }, + -- Zorvorax exit + [35007] = { + backPos = { x = 33002, y = 31595, z = 11 }, + }, + -- Gelidrazah exit + [35008] = { + backPos = { x = 32278, y = 31367, z = 4 }, + }, +} + +local exitTeleport = MoveEvent() +function exitTeleport.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local setting = UniqueTable[item.uid] + if not setting then + return true + end + player:teleportTo(setting.backPos) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true +end + +for index, value in pairs(UniqueTable) do + exitTeleport:uid(index) +end + +exitTeleport:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/movements_flower_bowl.lua b/data-otxserver/scripts/quests/the_first_dragon/movements_flower_bowl.lua new file mode 100644 index 000000000..b2e468f1f --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/movements_flower_bowl.lua @@ -0,0 +1,19 @@ +local flowerBowl = MoveEvent() + +function flowerBowl.onStepIn(creature, item, position, fromPosition) + if creature:isPlayer() then + return true + end + + if item.uid == 1066 then + if creature:getName() == "Unbeatable Dragon" then + creature:say("An allergic reaction weakens the dragon!", TALKTYPE_MONSTER_SAY) + creature:remove() + Game.createMonster("Somewhat Beatable", position, true, true) + end + end + return true +end + +flowerBowl:id(2983) +flowerBowl:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/movements_heaven_blossom.lua b/data-otxserver/scripts/quests/the_first_dragon/movements_heaven_blossom.lua new file mode 100644 index 000000000..982f66f8b --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/movements_heaven_blossom.lua @@ -0,0 +1,21 @@ +local heavenBlossom = MoveEvent() + +function heavenBlossom.onStepIn(creature, item, position, fromPosition) + if creature:isPlayer() then + return true + end + + if item.uid == 1066 then + if creature:getName() == "Spirit of Fertility" then + creature:say("An allergic reaction weakens the dragon!", TALKTYPE_MONSTER_SAY) + creature:remove() + Game.createMonster("Angry Plant", position, true, true) + item:remove() + creature:say("The fertile spirit brings a plant monster to life!", TALKTYPE_MONSTER_SAY) + end + end + return true +end + +heavenBlossom:id(3657) +heavenBlossom:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/movements_last_teleport.lua b/data-otxserver/scripts/quests/the_first_dragon/movements_last_teleport.lua new file mode 100644 index 000000000..80509399d --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/movements_last_teleport.lua @@ -0,0 +1,43 @@ +local lastTeleport = MoveEvent() + +local function isDateWithinEvent() + local currentDate = os.date("*t") + local startDate = { day = 14, month = 1 } + local endDate = { day = 12, month = 2 } + + if (currentDate.month == startDate.month and currentDate.day >= startDate.day) or (currentDate.month == endDate.month and currentDate.day <= endDate.day) or (currentDate.month > startDate.month and currentDate.month < endDate.month) then + return true + end + return false +end + +function lastTeleport.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return + end + + local destination = { x = 33585, y = 30990, z = 14 } + + if not isDateWithinEvent() then + player:teleportTo(fromPosition, true) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This teleport is only available between January 14 and February 12.") + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true + end + + if player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.FirstDragonTimer) < os.time() then + position:sendMagicEffect(CONST_ME_TELEPORT) + player:teleportTo(destination) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + else + player:teleportTo(fromPosition, true) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to wait to challenge The First Dragon again!") + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + end + + return true +end + +lastTeleport:uid(24889) +lastTeleport:register() diff --git a/data-otxserver/scripts/quests/the_first_dragon/movements_zorvorax_secrets.lua b/data-otxserver/scripts/quests/the_first_dragon/movements_zorvorax_secrets.lua new file mode 100644 index 000000000..367729674 --- /dev/null +++ b/data-otxserver/scripts/quests/the_first_dragon/movements_zorvorax_secrets.lua @@ -0,0 +1,42 @@ +local UniqueTable = { + [25002] = { + storage = Storage.Quest.U11_02.TheFirstDragon.DesertTile, + msg = "You enter the beautiful oasis. By visiting this sacred site you're infused with the power of water bringing life to the desert.", + }, + [25003] = { + storage = Storage.Quest.U11_02.TheFirstDragon.StoneSculptureTile, + msg = "You enter the circle of trees and flowers. By visiting this sacred site you're infused with the power of nature and plants.", + }, + [25004] = { + storage = Storage.Quest.U11_02.TheFirstDragon.SuntowerTile, + msg = "You entered the suntower of Ab'dendriel. By visiting this sacred site you're infused with the power of the life-giving sun.", + }, +} + +local zorvoraxSecrets = MoveEvent() + +function zorvoraxSecrets.onStepIn(creature, item, position, fromPosition) + local player = creature:getPlayer() + if not player then + return true + end + + local setting = UniqueTable[item.actionid] + if not setting then + return true + end + + if player:getStorageValue(setting.storage) < 1 then + player:setStorageValue(setting.storage, 1) + player:setStorageValue(Storage.Quest.U11_02.TheFirstDragon.SecretsCounter, player:getStorageValue(Storage.Quest.U11_02.TheFirstDragon.SecretsCounter) + 1) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, setting.msg) + return true + end + return true +end + +for index, value in pairs(UniqueTable) do + zorvoraxSecrets:aid(index) +end + +zorvoraxSecrets:register() diff --git a/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_treasure.lua b/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_treasure.lua new file mode 100644 index 000000000..4ca649849 --- /dev/null +++ b/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_treasure.lua @@ -0,0 +1,47 @@ +local items = { + { description = "a platinum coins", items = { { id = ITEM_PLATINUM_COIN, count = 5 } } }, + { + description = "some gems", + items = { + { id = 3029, count = 1 }, + { id = 3032, count = 1 }, + { id = 3030, count = 1 }, + }, + }, + { description = "a life ring", items = { { id = 3089, count = 1 } } }, + { description = "a red gem", items = { { id = 3039, count = 1 } } }, + { description = "a mana potion", items = { { id = 237, count = 10 } } }, + { description = "a health potion", items = { { id = 236, count = 8 } } }, +} + +local adventurersTreasure = Action() + +function adventurersTreasure.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter) >= 50 then + local treasure = items[math.random(#items)] + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is impossible to take along all of the treasures here. But you pick out " .. treasure.description) + for _, item in ipairs(treasure.items) do + player:addItem(item.id, item.count) + end + + player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, 0) + + local times = player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.Achievement) + if times < 0 then + times = 0 + end + times = times + 1 + player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.Achievement, times) + + if times == 10 then + player:addAchievement("Hoard of the Dragon") + end + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You try to pick a treasure, but you hear further dragons approaching. You should kill some more before picking out something.") + end + + return true +end + +adventurersTreasure:aid(50808) +adventurersTreasure:register() diff --git a/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_warrior_skeleton.lua b/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_warrior_skeleton.lua new file mode 100644 index 000000000..d4ed30749 --- /dev/null +++ b/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/actions_warrior_skeleton.lua @@ -0,0 +1,22 @@ +local adventurersWarriorSkeleton = Action() + +function adventurersWarriorSkeleton.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton) < 1 then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have discovered a deceased warrior's skeleton. It seems he tried to hunt the dragons around here - and failed.") + player:addItem(5882, 1) + + if player:getStorageValue(Storage.Quest.U9_80.AdventurersGuild.QuestLine) < 1 then + player:setStorageValue(Storage.Quest.U9_80.AdventurersGuild.QuestLine, 1) + end + + player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.WarriorSkeleton, 1) + player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, 0) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The dead explorer is empty.") + end + + return true +end + +adventurersWarriorSkeleton:aid(50806) +adventurersWarriorSkeleton:register() diff --git a/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/creaturescripts_the_great_dragon_hunt.lua b/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/creaturescripts_the_great_dragon_hunt.lua new file mode 100644 index 000000000..31d88658b --- /dev/null +++ b/data-otxserver/scripts/quests/the_great_dragon_hunt_quest/creaturescripts_the_great_dragon_hunt.lua @@ -0,0 +1,29 @@ +local areas = { + { from = Position(33061, 32646, 6), to = Position(33081, 32665, 6) }, + { from = Position(33027, 32634, 7), to = Position(33081, 32658, 7) }, + { from = Position(32983, 32616, 7), to = Position(33026, 32631, 7) }, + { from = Position(33007, 32612, 6), to = Position(33020, 32623, 6) }, + { from = Position(32987, 32621, 6), to = Position(33043, 32661, 6) }, + { from = Position(33002, 32614, 5), to = Position(33023, 32642, 5) }, + { from = Position(32993, 32632, 7), to = Position(33042, 32688, 7) }, +} + +local adventurersGuildHunt = CreatureEvent("TheGreatDragonHuntDeath") +function adventurersGuildHunt.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + local valid = false + for _, area in ipairs(areas) do + if creature:getPosition():isInRange(area.from, area.to) then + valid = true + break + end + end + if not valid then + return true + end + onDeathForParty(creature, mostDamageKiller, function(creature, player) + player:setStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter, math.max(0, player:getStorageValue(Storage.Quest.U10_80.TheGreatDragonHunt.DragonCounter)) + 1) + end) + return true +end + +adventurersGuildHunt:register() diff --git a/data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_magma_bubble_death.lua b/data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_magma_bubble_death.lua new file mode 100644 index 000000000..121b4071d --- /dev/null +++ b/data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_magma_bubble_death.lua @@ -0,0 +1,28 @@ +local magmaBubbleDeath = CreatureEvent("MagmaBubbleDeath") + +local function hasOutfit(player) + return player:hasOutfit(1569) or player:hasOutfit(1568) +end + +function magmaBubbleDeath.onDeath(creature, corpse, killer, mostDamage, unjustified, mostDamage_unjustified) + if not creature then + return + end + + local damageMap = creature:getMonster():getDamageMap() + for key, value in pairs(damageMap) do + local player = Player(key) + if player then + if not hasOutfit(player) then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Congratulations you received the Fire-Fighter Outfit.") + player:addOutfit(1569, 0) + player:addOutfit(1568, 0) + end + if player:getStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.MagmaBubbleKilled) < 1 then + player:setStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.MagmaBubbleKilled, 1) -- Access to The primal menace boss fight + end + end + end +end + +magmaBubbleDeath:register() diff --git a/data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_the_primal_menace_killed.lua b/data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_the_primal_menace_killed.lua new file mode 100644 index 000000000..3cafb041e --- /dev/null +++ b/data-otxserver/scripts/quests/the_primal_ordeal/creaturescripts_the_primal_menace_killed.lua @@ -0,0 +1,21 @@ +local thePrimalMenaceDeath = CreatureEvent("ThePrimalMenaceDeath") + +function thePrimalMenaceDeath.onDeath(creature) + local damageMap = creature:getMonster():getDamageMap() + local hazard = Hazard.getByName("hazard.gnomprona-gardens") + if not hazard then + return + end + local _, hazardPoints = hazard:getHazardPlayerAndPoints(damageMap) + onDeathForDamagingPlayers(creature, function(creature, player) + if player:getStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled) < 1 then + player:setStorageValue(Storage.Quest.U12_90.PrimalOrdeal.Bosses.ThePrimalMenaceKilled, 1) + end + + if hazard:getPlayerMaxLevel(player) == hazardPoints then + hazard:levelUp(player) + end + end) +end + +thePrimalMenaceDeath:register() diff --git a/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_climbing_vine.lua b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_climbing_vine.lua new file mode 100644 index 000000000..74a3a080a --- /dev/null +++ b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_climbing_vine.lua @@ -0,0 +1,24 @@ +local config = { + [12501] = Position(32336, 31813, 6), -- to the room + [12502] = Position(32337, 31815, 7), -- outside the room +} + +local theThievesVine = Action() + +function theThievesVine.onUse(player, item, fromPosition, target, toPosition, isHotkey) + local targetPosition = config[item.actionid] + if not targetPosition then + return true + end + if player:isPzLocked() then + player:sendTextMessage(MESSAGE_FAILURE, "You can not enter a protection zone after attacking another player.") + player:getPosition():sendMagicEffect(CONST_ME_POFF) + return true + end + player:teleportTo(targetPosition) + + return true +end + +theThievesVine:aid(12501, 12502) +theThievesVine:register() diff --git a/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_dwarf_disguise_kit.lua b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_dwarf_disguise_kit.lua new file mode 100644 index 000000000..bd574fcc0 --- /dev/null +++ b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_dwarf_disguise_kit.lua @@ -0,0 +1,13 @@ +local condition = Condition(CONDITION_OUTFIT) +condition:setTicks(5 * 60 * 1000) -- should be 5 minutes +condition:setOutfit({ lookType = 66 }) -- dwarf geomancer looktype + +local theThievesKit = Action() +function theThievesKit.onUse(player, item, fromPosition, target, toPosition, isHotkey) + player:addCondition(condition) + item:remove() + return true +end + +theThievesKit:id(7865) +theThievesKit:register() diff --git a/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_door.lua b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_door.lua new file mode 100644 index 000000000..647bf3259 --- /dev/null +++ b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_door.lua @@ -0,0 +1,11 @@ +local theThievesDoor = Action() +function theThievesDoor.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission06) == 3 then + player:say("You slip through the door", TALKTYPE_MONSTER_SAY) + player:teleportTo(Position(32359, 32786, 6)) + end + return true +end + +theThievesDoor:aid(51394) +theThievesDoor:register() diff --git a/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_key.lua b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_key.lua new file mode 100644 index 000000000..ad06adecb --- /dev/null +++ b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_fish_napping_key.lua @@ -0,0 +1,17 @@ +-- Theodore Loveless' key + +local theThievesKey = Action() +function theThievesKey.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:getStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission06) == 2 then + if target.actionid == 51394 and item.itemid == 7934 then + player:removeItem(7934, 1) + player:say("In your haste you break the key while slipping in.", TALKTYPE_MONSTER_SAY) + player:teleportTo(Position(32359, 32788, 6)) + return true + end + end + return false +end + +theThievesKey:id(7934) +theThievesKey:register() diff --git a/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_note.lua b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_note.lua new file mode 100644 index 000000000..829a9762e --- /dev/null +++ b/data-otxserver/scripts/quests/the_thieves_guild_quest/actions_note.lua @@ -0,0 +1,27 @@ +local notePos = Position(32598, 32381, 10) + +local function removeNote(position) + local noteItem = Tile(position):getItemById(7872) + if noteItem then + noteItem:remove() + end +end + +local theThievesNote = Action() + +function theThievesNote.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if target.actionid ~= 12509 then + return false + end + + if player:getStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission08) == 1 then + player:removeItem(7873, 1) + Game.createItem(7872, 1, notePos) + player:setStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission08, 2) + addEvent(removeNote, 5 * 60 * 1000, notePos) + end + return true +end + +theThievesNote:id(7873) +theThievesNote:register() diff --git a/data-otxserver/scripts/quests/thieves_guild/creaturescripts_nomad_kill.lua b/data-otxserver/scripts/quests/thieves_guild/creaturescripts_nomad_kill.lua new file mode 100644 index 000000000..656a31a60 --- /dev/null +++ b/data-otxserver/scripts/quests/thieves_guild/creaturescripts_nomad_kill.lua @@ -0,0 +1,11 @@ +local nomadKill = CreatureEvent("NomadDeath") +function nomadKill.onDeath(creature, _corpse, _lastHitKiller, mostDamageKiller) + onDeathForParty(creature, mostDamageKiller, function(creature, player) + if player:getStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission04) == 3 then + player:setStorageValue(Storage.Quest.U8_2.TheThievesGuildQuest.Mission04, 4) + end + end) + return true +end + +nomadKill:register() diff --git a/src/core.hpp b/src/core.hpp index 635211884..e3a9408c1 100644 --- a/src/core.hpp +++ b/src/core.hpp @@ -14,7 +14,7 @@ static constexpr auto AUTHENTICATOR_PERIOD = 30U; // SERVER_MAJOR_VERSION is the actual full version of the server, including minor and patch numbers. // This is intended for internal use to identify the exact state of the server (release) software. -static constexpr auto SERVER_RELEASE_VERSION = "3.1.2"; +static constexpr auto SERVER_RELEASE_VERSION = "6.2"; static constexpr auto CLIENT_VERSION = 1340; #define CLIENT_VERSION_UPPER (CLIENT_VERSION / 100)