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

DRG AF Quest: "Knight Stalker" NM Spawn Fix #4523

Closed

Conversation

UmeboshiXI
Copy link
Contributor

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?

Allows the 2 shadow NMs to spawn when:

  • Player is DRG.
  • Player has pet wyvern out and alive.

Previously the NMs would not spawn as intended, stopping quest progression.

Steps to test these changes

  • `!changejob drg 75' and flag quest (or comment out the charvar quest requirements).
  • !gotoid 17428862
  • Use Call Wyvern.
  • Click on ??? (ID:17428862).
  • See that 2 shadow NMs spawn.

Note: In future, this quest should be converted to the new framework but this will allow the quest to function in the mean time.

Allows the 2 shadow NMs to spawn when:

- Player is DRG.
- Player has pet wyvern out and alive.
Xaver-DaRed
Xaver-DaRed previously approved these changes Sep 20, 2023
@zach2good
Copy link
Contributor

Logically, does this allow 2x different players to spawn the NM at the same time? I believe thats why npcUtil.popFromQM is in the if block, because it checks for such a scenario

@Xaver-DaRed Xaver-DaRed dismissed their stale review September 20, 2023 09:25

I hadn't thought of Zach's scenario

@@ -17,7 +17,7 @@ entity.onTrigger = function(player, npc)
player:getCharVar('KnightStalker_Progress') == 4 and
player:getCharVar('KnightStalker_Kill') == 0 and
player:getMainJob() == xi.job.DRG and
pet and
pet ~= nil and
Copy link
Contributor

Choose a reason for hiding this comment

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

player:getPet() can only return a valid CLuaBaseEntity or nil, checking pet and pet ~= nil are equivalent if the pet has come out correctly, what did you observe here?

Copy link
Contributor

Choose a reason for hiding this comment

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

std::optional<CLuaBaseEntity> CLuaBaseEntity::getPet()
{
    auto* PBattle = static_cast<CBattleEntity*>(m_PBaseEntity);

    if (PBattle->PPet != nullptr)
    {
        return std::optional<CLuaBaseEntity>(PBattle->PPet);
    }

    return std::nullopt;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might end up closing this. Could be something weird on my end? I wasn't getting any lua errors. When I restarted my server/client, it happened to work fine afterwards. Before it was just not popping or displaying a message.

@UmeboshiXI UmeboshiXI closed this Sep 25, 2023
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.

3 participants