From 47cdfe5c148da3bd7a6b37f610100f4485b0aa30 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Thu, 13 Apr 2023 17:59:42 -0400 Subject: [PATCH] Handle quest execute which sets the player's flying state --- .../game/quest/enums/QuestExec.java | 2 +- .../game/quest/exec/ExecSetFlyable.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/main/java/emu/grasscutter/game/quest/exec/ExecSetFlyable.java diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java index 0ab8d6351..351b8e902 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java @@ -15,7 +15,7 @@ public enum QuestExec implements QuestTrigger { QUEST_EXEC_LOCK_FORCE(5), // missing, currently unused QUEST_EXEC_CHANGE_AVATAR_ELEMET(6), QUEST_EXEC_REFRESH_GROUP_MONSTER(7), - QUEST_EXEC_SET_IS_FLYABLE(8), // missing, maybe gives glider + QUEST_EXEC_SET_IS_FLYABLE(8), QUEST_EXEC_SET_IS_WEATHER_LOCKED(9), // missing QUEST_EXEC_SET_IS_GAME_TIME_LOCKED(10), // missing QUEST_EXEC_SET_IS_TRANSFERABLE(11), // missing, currently unused diff --git a/src/main/java/emu/grasscutter/game/quest/exec/ExecSetFlyable.java b/src/main/java/emu/grasscutter/game/quest/exec/ExecSetFlyable.java new file mode 100644 index 000000000..2dc436f7e --- /dev/null +++ b/src/main/java/emu/grasscutter/game/quest/exec/ExecSetFlyable.java @@ -0,0 +1,18 @@ +package emu.grasscutter.game.quest.exec; + +import emu.grasscutter.data.excels.QuestData; +import emu.grasscutter.game.props.PlayerProperty; +import emu.grasscutter.game.quest.GameQuest; +import emu.grasscutter.game.quest.QuestValueExec; +import emu.grasscutter.game.quest.enums.QuestExec; +import emu.grasscutter.game.quest.handlers.QuestExecHandler; + +@QuestValueExec(QuestExec.QUEST_EXEC_SET_IS_FLYABLE) +public final class ExecSetFlyable extends QuestExecHandler { + @Override + public boolean execute(GameQuest quest, QuestData.QuestExecParam condition, String... paramStr) { + var canFly = Integer.parseInt(paramStr[0]); + quest.getOwner().setProperty(PlayerProperty.PROP_IS_FLYABLE, canFly); + return true; + } +}