diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 805760c149a..eaf92e3a28b 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -685,7 +685,7 @@ xi.quest.id = PROMOTION_LANCE_CORPORAL = 92, PROMOTION_CORPORAL = 93, PROMOTION_SERGEANT = 94, - PROMOTION_SERGEANT_MAJOR = 95, + PROMOTION_SERGEANT_MAJOR = 95, -- + Converted PROMOTION_CHIEF_SERGEANT = 96, PROMOTION_SECOND_LIEUTENANT = 97, PROMOTION_FIRST_LIEUTENANT = 98, diff --git a/scripts/quests/ahtUrhgan/Promotion_Sergeant_Major.lua b/scripts/quests/ahtUrhgan/Promotion_Sergeant_Major.lua new file mode 100644 index 00000000000..36ae76e30e0 --- /dev/null +++ b/scripts/quests/ahtUrhgan/Promotion_Sergeant_Major.lua @@ -0,0 +1,193 @@ +----------------------------------- +-- Promotion: Promotion Sergeant Major +-- Naja Salaheem !pos 26 -8 -45.5 50 +----------------------------------- +local whitegateID = zones[xi.zone.AHT_URHGAN_WHITEGATE] +----------------------------------- + +local quest = Quest:new(xi.questLog.AHT_URHGAN, xi.quest.id.ahtUrhgan.PROMOTION_SERGEANT_MAJOR) + +quest.reward = +{ + keyItem = xi.ki.SM_WILDCAT_BADGE, + title = xi.title.SERGEANT_MAJOR, +} + +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_SERGEANT) == xi.questStatus.QUEST_COMPLETED + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5048), + + onEventFinish = + { + [5048] = function(player, csid, option, npc) + quest:begin(player) + quest:setVar(player, 'Prog', VanadielUniqueDay()) + if option == 2 then + quest:setVar(player, 'Stage', 1) + end + end, + }, + }, + }, + { + -- Didnt pass 1st game and has to redo + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and + vars.Stage == 0 and + vars.Prog < VanadielUniqueDay() + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5049), + + onEventFinish = + { + [5049] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', VanadielUniqueDay()) + if option == 2 then + -- passed 1st mini game, onto 2nd + quest:setVar(player, 'Stage', 1) + end + end, + }, + }, + }, + { + -- Passed 1st mini game, start 2nd + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and + vars.Stage == 1 and + vars.Prog < VanadielUniqueDay() + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5050), + + onEventFinish = + { + [5050] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', VanadielUniqueDay()) + if option == 2 then + -- passed mini game, onto 3rd game + quest:setVar(player, 'Stage', 3) + else + -- failed and has to do again + quest:setVar(player, 'Stage', 2) + end + end, + }, + }, + }, + { + -- Didnt pass 2nd game, redo + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and + vars.Stage == 2 and + vars.Prog < VanadielUniqueDay() + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5051), + + onEventFinish = + { + [5051] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', VanadielUniqueDay()) + if option == 2 then + -- passed mini game, onto 3rd game + quest:setVar(player, 'Stage', 3) + end + end, + }, + }, + }, + { + -- Passed 2nd mini game, start 3rd + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and + vars.Stage == 3 and + vars.Prog < VanadielUniqueDay() + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5052), + + onEventFinish = + { + [5052] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', VanadielUniqueDay()) + if option == 2 then + -- passed mini game, You did it! + quest:setVar(player, 'Stage', 5) + else + -- failed and has to do again + quest:setVar(player, 'Stage', 4) + end + end, + }, + }, + }, + { + -- Didnt pass 3rd game, Redo + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and + vars.Stage == 4 and + vars.Prog < VanadielUniqueDay() + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5053), + + onEventFinish = + { + [5053] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', VanadielUniqueDay()) + if option == 2 then + -- passed mini game, complete + quest:setVar(player, 'Stage', 5) + end + end, + }, + }, + }, + { + -- Passed all games and 1 game day wait + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED and + vars.Stage == 5 and + vars.Prog < VanadielUniqueDay() + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Naja_Salaheem'] = quest:progressEvent(5054), + + onEventFinish = + { + [5054] = function(player, csid, option, npc) + if quest:complete(player) then + player:setCharVar('AssaultPromotion', 0) + player:delKeyItem(xi.ki.S_WILDCAT_BADGE) + player:messageSpecial(whitegateID.text.PROMOTION_SERGEANT_MAJOR) + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua index 7ceb7e4bafa..fd896f697be 100644 --- a/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua +++ b/scripts/zones/Aht_Urhgan_Whitegate/IDs.lua @@ -45,6 +45,7 @@ zones[xi.zone.AHT_URHGAN_WHITEGATE] = ASSAULT_FAILED = 5670, -- Your mission was not successful; however, the Empire recognizes your contribution and has awarded you Assault Points. AUTOMATON_RENAME = 5847, -- Your automaton has a new name. YOU_CAN_BECOME_PUP = 5850, -- You can now become a puppetmaster! + PROMOTION_SERGEANT_MAJOR = 6174, -- has been promoted to Sergeant Major! 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! PAY_DIVINATION = 8784, -- ou pay 1000 gil for the divination.