protected QuestObjectiveInfo Talk(string target)
 {
     var result = new QuestObjectiveInfo();
     result.Type = ObjectiveType.Talk;
     result.Target = target;
     return result;
 }
 protected QuestObjectiveInfo ReachLevel(uint level)
 {
     var result = new QuestObjectiveInfo();
     result.Type = ObjectiveType.ReachLevel;
     result.Id = level;
     return result;
 }
Example #3
0
        public void AddObjective(string ident, string description, bool unlocked, uint region, uint x, uint y, QuestObjectiveInfo info)
        {
            foreach (string o in this.Info.Objectives.Keys)
            {
                if (o == ident)
                {
                    Logger.Warning("Multiple objectives with the same name ({1}) found in quest '{0}'. All but the first one will be ignored.", this.Id, ident);
                    return;
                }
            }

            info.Description = description;
            info.Unlocked = unlocked;

            info.Region = region;
            info.X = x;
            info.Y = y;

            // Subscribe to KilledByPlayer once for this quest, if needed for this objective.
            if (info.Type == ObjectiveType.Kill)
            {
                EventManager.PlayerEvents.KilledByPlayer -= this.OnKilledByPlayer;
                EventManager.PlayerEvents.KilledByPlayer += this.OnKilledByPlayer;
            }

            // Subscribe to OnCreatureItemAction once for this quest, if needed for this objective.
            if (info.Type == ObjectiveType.Collect)
            {
                EventManager.CreatureEvents.CreatureItemAction -= this.OnCreatureItemAction;
                EventManager.CreatureEvents.CreatureItemAction += this.OnCreatureItemAction;
            }

            this.Info.Objectives.Add(ident, info);
        }
 protected QuestObjectiveInfo ReachRank(SkillConst skillId, SkillRank rank)
 {
     var result = new QuestObjectiveInfo();
     result.Type = ObjectiveType.ReachRank;
     result.Id = (uint)skillId;
     result.Amount = (uint)rank;
     return result;
 }
 protected QuestObjectiveInfo Kill(uint amount, params uint[] races)
 {
     var result = new QuestObjectiveInfo();
     result.Type = ObjectiveType.Kill;
     result.Races.AddRange(races);
     result.Amount = amount;
     return result;
 }
 protected QuestObjectiveInfo Deliver(string target, uint itemId)
 {
     var result = new QuestObjectiveInfo();
     result.Type = ObjectiveType.Deliver;
     result.Target = target;
     result.Id = itemId;
     return result;
 }
 protected QuestObjectiveInfo Collect(uint itemId, uint amount)
 {
     var result = new QuestObjectiveInfo();
     result.Type = ObjectiveType.Collect;
     result.Id = itemId;
     result.Amount = amount;
     return result;
 }
Example #8
0
 public void AddObjective(string ident, string description, uint region, uint x, uint y, QuestObjectiveInfo info)
 {
     this.AddObjective(ident, description, false, region, x, y, info);
 }