Fix ContentNotFinishPlot

This commit is contained in:
KingRainbow44 2023-06-16 22:58:49 -04:00
parent 31cef88ef7
commit 762e7ae301
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
2 changed files with 12 additions and 22 deletions

View File

@ -1,21 +1,17 @@
package emu.grasscutter.game.quest.content;
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.*;
import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_PLOT;
import emu.grasscutter.data.binout.MainQuestData;
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValueContent;
@QuestValueContent(QUEST_CONTENT_FINISH_PLOT)
public class ContentFinishPlot extends BaseContent {
@Override
public boolean execute(
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
MainQuestData.TalkData talkData =
quest.getMainQuest().getTalks().get(Integer.valueOf(params[0]));
GameQuest subQuest = quest.getMainQuest().getChildQuestById(params[0]);
var talkData = quest.getMainQuest().getTalks().get(params[0]);
var subQuest = quest.getMainQuest().getChildQuestById(params[0]);
return (talkData != null && subQuest != null || condition.getParamStr().equals(paramStr))
&& condition.getParam()[0] == params[0];
}

View File

@ -1,24 +1,18 @@
package emu.grasscutter.game.quest.content;
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.*;
import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_NOT_FINISH_PLOT;
import emu.grasscutter.data.excels.quest.QuestData;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValueContent;
import lombok.val;
@QuestValueContent(QUEST_CONTENT_NOT_FINISH_PLOT)
public class ContentNotFinishPlot extends BaseContent {
@Override
public boolean execute(
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
val talkId = condition.getParam()[0];
val checkMainQuest = quest.getOwner().getQuestManager().getMainQuestByTalkId(talkId);
if (checkMainQuest == null) {
return true;
}
val talkData = checkMainQuest.getTalks().get(talkId);
return talkData == null;
var talkData = quest.getMainQuest().getTalks().get(params[0]);
var subQuest = quest.getMainQuest().getChildQuestById(params[0]);
return (talkData == null && subQuest != null || condition.getParamStr().equals(paramStr))
&& condition.getParam()[0] == params[0];
}
}