mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 17:33:02 +08:00
Implement quest data field: gainItems
This commit is contained in:
parent
29501bcd81
commit
c71386c69e
@ -5,6 +5,7 @@ import emu.grasscutter.Grasscutter;
|
|||||||
import emu.grasscutter.data.GameData;
|
import emu.grasscutter.data.GameData;
|
||||||
import emu.grasscutter.data.GameResource;
|
import emu.grasscutter.data.GameResource;
|
||||||
import emu.grasscutter.data.ResourceType;
|
import emu.grasscutter.data.ResourceType;
|
||||||
|
import emu.grasscutter.data.common.ItemParamData;
|
||||||
import emu.grasscutter.game.quest.enums.*;
|
import emu.grasscutter.game.quest.enums.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -36,7 +37,9 @@ public class QuestData extends GameResource {
|
|||||||
@Getter private List<QuestExecParam> finishExec;
|
@Getter private List<QuestExecParam> finishExec;
|
||||||
@Getter private List<QuestExecParam> failExec;
|
@Getter private List<QuestExecParam> failExec;
|
||||||
@Getter private Guide guide;
|
@Getter private Guide guide;
|
||||||
|
|
||||||
@Getter private List<Integer> trialAvatarList;
|
@Getter private List<Integer> trialAvatarList;
|
||||||
|
@Getter private List<ItemParamData> gainItems;
|
||||||
|
|
||||||
public static String questConditionKey(
|
public static String questConditionKey(
|
||||||
@Nonnull Enum<?> type, int firstParam, @Nullable String paramsStr) {
|
@Nonnull Enum<?> type, int firstParam, @Nullable String paramsStr) {
|
||||||
|
@ -226,14 +226,12 @@ public class GameQuest {
|
|||||||
ChapterStateOuterClass.ChapterState.CHAPTER_STATE_END));
|
ChapterStateOuterClass.ChapterState.CHAPTER_STATE_END));
|
||||||
}
|
}
|
||||||
|
|
||||||
// hard coding to give amber
|
// Give items for completing the quest.
|
||||||
if (getQuestData().getSubId() == 35402) {
|
this.getQuestData().getGainItems().forEach(item ->
|
||||||
getOwner().getInventory().addItem(1021, 1, ActionReason.QuestItem); // amber item id
|
this.getOwner().getInventory().addItem(item, ActionReason.QuestItem));
|
||||||
}
|
|
||||||
|
|
||||||
this.save();
|
this.save();
|
||||||
|
Grasscutter.getLogger().debug("Quest {} was completed.", subQuestId);
|
||||||
Grasscutter.getLogger().debug("Quest {} is finished", subQuestId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package emu.grasscutter.game.quest.enums;
|
package emu.grasscutter.game.quest.enums;
|
||||||
|
|
||||||
public enum ShowQuestGuideType {
|
public enum ShowQuestGuideType {
|
||||||
QUEST_GUIDE_ITEM_ENABLE(0),
|
QUEST_GUIDE_ITEM_ENABLE(0),
|
||||||
QUEST_GUIDE_ITEM_DISABLE(1),
|
QUEST_GUIDE_ITEM_DISABLE(1),
|
||||||
QUEST_GUIDE_ITEM_MOVE_HIDE(2);
|
QUEST_GUIDE_ITEM_MOVE_HIDE(2);
|
||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
ShowQuestGuideType(int id) {
|
ShowQuestGuideType(int id) {
|
||||||
this.value = id;
|
this.value = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user