From 3fd22d2ce39a58d98198982006183694d68a3b55 Mon Sep 17 00:00:00 2001 From: Aeshur Date: Tue, 21 Apr 2026 13:29:56 -0400 Subject: [PATCH] [lua] Fire in the Hole quest --- scripts/enum/item.lua | 1 + .../crystalWar/Better_Part_of_Valor.lua | 2 + .../quests/crystalWar/Fire_in_the_Hole.lua | 171 ++++++++++++++++++ .../North_Gustaberg_[S]/npcs/Solitary_Ant.lua | 17 -- 4 files changed, 174 insertions(+), 17 deletions(-) create mode 100644 scripts/quests/crystalWar/Fire_in_the_Hole.lua delete mode 100644 scripts/zones/North_Gustaberg_[S]/npcs/Solitary_Ant.lua diff --git a/scripts/enum/item.lua b/scripts/enum/item.lua index 959adc64e62..65a5d438ad7 100644 --- a/scripts/enum/item.lua +++ b/scripts/enum/item.lua @@ -7239,6 +7239,7 @@ xi.item = CHANOIXS_GORGET = 16270, LIEUTENANTS_GORGET = 16271, CHOCOBO_PULLUS_TORQUE = 16273, + REPUBLICAN_SILVER_MEDAL = 16276, PILE_CHAIN = 16279, HARALDRS_MUFFLER = 16280, CARACT_CHOKER = 16284, diff --git a/scripts/quests/crystalWar/Better_Part_of_Valor.lua b/scripts/quests/crystalWar/Better_Part_of_Valor.lua index bdee46ec3e9..a1cb26e9324 100644 --- a/scripts/quests/crystalWar/Better_Part_of_Valor.lua +++ b/scripts/quests/crystalWar/Better_Part_of_Valor.lua @@ -99,6 +99,8 @@ quest.sections = quest:setVar(player, 'Prog', 2) end, }, + + ['Solitary_Ant'] = quest:event(2):replaceDefault(), }, [xi.zone.VUNKERL_INLET_S] = diff --git a/scripts/quests/crystalWar/Fire_in_the_Hole.lua b/scripts/quests/crystalWar/Fire_in_the_Hole.lua new file mode 100644 index 00000000000..257c466dc94 --- /dev/null +++ b/scripts/quests/crystalWar/Fire_in_the_Hole.lua @@ -0,0 +1,171 @@ +----------------------------------- +-- Fire in the Hole +----------------------------------- +-- !addquest 7 36 +-- Stonehoused Adit : !pos -434.655 36.708 279.983 88 +-- Gentle Tiger : !pos -203.932 -9.998 2.237 87 +----------------------------------- + +local quest = Quest:new(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.FIRE_IN_THE_HOLE) + +quest.reward = +{ + item = xi.item.REPUBLICAN_SILVER_MEDAL, + title = xi.title.MYTHRIL_MUSKETEER_NO_6, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:hasCompletedQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.STORM_ON_THE_HORIZON) and + player:getCurrentMission(xi.mission.log_id.WOTG) >= xi.mission.id.wotg.IN_THE_NAME_OF_THE_FATHER + end, + + [xi.zone.BASTOK_MARKETS_S] = + { + onZoneIn = function(player, prevZone) + if prevZone == xi.zone.NORTH_GUSTABERG_S then + return 60 + end + end, + + onEventFinish = + { + [60] = function(player, csid, option, npc) + player:startEvent(77) + end, + + [77] = function(player, csid, option, npc) + quest:begin(player) + npcUtil.giveKeyItem(player, xi.ki.SILVERMINE_KEY) + quest:setVar(player, 'Prog', 1) + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.NORTH_GUSTABERG_S] = + { + ['Stonehoused_Adit'] = + { + onTrigger = function(player, npc) + if + quest:getVar(player, 'Prog') == 1 and + player:hasKeyItem(xi.ki.SILVERMINE_KEY) + then + return quest:progressEvent(5) + end + end, + }, + + ['Solitary_Ant'] = + { + onTrigger = function(player, npc) + local questProgress = quest:getVar(player, 'Prog') + + if + questProgress >= 1 and + questProgress <= 2 and + player:hasKeyItem(xi.ki.SILVERMINE_KEY) + then + return quest:progressEvent(7) + elseif + questProgress >= 3 and + not player:hasKeyItem(xi.ki.SILVERMINE_KEY) + then + return quest:progressEvent(8) + end + end, + }, + + onZoneIn = function(player, prevZone) + if + quest:getVar(player, 'Prog') == 4 and + prevZone == xi.zone.RUHOTZ_SILVERMINES + then + return 6 + end + end, + + onEventFinish = + { + [5] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 2) + end, + + [6] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 5) + end, + + [8] = function(player, csid, option, npc) + if npc and npc:getName() == 'Solitary_Ant' then + npcUtil.giveKeyItem(player, xi.ki.SILVERMINE_KEY) + quest:setVar(player, 'Prog', 2) + end + end, + }, + }, + + [xi.zone.RUHOTZ_SILVERMINES] = + { + -- Fire in the Hole instance is not implemented currently + onEventFinish = + { + [10000] = function(player, csid, option, npc) + if quest:getVar(player, 'Prog') == 3 then + quest:setVar(player, 'Prog', 4) + end + end, + }, + }, + + [xi.zone.BASTOK_MARKETS_S] = + { + onZoneIn = function(player, prevZone) + if + quest:getVar(player, 'Prog') == 5 and + prevZone == xi.zone.NORTH_GUSTABERG_S + then + return 62 + end + end, + + ['Gentle_Tiger'] = + { + onTrigger = function(player, npc) + local questProgress = quest:getVar(player, 'Prog') + + if questProgress == 6 then + return quest:progressEvent(63) + elseif questProgress == 7 then + return quest:progressEvent(65) + end + end, + }, + + onEventFinish = + { + [62] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 6) + end, + + [63] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 7) + end, + + [65] = function(player, csid, option, npc) + quest:complete(player) + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/North_Gustaberg_[S]/npcs/Solitary_Ant.lua b/scripts/zones/North_Gustaberg_[S]/npcs/Solitary_Ant.lua deleted file mode 100644 index c83017b1743..00000000000 --- a/scripts/zones/North_Gustaberg_[S]/npcs/Solitary_Ant.lua +++ /dev/null @@ -1,17 +0,0 @@ ------------------------------------ --- Area: North Gustaberg (S) (J-9) --- NPC: Solitary Ant --- Involved in Quests: Fire in the Hole ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrigger = function(player, npc) - if player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.BETTER_PART_OF_VALOR) == xi.questStatus.QUEST_ACCEPTED then - player:startEvent(2) - else - player:startEvent(112) - end -end - -return entity