From 5596e5dc5ed46ec966de6be5421481fdf345a0f1 Mon Sep 17 00:00:00 2001 From: KnowOne Date: Mon, 17 Feb 2025 19:23:53 -0600 Subject: [PATCH] Quest Fear of the Dark to IF --- scripts/globals/quests.lua | 2 +- scripts/quests/sandoria/Fear_of_the_Dark.lua | 70 +++++++++++++++++++ .../Northern_San_dOria/DefaultActions.lua | 1 + .../Northern_San_dOria/npcs/Secodiand.lua | 43 ------------ 4 files changed, 72 insertions(+), 44 deletions(-) create mode 100644 scripts/quests/sandoria/Fear_of_the_Dark.lua delete mode 100644 scripts/zones/Northern_San_dOria/npcs/Secodiand.lua diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index 8954cb833c6..ed9e4d3aca1 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -73,7 +73,7 @@ xi.quest.id = THE_RIVALRY = 75, -- ± THE_COMPETITION = 76, -- ± STARTING_A_FLAME = 77, -- ± - FEAR_OF_THE_DARK = 78, -- + + FEAR_OF_THE_DARK = 78, -- + Converted WARDING_VAMPIRES = 79, -- + SLEEPLESS_NIGHTS = 80, -- ± LUFETS_LAKE_SALT = 81, -- ± diff --git a/scripts/quests/sandoria/Fear_of_the_Dark.lua b/scripts/quests/sandoria/Fear_of_the_Dark.lua new file mode 100644 index 00000000000..4eba66d57a3 --- /dev/null +++ b/scripts/quests/sandoria/Fear_of_the_Dark.lua @@ -0,0 +1,70 @@ +----------------------------------- +-- Fear of the Dark +----------------------------------- +-- Log ID: 0, Quest ID: 78 +----------------------------------- +-- Secodiand : !pos -160 -0 137 231 +----------------------------------- + +local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) + +quest.reward = +{ + gil = 200, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE + end, + + [xi.zone.NORTHERN_SAN_DORIA] = + { + ['Secodiand'] = quest:progressEvent(19), + + onEventFinish = + { + [19] = 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.NORTHERN_SAN_DORIA] = + { + ['Secodiand'] = + { + onTrade = function(player, npc, trade) + if npcUtil.tradeHas(trade, { { xi.item.BAT_WING, 2 } }) then + return quest:progressEvent(18) + end + end, + }, + + onEventFinish = + { + [18] = function(player, csid, option, npc) + if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) == xi.questStatus.QUEST_ACCEPTED then + quest:complete(player) + else + npcUtil.giveCurrency(player, 'gil', 200) + player:addFame(xi.fameArea.SANDORIA, 5) + end + + player:confirmTrade() + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Northern_San_dOria/DefaultActions.lua b/scripts/zones/Northern_San_dOria/DefaultActions.lua index de23812236f..329e15fc6bf 100644 --- a/scripts/zones/Northern_San_dOria/DefaultActions.lua +++ b/scripts/zones/Northern_San_dOria/DefaultActions.lua @@ -56,6 +56,7 @@ return { ['Rodaillece'] = { text = ID.text.RODAILLECE_DIALOG }, ['Rondipur'] = { event = 721 }, ['Ronpaurege'] = { event = 669 }, + ['Secodiand'] = { event = 17 }, ['Shakir'] = { event = 538 }, ['Sochiene'] = { text = ID.text.SOCHIENE_DIALOG }, ['Suspicious_Elvaan'] = { event = 881 }, diff --git a/scripts/zones/Northern_San_dOria/npcs/Secodiand.lua b/scripts/zones/Northern_San_dOria/npcs/Secodiand.lua deleted file mode 100644 index 5ef175de8e8..00000000000 --- a/scripts/zones/Northern_San_dOria/npcs/Secodiand.lua +++ /dev/null @@ -1,43 +0,0 @@ ------------------------------------ --- Area: Northern San d'Oria --- NPC: Secodiand --- Starts and Finishes Quest: Fear of the dark --- !pos -160 -0 137 231 ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrade = function(player, npc, trade) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) ~= xi.questStatus.QUEST_AVAILABLE then - if trade:hasItemQty(xi.item.BAT_WING, 2) and trade:getItemCount() == 2 then - player:startEvent(18) - end - end -end - -entity.onTrigger = function(player, npc) - local fearOfTheDark = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) - - if fearOfTheDark == xi.questStatus.QUEST_AVAILABLE then - player:startEvent(19) - else - player:startEvent(17) - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 19 and option == 1 then - player:addQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) - elseif csid == 18 then - player:tradeComplete() - npcUtil.giveCurrency(player, 'gil', 200) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) == xi.questStatus.QUEST_ACCEPTED then - player:addFame(xi.fameArea.SANDORIA, 30) - player:completeQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.FEAR_OF_THE_DARK) - else - player:addFame(xi.fameArea.SANDORIA, 5) - end - end -end - -return entity