Created Add/Del SceneTag exec for quests

Added 2 missing classes for adding and deleting sceneTags in quests
This commit is contained in:
ShiroySan 2024-05-16 04:00:02 +08:00
parent 4022267888
commit 6ff8ec43e5
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package emu.grasscutter.game.quest.exec;
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.*;
import emu.grasscutter.game.quest.enums.QuestExec;
import emu.grasscutter.game.quest.handlers.QuestExecHandler;
import java.util.Arrays;
@QuestValueExec(QuestExec.QUEST_EXEC_ADD_SCENE_TAG)
public final class ExecAddSceneTag extends QuestExecHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestExecParam condition, String... paramStr) {
var param =
Arrays.stream(paramStr).filter(i -> !i.isBlank()).mapToInt(Integer::parseInt).toArray();
quest.getOwner().getProgressManager().addSceneTag(param[0], param[1]);
return true;
}
}

View File

@ -0,0 +1,19 @@
package emu.grasscutter.game.quest.exec;
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.*;
import emu.grasscutter.game.quest.enums.QuestExec;
import emu.grasscutter.game.quest.handlers.QuestExecHandler;
import java.util.Arrays;
@QuestValueExec(QuestExec.QUEST_EXEC_DEL_SCENE_TAG)
public final class ExecDelSceneTag extends QuestExecHandler {
@Override
public boolean execute(GameQuest quest, QuestData.QuestExecParam condition, String... paramStr) {
var param =
Arrays.stream(paramStr).filter(i -> !i.isBlank()).mapToInt(Integer::parseInt).toArray();
quest.getOwner().getProgressManager().delSceneTag(param[0], param[1]);
return true;
}
}