Anime-Game-Servers / Grasscutter-Quests

A server software implementation, ineroperable with a certain anime game client. The code in this repository is fully custom made for edyoucational purposes and future preservation, no copyrighted code is allowed in this repository.
https://grasscutters.xyz/grasscutter
GNU Affero General Public License v3.0
138 stars 31 forks source link

[Bug] After talking to the first guard in Chaseing shadows, the door cannot open. #89

Closed scooterboo closed 9 months ago

scooterboo commented 9 months ago

Describe the bug In Chasing Shadows, the worktop in front of the first door in the dungeon does not have an option to interact with it after you talk to the guard.

How to replicate: Start Chasing Shadows (fatui hideout in prologue act 2). Talk to the guard. After the talk, the worktop will not activate, meaning you cannot open the door.

Notes: The door is 5001 in scene20023_group220023005.lua The worktop is 5003

Here is likely what the problem is: https://github.com/Anime-Game-Servers/Grasscutter-Quests/blob/59e2d2b4ce2b780b1da98b360f2d540ef4fa80b1/src/main/java/emu/grasscutter/game/quest/exec/ExecNotifyGroupLua.java#L39-L40 This ScriptArgs needs to have a param2. According to scene20023_group220023005.lua line 105, when the event type is EVENT_QUEST_FINISH, evt.param2 is 1 for a success and 0 for a failure

Main grasscutter has: https://github.com/Grasscutters/Grasscutter/blob/6e1913aacb96473ab24027cee54d3fa806034f2c/src/main/java/emu/grasscutter/game/quest/exec/ExecNotifyGroupLua.java#L32-L37 and that was done in this commit: https://github.com/Grasscutters/Grasscutter/commit/20f0cda3e0225f6350a3d40be6dde451f9410bda

Might I suggest something like:

            if (quest.getState() == QuestState.QUEST_STATE_FINISHED) {
                scriptManager.callEvent(
                    new ScriptArgs(groupId, EventType.EVENT_QUEST_FINISH, quest.getSubQuestId(), 1)
                            .setEventSource(quest.getSubQuestId())
                );
            } else {
                scriptManager.callEvent(
                        new ScriptArgs(groupId, EventType.EVENT_QUEST_START, quest.getSubQuestId())
                                .setEventSource(quest.getSubQuestId())
                );
            }

Which branch did you use? multi_proto Grasscutter version: 1.4.4-dev-59e2d2b4 Lua: JNLua

Screenshots image

scooterboo commented 9 months ago

or

                new ScriptArgs(groupId, eventType, quest.getSubQuestId(), 1)
                    .setEventSource(quest.getSubQuestId())

If you want to go for minimalism.

scooterboo commented 9 months ago

Confirmed fixed