Skip to content

Commit

Permalink
Added comment describing table in mission 9
Browse files Browse the repository at this point in the history
Changed loop from range to enums
  • Loading branch information
Flibe-XI committed May 10, 2024
1 parent bf4d2fe commit 4b083dc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 28 deletions.
4 changes: 2 additions & 2 deletions scripts/missions/amk/06_An_Errand_The_Professors_Price.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
missionStatus == 0 and
not player:hasKeyItem(xi.ki.RIPE_STARFRUIT)
missionStatus == 0 and
not player:hasKeyItem(xi.ki.RIPE_STARFRUIT)
end,

[xi.zone.WINDURST_WALLS] =
Expand Down
19 changes: 11 additions & 8 deletions scripts/missions/amk/09_Rescue_A_Moogles_Labor_of_Love.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ mission.reward =
nextMission = { xi.mission.log_id.AMK, xi.mission.id.amk.ROAR_A_CAT_BURGLAR_BARES_HER_FANGS },
}

-- There are ten possible sets of QM locations that could be assigned to the player
-- that give the stone KIs. The table below holds the 10 sets that can be
-- randomly assigned, which stores the indices of the QM ids from a table
-- that is pulled from the database
local markerSets =
{
{ 1, 2, 5, 7, 8, 11, 14, 19, 20 },
Expand All @@ -51,8 +55,8 @@ local getMarkerSet = function(player)
end

local hasAllStones = function(player)
for offset = 0, 8 do
if not player:hasKeyItem(xi.ki.STONE_OF_SURYA + offset) then
for keyItemId = xi.ki.STONE_OF_SURYA, xi.ki.STONE_OF_KETU do
if not player:hasKeyItem(keyItemId) then
return false
end
end
Expand All @@ -66,7 +70,7 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission == mission.missionId and
player:getCharVar('Mission[10][8]progress') == 0
player:getCharVar('Mission[10][8]progress') == 0
end,

[xi.zone.QUICKSAND_CAVES] =
Expand Down Expand Up @@ -118,10 +122,9 @@ mission.sections =

-- Determine if QM triggered is in markerset
local keyItem = 0
for setIndex = 1, 9 do
local markerIdIndex = markerSets[amkMarkerSet][setIndex]
for idx, markerIdIndex in ipairs(markerSets[amkMarkerSet]) do
if npc:getID() == ID.npc.QM_AMK[markerIdIndex] then
keyItem = xi.ki.STONE_OF_SURYA + setIndex - 1
keyItem = xi.ki.STONE_OF_SURYA + idx - 1
end
end

Expand Down Expand Up @@ -156,8 +159,8 @@ mission.sections =
onEventFinish =
{
[100] = function(player, csid, option, npc)
for i = 0, 8 do
player:delKeyItem(xi.ki.STONE_OF_SURYA + i)
for keyItemId = xi.ki.STONE_OF_SURYA, xi.ki.STONE_OF_KETU do
player:delKeyItem(keyItemId)
end

player:setCharVar('Mission[10][8]markerSet', 0)
Expand Down
36 changes: 18 additions & 18 deletions scripts/missions/amk/13_A_Challenge_You_Could_Be_a_Winner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
not player:hasKeyItem(xi.ki.GAUNTLET_CHALLENGE_KUPON)
not player:hasKeyItem(xi.ki.GAUNTLET_CHALLENGE_KUPON)
end,

[xi.zone.CASTLE_ZVAHL_BAILEYS] =
Expand All @@ -65,11 +65,11 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
(mission:getVar(player, 'progress') == 1 or
currentMission > mission.missionId) and
not player:hasKeyItem(xi.ki.POCKET_MOGBOMB) and
not player:hasKeyItem(xi.ki.TRIVIA_CHALLENGE_KUPON) and
player:needToZone() == false
(mission:getVar(player, 'progress') == 1 or
currentMission > mission.missionId) and
not player:hasKeyItem(xi.ki.POCKET_MOGBOMB) and
not player:hasKeyItem(xi.ki.TRIVIA_CHALLENGE_KUPON) and
player:needToZone() == false
end,

[xi.zone.BEAUCEDINE_GLACIER] =
Expand Down Expand Up @@ -100,10 +100,10 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
mission:getVar(player, 'progress') == 1 and
not player:hasKeyItem(xi.ki.POCKET_MOGBOMB) and
not player:hasKeyItem(xi.ki.TRIVIA_CHALLENGE_KUPON) and
player:needToZone() == true
mission:getVar(player, 'progress') == 1 and
not player:hasKeyItem(xi.ki.POCKET_MOGBOMB) and
not player:hasKeyItem(xi.ki.TRIVIA_CHALLENGE_KUPON) and
player:needToZone() == true
end,

[xi.zone.BEAUCEDINE_GLACIER] =
Expand Down Expand Up @@ -248,8 +248,8 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
mission:getVar(player, 'progress') == 1 and
player:hasKeyItem(xi.ki.POCKET_MOGBOMB)
mission:getVar(player, 'progress') == 1 and
player:hasKeyItem(xi.ki.POCKET_MOGBOMB)
end,

[xi.zone.BEAUCEDINE_GLACIER] =
Expand Down Expand Up @@ -284,8 +284,8 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
mission:getVar(player, 'progress') == 2 and
player:hasKeyItem(xi.ki.TRIVIA_CHALLENGE_KUPON)
mission:getVar(player, 'progress') == 2 and
player:hasKeyItem(xi.ki.TRIVIA_CHALLENGE_KUPON)
end,

[xi.zone.BEAUCEDINE_GLACIER] =
Expand Down Expand Up @@ -342,8 +342,8 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
mission:getVar(player, 'progress') == 3 and
player:hasKeyItem(xi.ki.GAUNTLET_CHALLENGE_KUPON)
mission:getVar(player, 'progress') == 3 and
player:hasKeyItem(xi.ki.GAUNTLET_CHALLENGE_KUPON)
end,

[xi.zone.XARCABARD] =
Expand Down Expand Up @@ -445,8 +445,8 @@ mission.sections =
{
check = function(player, currentMission, missionStatus, vars)
return currentMission >= mission.missionId and
mission:getVar(player, 'progress') == 4 and
player:hasKeyItem(xi.ki.FESTIVAL_SOUVENIR_KUPON)
mission:getVar(player, 'progress') == 4 and
player:hasKeyItem(xi.ki.FESTIVAL_SOUVENIR_KUPON)
end,

[xi.zone.CASTLE_ZVAHL_BAILEYS] =
Expand Down

0 comments on commit 4b083dc

Please sign in to comment.