Esempio n. 1
0
        /// <summary>
        /// Defends an Object.
        /// </summary>
        /// <remarks>
        /// Created 12/8/2010.
        /// </remarks>
        /// <param name="args">A variable-length parameters list containing arguments.</param>
        public DefendObject(Dictionary <string, string> args) : base(args)
        {
            try
            {
                _location = GetAttributeAsNullable("", false, ConstrainAs.WoWPointNonEmpty, null) ?? _me.Location;
                _objectId = GetNumberedAttributesAsArray <uint>("ObjectId", 1, null, new[] { "NpcId", "MobId" }) ?? new uint[] { 27430 };
                _questId  = GetAttributeAsNullable("QuestId", false, ConstrainAs.QuestId(this), null) ?? 0;
                _questRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete;
                _questRequirementInLog    = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog;
                _maxRange = GetAttributeAsNullable <int>("MaxRange", false, null, null) ?? 40;
            }

            catch (Exception except)
            {
                // Maintenance problems occur for a number of reasons.  The primary two are...
                // * Changes were made to the behavior, and boundary conditions weren't properly tested.
                // * The Honorbuddy core was changed, and the behavior wasn't adjusted for the new changes.
                // In any case, we pinpoint the source of the problem area here, and hopefully it
                // can be quickly resolved.
                LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message
                           + "\nFROM HERE:\n"
                           + except.StackTrace + "\n");
                IsAttributeProblem = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Defends an Object.
        /// </summary>
        /// <remarks>
        /// Created 12/8/2010.
        /// </remarks>
        /// <param name="args">A variable-length parameters list containing arguments.</param>
        public DefendObject(Dictionary<string, string> args) : base(args)
        {
            try
            {
                _location = GetAttributeAsNullable("", false, ConstrainAs.WoWPointNonEmpty, null) ?? _me.Location;
                _objectId = GetNumberedAttributesAsArray<uint>("ObjectId", 1, null, new[] {"NpcId", "MobId"}) ?? new uint[] { 27430 };
                _questId = GetAttributeAsNullable("QuestId", false, ConstrainAs.QuestId(this), null) ?? 0;
                _questRequirementComplete = GetAttributeAsNullable<QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete;
                _questRequirementInLog = GetAttributeAsNullable<QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog;
                _maxRange = GetAttributeAsNullable<int>("MaxRange", false, null, null) ?? 40;
            }

            catch (Exception except)
            {
                // Maintenance problems occur for a number of reasons.  The primary two are...
                // * Changes were made to the behavior, and boundary conditions weren't properly tested.
                // * The Honorbuddy core was changed, and the behavior wasn't adjusted for the new changes.
                // In any case, we pinpoint the source of the problem area here, and hopefully it
                // can be quickly resolved.
                LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message
                                    + "\nFROM HERE:\n"
                                    + except.StackTrace + "\n");
                IsAttributeProblem = true;
            }
        }
 public static void BuildReplacementArgs_QuestSpec(
     List <Tuple <string, string> > replacementArgs,
     int questId,
     QuestCompleteRequirement questCompleteRequirement,
     QuestInLogRequirement questInLogRequirement)
 {
     if (questId > 0)
     {
         replacementArgs.Add(Tuple.Create("QuestId", questId.ToString()));
     }
     if (questInLogRequirement != QuestInLogRequirement.InLog)
     {
         replacementArgs.Add(Tuple.Create("QuestInLogRequirement", questInLogRequirement.ToString()));
     }
     if (questCompleteRequirement != QuestCompleteRequirement.NotComplete)
     {
         replacementArgs.Add(Tuple.Create("QuestCompleteRequirement", questCompleteRequirement.ToString()));
     }
 }