From 6108d51b3c7130209710d699bbf7697ea4d0a76a Mon Sep 17 00:00:00 2001 From: KnowOne Date: Mon, 24 Feb 2025 20:06:22 -0600 Subject: [PATCH] Quest Sleepless Night to IF --- scripts/globals/quests.lua | 2 +- scripts/quests/sandoria/Sleepless_Nights.lua | 79 +++++++++++++++++++ .../Southern_San_dOria/DefaultActions.lua | 3 +- .../zones/Southern_San_dOria/npcs/Paouala.lua | 50 ------------ 4 files changed, 82 insertions(+), 52 deletions(-) create mode 100644 scripts/quests/sandoria/Sleepless_Nights.lua delete mode 100644 scripts/zones/Southern_San_dOria/npcs/Paouala.lua diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index fd8b7822a0a..e09be1b0795 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -75,7 +75,7 @@ xi.quest.id = STARTING_A_FLAME = 77, -- ± FEAR_OF_THE_DARK = 78, -- + Converted WARDING_VAMPIRES = 79, -- + - SLEEPLESS_NIGHTS = 80, -- ± + SLEEPLESS_NIGHTS = 80, -- ± Converted LUFETS_LAKE_SALT = 81, -- ± HEALING_THE_LAND = 82, -- ± SORCERY_OF_THE_NORTH = 83, -- ± diff --git a/scripts/quests/sandoria/Sleepless_Nights.lua b/scripts/quests/sandoria/Sleepless_Nights.lua new file mode 100644 index 00000000000..0df9930d911 --- /dev/null +++ b/scripts/quests/sandoria/Sleepless_Nights.lua @@ -0,0 +1,79 @@ +----------------------------------- +-- Sleepless Nights +----------------------------------- +-- Log ID: 0, Quest ID: 80 +----------------------------------- +-- Paouala : !pos 158 -6 17 230 +----------------------------------- + +local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.SLEEPLESS_NIGHTS) + +quest.reward = +{ + gil = 5000, + title = xi.title.SHEEPS_MILK_DELIVERER, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:getFameLevel(xi.fameArea.SANDORIA) >= 2 + end, + + [xi.zone.SOUTHERN_SAN_DORIA] = + { + ['Paouala'] = quest:progressEvent(85), + + onEventFinish = + { + [85] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_ACCEPTED + end, + + [xi.zone.SOUTHERN_SAN_DORIA] = + { + ['Paouala'] = + { + onTrade = function(player, npc, trade) + if npcUtil.tradeHas(trade, xi.item.JUG_OF_MARYS_MILK) then + return quest:progressEvent(84) + end + end, + + onTrigger = quest:event(83), + }, + + onEventFinish = + { + [84] = function(player, csid, option, npc) + if quest:complete(player) then + player:confirmTrade() + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_COMPLETED + end, + + [xi.zone.SOUTHERN_SAN_DORIA] = + { + ['Paouala'] = quest:event(81):replaceDefault(), + }, + }, +} + +return quest diff --git a/scripts/zones/Southern_San_dOria/DefaultActions.lua b/scripts/zones/Southern_San_dOria/DefaultActions.lua index 76e98cdd991..b7539dd4328 100644 --- a/scripts/zones/Southern_San_dOria/DefaultActions.lua +++ b/scripts/zones/Southern_San_dOria/DefaultActions.lua @@ -34,7 +34,8 @@ return { ['Maugie'] = { event = 46 }, ['Melledanne'] = { event = 943 }, ['Ophelia'] = { event = 751 }, - ['Phillone'] = { event = 29 }, + ['Paouala'] = { event = 82 }, + ['Phillone'] = { event = 29 }, ['Poudoruchant'] = { event = 779 }, ['qm2'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY }, ['qm4'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY }, diff --git a/scripts/zones/Southern_San_dOria/npcs/Paouala.lua b/scripts/zones/Southern_San_dOria/npcs/Paouala.lua deleted file mode 100644 index 07558c6bc1d..00000000000 --- a/scripts/zones/Southern_San_dOria/npcs/Paouala.lua +++ /dev/null @@ -1,50 +0,0 @@ ------------------------------------ --- Area: Southern San d'Oria --- NPC: Paouala --- Starts and Finishes Quest: Sleepless Nights --- !pos 158 -6 17 230 ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrade = function(player, npc, trade) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.SLEEPLESS_NIGHTS) == xi.questStatus.QUEST_ACCEPTED then - if - trade:hasItemQty(xi.item.JUG_OF_MARYS_MILK, 1) and - trade:getItemCount() == 1 - then - player:startEvent(84) - end - end -end - -entity.onTrigger = function(player, npc) - local sleeplessNights = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.SLEEPLESS_NIGHTS) - - if - player:getFameLevel(xi.fameArea.SANDORIA) >= 2 and - sleeplessNights == xi.questStatus.QUEST_AVAILABLE - then - player:startEvent(85) - elseif sleeplessNights == xi.questStatus.QUEST_ACCEPTED then - player:startEvent(83) - elseif sleeplessNights == xi.questStatus.QUEST_COMPLETED then - player:startEvent(81) - else - player:startEvent(82) - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 85 and option == 1 then - player:addQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.SLEEPLESS_NIGHTS) - elseif csid == 84 then - player:tradeComplete() - player:addTitle(xi.title.SHEEPS_MILK_DELIVERER) - npcUtil.giveCurrency(player, 'gil', 5000) - player:addFame(xi.fameArea.SANDORIA, 30) - player:completeQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.SLEEPLESS_NIGHTS) - end -end - -return entity