示例#1
0
 public PQuestGameObject(GameObject_spawn spawn, PQuestObjective objective)
 {
     this.Spawn     = spawn;
     Name           = spawn.Proto.Name;
     this.Objective = objective;
     this.Respawn   = 0;
 }
示例#2
0
        public PQuestCreature(Creature_spawn spawn, PQuestObjective objective, PublicQuest publicQuest) : base(spawn)
        {
            _objective   = objective;
            _publicQuest = publicQuest;

            if (objective.Objective.Type == (byte)Objective_Type.QUEST_PROTECT_UNIT)
            {
                EvtInterface.AddEvent(Protected, objective.Objective.Time * 1000, 1);
            }

            EvtInterface.AddEventNotify(EventName.OnLeaveCombat, _publicQuest.MobLeavingCombat);
        }
示例#3
0
        /// <summary>
        /// Initializes the public quest's objectives and stages.
        /// </summary>
        /// <param name="info"></param>
        public PublicQuest(PQuest_Info info)
            : this()
        {
            Info          = info;
            Name          = info.Name;
            ActivePlayers = new List <uint>();
            Players       = new Dictionary <uint, ContributionInfo>();
            Stages        = new List <PQuestStage>();

            foreach (PQuest_Objective obj in info.Objectives)
            {
                // Create a new public quest stage for this objective, if one did not previously exist.
                bool exists = Stages.Any(x => x.StageName == obj.StageName);

                if (!exists)
                {
                    PQuestStage stage = new PQuestStage
                    {
                        StageName   = obj.StageName,
                        Number      = Stages.Count,
                        Description = obj.Description,
                        Time        = obj.Time
                    };
                    Stages.Add(stage);
                }

                // Assign this objective to its public quest stage.
                foreach (PQuestStage stage in Stages)
                {
                    if (stage.StageName == obj.StageName)
                    {
                        PQuestObjective objective = new PQuestObjective
                        {
                            Quest       = this,
                            Objective   = obj,
                            ObjectiveID = obj.Guid,
                            Count       = 0
                        };
                        stage.AddObjective(objective);
                    }
                }
            }
        }
示例#4
0
 public void AddObjective(PQuestObjective Objective)
 {
     Objectives.Add(Objective);
 }