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 Librarian Story Quest #2218

Merged
merged 7 commits into from
Jun 20, 2023
Merged

Fix Librarian Story Quest #2218

merged 7 commits into from
Jun 20, 2023

Conversation

scooterboo
Copy link
Contributor

@scooterboo scooterboo commented Jun 18, 2023

Description

Various fixes to make Librarian's story quest go from red to dark green.

4 in 1 pack!

Issues fixed by this PR

GadgetGatherObject.java ->
When gathering an object, send a EventType.EVENT_GATHER to ScriptArgs so that those kinds of triggers will happen.
Quest 1010115 was not finishing because the lua in scene 1004 group 201004003 was not being told that the book was taken from the shelf.

ScriptLib.java -> config_id
There was a CreateGadget with config_id of 0 in scene 20010, group 220010006. I don't know what the crap it is supposed to do, but it keeps the group from loading.
I made it check for config_id of 0 and return a 0 in that case.

ScriptLib.java -> VisionType.VISION_TYPE_REMOVE
When we REMOVE an entity, we should send a VisionType.VISION_TYPE_REMOVE not a VisionType.VISION_TYPE_DIE
In the dungeon in this quest, there's an invisible floor that keeps you from taking the platform down. With VisionType.VISION_TYPE_DIE the invisible floor remained in place and with VisionType.VISION_TYPE_REMOVE it was removed.

GameEntity.java, EntityIdType.java, EntityType.java ->
This is the only fix that you might want to look into.
in the lua scripts, the values of EntityType are used for things like EntityType.GADGET . For Grasscutter, the values from EntityIdType are used to make unique IDs. I could not find a way to get an entity's EntityType from a GameEntity. So instead, I put a map in EntityIdType that converts EntityIdTypes to EntityType. I checked GameEntity's getEntityType() and it is only used when EntityType is needed, but it returns EntityIdTypes instead. I added Region to EntityType because it's used in the lua in the electric islands (might as well add it now).
In the game, when trying to remove that invisible floor I was talking about earlier, it would return a 1 instead of a 0 in ScriptLib.java's RemoveEntityByConfigId (scene 20010 group 220010010) and therefor fail. This was because entity.getEntityType() (which returns a EntityIdType) was being checked against entityType (which was a EntityType). This made it so that the final worktop in the dungeon would appear to not do anything when you interacted with it.

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.

@scooterboo scooterboo requested a review from Hartie95 June 18, 2023 13:46
@KingRainbow44 KingRainbow44 merged commit b58caf0 into Grasscutters:development Jun 20, 2023
2 checks passed
@scooterboo scooterboo mentioned this pull request Jul 20, 2023
8 tasks
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