diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index fd8b7822a0a..fedb9e30774 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -76,7 +76,7 @@ xi.quest.id = FEAR_OF_THE_DARK = 78, -- + Converted WARDING_VAMPIRES = 79, -- + SLEEPLESS_NIGHTS = 80, -- ± - LUFETS_LAKE_SALT = 81, -- ± + LUFETS_LAKE_SALT = 81, -- ± Converted HEALING_THE_LAND = 82, -- ± SORCERY_OF_THE_NORTH = 83, -- ± THE_CRIMSON_TRIAL = 84, -- ± Converted diff --git a/scripts/quests/sandoria/Lufets_Lake_Salt.lua b/scripts/quests/sandoria/Lufets_Lake_Salt.lua new file mode 100644 index 00000000000..c1865b843c1 --- /dev/null +++ b/scripts/quests/sandoria/Lufets_Lake_Salt.lua @@ -0,0 +1,78 @@ +----------------------------------- +-- Lufets Lake Salt +----------------------------------- +-- Log ID: 0, Quest ID: 81 +----------------------------------- +-- Nogelle : !pos -70 -5.5 -33 232 +----------------------------------- + +local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.LUFETS_LAKE_SALT) + +quest.reward = +{ + gil = 600, + title = xi.title.BEAN_CUISINE_SALTER, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE + end, + + [xi.zone.PORT_SAN_DORIA] = + { + ['Nogelle'] = quest:progressEvent(12), + + onEventFinish = + { + [12] = 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.PORT_SAN_DORIA] = + { + ['Nogelle'] = + { + onTrade = function(player, npc, trade) + if npcUtil.tradeHas(trade, { { xi.item.CHUNK_OF_LUFET_SALT, 3 } }) then + return quest:progressEvent(11) + end + end, + + onTrigger = quest:event(10), + }, + + onEventFinish = + { + [11] = 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.PORT_SAN_DORIA] = + { + ['Nogelle'] = quest:event(522):replaceDefault(), + }, + }, +} + +return quest diff --git a/scripts/zones/Port_San_dOria/npcs/Nogelle.lua b/scripts/zones/Port_San_dOria/npcs/Nogelle.lua deleted file mode 100644 index 23849b4ad10..00000000000 --- a/scripts/zones/Port_San_dOria/npcs/Nogelle.lua +++ /dev/null @@ -1,44 +0,0 @@ ------------------------------------ --- Area: Port San d'Oria --- NPC: Nogelle --- Starts Lufet's Lake Salt ------------------------------------ ----@type TNpcEntity -local entity = {} - -entity.onTrade = function(player, npc, trade) - if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.LUFETS_LAKE_SALT) == xi.questStatus.QUEST_ACCEPTED then - if - trade:hasItemQty(xi.item.CHUNK_OF_LUFET_SALT, 3) and - trade:getItemCount() == 3 - then - player:startEvent(11) - end - end -end - -entity.onTrigger = function(player, npc) - local lufetsLakeSalt = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.LUFETS_LAKE_SALT) - - if lufetsLakeSalt == 0 then - player:startEvent(12) - elseif lufetsLakeSalt == 1 then - player:startEvent(10) - elseif lufetsLakeSalt == 2 then - player:startEvent(522) - end -end - -entity.onEventFinish = function(player, csid, option, npc) - if csid == 12 and option == 1 then - player:addQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.LUFETS_LAKE_SALT) - elseif csid == 11 then - player:tradeComplete() - player:addFame(xi.fameArea.SANDORIA, 30) - player:addTitle(xi.title.BEAN_CUISINE_SALTER) - npcUtil.giveCurrency(player, 'gil', 600) - player:completeQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.LUFETS_LAKE_SALT) - end -end - -return entity