From c26001c9943858073f78226c86623be9fa3b7107 Mon Sep 17 00:00:00 2001 From: KnowOne Date: Mon, 24 Feb 2025 13:12:58 -0600 Subject: [PATCH] Quest Starting a Fame to IF --- scripts/globals/quests.lua | 2 +- scripts/quests/sandoria/Starting_a_Flame.lua | 73 +++++++++++++++++++ .../zones/Southern_San_dOria/npcs/Legata.lua | 44 ----------- 3 files changed, 74 insertions(+), 45 deletions(-) create mode 100644 scripts/quests/sandoria/Starting_a_Flame.lua delete mode 100644 scripts/zones/Southern_San_dOria/npcs/Legata.lua diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index e0542692e26..e93bdd153c1 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -72,7 +72,7 @@ xi.quest.id = DISTANT_LOYALTIES = 74, -- ± Converted THE_RIVALRY = 75, -- ± THE_COMPETITION = 76, -- ± - STARTING_A_FLAME = 77, -- ± + STARTING_A_FLAME = 77, -- ± Converted FEAR_OF_THE_DARK = 78, -- + Converted WARDING_VAMPIRES = 79, -- + SLEEPLESS_NIGHTS = 80, -- ± diff --git a/scripts/quests/sandoria/Starting_a_Flame.lua b/scripts/quests/sandoria/Starting_a_Flame.lua new file mode 100644 index 00000000000..da48edc1fb5 --- /dev/null +++ b/scripts/quests/sandoria/Starting_a_Flame.lua @@ -0,0 +1,73 @@ +----------------------------------- +-- Starting a Flame +----------------------------------- +-- Log ID: 0, Quest ID: 77 +----------------------------------- +-- Legata : !pos 82 0 116 230 +----------------------------------- + +local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE + end, + + [xi.zone.SOUTHERN_SAN_DORIA] = + { + ['Legata'] = quest:progressEvent(37), + + onEventFinish = + { + [37] = function(player, csid, option, npc) + if option == 1 then + quest:begin(player) + end + end, + }, + }, + }, + { + check = function(player, status, vars) + return status ~= xi.questStatus.QUEST_AVAILABLE + end, + + [xi.zone.SOUTHERN_SAN_DORIA] = + { + ['Legata'] = + { + onTrade = function(player, npc, trade) + if npcUtil.tradeHas(trade, { { xi.item.FLINT_STONE, 4 } }) then + return quest:progressEvent(36) + end + end, + + onTrigger = function(player, npc) + if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) == xi.questStatus.QUEST_ACCEPTED then + return quest:event(35) + else + return quest:event(37, { [7] = 1 }) + end + end, + }, + + onEventFinish = + { + [36] = function(player, csid, option, npc) + if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) == xi.questStatus.QUEST_ACCEPTED then + quest:complete(player) + else + player:addFame(xi.fameArea.SANDORIA, 5) + end + + npcUtil.giveCurrency(player, 'gil', 100) + player:confirmTrade() + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Southern_San_dOria/npcs/Legata.lua b/scripts/zones/Southern_San_dOria/npcs/Legata.lua deleted file mode 100644 index 4cc4ab27972..00000000000 --- a/scripts/zones/Southern_San_dOria/npcs/Legata.lua +++ /dev/null @@ -1,44 +0,0 @@ ------------------------------------ --- Area: Southern San d'Oria --- NPC: Legata --- Starts and Finishes Quest: Starting a Flame (R) --- !pos 82 0 116 230 ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrade = function(player, npc, trade) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) ~= xi.questStatus.QUEST_AVAILABLE then - if - trade:hasItemQty(xi.item.FLINT_STONE, 4) and - trade:getItemCount() == 4 - then - player:startEvent(36) - end - end -end - -entity.onTrigger = function(player, npc) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) == xi.questStatus.QUEST_AVAILABLE then - player:startEvent(37) - else - player:startEvent(35) - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 37 and option == 1 then - player:addQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) - elseif csid == 36 then - player:tradeComplete() - npcUtil.giveCurrency(player, 'gil', 100) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) == xi.questStatus.QUEST_ACCEPTED then - player:addFame(xi.fameArea.SANDORIA, 30) - player:completeQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.STARTING_A_FLAME) - else - player:addFame(xi.fameArea.SANDORIA, 5) - end - end -end - -return entity