mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-07 10:36:41 +01:00
Invoke the 'not equal' events
This commit is contained in:
@@ -104,19 +104,7 @@ public class GameQuest {
|
||||
|
||||
// Some subQuests and talks become active when some other subQuests are unfinished (even from
|
||||
// different MainQuests)
|
||||
getOwner()
|
||||
.getQuestManager()
|
||||
.queueEvent(
|
||||
QuestContent.QUEST_CONTENT_QUEST_STATE_EQUAL,
|
||||
getSubQuestId(),
|
||||
getState().getValue(),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
getOwner()
|
||||
.getQuestManager()
|
||||
.queueEvent(
|
||||
QuestCond.QUEST_COND_STATE_EQUAL, getSubQuestId(), getState().getValue(), 0, 0, 0);
|
||||
this.triggerStateEvents();
|
||||
|
||||
getQuestData()
|
||||
.getBeginExec()
|
||||
@@ -127,6 +115,24 @@ public class GameQuest {
|
||||
this.save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers events:
|
||||
* 'QUEST_COND_STATE_EQUAL',
|
||||
* 'QUEST_COND_STATE_NOT_EQUAL',
|
||||
* 'QUEST_CONTENT_QUEST_STATE_EQUAL',
|
||||
* 'QUEST_CONTENT_QUEST_STATE_NOT_EQUAL'
|
||||
*/
|
||||
public void triggerStateEvents() {
|
||||
var questManager = this.getOwner().getQuestManager();
|
||||
var questId = this.getSubQuestId();
|
||||
var state = this.getState().getValue();
|
||||
|
||||
questManager.queueEvent(QuestCond.QUEST_COND_STATE_EQUAL, questId, state, 0, 0, 0);
|
||||
questManager.queueEvent(QuestCond.QUEST_COND_STATE_NOT_EQUAL, questId, state, 0, 0, 0);
|
||||
questManager.queueEvent(QuestContent.QUEST_CONTENT_QUEST_STATE_EQUAL, questId, state, 0, 0, 0);
|
||||
questManager.queueEvent(QuestContent.QUEST_CONTENT_QUEST_STATE_NOT_EQUAL, questId, state, 0, 0, 0);
|
||||
}
|
||||
|
||||
public String getTriggerNameById(int id) {
|
||||
TriggerExcelConfigData trigger = GameData.getTriggerExcelConfigDataMap().get(id);
|
||||
if (trigger != null) {
|
||||
@@ -214,10 +220,7 @@ public class GameQuest {
|
||||
this.getOwner()
|
||||
.getQuestManager()
|
||||
.queueEvent(QuestContent.QUEST_CONTENT_FINISH_PLOT, this.subQuestId, 0);
|
||||
this.getOwner()
|
||||
.getQuestManager()
|
||||
.queueEvent(
|
||||
QuestCond.QUEST_COND_STATE_EQUAL, this.subQuestId, this.state.getValue(), 0, 0, 0);
|
||||
this.triggerStateEvents();
|
||||
this.getOwner()
|
||||
.getScene()
|
||||
.triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_FINISH_QUEST, getSubQuestId());
|
||||
@@ -250,19 +253,7 @@ public class GameQuest {
|
||||
this.getOwner().sendPacket(new PacketQuestListUpdateNotify(this));
|
||||
|
||||
// Some subQuests have conditions that subQuests fail (even from different MainQuests)
|
||||
this.getOwner()
|
||||
.getQuestManager()
|
||||
.queueEvent(
|
||||
QuestContent.QUEST_CONTENT_QUEST_STATE_EQUAL,
|
||||
this.subQuestId,
|
||||
this.state.getValue(),
|
||||
0,
|
||||
0,
|
||||
0);
|
||||
this.getOwner()
|
||||
.getQuestManager()
|
||||
.queueEvent(
|
||||
QuestCond.QUEST_COND_STATE_EQUAL, this.subQuestId, this.state.getValue(), 0, 0, 0);
|
||||
this.triggerStateEvents();
|
||||
|
||||
this.getQuestData()
|
||||
.getFailExec()
|
||||
|
||||
Reference in New Issue
Block a user