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
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/zones/Temple_of_Uggalepih/npcs/qm15.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ 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:getPetID() == xi.petId.WYVERN and
npcUtil.popFromQM(player, npc, { ID.mob.CLEUVARION_M_RESOAIX, ID.mob.ROMPAULION_S_CITALLE }, { hide = 0, claim = false })
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.

pet:getPetID() == xi.petId.WYVERN
then
player:messageSpecial(ID.text.SOME_SORT_OF_CEREMONY + 1) -- Your wyvern reacts violently to this spot!
npcUtil.popFromQM(player, npc, { ID.mob.CLEUVARION_M_RESOAIX, ID.mob.ROMPAULION_S_CITALLE }, { hide = 0, claim = false })
elseif player:getCharVar('KnightStalker_Kill') == 1 then
player:startEvent(67)
else
Expand Down