-
Notifications
You must be signed in to change notification settings - Fork 890
Add Unexpected Treasure quest implementation #10071
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
Open
Lydya-nick77
wants to merge
1
commit into
LandSandBoat:base
Choose a base branch
from
Lydya-nick77:unexpected-treasure-quest
base: base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+157
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ----------------------------------- | ||
| -- ID: 57 | ||
| -- Item: Cupboard | ||
| ----------------------------------- | ||
| ---@type TItemFurniture | ||
| local itemObject = {} | ||
|
|
||
| itemObject.onFurniturePlaced = function(player) | ||
| if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.UNEXPECTED_TREASURE) == xi.questStatus.QUEST_AVAILABLE then | ||
| player:setCharVar('Quest[0][70]cupboardPlacedTime', GetSystemTime()) | ||
| player:setCharVar('Quest[0][70]mustZone', 1) | ||
| end | ||
| end | ||
|
|
||
| itemObject.onFurnitureRemoved = function(player) | ||
| player:setCharVar('Quest[0][70]cupboardPlacedTime', 0) | ||
| end | ||
|
|
||
| return itemObject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| ----------------------------------- | ||
| -- Unexpected Treasure | ||
| ----------------------------------- | ||
| -- Log ID: 0, Quest ID: 70 | ||
| ----------------------------------- | ||
| -- Morunaude : !pos -102.505 -2.261 41.439 231 | ||
| -- Calovour : !pos 131.915 0.000 129.446 231 | ||
| ----------------------------------- | ||
| local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.UNEXPECTED_TREASURE) | ||
|
|
||
| quest.reward = | ||
| { | ||
| gil = 12000, | ||
| } | ||
|
|
||
| quest.sections = {} | ||
|
|
||
| -- Section 1: Cupboard has been placed in mog house and 1 minutes have elapsed. | ||
| quest.sections[1] = | ||
| { | ||
| check = function(player, status, vars) | ||
| local cupboardPlacedTime = quest:getVar(player, 'cupboardPlacedTime') | ||
|
|
||
| return status == xi.questStatus.QUEST_AVAILABLE and | ||
| xi.moghouse.inMogHouseInHomeNation(player) and | ||
| player:getFameLevel(player:getNation()) >= 4 and | ||
| not quest:getMustZone(player) and | ||
| cupboardPlacedTime ~= 0 and | ||
| GetSystemTime() > cupboardPlacedTime + 60 | ||
| end, | ||
| } | ||
|
|
||
| -- Moogle presents the Small Teacup that was hidden in the cupboard. | ||
| local questAvailable = | ||
| { | ||
| ['Moogle'] = | ||
| { | ||
| onTrigger = function(player, npc) | ||
| return quest:progressEvent(30003, 0, 0, 15, xi.item.CUPBOARD, xi.keyItem.SMALL_TEACUP) | ||
| end, | ||
| }, | ||
|
|
||
| onEventFinish = | ||
| { | ||
| [30003] = function(player, csid, option, npc) | ||
| npcUtil.giveKeyItem(player, xi.ki.SMALL_TEACUP) | ||
| quest:begin(player) | ||
| quest:setVar(player, 'Prog', 0) | ||
| end, | ||
| }, | ||
| } | ||
|
|
||
| -- Section 2: Quest accepted - speak to Morunaude twice, then trade Mistletoe to Calovour. | ||
| quest.sections[2] = | ||
| { | ||
| check = function(player, status, vars) | ||
| return status == xi.questStatus.QUEST_ACCEPTED | ||
| end, | ||
|
|
||
| [xi.zone.NORTHERN_SAN_DORIA] = | ||
| { | ||
| ['Morunaude'] = | ||
| { | ||
| onTrigger = function(player, npc) | ||
| local prog = quest:getVar(player, 'Prog') | ||
|
|
||
| if prog == 0 then | ||
| return quest:progressEvent(635, 0, xi.ki.SMALL_TEACUP, xi.item.CUPBOARD) | ||
| else | ||
| return quest:progressEvent(636, 0, xi.ki.SMALL_TEACUP, xi.item.CUPBOARD) | ||
| end | ||
| end, | ||
| }, | ||
|
|
||
| ['Calovour'] = | ||
| { | ||
| onTrade = function(player, npc, trade) | ||
| if | ||
| quest:getVar(player, 'Prog') == 3 and | ||
| npcUtil.tradeHasExactly(trade, xi.item.SPRIG_OF_MISTLETOE) | ||
| then | ||
| return quest:progressEvent(639, 0, 0, 0, xi.item.SPRIG_OF_MISTLETOE) | ||
| end | ||
| end, | ||
|
|
||
| onTrigger = function(player, npc) | ||
| if quest:getVar(player, 'Prog') == 2 then | ||
| return quest:progressEvent(637, 0, 0, xi.item.CUPBOARD, xi.item.SPRIG_OF_MISTLETOE) | ||
| elseif quest:getVar(player, 'Prog') == 3 then | ||
| return quest:progressEvent(638, 0, 0, xi.item.CUPBOARD, xi.item.SPRIG_OF_MISTLETOE) | ||
| end | ||
| end, | ||
| }, | ||
|
|
||
| onEventFinish = | ||
| { | ||
| [635] = function(player, csid, option, npc) | ||
| quest:setVar(player, 'Prog', 1) | ||
| end, | ||
|
|
||
| [636] = function(player, csid, option, npc) | ||
| if quest:getVar(player, 'Prog') == 1 then | ||
| quest:setVar(player, 'Prog', 2) | ||
| end | ||
| end, | ||
|
|
||
| [637] = function(player, csid, option, npc) | ||
| quest:setVar(player, 'Prog', 3) | ||
| end, | ||
|
Xaver-DaRed marked this conversation as resolved.
|
||
|
|
||
| [639] = function(player, csid, option, npc) | ||
| if quest:complete(player) then | ||
| player:confirmTrade() | ||
| player:delKeyItem(xi.ki.SMALL_TEACUP) | ||
| end | ||
| end, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| -- Section 3: Quest completed - repeat dialogue for Morunaude and Calovour. | ||
| quest.sections[3] = | ||
| { | ||
| check = function(player, status, vars) | ||
| return status == xi.questStatus.QUEST_COMPLETED | ||
| end, | ||
|
|
||
| [xi.zone.NORTHERN_SAN_DORIA] = | ||
| { | ||
| ['Calovour'] = quest:event(640):replaceDefault(), | ||
| }, | ||
| } | ||
|
|
||
| for _, zoneId in ipairs(xi.moghouse.moghouseZones) do | ||
| quest.sections[1][zoneId] = questAvailable | ||
| end | ||
|
|
||
| return quest | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.