Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quest] Promotion Sergeant Major #6867

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ xi.quest.id =
PROMOTION_LANCE_CORPORAL = 92,
PROMOTION_CORPORAL = 93,
PROMOTION_SERGEANT = 94, -- + Converted
PROMOTION_SERGEANT_MAJOR = 95,
PROMOTION_SERGEANT_MAJOR = 95, -- + Converted
PROMOTION_CHIEF_SERGEANT = 96,
PROMOTION_SECOND_LIEUTENANT = 97,
PROMOTION_FIRST_LIEUTENANT = 98,
Expand Down
193 changes: 193 additions & 0 deletions scripts/quests/ahtUrhgan/Promotion_Sergeant_Major.lua
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions scripts/zones/Aht_Urhgan_Whitegate/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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, -- <name> 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!
PROMOTION_SERGEANT = 7740, -- <player> has been promoted to Sergeant!
Expand Down
Loading