Example #1
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     //Logger.Debug(" (QuestObjective ctor) creating an objective with ID {0}, QuestStepObjective {1} and QuestStep ID {2}", id, objective.Group1Name, questStep.QuestStepID);
     ID = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Example #2
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     Logger.Debug(" (QuestObjective ctor) creating an objective with ID {0}, QuestStepObjective {1} and QuestStep ID {2}", id, objective.Group1Name, questStep.QuestStepID);
     ID             = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Example #3
0
                public QuestObjective(Game game, Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
                {
                    ID             = id;
                    this.objective = objective;
                    this.questStep = questStep;
                    this.game      = game;

                    //TODO: Rewrite all this as quests should subscribe to events and not objects notify quests
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillGroup)
                    {
                        logger.Debug("KillGroup objective");
                        foreach (var world in game._worlds.Values)
                        {
                            //subscribe to each actor in group destroy/kill event
                            var spawnerGroupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            //
                            foreach (var actor in spawnerGroupActors)
                            {
                                if (actor is Spawner)
                                {
                                    (actor as Spawner).Spawn();
                                }
                            }

                            var groupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            foreach (var actor in groupActors)
                            {
                                actor.ActorKilled += new EventHandler(actor_ActorKilled);
                            }
                        }
                    }
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster)
                    {
                    }
                }
Example #4
0
                public QuestObjective(Game game, Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
                {
                    ID = id;
                    this.objective = objective;
                    this.questStep = questStep;
                    this.game = game;

                    //TODO: Rewrite all this as quests should subscribe to events and not objects notify quests
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillGroup)
                    {
                        logger.Debug("KillGroup objective");
                        foreach( var world in game._worlds.Values)
                        {
                            //subscribe to each actor in group destroy/kill event
                            var spawnerGroupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            //
                            foreach (var actor in spawnerGroupActors)
                            {
                                if (actor is Spawner)
                                {
                                    (actor as Spawner).Spawn();
                                }

                            }

                            var groupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            foreach (var actor in groupActors)
                            {
                                actor.ActorKilled += new EventHandler(actor_ActorKilled);
                            }
                        }                        
                    }
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster)
                    {
                    }
                }
Example #5
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     ID             = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Example #6
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     ID = id;
     this.objective = objective;
     this.questStep = questStep;
 }