diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 96378ce47ae..a5ae670f6b4 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -733,7 +733,7 @@ xi.quest.id = BOY_AND_THE_BEAST = 24, -- + Converted WRATH_OF_THE_GRIFFON = 25, -- + Converted THE_LOST_BOOK = 26, -- + Converted - KNOT_QUITE_THERE = 27, + KNOT_QUITE_THERE = 27, -- + Converted A_MANIFEST_PROBLEM = 28, BEANS_AHOY = 29, -- + BEAST_FROM_THE_EAST = 30, diff --git a/scripts/quests/crystalWar/Knot_Quite_There.lua b/scripts/quests/crystalWar/Knot_Quite_There.lua new file mode 100644 index 00000000000..79341d14a1e --- /dev/null +++ b/scripts/quests/crystalWar/Knot_Quite_There.lua @@ -0,0 +1,125 @@ +----------------------------------- +-- Knot Quite There +----------------------------------- +-- !addquest 7 27 +-- Door Acolyte Hostel : !pos 124.000 -3.000 222.215 94 +-- Bulwark Gate : !pos -445 0 342 98 +-- Door:House : !pos 148 0 27 80 +----------------------------------- + +local quest = Quest:new(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) + +quest.reward = +{ + item = xi.item.PLATINUM_BEASTCOIN, +} + +quest.sections = +{ + -- Talk to the Door Acolyte Hostel in Windurst Waters [S]. + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:hasCompletedMission(xi.mission.log_id.WOTG, xi.mission.id.wotg.BACK_TO_THE_BEGINNING) and + player:hasCompletedQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) + end, + + [xi.zone.WINDURST_WATERS_S] = + { + ['Door_Acolyte_Hostel_down'] = + { + onTrigger = function(player, npc) + return quest:progressEvent(151) + end, + }, + + onEventFinish = + { + [151] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + end + end, + }, + }, + }, + + -- Speak with the Bulwark Gate, trade a One Hundred Eight Knot Quipu, + -- enter Southern San d'Oria [S] from East Ronfaure [S], then check the door. + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.SAUROMUGUE_CHAMPAIGN_S] = + { + ['Bulwark_Gate'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 0 then + return quest:progressEvent(105) + elseif quest:getVar(player, 'Prog') == 1 then + return quest:event(107) + elseif quest:getVar(player, 'Prog') == 2 then + return quest:event(108) + end + end, + + onTrade = function(player, npc, trade) + if + quest:getVar(player, 'Prog') == 1 and + npcUtil.tradeHasExactly(trade, { xi.item.ONE_HUNDRED_EIGHT_KNOT_QUIPU }) + then + return quest:progressEvent(106) + end + end, + }, + + onEventFinish = + { + [105] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 1) + end, + + [106] = function(player, csid, option, npc) + player:confirmTrade() + quest:setVar(player, 'Prog', 2) + end, + }, + }, + + [xi.zone.SOUTHERN_SAN_DORIA_S] = + { + onZoneIn = function(player, prevZone) + if + prevZone == xi.zone.EAST_RONFAURE_S and + quest:getVar(player, 'Prog') == 2 + then + return 62 + end + end, + + ['_6eo'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 3 then + return quest:progressEvent(63) + end + end, + }, + + onEventFinish = + { + [62] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 3) + end, + + [63] = function(player, csid, option, npc) + quest:complete(player) + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Sauromugue_Champaign_[S]/npcs/Bulwark_Gate.lua b/scripts/zones/Sauromugue_Champaign_[S]/npcs/Bulwark_Gate.lua index c1a23b29ae5..eae5d9a7a3e 100644 --- a/scripts/zones/Sauromugue_Champaign_[S]/npcs/Bulwark_Gate.lua +++ b/scripts/zones/Sauromugue_Champaign_[S]/npcs/Bulwark_Gate.lua @@ -7,35 +7,12 @@ local entity = {} entity.onTrade = function(player, npc, trade) - if - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and - player:getCharVar('KnotQuiteThere') == 1 - then - if - trade:hasItemQty(xi.item.ONE_HUNDRED_EIGHT_KNOT_QUIPU, 1) and - trade:getGil() == 0 and - trade:getItemCount() == 1 - then - player:startEvent(106) - end - end end entity.onTrigger = function(player, npc) - if player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED then - if player:getCharVar('KnotQuiteThere') == 0 then - player:startEvent(105) - end - end end entity.onEventFinish = function(player, csid, option, npc) - if csid == 105 then - player:setCharVar('KnotQuiteThere', 1) - elseif csid == 106 then - player:tradeComplete() - player:setCharVar('KnotQuiteThere', 2) - end end return entity diff --git a/scripts/zones/Southern_San_dOria_[S]/Zone.lua b/scripts/zones/Southern_San_dOria_[S]/Zone.lua index 33b7dde7a0e..e8a1bb001e0 100644 --- a/scripts/zones/Southern_San_dOria_[S]/Zone.lua +++ b/scripts/zones/Southern_San_dOria_[S]/Zone.lua @@ -12,15 +12,6 @@ zoneObject.onInitialize = function(zone) end zoneObject.onZoneIn = function(player, prevZone) - if prevZone == xi.zone.EAST_RONFAURE_S then - if - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and - player:getCharVar('KnotQuiteThere') == 2 - then - return 62 - end - end - return xi.moghouse.onMoghouseZoneEvent(player, prevZone) end @@ -31,9 +22,6 @@ zoneObject.onEventUpdate = function(player, csid, option, npc) end zoneObject.onEventFinish = function(player, csid, option, npc) - if csid == 62 then - player:setCharVar('KnotQuiteThere', 3) - end end return zoneObject diff --git a/scripts/zones/Southern_San_dOria_[S]/npcs/_6eo.lua b/scripts/zones/Southern_San_dOria_[S]/npcs/_6eo.lua index fdcb4ca4a2f..828e6a4f83b 100644 --- a/scripts/zones/Southern_San_dOria_[S]/npcs/_6eo.lua +++ b/scripts/zones/Southern_San_dOria_[S]/npcs/_6eo.lua @@ -4,31 +4,13 @@ -- !pos 148 0 27 80 -- Involved in Knot Quite There ----------------------------------- -local ID = zones[xi.zone.SOUTHERN_SAN_DORIA_S] ------------------------------------ ---@type TNpcEntity local entity = {} entity.onTrigger = function(player, npc) - if - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and - player:getCharVar('KnotQuiteThere') == 3 - then - player:startEvent(63) - end end entity.onEventFinish = function(player, csid, option, npc) - if csid == 63 then - if player:getFreeSlotsCount() == 0 then - player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.PLATINUM_BEASTCOIN) - else - player:completeQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) - player:addItem(xi.item.PLATINUM_BEASTCOIN) - player:messageSpecial(ID.text.ITEM_OBTAINED, xi.item.PLATINUM_BEASTCOIN) - player:setCharVar('KnotQuiteThere', 0) - end - end end return entity diff --git a/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua b/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua index a84c2cc1a5d..2b0ecae5b47 100644 --- a/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua +++ b/scripts/zones/Windurst_Waters_[S]/DefaultActions.lua @@ -11,6 +11,7 @@ return { ['Churacoco'] = { event = 434 }, ['Corbrere'] = { event = 414 }, ['Dallus-Mallus'] = { event = 323 }, + ['Door_Acolyte_Hostel_down'] = { text = ID.text.DOOR_ACOLYTE_HOSTEL_LOCKED }, ['Eih_Lhogotan'] = { event = 407 }, ['Ekki-Mokki'] = { event = 409 }, ['Emhi_Tchaoryo'] = { event = 307 }, diff --git a/scripts/zones/Windurst_Waters_[S]/IDs.lua b/scripts/zones/Windurst_Waters_[S]/IDs.lua index d3c1bfc6492..129d718db27 100644 --- a/scripts/zones/Windurst_Waters_[S]/IDs.lua +++ b/scripts/zones/Windurst_Waters_[S]/IDs.lua @@ -32,7 +32,7 @@ zones[xi.zone.WINDURST_WATERS_S] = HOMEPOINT_SET = 10886, -- Home point set! YASSI_POSSI_DIALOG = 10906, -- Swifty-wifty and safey-wafey parcel delivery! Is there something you need to send? EZURAROMAZURA_SHOP_DIALOG = 10907, -- A potent spelly-well or two can be the key to survival in this time of war. But can you mastaru my magic, or will it master you? - DOOR_ACOLYTE_HOSTEL_LOCKED = 11349, -- The door appears to be locked... + DOOR_ACOLYTE_HOSTEL_LOCKED = 11350, -- The door appears to be locked... MIKHE_ARYOHCHA_DIALOG = 12486, -- Do you like the headpiece? I made it from my firrrst victim. I wear it to let everrryone know what happens when they cross Mikhe Aryohcha! LUTETE_DIALOG = 12488, -- ... Mastering these Near Eastern magics can be quite taxing. If I had a choice, I'd rather be back in bed, relaxing... CAMPAIGN_RESULTS_TALLIED = 12574, -- Campaign results tallied. diff --git a/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua b/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua index 914a46c8fe5..a6a5357a6b8 100644 --- a/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua +++ b/scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua @@ -14,16 +14,6 @@ entity.onTrigger = function(player, npc) player:hasKeyItem(xi.ki.SMALL_STARFRUIT) then player:startEvent(129) - elseif - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_COMPLETED and - player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_AVAILABLE and - player:hasCompletedMission(xi.mission.log_id.WOTG, xi.mission.id.wotg.BACK_TO_THE_BEGINNING) - then - player:startEvent(151) - elseif player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED then - player:startEvent(152) - else - player:messageSpecial(ID.text.DOOR_ACOLYTE_HOSTEL_LOCKED) end end @@ -33,8 +23,6 @@ entity.onEventFinish = function(player, csid, option, npc) player:messageSpecial(ID.text.ITEM_OBTAINED, 4144) player:delKeyItem(xi.ki.SMALL_STARFRUIT) player:completeQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS) - elseif csid == 151 then - player:addQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) end end