From 44f177d1c483139d802cd05b15300bbcefe48ea3 Mon Sep 17 00:00:00 2001 From: KnowOne Date: Sun, 26 Jan 2025 19:52:15 -0600 Subject: [PATCH] Quest Promotion Sergeant --- scripts/globals/quests.lua | 2 +- .../quests/ahtUrhgan/Promotion_Sergeant.lua | 181 ++++++++++++++++++ scripts/zones/Aht_Urhgan_Whitegate/IDs.lua | 1 + scripts/zones/Aht_Urhgan_Whitegate/Zone.lua | 1 + scripts/zones/Nashmau/Zone.lua | 1 + 5 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 scripts/quests/ahtUrhgan/Promotion_Sergeant.lua diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 805760c149a..467a08d5a2f 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -684,7 +684,7 @@ xi.quest.id = PROMOTION_SUPERIOR_PRIVATE = 91, -- + Converted PROMOTION_LANCE_CORPORAL = 92, PROMOTION_CORPORAL = 93, - PROMOTION_SERGEANT = 94, + PROMOTION_SERGEANT = 94, -- + Converted PROMOTION_SERGEANT_MAJOR = 95, PROMOTION_CHIEF_SERGEANT = 96, PROMOTION_SECOND_LIEUTENANT = 97, diff --git a/scripts/quests/ahtUrhgan/Promotion_Sergeant.lua b/scripts/quests/ahtUrhgan/Promotion_Sergeant.lua new file mode 100644 index 00000000000..3efff51370d --- /dev/null +++ b/scripts/quests/ahtUrhgan/Promotion_Sergeant.lua @@ -0,0 +1,181 @@ +----------------------------------- +-- Promotion: Sergeant +-- Log ID: 6, Quest ID: 94 +-- Naja Salaheem : !pos 26 -8 -45.5 50 +-- Region 10 Whitegate: !pos -80 0 0 50 +-- Region 1 Nashmau : !pos 0 0 -40 53 +-- Totoroon : !pos -13 0 -24 53 +-- qm11 : !pos 195 2 -616 79 +----------------------------------- +local whitegateID = zones[xi.zone.AHT_URHGAN_WHITEGATE] +----------------------------------- + +local quest = Quest:new(xi.questLog.AHT_URHGAN, xi.quest.id.ahtUrhgan.PROMOTION_SERGEANT) + +quest.reward = +{ + keyItem = xi.ki.S_WILDCAT_BADGE, + title = xi.title.SERGEANT, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and player:getCharVar('AssaultPromotion') >= 25 and + player:getQuestStatus(xi.questLog.AHT_URHGAN, xi.quest.id.ahtUrhgan.PROMOTION_CORPORAL) == xi.questStatus.QUEST_COMPLETED + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5055), + + onEventFinish = + { + [5055] = function(player, csid, option, npc) + if option == 0 then + quest:begin(player) + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and vars.Prog == 0 + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5058):oncePerZone(), + + onTriggerAreaEnter = + { + [10] = function(player, triggerArea) + return quest:progressEvent(5056) + end, + }, + + onEventFinish = + { + [5056] = function(player, csid, option, npc) + if option == 0 then + quest:setVar(player, 'Prog', 1) + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and vars.Prog == 1 + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5058):oncePerZone(), + }, + + [xi.zone.NASHMAU] = + { + onTriggerAreaEnter = + { + [1] = function(player, triggerArea) + if VanadielUniqueDay() > quest:getVar(player, 'Stage') then + return quest:progressEvent(303) + end + end, + }, + + onEventFinish = + { + [303] = function(player, csid, option, npc) + if option == 2 then + quest:setVar(player, 'Prog', 2) + else + quest:setVar(player, 'Stage', VanadielUniqueDay() + 1) + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and vars.Prog == 2 + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5058):oncePerZone(), + }, + + [xi.zone.NASHMAU] = + { + ['Totoroon'] = + { + onTrade = function(player, npc, trade) + if npcUtil.tradeHasExactly(trade, xi.item.BOWL_OF_SUTLAC) then + return quest:progressEvent(304) + end + end, + + onTrigger = function(player, npc) + return quest:event(252) + end, + }, + + onEventFinish = + { + [304] = function(player, csid, option, npc) + player:confirmTrade() + quest:setVar(player, 'Prog', 3) + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and vars.Prog == 3 + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5058):oncePerZone(), + }, + + [xi.zone.CAEDARVA_MIRE] = + { + ['qm11'] = quest:progressEvent(20), + + onEventFinish = + { + [20] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 4) + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and vars.Prog == 4 + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5057), + + onEventFinish = + { + [5057] = function(player, csid, option, npc) + if quest:complete(player) then + player:setCharVar('AssaultPromotion', 0) + player:messageSpecial(whitegateID.text.PROMOTION_SERGEANT) + player:delKeyItem(xi.ki.C_WILDCAT_BADGE) + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua index 7ceb7e4bafa..2cb82d620ae 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua @@ -47,6 +47,7 @@ zones[xi.zone.AHT_URHGAN_WHITEGATE] = YOU_CAN_BECOME_PUP = 5850, -- You can now become a puppetmaster! NYZUL_FAIL = 6191, -- Your mission was not successful. I regret to inform you that the Imperial Army does not officially recognize your efforts within this Assault area. BESIEGED_OFFSET = 6832, -- Your Imperial Standing has increased! + PROMOTION_SERGEANT = 7740, -- has been promoted to Sergeant! PAY_DIVINATION = 8784, -- ou pay 1000 gil for the divination. MEMBER_OF_SALAHEEMS_SENTINELS = 9262, -- You are now a member of Salaheem's Sentinels. ACCESS_TO_A_MOG_LOCKER = 9263, -- ou now have access to a Mog Locker. diff --git a/scripts/zones/Aht_Urhgan_Whitegate/Zone.lua b/scripts/zones/Aht_Urhgan_Whitegate/Zone.lua index 3806217b179..e7c5623d36b 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/Zone.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/Zone.lua @@ -16,6 +16,7 @@ zoneObject.onInitialize = function(zone) zone:registerTriggerArea(7, 69, 0.0, 7, 73, 0.0, 11) -- Sets Mark for 'Led Astry' Quest cutscene. zone:registerTriggerArea(8, 10, 2.0, -96, 14, 2.0, -92) -- Sets Mark for 'Led Astry' Quest cutscene. zone:registerTriggerArea(9, -103, 0.0, -16, -100, 0.0, -12) -- Sets Mark for 'Striking a Balance' Quest cutscene. + zone:registerTriggerArea(10, -89, 0.0, -8, -71, 0.0, 8) -- Balrahn Way end zoneObject.onZoneIn = function(player, prevZone) diff --git a/scripts/zones/Nashmau/Zone.lua b/scripts/zones/Nashmau/Zone.lua index 8500fc7c9f5..7d26e5bab12 100644 --- a/scripts/zones/Nashmau/Zone.lua +++ b/scripts/zones/Nashmau/Zone.lua @@ -5,6 +5,7 @@ local zoneObject = {} zoneObject.onInitialize = function(zone) + zone:registerTriggerArea(1, 0, 0.0, -50, 20, 0.0, -35) -- In front of boat customs end zoneObject.onZoneIn = function(player, prevZone)