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

Fix daily dungeon flow #2398

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Conversation

longfruit
Copy link
Contributor

@longfruit longfruit commented Oct 10, 2023

Fix daily dungeon flow

Description

  • Fixed "Locked" dungeon entry issue. How this works:
    • Dungeons start out Locked on client side. Interacting with dungeons in this state causes the client to send GetDungeonEntryExploreConditionReq to get level and/or quest completion requirement for dungeon entry.
    • The server would respond with GetDungeonEntryExploreConditionRsp to show the conditions.
      • On player level (AR) up, the server should send DungeonEntryToBeExploreNotify to tell the client some dungeon is ready to be explored. This gives that dungeon the "Unknown" text bubble in the client world map.
      • In this state, the client will no longer send GetDungeonEntryExploreConditionReq and instead send DungeonEntryInfoReq to enumerate dungeon entries as usual, as well as the packet to unlock the teleport waypoint.
    • Unfortunately this fix still needs improvement: I don't know how to make the unlock state persistent.
      • On relog, the dungeon goes back to its locked state. However, its teleport waypoint is still active.
        • In this state, player can still teleport to it, but on interaction, client resumes sending GetDungeonEntryExploreConditionReq.
        • The server has to resend the DungeonEntryToBeExploreNotify again to put it in the unlock state for client to enter.
  • Fix daily dungeon enumeration issue.
    • The "dungeonRandomList" field now has alternative name "GLEKJMEEOMH"
    • Note: This field enumerates dungeon entries for different days of week.
  • Implement dungeon replay flow by kicking every player out of its scene and adding them back in again.
    • This causes the scene to be cleaned up so that scripting states are restarted when the players are spawned back in. Otherwise the Key trigger to start the dungeon challenge will be missing, as will the barrier to the reward statue.
  • Fix GadgetRewardStatue not actually dispensing rewards.
    • Seems the dungeons used to have DungeonChallenge, but they are now WorldChallenge. GadgetRewardStatue was only dispensing rewards for DungeonChallenge.
      • DungeonChallenge is currently used only in Tower.
  • Implement UnfreezeGroupLimit.
    • This fixes unlocking the first weapon mats dungeon and hopefully other dungeons with similar unlock requirements.
    • These dungeons have attribute groupLimit: true in BinOutput/Scene/Point/scene*_point.json. Lua scripts would call UnfreezeGroupLimit, which should then send an UnfreezeGroupLimitNotify to trigger the unlock.

Under the hood

  • Update ScriptLib to pass in current group ID in addition to config ID. Getting the first entity found with only a config ID can lead to wrong outcomes. Config IDs are not unique in a scene.

Issues fixed by this PR

#2282

Type of changes

  • Bug fix
  • New feature
  • Enhancement
  • Documentation

Checklist:

  • My code follows the style guidelines of this project
  • My pull request is unique and no other pull requests have been opened for these changes
  • I have read the Contributing note and Code of conduct
  • I am responsible for any copyright issues with my code if it occurs in the future.

@YetAG
Copy link

YetAG commented Oct 12, 2023

I think it is a good PR.
However, I was indeed able to access Domain and receive the reward, but I can't choose between using the concentrated resin or using the resin as is.
I use the resin directly as it is.

@longfruit
Copy link
Contributor Author

I think it is a good PR. However, I was indeed able to access Domain and receive the reward, but I can't choose between using the concentrated resin or using the resin as is. I use the resin directly as it is.

Thanks for testing the changes.

Currently, on interaction with the tree, the client always sends a GadgetInteractReq with resin explicitly set to Original Resin.

It seems something, like an open state or the tree's EntityGadgetInfo field, must be set so that the prompt to select between Original and Condensed appears. I've had no luck finding what would work so far.

@KingRainbow44 KingRainbow44 merged commit 770cd62 into Grasscutters:development Oct 17, 2023
2 checks passed
@longfruit longfruit deleted the dungeon-fix branch November 2, 2023 23:40
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.

None yet

3 participants