From c6c7f9aa9ccc1b06ada127743b1518cd209289f3 Mon Sep 17 00:00:00 2001 From: ThrisStraizo <45871917+ThrisStraizo@users.noreply.github.com> Date: Wed, 4 Mar 2026 16:54:52 -0800 Subject: [PATCH] PUP AF3 Puppetmaster Blues This PR adds the quest Puppetmaster Blues and the framework for the battlefield. --- .../Talacca_Cove/puppetmaster_blues.lua | 38 ++++ scripts/globals/quests.lua | 2 +- .../ahtUrhgan/PUP_AF3_Puppetmaster_Blues.lua | 179 ++++++++++++++++++ .../zones/Mount_Zhayolm/DefaultActions.lua | 9 +- scripts/zones/Mount_Zhayolm/IDs.lua | 1 + scripts/zones/Talacca_Cove/IDs.lua | 1 + sql/mob_spawn_points.sql | 6 +- sql/npc_list.sql | 2 +- 8 files changed, 229 insertions(+), 9 deletions(-) create mode 100644 scripts/battlefields/Talacca_Cove/puppetmaster_blues.lua create mode 100644 scripts/quests/ahtUrhgan/PUP_AF3_Puppetmaster_Blues.lua diff --git a/scripts/battlefields/Talacca_Cove/puppetmaster_blues.lua b/scripts/battlefields/Talacca_Cove/puppetmaster_blues.lua new file mode 100644 index 00000000000..c590e217e12 --- /dev/null +++ b/scripts/battlefields/Talacca_Cove/puppetmaster_blues.lua @@ -0,0 +1,38 @@ +----------------------------------- +--- Area: Talacca Cove +-- Quest: Puppetmaster Blues - PUP AF3 +----------------------------------- +local talaccaCoveID = zones[xi.zone.TALACCA_COVE] +----------------------------------- + +local content = BattlefieldQuest:new({ + zoneId = xi.zone.TALACCA_COVE, + battlefieldId = xi.battlefield.id.PUPPETMASTER_BLUES, + maxPlayers = 6, + levelCap = xi.settings.main.MAX_LEVEL, + timeLimit = utils.minutes(30), + index = 2, + entryNpc = '_1l0', + exitNpcs = { '_1l1', '_1l2', '_1l3' }, + questArea = xi.questLog.AHT_URHGAN, + quest = xi.quest.id.ahtUrhgan.PUPPETMASTER_BLUES, + requiredKeyItems = { xi.ki.TOGGLE_SWITCH, xi.ki.VALKENGS_MEMORY_CHIP }, +}) + +content.groups = +{ + { + mobIds = + { + { talaccaCoveID.mob.VALKENG }, + { talaccaCoveID.mob.VALKENG + 1 }, + { talaccaCoveID.mob.VALKENG + 2 }, + }, + + allDeath = function(battlefield, mob) + battlefield:setStatus(xi.battlefield.status.WON) + end, + }, +} + +return content:register() diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index e7609d41fea..6fda1a3b901 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -650,7 +650,7 @@ xi.quest.id = AGAINST_ALL_ODDS = 26, -- + THE_WAYWARD_AUTOMATON = 27, -- + OPERATION_TEATIME = 28, -- + - PUPPETMASTER_BLUES = 29, + PUPPETMASTER_BLUES = 29, -- + Converted MOMENT_OF_TRUTH = 30, THREE_MEN_AND_A_CLOSET = 31, -- + Converted FIVE_SECONDS_OF_FAME = 32, diff --git a/scripts/quests/ahtUrhgan/PUP_AF3_Puppetmaster_Blues.lua b/scripts/quests/ahtUrhgan/PUP_AF3_Puppetmaster_Blues.lua new file mode 100644 index 00000000000..2131be3df88 --- /dev/null +++ b/scripts/quests/ahtUrhgan/PUP_AF3_Puppetmaster_Blues.lua @@ -0,0 +1,179 @@ +----------------------------------- +-- Puppetmaster Blues +----------------------------------- +-- Log ID: 6, Quest ID: 29 +----------------------------------- + +local quest = Quest:new(xi.questLog.AHT_URHGAN, xi.quest.id.ahtUrhgan.PUPPETMASTER_BLUES) + +quest.reward = +{ + item = xi.item.PUPPETRY_TAJ, + title = xi.title.PARAGON_OF_PUPPETMASTER_EXCELLENCE, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:hasCompletedQuest(xi.questLog.AHT_URHGAN, xi.quest.id.ahtUrhgan.OPERATION_TEATIME) and + player:getMainJob() == xi.job.PUP and + player:getMainLvl() >= xi.settings.main.AF3_QUEST_LEVEL + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Iruki-Waraki'] = + { + onTrigger = function(player, npc) + return quest:progressEvent(782) + end, + }, + + onEventFinish = + { + [782] = function(player, csid, option, npc) + return quest:begin(player) + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Iruki-Waraki'] = + { + onTrigger = function(player, npc) + local questProgress = quest:getVar(player, 'Prog') + + if questProgress <= 2 then + return quest:event(783) + elseif questProgress == 3 then + return quest:progressEvent(784) + elseif questProgress == 4 then + return quest:event(785) + else + return quest:progressEvent(786) + end + end, + }, + + onEventFinish = + { + [784] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 4) + end, + + [786] = function(player, csid, option, npc) + quest:complete(player) + end, + + }, + }, + + [xi.zone.BASTOK_MARKETS] = + { + ['Shamarhaan'] = + { + onTrigger = function(player, npc) + local questProgress = quest:getVar(player, 'Prog') + + if questProgress == 0 then + return quest:progressEvent(437) + elseif questProgress == 1 then + return quest:event(438) + elseif questProgress == 2 then + return quest:progressEvent(439) + else + return quest:event(440) + end + end, + }, + + onEventFinish = + { + [437] = function(player, csid, option, npc) + npcUtil.giveKeyItem(player, xi.ki.VALKENGS_MEMORY_CHIP) + quest:setVar(player, 'Prog', 1) + end, + + [439] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 3) + end, + }, + }, + + [xi.zone.MOUNT_ZHAYOLM] = + { + ['qm8'] = + { + onTrigger = function(player, npc) + if + quest:getVar(player, 'Prog') == 1 and + not player:hasKeyItem(xi.ki.TOGGLE_SWITCH) + then + npcUtil.giveKeyItem(player, xi.ki.TOGGLE_SWITCH) + return quest:noAction() + end + end, + }, + }, + + [xi.zone.NASHMAU] = + { + ['Sajhra'] = + { + onTrigger = function(player, npc) + if quest:getVar(player, 'Prog') == 4 then + return quest:progressEvent(291) + end + end, + }, + + onEventFinish = + { + [291] = function(player, csid, option, npc) + quest:setVar(player, 'Prog', 5) + end, + }, + }, + + [xi.zone.TALACCA_COVE] = + { + onEventFinish = + { + [32001] = function(player, csid, option, npc) + if player:getLocalVar('battlefieldWin') == xi.battlefield.id.PUPPETMASTER_BLUES then + player:delKeyItem(xi.ki.VALKENGS_MEMORY_CHIP) + player:delKeyItem(xi.ki.TOGGLE_SWITCH) + quest:setVar(player, 'Prog', 2) + end + end, + }, + }, + }, + + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_COMPLETED + end, + + [xi.zone.AHT_URHGAN_WHITEGATE] = + { + ['Iruki-Waraki'] = + { + onTrigger = function(player, npc) + player:startEvent(787) + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Mount_Zhayolm/DefaultActions.lua b/scripts/zones/Mount_Zhayolm/DefaultActions.lua index 98056e536c2..92491ef7eba 100644 --- a/scripts/zones/Mount_Zhayolm/DefaultActions.lua +++ b/scripts/zones/Mount_Zhayolm/DefaultActions.lua @@ -1,9 +1,10 @@ local ID = zones[xi.zone.MOUNT_ZHAYOLM] return { - ['_1p7'] = { event = 13 }, - ['Acid-eaten_Door'] = { messageSpecial = ID.text.ACID_EATEN_DOOR }, - ['blank11'] = { messageSpecial = ID.text.NOTHING_HAPPENS }, + ['_1p7' ] = { event = 13 }, + ['Acid-eaten_Door' ] = { messageSpecial = ID.text.ACID_EATEN_DOOR }, + ['blank11' ] = { messageSpecial = ID.text.NOTHING_HAPPENS }, ['Sprightly_Footsteps'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY }, - ['Warhorse_Hoofprint'] = { messageSpecial = ID.text.WARHORSE_HOOFPRINT }, + ['Warhorse_Hoofprint' ] = { messageSpecial = ID.text.WARHORSE_HOOFPRINT }, + ['qm8' ] = { messageSpecial = ID.text.DETACHED_PART }, } diff --git a/scripts/zones/Mount_Zhayolm/IDs.lua b/scripts/zones/Mount_Zhayolm/IDs.lua index 3cb903db998..65b05842ac7 100644 --- a/scripts/zones/Mount_Zhayolm/IDs.lua +++ b/scripts/zones/Mount_Zhayolm/IDs.lua @@ -32,6 +32,7 @@ zones[xi.zone.MOUNT_ZHAYOLM] = AREA_FULL = 7494, -- This area is fully occupied. You were unable to enter. MEMBER_NO_REQS = 7498, -- Not all of your party members meet the requirements for this objective. Unable to enter area. MEMBER_TOO_FAR = 7502, -- One or more party members are too far away from the entrance. Unable to enter area. + DETACHED_PART = 7557, -- There is a detached part here... SHED_LEAVES = 7572, -- The ground is strewn with shed leaves... SICKLY_SWEET = 7577, -- A sickly sweet fragrance pervades the air... ACIDIC_ODOR = 7578, -- An acidic odor pervades the air... diff --git a/scripts/zones/Talacca_Cove/IDs.lua b/scripts/zones/Talacca_Cove/IDs.lua index a7e4e210736..e59d3d5b558 100644 --- a/scripts/zones/Talacca_Cove/IDs.lua +++ b/scripts/zones/Talacca_Cove/IDs.lua @@ -39,6 +39,7 @@ zones[xi.zone.TALACCA_COVE] = { GESSHO = GetFirstID('Gessho'), QULTADA = GetFirstID('Qultada'), + VALKENG = GetFirstID('Valkeng'), }, npc = { diff --git a/sql/mob_spawn_points.sql b/sql/mob_spawn_points.sql index bf8dfa1cfc2..a0b8de6d545 100644 --- a/sql/mob_spawn_points.sql +++ b/sql/mob_spawn_points.sql @@ -13016,9 +13016,9 @@ INSERT INTO `mob_spawn_points` VALUES (17010715,0,'Angler_Orobon','Angler Orobon INSERT INTO `mob_spawn_points` VALUES (17010717,0,'Angler_Orobon','Angler Orobon',8,80,80,220,-40.5,185,65); -- Quest: Puppetmaster Blues -INSERT INTO `mob_spawn_points` VALUES (17010719,0,'Valkeng','Valkeng',16,60,60,0.000,0.000,0.000,0); -INSERT INTO `mob_spawn_points` VALUES (17010720,0,'Valkeng','Valkeng',9,60,60,0.000,0.000,0.000,0); -INSERT INTO `mob_spawn_points` VALUES (17010721,0,'Valkeng','Valkeng',9,60,60,0.000,0.000,0.000,0); +INSERT INTO `mob_spawn_points` VALUES (17010719,0,'Valkeng','Valkeng',16,66,66,-180,39.5,185,65); +INSERT INTO `mob_spawn_points` VALUES (17010720,0,'Valkeng','Valkeng',9,66,66,20,-0.5,185,65); +INSERT INTO `mob_spawn_points` VALUES (17010721,0,'Valkeng','Valkeng',9,66,66,220,-40.5,185,65); -- Quest: Breaking the Bonds of Fate INSERT INTO `mob_spawn_points` VALUES (17010722,0,'Qultada','Qultada',10,70,70,-180,39.5,185,65); diff --git a/sql/npc_list.sql b/sql/npc_list.sql index e4c4658e4cc..928f3423860 100644 --- a/sql/npc_list.sql +++ b/sql/npc_list.sql @@ -5567,7 +5567,7 @@ INSERT INTO `npc_list` VALUES (17010915,'blank','',227,14.386,-0.622,188.423,1,5 INSERT INTO `npc_list` VALUES (17010916,'blank','',20,15.101,-0.621,182.898,1,50,50,0,0,0,0,2051,0x0000340000000000000000000000000000000000,0,'TOAU',1); INSERT INTO `npc_list` VALUES (17010917,'blank','',50,7.745,-0.221,167.887,1,50,50,0,0,0,0,2051,0x0000340000000000000000000000000000000000,0,'TOAU',1); INSERT INTO `npc_list` VALUES (17010918,'qm1','???',117,-61.516,-9.905,-138.676,1,40,40,0,0,0,0,3,0x0000340000000000000000000000000000000000,0,'TOAU',0); -INSERT INTO `npc_list` VALUES (17010919,'Valkeng','Valkeng',0,0.000,0.000,0.000,0,50,50,0,0,0,2,27,0x0000E60300000000000000000000000000000000,32,NULL,1); +INSERT INTO `npc_list` VALUES (17010919,'Valkeng','Valkeng',0,0.000,0.000,0.000,0,50,50,0,0,0,2,27,0x0000E60300000000000000000000000000000000,32,'TOAU',1); INSERT INTO `npc_list` VALUES (17010920,'Ramblix','Ramblix',186,-24.552,-7.803,-269.619,0,40,40,0,0,0,6,27,0x0000550000000000000000000000000000000000,0,'TOAU',1); INSERT INTO `npc_list` VALUES (17010921,'Goblin_Footprint','Goblin Footprint',186,-24.552,-7.803,-269.619,1,40,40,0,0,0,0,3,0x0000340000000000000000000000000000000000,0,'TOAU',0); -- NC: INSERT INTO `npc_list` VALUES (17010922,'NOT_CAPTURED',' ',0,0.000,0.000,0.000,0,50,50,0,0,0,0,0,0x0000320000000000000000000000000000000000,0,NULL,0);