diff --git a/scripts/globals/quests.lua b/scripts/globals/quests.lua index fd8b7822a0a..b82d40de2f3 100644 --- a/scripts/globals/quests.lua +++ b/scripts/globals/quests.lua @@ -52,13 +52,13 @@ xi.quest.id = UNDYING_FLAMES = 26, -- + A_PURCHASE_OF_ARMS = 27, -- + A_KNIGHTS_TEST = 29, -- + Converted - THE_MEDICINE_WOMAN = 30, -- + + THE_MEDICINE_WOMAN = 30, -- + Converted BLACK_TIGER_SKINS = 31, -- + Converted GROWING_FLOWERS = 58, -- ± Converted TRIAL_BY_ICE = 59, -- + THE_GENERALS_SECRET = 60, -- ± Converted THE_RUMOR = 61, -- ± Converted - HER_MAJESTYS_GARDEN = 62, -- + + HER_MAJESTYS_GARDEN = 62, -- + Converted INTRODUCTION_TO_TEAMWORK = 63, -- + Converted INTERMEDIATE_TEAMWORK = 64, -- + Converted ADVANCED_TEAMWORK = 65, -- + Converted diff --git a/scripts/quests/sandoria/Her_Majestys_Garden.lua b/scripts/quests/sandoria/Her_Majestys_Garden.lua new file mode 100644 index 00000000000..3c35f6f5c48 --- /dev/null +++ b/scripts/quests/sandoria/Her_Majestys_Garden.lua @@ -0,0 +1,68 @@ +----------------------------------- +-- Her Majestys Garden +----------------------------------- +-- Log ID: 0, Quest ID: 62 +----------------------------------- +-- Chalvatot : !pos -105 0.1 72 233 +----------------------------------- + +local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.HER_MAJESTYS_GARDEN) + +quest.reward = +{ + keyItem = xi.ki.MAP_OF_THE_NORTHLANDS_AREA, +} + +quest.sections = +{ + { + check = function(player, status, vars) + return status == xi.questStatus.QUEST_AVAILABLE and + player:getFameLevel(xi.fameArea.SANDORIA) >= 4 + end, + + [xi.zone.CHATEAU_DORAGUILLE] = + { + ['Chalvatot'] = quest:progressEvent(84), + + onEventFinish = + { + [84] = 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.CHATEAU_DORAGUILLE] = + { + ['Chalvatot'] = + { + onTrade = function(player, npc, trade) + if npcUtil.tradeHas(trade, xi.item.CHUNK_OF_DERFLAND_HUMUS) then + return quest:progressEvent(83) + end + end, + + onTrigger = quest:event(82), + }, + + onEventFinish = + { + [83] = function(player, csid, option, npc) + if quest:complete(player) then + player:confirmTrade() + end + end, + }, + }, + }, +} + +return quest diff --git a/scripts/zones/Chateau_dOraguille/DefaultActions.lua b/scripts/zones/Chateau_dOraguille/DefaultActions.lua index 06b90762d02..e32c32e6cc1 100644 --- a/scripts/zones/Chateau_dOraguille/DefaultActions.lua +++ b/scripts/zones/Chateau_dOraguille/DefaultActions.lua @@ -8,6 +8,7 @@ return { ['Arsha'] = { event = 513 }, ['Atoranne'] = { event = 519 }, ['Chaloutte'] = { event = 557 }, + ['Chalvatot'] = { event = 531 }, ['Chaphoire'] = { event = 512 }, ['Chupaile'] = { event = 514 }, ['Cotelle'] = { event = 520 }, diff --git a/scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua b/scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua index ea0d089f002..5e1e3605d5e 100644 --- a/scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua +++ b/scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua @@ -9,25 +9,11 @@ ---@type TNpcEntity local entity = {} -entity.onTrade = function(player, npc, trade) - local herMajestysGarden = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.HER_MAJESTYS_GARDEN) - - -- HER MAJESTY'S GARDEN (derfland humus) - if - herMajestysGarden == xi.questStatus.QUEST_ACCEPTED and - trade:hasItemQty(xi.item.CHUNK_OF_DERFLAND_HUMUS, 1) and - trade:getItemCount() == 1 - then - player:startEvent(83) - end -end - entity.onTrigger = function(player, npc) local circleOfTime = player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_CIRCLE_OF_TIME) local circleProgress = player:getCharVar('circleTime') local lureOfTheWildcat = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.LURE_OF_THE_WILDCAT) local wildcatSandy = player:getCharVar('WildcatSandy') - local herMajestysGarden = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.HER_MAJESTYS_GARDEN) -- CIRCLE OF TIME (Bard AF3) if circleOfTime == xi.questStatus.QUEST_ACCEPTED then @@ -47,19 +33,6 @@ entity.onTrigger = function(player, npc) not utils.mask.getBit(wildcatSandy, 19) then player:startEvent(561) - - -- HER MAJESTY'S GARDEN - elseif - herMajestysGarden == xi.questStatus.QUEST_AVAILABLE and - player:getFameLevel(xi.fameArea.SANDORIA) >= 4 - then - player:startEvent(84) - elseif herMajestysGarden == xi.questStatus.QUEST_ACCEPTED then - player:startEvent(82) - - -- DEFAULT DIALOG - else - player:startEvent(531) end end @@ -79,14 +52,6 @@ entity.onEventFinish = function(player, csid, option, npc) -- LURE OF THE WILDCAT elseif csid == 561 then player:setCharVar('WildcatSandy', utils.mask.setBit(player:getCharVar('WildcatSandy'), 19, true)) - -- HER MAJESTY'S GARDEN - elseif csid == 84 and option == 1 then - player:addQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.HER_MAJESTYS_GARDEN) - elseif csid == 83 then - player:tradeComplete() - npcUtil.giveKeyItem(player, xi.ki.MAP_OF_THE_NORTHLANDS_AREA) - player:addFame(xi.fameArea.SANDORIA, 30) - player:completeQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.HER_MAJESTYS_GARDEN) end end