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] rewrite logic to spawn skull NMs in Eldieme Necropolis #7011

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

Grahf0085
Copy link
Contributor

@Grahf0085 Grahf0085 commented Feb 10, 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?

This PR makes the following changes when lighting the tallow candles in Eldieme Necropolis:

  • flint stones are no longer consumed when trading them tot he tallow candle
  • each candle stays lit for five minutes - in current code it was 40 seconds I think?
  • added the "nothing happened" message special when trading a flint stone to the tallow candles when trading occurs outside time frame to trade to them
  • an animation was added to the tallow candles when they are lit so they look like they're on fire when they're lit

This PR should fix the following issues that are present in the current code:

  • checking a tallow candle that was already lit would tell you to trade a flint stone to it to light it - even though it was already lit
  • trading multiple flint stones to the same candle would cause the count down to spawning the Skull NMs to progress - it should be only one trade per tallow candle. This behavior was sporadic - not sure what triggered it. I would just go to random candles and try trading multiple flint stones and sometimes that would cause this bug

I looked at this capture: https://www.youtube.com/watch?v=8bOepLkqArA

  • Here it shows the flint stone isn't consumed when traded: https://youtu.be/8bOepLkqArA?feature=shared&t=207
  • In the video the lamp it lit at 3:30 and goes out at 9:10. That means it stays lit for 5 minutes and 40 seconds. I'm wondering if my math is off or I'm missing something because 5 minutes and 40 seconds is a weird number. I coded it to stay lit for 5 minutes because that's what the ffxi encyclopedia says. Not sure how everyone feels about this.

Steps to test these changes

  1. !gotoid 17576335
  • checking NPC should tell you that you can trade a flint stone to it
  • trade a flint stone to NPC
  • flint stone should stay in inventory
  • lamp should start a fire
  • should get dialogue saying the lamp was lit and how many remain to be lit
  • checking lamp again should tell you it's lit
  1. Repeat by adding one to id until you reach 17576342
  2. All seven NMs should spawn
  3. You should not be able to light the lamps again for an hour

Copy link

✨ Thanks for the PR! ✨

This is a friendly automated reminder that the maintainers won't look at your PR until you've properly completed all of the checkboxes in the pre-filled template.

end
end

local eldiemeGlobal = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local nameOfTheTable =
{

This applies for all tables and such

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry about that

@@ -72,7 +75,7 @@ local eldiemeGlobal =
-- gates are grouped in groups of five. even numbered groups share one animation, while odd numbered groups share the other.

local animEven = (npc:getAnimation() == xi.anim.OPEN_DOOR) and xi.anim.CLOSE_DOOR or xi.anim.OPEN_DOOR
local animOdd = (npc:getAnimation() == xi.anim.OPEN_DOOR) and xi.anim.OPEN_DOOR or xi.anim.CLOSE_DOOR
local animOdd = (npc:getAnimation() == xi.anim.OPEN_DOOR) and xi.anim.OPEN_DOOR or xi.anim.CLOSE_DOOR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was properly aligned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's my auto formatter
/cry

@zach2good zach2good merged commit afd7680 into LandSandBoat:base Feb 13, 2025
13 checks passed
Comment on lines +42 to +47
npc:setAnimation(xi.anim.OPEN_DOOR)

--unlight brazier after five minutes
npc:timer(300000, function()
npc:setAnimation(xi.anim.CLOSE_DOOR)
end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so you are aware in the future, there is literally a function specifically to open a door, wait a specified number of seconds, and then close the same door, performing all 3 of these functions with one invocation without any seconds to milliseconds conversion or potential snags you can hit by invoking timer() directly. There is also a matching function to do a the reverse (closing a default open door, and then reopening it after a timeout).

npc:openDoor(300) would have done exactly what you did here in a single line.

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.

5 participants