diff --git a/src/main/java/emu/grasscutter/data/excels/QuestData.java b/src/main/java/emu/grasscutter/data/excels/QuestData.java index 76ccd532a..b3d82440b 100644 --- a/src/main/java/emu/grasscutter/data/excels/QuestData.java +++ b/src/main/java/emu/grasscutter/data/excels/QuestData.java @@ -5,6 +5,7 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameResource; import emu.grasscutter.data.ResourceType; +import emu.grasscutter.data.common.ItemParamData; import emu.grasscutter.game.quest.enums.*; import java.util.ArrayList; import java.util.List; @@ -36,7 +37,9 @@ public class QuestData extends GameResource { @Getter private List finishExec; @Getter private List failExec; @Getter private Guide guide; + @Getter private List trialAvatarList; + @Getter private List gainItems; public static String questConditionKey( @Nonnull Enum type, int firstParam, @Nullable String paramsStr) { diff --git a/src/main/java/emu/grasscutter/game/quest/GameQuest.java b/src/main/java/emu/grasscutter/game/quest/GameQuest.java index 00877bc3c..09840dec2 100644 --- a/src/main/java/emu/grasscutter/game/quest/GameQuest.java +++ b/src/main/java/emu/grasscutter/game/quest/GameQuest.java @@ -226,14 +226,12 @@ public class GameQuest { ChapterStateOuterClass.ChapterState.CHAPTER_STATE_END)); } - // hard coding to give amber - if (getQuestData().getSubId() == 35402) { - getOwner().getInventory().addItem(1021, 1, ActionReason.QuestItem); // amber item id - } + // Give items for completing the quest. + this.getQuestData().getGainItems().forEach(item -> + this.getOwner().getInventory().addItem(item, ActionReason.QuestItem)); this.save(); - - Grasscutter.getLogger().debug("Quest {} is finished", subQuestId); + Grasscutter.getLogger().debug("Quest {} was completed.", subQuestId); } // TODO diff --git a/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java b/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java index a973fe818..d59d1737b 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java @@ -1,17 +1,17 @@ -package emu.grasscutter.game.quest.enums; - -public enum ShowQuestGuideType { - QUEST_GUIDE_ITEM_ENABLE(0), - QUEST_GUIDE_ITEM_DISABLE(1), - QUEST_GUIDE_ITEM_MOVE_HIDE(2); - - private final int value; - - ShowQuestGuideType(int id) { - this.value = id; - } - - public int getValue() { - return value; - } -} +package emu.grasscutter.game.quest.enums; + +public enum ShowQuestGuideType { + QUEST_GUIDE_ITEM_ENABLE(0), + QUEST_GUIDE_ITEM_DISABLE(1), + QUEST_GUIDE_ITEM_MOVE_HIDE(2); + + private final int value; + + ShowQuestGuideType(int id) { + this.value = id; + } + + public int getValue() { + return value; + } +}