-
Notifications
You must be signed in to change notification settings - Fork 636
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] Convert 'Community Service' quest to interaction framework #6796
base: base
Are you sure you want to change the base?
Conversation
3f32ff4
to
cab7b7b
Compare
I know Lua Diagnostics is mad at me about the return but the quest wont work without the return :( |
|
||
if hasCompletedQuest and option == 1 then | ||
-- Lua Diagnostics complains about this return but key item wont be given without a return | ||
return npcUtil.giveKeyItem(player, xi.ki.LAMP_LIGHTERS_MEMBERSHIP_CARD) -- only get this key item for repeating the quest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an invalid return. onEventFinish does not process any return at all. Just use npcUtil.giveKeyItem directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need to exit the function, just use return with no args.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent like an hour trying to get this keyItem. I tried npcUtil.giveKeyItem in other places and it worked without the return. I tried player:addKeyItem here and it didn't work. I can remove the return but just for the record getting the keyitem isn't working for me without the return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an invalid return. onEventFinish does not process any return at all. Just use npcUtil.giveKeyItem directly.
And what's even weirder is that I would try getting different key items at this onEventFinish without the return and it worked fine. Call me crazy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I affirm:
What does this pull request do?
Converts the quest "Community Service" to the new framework and fixes some bugs like those listed here: AirSkyBoat#2697
I referenced this capture by Siknawz to code the quest: https://www.youtube.com/watch?v=dMCHSUnPDlg
The quest was coded so that even though you could accept the quest at 6pm you couldn't start until a few hours later. From my research I found that this was how the quest was in retail until mid 2005. Since then it was changed so that you could start the quest as soon as you accepted it. So CS 115 - to remind players to start later on after they accepted the quest - was removed
Cut scene 113 was added. The NPC uses it after you light the lamps until the next morning when the lamps are unlit.
Some code related to the quest remains in Zone.lua:
The quest will only offer you he key item as a reward if you do not already have it. I believe it would be repeatedly offered the way it was coded.
You can now turn in the quest anytime - something the internet seems to agree with. Before you had to turn it in by 1am. You just have to light the lamps by 1am. Talking to the NPC to complete the quest can be done anytime.
Finally in most quests what changes the behavior of NPCs is whether the quest is available, accepted, or completed. That was not the case for this quest due to it being repeatable, only available during certain hours, and only one person on server can do it per night. I try to name variables and conditions appropriately for each check function.
Steps to test these changes
Complete the quest "Community Service" in Lower Jeuno.