Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lua][Quest] Her Majestys Garden to IF #7119

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 68 additions & 0 deletions scripts/quests/sandoria/Her_Majestys_Garden.lua
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions scripts/zones/Chateau_dOraguille/DefaultActions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
35 changes: 0 additions & 35 deletions scripts/zones/Chateau_dOraguille/npcs/Chalvatot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand Down