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] Convert 'Community Service' quest to interaction framework #6796

Open
wants to merge 1 commit into
base: base
Choose a base branch
from

Conversation

Grahf0085
Copy link
Contributor

@Grahf0085 Grahf0085 commented Jan 22, 2025

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

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:

  1. All streetlamps are turned off at 7am
  2. Everyone with a membership card is notified that Zauko is recruiting at 6pm
  3. If no playable characters is doing the quest by 1am then a NPC named Vhana Ehgaklywha walks around the lights

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.

@Grahf0085
Copy link
Contributor Author

I know Lua Diagnostics is mad at me about the return but the quest wont work without the return :(

@Grahf0085 Grahf0085 changed the title convert Community Service quest to interactive framework {Quest]convert Community Service quest to interactive framework Jan 23, 2025
@Grahf0085 Grahf0085 changed the title {Quest]convert Community Service quest to interactive framework [Quest]convert Community Service quest to interactive framework Jan 23, 2025
@Grahf0085 Grahf0085 changed the title [Quest]convert Community Service quest to interactive framework [lua, quest]convert Community Service quest to interactive framework Jan 23, 2025

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
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

This is what I got in game when I returned with no args.
image
image

It says I got the key item but I didn't.

@zach2good zach2good changed the title [lua, quest]convert Community Service quest to interactive framework [lua, quest] Convert 'Community Service' quest to interaction framework Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants