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

AMK mission 7 progress: Choco digging spots #4578

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 1 addition & 2 deletions scripts/globals/chocobo_digging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,8 @@ xi.chocoboDig.start = function(player, precheck)
roll = roll * .5
end

-- AMK07
-- AMK mission 7 (index 6)
if
xi.settings.main.ENABLE_AMK == 1 and
player:getCurrentMission(xi.mission.log_id.AMK) == xi.mission.id.amk.SHOCK_ARRANT_ABUSE_OF_AUTHORITY and
xi.amk.helpers.chocoboDig(player, zoneId, text)
then
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/helm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ xi.helm.onTrade = function(player, npc, trade, helmType, csid, func)
npcUtil.giveKeyItem(player, xi.ki.RAINBOW_BERRY)
end

-- AMK04
-- AMK mission 4 (index 3)
if xi.settings.main.ENABLE_AMK == 1 then
xi.amk.helpers.helmTrade(player, helmType, broke)
end
Expand Down
14 changes: 7 additions & 7 deletions scripts/globals/missions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,13 @@ xi.mission.id =
AN_ERRAND_THE_PROFESSORS_PRICE = 5, -- ±
SHOCK_ARRANT_ABUSE_OF_AUTHORITY = 6, -- ±
LENDER_BEWARE_READ_THE_FINE_PRINT = 7, -- ±
RESCUE_A_MOOGLES_LABOR_OF_LOVE = 8,
ROAR_A_CAT_BURGLAR_BARES_HER_FANGS = 9,
RELIEF_A_TRIUMPHANT_RETURN = 10,
JOY_SUMMONED_TO_A_FABULOUS_FETE = 11,
A_CHALLENGE_YOU_COULD_BE_A_WINNER = 12,
SMASH_A_MALEVOLENT_MENACE = 13,
A_MOOGLE_KUPO_DETAT_FIN = 14,
RESCUE_A_MOOGLES_LABOR_OF_LOVE = 8, -- ±
ROAR_A_CAT_BURGLAR_BARES_HER_FANGS = 9, -- ±
RELIEF_A_TRIUMPHANT_RETURN = 10, -- ±
JOY_SUMMONED_TO_A_FABULOUS_FETE = 11, -- ±
A_CHALLENGE_YOU_COULD_BE_A_WINNER = 12, -- ±
SMASH_A_MALEVOLENT_MENACE = 13, -- ±
A_MOOGLE_KUPO_DETAT_FIN = 14, -- ±
},

-----------------------------------
Expand Down
6 changes: 6 additions & 0 deletions scripts/missions/amk/01_A_Moogle_Kupo_dEtat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
-- A Moogle Kupo d'Etat M1
-- !addmission 10 0
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/moghouse')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.A_MOOGLE_KUPO_DETAT)

Expand All @@ -26,6 +30,8 @@ end

local moogleTriggerEvent =
{
-- TODO: Does there need to be onZoneIn here?

['Moogle'] =
{
onTrigger = function(player, npc)
Expand Down
5 changes: 5 additions & 0 deletions scripts/missions/amk/02_Drenched_It_Began_with_a_Raindrop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
-- QUADAV_BACKSCALE : !additem 2758
-- YAGUDO_CAULK : !additem 2759
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/moghouse')
require('scripts/globals/npc_util')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.DRENCHED_IT_BEGAN_WITH_A_RAINDROP)

Expand Down
3 changes: 3 additions & 0 deletions scripts/missions/amk/03_Hasten_In_a_Jam_in_Jeuno.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
-- !addmission 10 2
-- Inconspicuous Door : !pos -15 1.300 68 244
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.HASTEN_IN_A_JAM_IN_JEUNO)

Expand Down
6 changes: 6 additions & 0 deletions scripts/missions/amk/04_Welcome_To_My_Decrepit_Domicile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
-- STURDY_METAL_STRIP : !addkeyitem 1136
-- PIECE_OF_RUGGED_TREE_BARK : !addkeyitem 1137
-- SAVORY_LAMB_ROAST : !addkeyitem 1138
--
-- TODO: Refactor this to use ['Harvesting_Point'] onTrade
-- Like in: scripts\quests\adoulin\Flavors_of_Our_Lives.lua
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.WELCOME_TO_MY_DECREPIT_DOMICILE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
-- !addmission 10 4
-- Shantotto : !pos 122 -2 112 239
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.CURSES_A_HORRIFICALLY_HARROWING_HEX)

Expand Down
45 changes: 36 additions & 9 deletions scripts/missions/amk/06_An_Errand_The_Professors_Price.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
-- RIPE_STARFRUIT : !addkeyitem 1143
-- Shantotto : !pos 122 -2 112 239
-----------------------------------
require('scripts/globals/confrontation')
require('scripts/globals/missions')
require('scripts/globals/npc_util')
require('scripts/globals/interaction/mission')
-----------------------------------
local horutotoID = zones[xi.zone.OUTER_HORUTOTO_RUINS]
-----------------------------------

Expand All @@ -20,28 +25,37 @@ mission.reward =
nextMission = { xi.mission.log_id.AMK, xi.mission.id.amk.SHOCK_ARRANT_ABUSE_OF_AUTHORITY },
}

-- TODO: Test and make sure this works
local orbKeyItems =
{
xi.ki.ORB_OF_SWORDS,
xi.ki.ORB_OF_CUPS,
xi.ki.ORB_OF_BATONS,
xi.ki.ORB_OF_COINS,
-- keyItem, mod, immune value, vulnerable value
{ xi.ki.ORB_OF_SWORDS, xi.mod.SLASH_SDT, 0, 1000 },
{ xi.ki.ORB_OF_CUPS, xi.mod.BLUNT_SDT, 0, 1000 },
{ xi.ki.ORB_OF_BATONS, xi.mod.PIERCE_SDT, 0, 1000 },
{ xi.ki.ORB_OF_COINS, xi.mod.UDMGMAGIC, -10000, 0 },
}

local beginCardianFight = function(player, npc)
-- TODO: Increase default number of cardians to 20 as is required. Mob IDs missing
local numToSpawn = 15

-- TODO: Add immunities to cardians
local modsToAdd = {}

-- Remove KIs
-- Count KI's so we know how many Cardians to spawn
local removedKIs = 0
for _, keyItemId in ipairs(orbKeyItems) do
for _, entry in ipairs(orbKeyItems) do
local keyItemId = entry[1]
local immunity = entry[2]
local immuneValue = entry[3]
local vulnValue = entry[4]

if player:hasKeyItem(keyItemId) then
-- TODO: Remove damage immunity for the relevant mob. The orbKeyItems table
-- may need to be expanded to support which mob receives which reduction.
table.insert(modsToAdd, { immunity, vulnValue })

player:delKeyItem(keyItemId)
removedKIs = removedKIs + 1
else
table.insert(modsToAdd, { immunity, immuneValue })
end
end

Expand All @@ -56,10 +70,23 @@ local beginCardianFight = function(player, npc)
table.insert(cardianIds, cardianId)
end

-- Spawn mobs and start battle
xi.confrontation.start(player, npc, cardianIds, function(playerArg)
npcUtil.giveKeyItem(playerArg, xi.keyItem.RIPE_STARFRUIT)
npcUtil.giveKeyItem(playerArg, xi.keyItem.PEACH_CORAL_KEY)
end)

-- Apply mods
for _, mobId in pairs(cardianIds) do
local mob = GetMobByID(mobId)
if mob then
for _, entry in pairs(modsToAdd) do
local mod = entry[1]
local val = entry[2]
mob:setMod(mod, val)
end
end
end
end

mission.sections =
Expand Down
10 changes: 7 additions & 3 deletions scripts/missions/amk/07_Shock_Arrant_Abuse_of_Authority.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
-- Note: KI aquisition is handled in chocobo_digging.lua
-- MOLDY_WORM_EATEN_CHEST : !addkeyitem 1144
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/interaction/mission')
require('scripts/missions/amk/helpers')
-----------------------------------

Expand All @@ -30,8 +32,9 @@ mission.sections =
{
-- Reminder
onTrigger = function(player, npc)
-- Variable is stored as 1-indexed zone offset, cutscenes are 0-indexed
local diggingZone = xi.amk.helpers.getDiggingZone(player)
return mission:progressEvent(10182, diggingZone)
return mission:progressEvent(10182, diggingZone) - 1
end,
},

Expand All @@ -44,7 +47,7 @@ mission.sections =
},
},

-- Digging minigame, handled in
-- Digging minigame, handled in xi.amk.helpers and chocobo_digging.lua
{
check = function(player, currentMission, missionStatus, vars)
return currentMission == mission.missionId and missionStatus == 1 and
Expand All @@ -57,7 +60,8 @@ mission.sections =
{
-- Reminder
onTrigger = function(player, npc)
local diggingZone = xi.amk.helpers.getDiggingZone(player)
-- Variable is stored as 1-indexed zone offset, cutscenes are 0-indexed
local diggingZone = xi.amk.helpers.getDiggingZone(player) - 1
return mission:progressEvent(10189, diggingZone)
end,
},
Expand Down
3 changes: 3 additions & 0 deletions scripts/missions/amk/08_Lender_Beware_Read_the_Fine_Print.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
-- Waterfall Basin : !pos 104.888 0.477 -114.185 176
-- Inconspicuous Door : !pos -15 1.300 68 244
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.LENDER_BEWARE_READ_THE_FINE_PRINT)

Expand Down
101 changes: 101 additions & 0 deletions scripts/missions/amk/09_Rescue_A_Moogles_Labor_of_Love.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
-----------------------------------
-- Rescue! A Moogle's Labor of Love
-- A Moogle Kupo d'Etat M9
-- !addmission 10 8
-----------------------------------
require('scripts/globals/missions')
require('scripts/globals/interaction/mission')
-----------------------------------

local mission = Mission:new(xi.mission.log_id.AMK, xi.mission.id.amk.RESCUE_A_MOOGLES_LABOR_OF_LOVE)

mission.reward =
{
nextMission = { xi.mission.log_id.AMK, xi.mission.id.amk.ROAR_A_CAT_BURGLAR_BARES_HER_FANGS },
}

mission.sections =
{
-- 0: Shady Sconce
{
check = function(player, currentMission, missionStatus, vars)
return currentMission == mission.missionId and missionStatus == 0
end,

[xi.zone.SEA_SERPENT_GROTTO] =
{
['Shady_Sconce'] =
{
onTrigger = function(player, npc)
return mission:progressEvent(19, 176)
end,
},

onEventFinish =
{
[19] = function(player, csid, option, npc)
if option == 1 then
player:setMissionStatus(xi.mission.log_id.AMK, 1)
end
end,
},
},
},

-- 1: Waterfall Basin
{
check = function(player, currentMission, missionStatus, vars)
return currentMission == mission.missionId and missionStatus == 1
end,

[xi.zone.SEA_SERPENT_GROTTO] =
{
['Shady_Sconce'] =
{
onTrigger = function(player, npc)
return mission:event(22)
end,
},

['Waterfall_Basin'] =
{
onTrigger = function(player, npc)
return mission:progressEvent(20)
end,
},

onEventFinish =
{
[20] = function(player, csid, option, npc)
player:setMissionStatus(xi.mission.log_id.AMK, 2)
end,
},
},
},

-- 2: Inconspicuous Door
{
check = function(player, currentMission, missionStatus, vars)
return currentMission == mission.missionId and missionStatus == 2
end,

[xi.zone.UPPER_JEUNO] =
{
['Inconspicuous_Door'] =
{
onTrigger = function(player, npc)
return mission:progressEvent(10184)
end,
},

onEventFinish =
{
[10184] = function(player, csid, option, npc)
mission:complete(player)
end,
},
},
},
}

return mission
Loading