mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-20 02:45:52 +01:00
Implement quest data field: gainItems
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user