private void UpdateCounter(QuestObjective objective) { if (_questStep is Mooege.Common.MPQ.FileFormats.QuestUnassignedStep == false) { foreach (var player in _quest.game.Players.Values) { player.InGameClient.SendMessage(new QuestCounterMessage() { snoQuest = _quest.SNOHandle.Id, snoLevelArea = -1, StepID = _questStep.ID, TaskIndex = objective.ID, Counter = objective.Counter, Checked = objective.Done ? 1 : 0, }); } } var completedObjectiveList = from objectiveSet in ObjectivesSets where (from o in objectiveSet.Objectives select o.Done).Aggregate((r, o) => r && o) select objectiveSet.FollowUpStepID; if (completedObjectiveList.Count() > 0) { _quest.StepCompleted(completedObjectiveList.First()); } }
private void UpdateCounter(QuestObjective objective) { Logger.Debug(" (UpdateCounter) is _questStep unassiagned ? {0}", (_questStep is Mooege.Common.MPQ.FileFormats.QuestUnassignedStep == false)); if (_questStep is Mooege.Common.MPQ.FileFormats.QuestUnassignedStep == false) { Logger.Debug(" (UpdateCounter) calling updateCounter snoQuest {0}, step ID {1}, TaskIndex {2}, counter {3}, Checked {4}", _quest.SNOHandle.Id, _questStep.ID, objective.ID, objective.Counter, objective.Done ? 1 : 0); foreach (var player in _quest.game.Players.Values) { player.InGameClient.SendMessage(new QuestCounterMessage() { snoQuest = _quest.SNOHandle.Id, snoLevelArea = -1, StepID = _questStep.ID, TaskIndex = objective.ID, Counter = objective.Counter, Checked = objective.Done ? 1 : 0, }); } } //EREKOSE WARNING quest 87700 has at least 2 objective in stepID 55 var completedObjectiveList = from objectiveSet in ObjectivesSets where (from o in objectiveSet.Objectives select o.Done).Aggregate((r, o) => r && o) select objectiveSet.FollowUpStepID; Logger.Debug(" (UpdateCounter) contains {0} accomplished objectives ", completedObjectiveList.Count()); Logger.Debug(" (UpdateCounter) Current quest step contains {0} objectiveSet ", ObjectivesSets.Count()); foreach (var objectiveSet in ObjectivesSets) { foreach (var l_objective in objectiveSet.Objectives) { Logger.Debug(" (UpdateCounter) objective in ObjSets contains objective ID {0}, type {1}, value {2}, isDone {3} ", l_objective.ID, l_objective.ObjectiveType, l_objective.ObjectiveValue, l_objective.Done); } } if (completedObjectiveList.Count() == ObjectivesSets.Count()) { Logger.Debug(" (Update Counter) Now calling StepCompleted with followupID {0} ", completedObjectiveList.First()); _quest.StepCompleted(completedObjectiveList.First()); } }