public NPCAssistance(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                QuestId = GetAttributeAsNullable <int>("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;

                MobIds             = GetNumberedAttributesAsArray <int>("MobId", 1, ConstrainAs.MobId, new[] { "NpcId" });
                NpcState           = GetAttributeAsNullable <NpcStateType>("MobState", false, null, new[] { "NpcState" }) ?? NpcStateType.Alive;
                CurrentCommand     = GetAttributeAsNullable <NpcCommand>("MobCommand", false, null, new[] { "NpcCommand" }) ?? NpcCommand.Target;
                WaitTime           = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 1500;
                WaitForNpcs        = GetAttributeAsNullable <bool>("WaitForNpcs", false, null, null) ?? false;
                MobHpPercentLeft   = GetAttributeAsNullable <double>("MobHpPercentLeft", false, ConstrainAs.Percent, new[] { "HpLeftAmount" }) ?? 100.0;
                CollectionDistance = GetAttributeAsNullable <double>("CollectionDistance", false, ConstrainAs.Range, null) ?? 100.0;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #2
0
        public RunLua(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                LuaCommand = GetAttributeAs <string>("Lua", true, ConstrainAs.StringNonEmpty, null) ?? string.Empty;
                NumOfTimes = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1;
                WaitTime   = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 0;

                GoalText = GetAttributeAs("GoalText", false, ConstrainAs.StringNonEmpty, null) ?? "Running Lua";
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public SlayTheFools(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                Location    = GetAttributeAsNullable <Vector3>("", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                QuestId     = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0;
                ObjectiveId = GetAttributeAsNullable <int>("ObjectiveId", false, ConstrainAs.RepeatCount, null) ?? 0;
                MobId       = GetAttributeAsNullable <int>("MobId", true, ConstrainAs.MobId, null) ?? 0;
                Distance    = GetAttributeAsNullable <int>("CollectionDistance", false, null, null) ?? 1000;
                QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete;
                QuestRequirementInLog    = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog;

                QBCLog.DeveloperInfo("Distance thingy is:" + Distance);
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #4
0
        /// <summary>
        /// This is only used when you get a quest that Says, Kill anything x times. Or on the chance the wowhead ID is wrong
        /// ##Syntax##
        /// QuestId: Id of the quest.
        /// MobId, MobId2, ...MobIdN: Mob Values that it will kill.
        /// X,Y,Z: The general location where theese objects can be found
        /// </summary>
        ///
        public Rag(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                Location = GetAttributeAsNullable <Vector3>("", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero;
                //MobIds = GetNumberedAttributesAsArray<int>("MobId", 1, ConstrainAs.MobId, new[] {"NpcID"})
                QuestRequirementComplete = QuestCompleteRequirement.NotComplete;
                QuestRequirementInLog    = QuestInLogRequirement.InLog;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public DroppingTheHammer(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                QuestId = 27817;
                QuestRequirementComplete = QuestCompleteRequirement.NotComplete;
                QuestRequirementInLog    = QuestInLogRequirement.InLog;
                MobIds = new uint[] { 50635, 50638, 50643, 50636 };
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public TaxiRide(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                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;

                DestName    = GetAttributeAs("DestName", false, ConstrainAs.StringNonEmpty, null) ?? "ViewNodesOnly";
                MobId       = GetAttributeAsNullable("MobId", true, ConstrainAs.MobId, null) ?? 0;
                NpcState    = GetAttributeAsNullable <NpcStateType>("MobState", false, null, new[] { "NpcState" }) ?? NpcStateType.Alive;
                TaxiNumber  = GetAttributeAs("TaxiNumber", false, ConstrainAs.StringNonEmpty, null) ?? "0";
                WaitForNpcs = GetAttributeAsNullable <bool>("WaitForNpcs", false, null, null) ?? false;
                WaitTime    = GetAttributeAsNullable("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 1500;
                NpcLocation = GetAttributeAsNullable("", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #7
0
        public TheLightOfDawn(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                QuestId = GetAttributeAsNullable <int>("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;

                DistanceToFollowWarlord          = 45.0;
                Location_Battlefield             = new Blackspot(new WoWPoint(2266.047, -5300.083, 89.15713), 95.0f, 10.0f);
                Location_WaitForBattleToComplete = new WoWPoint(2282.805, -5207.55, 82.10373).FanOutRandom(20.0);
                Location_WaitToChatWithDarion    = new WoWPoint(2431.67, -5137.021, 83.84176).FanOutRandom(20.0);
                AuraId_TheMightOfMograine        = 53642;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public UseTransport(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.

                StartLocation  = GetAttributeAsNullable <Vector3>("TransportStart", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                EndLocation    = GetAttributeAsNullable <Vector3>("TransportEnd", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                GetOffLocation = GetAttributeAsNullable <Vector3>("GetOff", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                StandLocation  = GetAttributeAsNullable <Vector3>("StandOn", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                WaitAtLocation = GetAttributeAsNullable <Vector3>("WaitAt", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;

                DestName = GetAttributeAs <string>("DestName", false, ConstrainAs.StringNonEmpty, null) ?? "";

                TransportId = GetAttributeAsNullable <int>("TransportId", true, ConstrainAs.MobId, new[] { "Transport" }) ?? 0;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #9
0
        public WaitTimer(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // NB: Core attributes are parsed by QuestBehaviorBase parent (e.g., QuestId, NonCompeteDistance, etc)

                // Behavior-specific attributes...
                StatusText = GetAttributeAs <string>("GoalText", false, ConstrainAs.StringNonEmpty, null)
                             ?? "Wait time remaining... {TimeRemaining} of {TimeDuration}.";
                VariantTime = GetAttributeAsNullable <int>("VariantTime", false, ConstrainAs.Milliseconds, null) ?? 0;
                WaitTime    = GetAttributeAsNullable <int>("WaitTime", true, ConstrainAs.Milliseconds, null) ?? 1000;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #10
0
        public RocketRescue_24910_25050(Dictionary <string, string> args)
            : base(args)
        {
            try
            {
                QuestId = Me.IsAlliance ? 25050 : 24910;
                TerminationChecksQuestProgress = false;

                AuraId_EmergencyRocketPack            = 75730; // http://wowhead.com/spell=75730 (applies to us)
                AuraId_Parachute                      = 54649; // http://wowhead.com/spell=54649 (applies to us)
                AuraId_RocketPack                     = 72359; // http://wowhead.com/spell=72359 (applies to mob)
                MobId_Objective1_SteamwheedleSurvivor = 38571; // http://wowhead.com/npc=38571
                MobId_Objective2_SouthseaBlockader    = 40583; // http://wowhead.com/npc=40583
                MobId_SteamwheedleRescueBalloon       = 40604; // http://wowhead.com/npc=40604
                VehicleStagingArea                    = new WoWPoint(-7092.513, -3906.368, 10.96168);

                // Weapon allows TAU (i.e., 2*PI) horizontal rotation
                WeaponAzimuthMax = 0.0;                    // Use: /script print(VehicleAimGetAngle())
                WeaponAzimuthMin = -1.18;                  // Use: /script print(VehicleAimGetAngle())
                WeaponLifeRocket_MuzzleVelocity           = 80.0;
                WeaponPirateDestroyingBomb_MuzzleVelocity = 80.0;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #11
0
        public Escort(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                EscortUntil = GetAttributeAsNullable <EscortUntilType>("EscortUntil", false, null, null) ?? EscortUntilType.QuestComplete;
                DefendType  = GetAttributeAsNullable <DefendUnitType>("DefendType", false, null, null) ?? DefendUnitType.Unit;
                MobType     = GetAttributeAsNullable <ObjectType>("MobType", false, null, new[] { "ObjectType" }) ?? ObjectType.Npc;

                EscortDestination        = GetAttributeAsNullable("EscortDest", (EscortUntil == EscortUntilType.DestinationReached), ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero;
                Location                 = GetAttributeAsNullable("", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                ItemId                   = GetAttributeAsNullable("ItemId", false, ConstrainAs.ItemId, null) ?? 0;
                ObjectId                 = GetNumberedAttributesAsArray("MobId", 1, ConstrainAs.MobId, new[] { "NpcId" });
                MaxRange                 = GetAttributeAsNullable("Range", false, ConstrainAs.Range, null) ?? 20;
                QuestId                  = GetAttributeAsNullable("QuestId", (EscortUntil == EscortUntilType.QuestComplete), ConstrainAs.QuestId(this), null) ?? 0;
                QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete;
                QuestRequirementInLog    = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #12
0
        public WaitForPatrol(Dictionary <string, string> args)
            : base(args)
        {
            try
            {
                // NB: Core attributes are parsed by QuestBehaviorBase parent (e.g., QuestId, NonCompeteDistance, etc)

                AvoidDistance    = GetAttributeAsNullable <double>("AvoidDistance", true, ConstrainAs.Range, new[] { "Distance" }) ?? 20.0;
                MobIdToAvoid     = GetAttributeAsNullable <int>("AvoidMobId", true, ConstrainAs.MobId, new[] { "MobId" }) ?? 0;
                MobIdToMoveNear  = GetAttributeAsNullable <int>("MoveToMobId", false, ConstrainAs.MobId, new[] { "MoveToMobID" }) ?? 0;
                SafespotLocation = GetAttributeAsNullable <Vector3>("", true, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero;

                // Tunables...
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public ForcedMount(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                MountType = GetAttributeAsNullable <ForcedMountType>("MountType", false, null, null) ?? ForcedMountType.Ground;
                QuestId   = GetAttributeAsNullable <int>("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;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public Brewfest_RamRidingQuests(Dictionary <string, string> args)
            : base(args)
        {
            try
            {
                // NB: Core attributes are parsed by QuestBehaviorBase parent (e.g., QuestId, NonCompeteDistance, etc)

                // QuestBehaviorBase will handle QuestId, but we re-acquire here because it is 'required'...
                GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null);

                TerminationChecksQuestProgress = false;

                // RidingPath processing...
                RidingPath          = HuntingGroundsType.GetOrCreate(Element, "RidingPath");
                IsAttributeProblem |= RidingPath.IsAttributeProblem;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #15
0
        public MobType(XElement xElement)
            : base(xElement)
        {
            try
            {
                Name  = GetAttributeAs <string>("Name", false, ConstrainAs.StringNonEmpty, null) ?? string.Empty;
                Entry = GetAttributeAsNullable <int>("Entry", false, ConstrainAs.MobId, null)
                        ?? GetAttributeAsNullable <int>("Id", false, ConstrainAs.MobId, null)
                        ?? 0;

                if (Entry == 0)
                {
                    QBCLog.Error(QBCLog.BuildMessageWithContext(Element,
                                                                "Attribute '{1}' is required, but was not provided.",
                                                                Environment.NewLine,
                                                                "Entry"));
                    IsAttributeProblem = true;
                }

                HandleAttributeProblem();
            }

            catch (Exception except)
            {
                if (Query.IsExceptionReportingNeeded(except))
                {
                    QBCLog.Exception(except, "PROFILE PROBLEM with \"{0}\"", xElement.ToString());
                }
                IsAttributeProblem = true;
            }
        }
        public EjectVeh(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                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;

                GetAttributeAsNullable <bool>("Eject", false, null, null);    // unused, but required for backward compatibility
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #17
0
        public UseItem(Dictionary <string, string> args)
            : base(args)
        {
            try
            {
                // NB: Core attributes are parsed by QuestBehaviorBase parent (e.g., QuestId, NonCompeteDistance, etc)

                ItemId        = GetAttributeAsNullable <int>("ItemId", true, ConstrainAs.ItemId, null) ?? 0;
                Location      = GetAttributeAsNullable <Vector3>("", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                NumOfTimes    = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1;
                WaitTime      = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 1500;
                TargetNearest = GetAttributeAsNullable <bool>("TargetNearest", false, null, new[] { "TargetClosest" }) ?? false;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public InstanceTimer(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                GoalText = GetAttributeAs("GoalText", false, ConstrainAs.StringNonEmpty, null) ?? "Waiting for {TimeRemaining}  of  {TimeDuration}";
                Timer    = GetAttributeAsNullable <TimerCommand>("Timer", true, null, null) ?? TimerCommand.Start;
                WaitTime = GetAttributeAsNullable("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 360000;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public Battlezone_27990(Dictionary <string, string> args)
            : base(args)
        {
            try
            {
                QuestId = 27990;
                TerminationChecksQuestProgress = false;

                MobId_Objective1_DecrepitWatcher = 47385;   // http://wowhead.com/npc=47385
                MobId_SchnottzSiegeTank          = 47732;   // http://wowhead.com/npc=47732
                MobId_SchnottzSiegeTankInstanced = 47743;   // http://wowhead.com/npc=47743
                Location_VehicleStagingArea      = new WoWPoint(-10697.07, 1106.809, 23.11283);
                Location_ReturnToSchnottz        = new WoWPoint(-10674.97, 933.8754, 26.32263);

                // Weapon allows TAU (i.e., 2*PI) horizontal rotation
                WeaponAzimuthMax     = 0.785;           // Use: /script print(VehicleAimGetAngle())
                WeaponAzimuthMin     = -0.524;          // Use: /script print(VehicleAimGetAngle())
                WeaponMuzzleVelocity = 65.0;            // (slot 1) http://wowhead.com/npc=75560
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #20
0
        public LoadProfile(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                ProfileName     = GetAttributeAs <string>("ProfileName", true, ConstrainAs.StringNonEmpty, new[] { "Profile" }) ?? "";
                RememberProfile = GetAttributeAsNullable <bool>("RememberProfile", false, null, null) ?? false;

                if (!ProfileName.ToLower().EndsWith(".xml"))
                {
                    ProfileName += ".xml";
                }
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public GoThruPortal(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // NB: Core attributes are parsed by QuestBehaviorBase parent (e.g., QuestId, NonCompeteDistance, etc)

                // Behavior-specific attributes...
                MovePoint = GetAttributeAsNullable <Vector3>("", true, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero;

                // Tunables...
                StartingPoint = GetAttributeAsNullable <Vector3>("Initial", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                MaxRetryCount = GetAttributeAsNullable <int>("MaxRetryCount", false, new ConstrainTo.Domain <int>(1, 10), null) ?? 3;
                int retryDelay        = GetAttributeAsNullable <int>("RetryDelay", false, new ConstrainTo.Domain <int>(0, 300000), null) ?? 90000;
                int zoningMaxWaitTime = GetAttributeAsNullable <int>("Timeout", false, new ConstrainTo.Domain <int>(1, 60000), null) ?? 10000;

                MovePoint            = WoWMathHelper.CalculatePointFrom(StartingPoint, MovePoint, -15.0f);
                RetryDelay           = TimeSpan.FromMilliseconds(retryDelay);
                MaxTimeToPortalEntry = TimeSpan.FromMilliseconds(zoningMaxWaitTime);
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #22
0
        public DefendObject(Dictionary <string, string> args) : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                _location = GetAttributeAsNullable("", false, ConstrainAs.Vector3NonEmpty, 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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public LoadProfileOn(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                MinLevel   = GetAttributeAsNullable("MinLevel", false, ConstrainAs.Milliseconds, null) ?? 0;
                CheckRange = GetAttributeAsNullable("CheckRange", false, ConstrainAs.Milliseconds, null) ?? 0;
                // Disabled until I can find out a safer way to to it.
                // ChkExp = GetAttributeAsNullable("ChkExp", false, ConstrainAs.Milliseconds, null) ?? 0;
                ProfileName = GetAttributeAs("ProfileName", false, ConstrainAs.StringNonEmpty, null) ?? "";
                RemotePath  = GetAttributeAs(@"RemotePath", false, ConstrainAs.StringNonEmpty, null) ?? "";
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #24
0
        public SpellType(XElement xElement)
            : base(xElement)
        {
            try
            {
                Name    = GetAttributeAs <string>("Name", false, ConstrainAs.StringNonEmpty, null) ?? string.Empty;
                SpellId = GetAttributeAsNullable <int>("SpellId", true, ConstrainAs.SpellId, null) ?? 0;

                if (string.IsNullOrEmpty(Name))
                {
                    Name = GetDefaultName(SpellId);
                }

                HandleAttributeProblem();
            }

            catch (Exception except)
            {
                if (Query.IsExceptionReportingNeeded(except))
                {
                    QBCLog.Exception(except, "PROFILE PROBLEM with \"{0}\"", xElement.ToString());
                }
                IsAttributeProblem = true;
            }
        }
예제 #25
0
        public RunLikeHell(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                QuestId = GetAttributeAsNullable <int>("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;

                AllowCombat = GetAttributeAsNullable <bool>("AllowCombat", false, null, new[] { "Combat" }) ?? true;
                MobId       = GetAttributeAsNullable <int>("MobId", false, ConstrainAs.MobId, new[] { "NpcId" }) ?? 0;
                NumOfTimes  = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1;
                Range       = GetAttributeAsNullable <double>("Range", false, ConstrainAs.Range, null) ?? 15;
                UseCTM      = GetAttributeAsNullable <bool>("UseCTM", false, null, null) ?? false;
                WaitTime    = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 0;

                _lastStateReturn = RunStatus.Success;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #26
0
        public JadeForestTakeNoPrisoners(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                VariantQuestIds = VariantQuestIds.Any() ? VariantQuestIds : new HashSet <int> {
                    29727
                };
                QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete;
                QuestRequirementInLog    = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public WaypointType(XElement xElement)
            : base(xElement)
        {
            try
            {
                DefinedLocation  = GetAttributeAsNullable <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty;
                AllowedVariance  = GetAttributeAsNullable <double>("AllowedVariance", false, new ConstrainTo.Domain <double>(0.0, 50.0), null) ?? DefaultAllowedVariance;
                ArrivalTolerance = GetAttributeAsNullable <double>("ArrivalTolerance", false, ConstrainAs.Range, null) ?? DefaultArrivalTolerance;
                Name             = GetAttributeAs <string>("Name", false, ConstrainAs.StringNonEmpty, null) ?? string.Empty;

                if (string.IsNullOrEmpty(Name))
                {
                    Name = GetDefaultName(DefinedLocation);
                }

                GenerateNewVariantLocation();

                HandleAttributeProblem();
            }

            catch (Exception except)
            {
                if (Query.IsExceptionReportingNeeded(except))
                {
                    QBCLog.Exception(except, "PROFILE PROBLEM with \"{0}\"", xElement.ToString());
                }
                IsAttributeProblem = true;
            }
        }
        public UseHearthstone(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.

                WaitOnCd = GetAttributeAsNullable <bool>("WaitForCD", false, null, null) ?? false;
                UseGarrisonHearthstone = GetAttributeAsNullable <bool>("UseGarrisonHearthstone", false, null, null) ?? false;
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
예제 #29
0
        public NoCombatMoveTo(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                QuestId = GetAttributeAsNullable <int>("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;

                Destination     = GetAttributeAsNullable <Vector3>("", true, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero;
                DestinationName = GetAttributeAs <string>("DestName", false, ConstrainAs.StringNonEmpty, null) ?? "";

                if (string.IsNullOrEmpty(DestinationName))
                {
                    DestinationName = Destination.ToString();
                }
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
        public CompleteLogQuest(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;

            try
            {
                QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), new[] { "QuestID" }) ?? 0;


                // Final initialization...
                PlayerQuest quest = StyxWoW.Me.QuestLog.GetQuestById((uint)QuestId);

                QuestName = (quest != null) ? quest.Name : string.Format("QuestId({0})", QuestId);
            }

            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.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }