[Module] Quest "Chocobo's Wounds" - Era-Wait-Time#9771
Conversation
CriticalXI
left a comment
There was a problem hiding this comment.
An overall adjustment we should make too is that we should adjust this file to be a general quest adjustments file rather than being specifically for the Chocobo Wounds quest. Let's rename the file to "quest_adjustments.lua"
| -- onEventFinish handlers confirmTrade() and set Timer. | ||
| -- Event 73 is "too soon" response, confirms trade and gives item back without setting a new timer or progress. | ||
| -- Other events where the Chocobo is not ready confirm the trade, give the item back, and set a new timer and progress. | ||
| quest.sections[2][xi.zone.UPPER_JEUNO].onEventFinish[73] = function(player, csid, option, npc) |
There was a problem hiding this comment.
Small nit but we should order these onEventFinish in numerical order.
There was a problem hiding this comment.
I will re-order this event to the bottom. Thank You.
| -- TODO: needs capture for retail event data to determine how the trades are completed. | ||
| -- Retail doesn't print the gausebit grass obtained by player after each "too soon" trade. | ||
| -- Suggests the event may be giving the item back or zoning player. |
There was a problem hiding this comment.
I think trying to module this quest is surfacing an issue we have with the tradeComplete. Looks like it currently doesn't take the item but it locks it in a weird state like we were talking about on Discord. This might require another PR to fix the trade binding so this npcUtil.giveItem isn't needed.
There was a problem hiding this comment.
If one isnt completing/terminating a trade, One isnt supposed to use the tradeHasExactly() util.
And example of a trade that doesnt consume items but performs an action would be the beastcoin doors at Sea Serpent Grotto.
entity.onTrade = function(player, npc, trade)
-- The coin isn't consumed, so we only need to know if one was in the trade window
if trade:getItemQty(xi.item.GOLD_BEASTCOIN) > 0 then
if player:getCharVar('SSG_GoldDoor') == 7 then
npc:openDoor(5) -- Open the door if a gold beastcoin has been traded after checking the door the required number of times
end
end
endThis logic doesn't consude the item, nor changes it's state to reserved
trade:getItemQty(ITEM_ID) Should be used for those.
There was a problem hiding this comment.
I'll work changing the non-consuming events to use this function.
| local timer = tonumber(quest:getVar(player, 'Timer')) or 0 | ||
| -- Allow one attempt on first day (timer defaults 0) and once per new Vanadiel day | ||
| if timer < VanadielUniqueDay() then | ||
| local prog = tonumber(quest:getVar(player, 'Prog')) or 1 |
There was a problem hiding this comment.
getVar always returns an int type.
| if npcUtil.tradeHasExactly(trade, xi.item.BUNCH_OF_GYSAHL_GREENS) then | ||
| return quest:progressEvent(76) | ||
| elseif npcUtil.tradeHasExactly(trade, xi.item.CLUMP_OF_GAUSEBIT_WILDGRASS) then | ||
| local timer = tonumber(quest:getVar(player, 'Timer')) or 0 |
There was a problem hiding this comment.
Int type by default, no need to cast
| -- Allow one attempt on first day (timer defaults 0) and once per new Vanadiel day | ||
| if timer < VanadielUniqueDay() then | ||
| local prog = tonumber(quest:getVar(player, 'Prog')) or 1 | ||
| local chocoboFeedTrades = { 57, 58, 59, 60, 63, 64 } |
There was a problem hiding this comment.
Its a module, but magic numbers are never appreciated for future maintainers
534dc23 to
911f1e2
Compare
911f1e2 to
4bac3d1
Compare
[Module] Quest "Chocobo's Wounds" - Era Wait-Time
I affirm:
What does this pull request do?
from 1 minute to wait for a new unique Vanadiel day.
Proposal Co-Authored-By: Xaver-DaRed
Steps to test these changes
!setplayerlevel 20
!zone Upper Jeuno
!gotoname Brutus
!additem CLUMP_OF_GAUSEBIT_WILDGRASS x4