Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Checklist: