public ForceTrain(Dictionary <string, string> args) : base(args) { try { // Deprecation warnings... LogMessage("warning", "*****\n" + "* THIS BEHAVIOR IS DEPRECATED, and may be retired in a near, future release.\n" + "*\n" + "* ForceTrain adds _no_ _additonal_ _value_ over the ForceSetVendor behavior.\n" + "* Please update the profile to use ForceSetVendor in preference to this Behavior.\n" + "*****"); // 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; } 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 RunLua(Dictionary <string, string> args) : base(args) { 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. Lua = GetAttributeAs <string>("Lua", true, ConstrainAs.StringNonEmpty, null) ?? string.Empty; NumOfTimes = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1; 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; WaitTime = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 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. LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }
public Message(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. ColorLog = Color.FromKnownColor(GetAttributeAsNullable <KnownColor>("LogColor", false, null, null) ?? KnownColor.DarkGray); 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; Text = GetAttributeAs <string>("Text", true, ConstrainAs.StringNonEmpty, null) ?? ""; UpdateGoalText = GetAttributeAsNullable <bool>("UpdateGoalText", false, null, null) ?? (GetAttributeAsNullable <KnownColor>("GoalColor", false, null, null) != 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; } }
public SafeQuestTurnin(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", true, ConstrainAs.QuestId(this), null) ?? 0; QuestName = GetAttributeAs <string>("QuestName", true, ConstrainAs.StringNonEmpty, null) ?? string.Empty; QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete; QuestRequirementInLog = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog; TurnInId = GetAttributeAsNullable <int>("TurnInId", true, ConstrainAs.MobId, null) ?? 0; TurnInName = GetAttributeAs <string>("TurnInName", true, ConstrainAs.StringNonEmpty, null) ?? string.Empty; TurnInLocation = GetAttributeAsNullable <Vector3>("", true, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; } 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 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; } }
/// <summary> /// Supports walk through portals in a way that does not result /// in red error messages in WoW or in the HB log/debug files. /// /// xyz should be a position as close as possible to portal entrance /// without entering. /// /// ##Syntax## /// [Optional] QuestId: The id of the quest (0 is default) /// [Optional] QuestName: The name of the quest. /// [Optional] Timeout: time in milliseconds it allows for completing (10000 is default) /// X,Y,Z: used with current location to create a vector it moves along /// /// ##Example## /// use RunTo to get start position, then GoThruPortal to run throuhg xyz vector /// on way through portal. /// /// <RunTo X="4646.201" Y="-3685.043" Z="954.2496" /> /// <CustomBehavior File="GoThruPortal" X="4656.928" Y="-3685.472" Z="957.185" /> /// /// </summary> public GoThruPortal(Dictionary <string, string> args) : base(args) { 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. MovePoint = GetAttributeAsNullable <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty; 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; Timeout = GetAttributeAsNullable <int>("Timeout", false, new ConstrainTo.Domain <int>(1, 60000), null) ?? 10000; GetAttributeAs <string>("QuestName", false, ConstrainAs.StringNonEmpty, null); // not used - documentation purposes only Timeout += System.Environment.TickCount; MovePoint = WoWMovement.CalculatePointFrom(MovePoint, -15); ZoneText = StyxWoW.Me.ZoneText; } 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; } }
/// <summary> /// Completes the quest http://www.wowhead.com/quest=25310 /// by using the item to enter a vehicle then casting /// its attack and shield abilities as needed to defeat the target /// /// Note: you must already be within 100 yds of MobId when starting /// /// ##Syntax## /// QuestId: Id of the quest (default is 0) /// MobId: Id of the mob to kill /// [Optional] QuestName: optional quest name (documentation only) /// </summary> /// public GreaterOfTwoEvils(Dictionary <string, string> args) : base(args) { 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", true, ConstrainAs.QuestId(this), null) ?? 0; /* */ GetAttributeAs <string>("QuestName", false, ConstrainAs.StringNonEmpty, null); // (doc only - not used) MobId = GetAttributeAsNullable <int>("MobId", true, ConstrainAs.MobId, new [] { "NpcId" }) ?? 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. LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }
public TheGrandMelee(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 <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? _mountSpot; QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; _enemy = GetAttributeAsArray <uint>("Enemys", false, new ConstrainTo.Domain <uint>(0, 100000), new[] { "Enemy" }, null); _enemyDebuff = GetAttributeAsArray <uint>("EnemysDebuff", false, new ConstrainTo.Domain <uint>(0, 100000), new[] { "EnemyDebuff" }, null); 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 EquipItem(Dictionary <string, string> args) : base(args) { QBCLog.BehaviorLoggingContext = this; try { ItemId = GetAttributeAsNullable <int>("ItemId", true, ConstrainAs.ItemId, null) ?? 0; 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; Slot = GetAttributeAsNullable <InventorySlot>("Slot", false, null, null) ?? InventorySlot.None; } 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 BasicUseObject(Dictionary <string, string> args) : base(args) { try { ObjectId = GetAttributeAsNullable <int>("ObjectId", true, ConstrainAs.MobId, null) ?? 0; 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; Counter = 1; MovedToTarget = 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. LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }
public _24817(Dictionary <string, string> Args) : base(Args) { QBCLog.BehaviorLoggingContext = this; QuestId = GetAttributeAsNullable <int>("QuestId", false, ConstrainAs.QuestId(this), null) ?? 0; }
public InteractWith(Dictionary <string, string> args) : base(args) { 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. WaitForNpcs = GetAttributeAsNullable <bool>("WaitForNpcs", false, null, null) ?? true; BuyItemCount = GetAttributeAsNullable <int>("BuyItemCount", false, new ConstrainTo.Domain <int>(1, 1000), null) ?? 1; BuyItemId = GetAttributeAsNullable <int>("BuyItemId", false, ConstrainAs.ItemId, null) ?? 0; BuySlot = GetAttributeAsNullable <int>("BuySlot", false, new ConstrainTo.Domain <int>(-1, 100), null) ?? -1; CollectionDistance = GetAttributeAsNullable <int>("CollectionDistance", false, new ConstrainTo.Domain <int>(1, 10000), null) ?? 100; GossipOptions = GetAttributeAsArray <int>("GossipOptions", false, new ConstrainTo.Domain <int>(-1, 10), null, null) ?? new int[0]; Location = GetAttributeAsNullable <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty; Loot = GetAttributeAsNullable <bool>("Loot", false, null, null) ?? false; MobId = GetAttributeAsNullable <int>("MobId", true, ConstrainAs.MobId, null) ?? 0; ObjType = GetAttributeAsNullable <ObjectType>("ObjectType", false, null, null) ?? ObjectType.Npc; NotMoving = GetAttributeAsNullable <bool>("NotMoving", false, null, null) ?? false; NumOfTimes = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1; 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; Range = (int?)GetAttributeAsNullable <double>("Range", false, ConstrainAs.Range, null) ?? 4; WaitTime = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 3000; for (int i = 0; i < GossipOptions.Length; ++i) { GossipOptions[i] -= 1; } WoWUnit mob = ObjectManager.GetObjectsOfType <WoWUnit>() .Where(unit => unit.Entry == MobId) .FirstOrDefault(); MobName = ((mob != null) && !string.IsNullOrEmpty(mob.Name)) ? mob.Name : ("Mob(" + MobId + ")"); } 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. UtilLogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }
public _10838(Dictionary <string, string> args) : base(args) { try { QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; } catch { Logging.Write("Problem parsing a QuestId in behavior: 10838"); } }
public UserDialog(Dictionary <string, string> args) : base(args) { try { string[] expiryActionNames = UserDialogForm.ExpiryActionHandler.GetEnumNames().ToArray(); Dictionary <string, System.Media.SystemSound> soundsAllowed = new Dictionary <string, System.Media.SystemSound>() { { "Asterisk", System.Media.SystemSounds.Asterisk }, { "Beep", System.Media.SystemSounds.Beep }, { "Exclamation", System.Media.SystemSounds.Exclamation }, { "Hand", System.Media.SystemSounds.Hand }, { "Question", System.Media.SystemSounds.Question }, }; string tmpSoundCueName = ""; // 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. DialogText = GetAttributeAs <string>("Text", true, ConstrainAs.StringNonEmpty, null) ?? ""; DialogTitle = GetAttributeAs <string>("Title", false, ConstrainAs.StringNonEmpty, null) ?? "Attention Required..."; ExpiryActionName = GetAttributeAs <string>("ExpiryAction", false, new ConstrainTo.SpecificValues <string>(expiryActionNames), null) ?? "InputEnabled_Continue"; ExpiryTime = GetAttributeAsNullable <int>("ExpiryTime", false, new ConstrainTo.Domain <int>(1, int.MaxValue), null) ?? 0; IsBotStopAllowed = GetAttributeAsNullable <bool>("AllowBotStop", false, null, null) ?? false; IsStopOnContinue = GetAttributeAsNullable <bool>("StopOnContinue", false, null, null) ?? false; 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; tmpSoundCueName = GetAttributeAs <string>("SoundCue", false, new ConstrainTo.SpecificValues <string>(soundsAllowed.Keys.ToArray()), null) ?? "Asterisk"; SoundCue = soundsAllowed[tmpSoundCueName]; SoundCueIntervalInSeconds = GetAttributeAsNullable <int>("SoundCueInterval", false, new ConstrainTo.Domain <int>(0, int.MaxValue), null) ?? 60; // Note: we don't want to actually create the dialog here, as that will cause it // to popup even if the quest is complete. This action is properly deferred until // OnStart(), which handles IsDone processing. } 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 UseItemOn(Dictionary <string, string> args) : base(args) { try { int tmpMobHasAuraId; int tmpMobHasAuraMissingId; // 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. CollectionDistance = GetAttributeAsNullable <double>("CollectionDistance", false, ConstrainAs.Range, null) ?? 100.0; tmpMobHasAuraId = GetAttributeAsNullable <int>("HasAuraId", false, ConstrainAs.AuraId, new [] { "HasAura" }) ?? 0; tmpMobHasAuraMissingId = GetAttributeAsNullable <int>("IsMissingAuraId", false, ConstrainAs.AuraId, null) ?? 0; MobHpPercentLeft = GetAttributeAsNullable <double>("MobHpPercentLeft", false, ConstrainAs.Percent, new [] { "HpLeftAmount" }) ?? 100.0; ItemId = GetAttributeAsNullable <int>("ItemId", true, ConstrainAs.ItemId, null) ?? 0; Location = GetAttributeAsNullable <WoWPoint>("", false, ConstrainAs.WoWPointNonEmpty, null) ?? Me.Location; MobIds = GetNumberedAttributesAsArray <int>("MobId", 1, ConstrainAs.MobId, new [] { "NpcId" }); MobType = GetAttributeAsNullable <ObjectType>("MobType", false, null, new [] { "ObjectType" }) ?? ObjectType.Npc; NumOfTimes = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1; NpcState = GetAttributeAsNullable <NpcStateType>("MobState", false, null, new [] { "NpcState" }) ?? NpcStateType.DontCare; WaitForNpcs = GetAttributeAsNullable <bool>("WaitForNpcs", false, null, null) ?? false; Range = GetAttributeAsNullable <double>("Range", false, ConstrainAs.Range, null) ?? 4; 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; WaitTime = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 1500; MobAuraName = (tmpMobHasAuraId != 0) ? AuraNameFromId("HasAuraId", tmpMobHasAuraId) : null; MobAuraMissingName = (tmpMobHasAuraMissingId != 0) ? AuraNameFromId("HasAuraId", tmpMobHasAuraMissingId) : 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. LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }
public TalkToAndListenToStory(Dictionary <string, string> args) : base(args) { try { int[] tmpMobIds; LogMessage("warning", "*****\n" + "* THIS BEHAVIOR IS DEPRECATED, and may be retired in a near, future release.\n" + "*\n" + "* TalkToAndListenToStory adds _no_ _additonal_ _value_ over the InteractWith behavior (with the \"GossipOption\" attribute).\n" + "* Please update the profile to use InteractWith in preference to the TalkToAndListenToStory behavior.\n" + "*****"); // 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. tmpMobIds = GetAttributeAsArray <int>("MobIds", true, ConstrainAs.MobId, new[] { "NpcIds" }, null); QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete; QuestRequirementInLog = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog; foreach (int mobId in tmpMobIds) { _npcResults.Enqueue(NpcQueries.GetNpcById((uint)mobId)); } } 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 VehicleBehavior(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; AttackButton = GetAttributeAsNullable("AttackButton", true, ConstrainAs.HotbarButton, new[] { "SpellIndex" }) ?? 0; FirePoint = GetAttributeAsNullable("FireLocation", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; FireHeight = GetAttributeAsNullable("FireHeight", false, new ConstrainTo.Domain <int>(1, 999), null) ?? 1; FireUntilFinished = GetAttributeAsNullable <bool>("FireUntilFinished", false, null, new[] { "FireTillFinish" }) ?? false; PreviousLocation = GetAttributeAsNullable("PreviousFireLocation", false, ConstrainAs.Vector3NonEmpty, null); TargetPoint = GetAttributeAsNullable("TargetLocation", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; VehicleId = GetAttributeAsNullable("VehicleId", true, ConstrainAs.VehicleId, new[] { "VehicleID" }) ?? 0; VehicleMountId = GetAttributeAsNullable("VehicleMountId", true, ConstrainAs.VehicleId, new[] { "NpcMountId", "NpcMountID" }) ?? 0; StartObjectivePoint = GetAttributeAsNullable("StartObjectivePoint", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; NPCIds = GetNumberedAttributesAsArray("MobId", 0, ConstrainAs.MobId, new[] { "NpcID" }); EndPoint = GetAttributeAsNullable("EndPoint", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; StartPoint = GetAttributeAsNullable("StartPoint", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; VehicleType = GetAttributeAsNullable("VehicleType", false, new ConstrainTo.Domain <int>(0, 4), null) ?? 0; Counter = 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; } }
public UsePetAbility(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; AttackButton = GetAttributeAsNullable <int>("AttackButton", true, ConstrainAs.HotbarButton, new[] { "AttackIndex", "SpellIndex" }) ?? 0; ClickToLocation = GetAttributeAsNullable <Vector3>("ClickTo", false, ConstrainAs.Vector3NonEmpty, null) ?? Vector3.Zero; CollectionDistance = GetAttributeAsNullable <double>("CollectionDistance", false, ConstrainAs.Range, null) ?? 100; IgnoreCombat = GetAttributeAsNullable <bool>("IgnoreCombat", false, null, null) ?? false; MinRange = GetAttributeAsNullable <double>("MinRange", false, ConstrainAs.Range, null) ?? 4.0; MobHpPercentLeft = GetAttributeAsNullable <double>("MobHpPercentLeft", false, ConstrainAs.Percent, new[] { "HpLeftAmount" }) ?? 100.0; MobIds = GetNumberedAttributesAsArray <int>("MobId", 0, ConstrainAs.MobId, new[] { "ObjectId" }); MoveToLocation = GetAttributeAsNullable <Vector3>("", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location; NpcState = GetAttributeAsNullable <NpcStateType>("MobState", false, null, new[] { "NpcState" }) ?? NpcStateType.DontCare; NumOfTimes = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, null) ?? 1; Range = GetAttributeAsNullable <double>("Range", false, ConstrainAs.Range, null) ?? 20.0; UseType = GetAttributeAsNullable <QBType>("UseType", false, null, null) ?? QBType.Current; WaitTime = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 0; Counter = 1; } 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 _10838(Dictionary <string, string> args) : base(args) { QBCLog.BehaviorLoggingContext = this; try { QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 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; } }
protected QuestBehaviorBase(Dictionary <string, string> args) : base(args) { BehaviorLoggingContext = this; try { // Quest handling... // 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; QuestObjectiveIndex = GetAttributeAsNullable <int>("QuestObjectiveIndex", false, new ConstrainTo.Domain <int>(1, 5), null) ?? 0; // Tunables... CombatMaxEngagementDistance = GetAttributeAsNullable <double>("CombatMaxEngagementDistance", false, new ConstrainTo.Domain <double>(1.0, 40.0), null) ?? 23.0; IgnoreMobsInBlackspots = GetAttributeAsNullable <bool>("IgnoreMobsInBlackspots", false, null, null) ?? true; MaxDismountHeight = GetAttributeAsNullable <double>("MaxDismountHeight", false, new ConstrainTo.Domain <double>(1.0, 75.0), null) ?? 8.0; MovementBy = GetAttributeAsNullable <MovementByType>("MovementBy", false, null, null) ?? MovementByType.FlightorPreferred; NonCompeteDistance = GetAttributeAsNullable <double>("NonCompeteDistance", false, new ConstrainTo.Domain <double>(0.0, 50.0), null) ?? 20.0; } catch (Exception except) { if (IsExceptionReportingNeeded(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. LogError("[MAINTENANCE PROBLEM]: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); } IsAttributeProblem = true; } }
public BaronGeddon(Dictionary <string, string> args) : base(args) { 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. AuraId = GetAttributeAsNullable <int>("AuraId", false, ConstrainAs.AuraId, null) ?? 74813; // should be 74813 - Inferno - http://www.wowhead.com/spell=74813 CollectionDistance = GetAttributeAsNullable <double>("CollectionDistance", false, ConstrainAs.Range, null) ?? 100.0; // dist from point to search for mob ItemId = GetAttributeAsNullable <int>("ItemId", false, ConstrainAs.ItemId, null) ?? 54463; // should be 54463 - Flameseer's Staff Location = GetAttributeAsNullable <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty; // point to start at/run to when mob has AuraId // ...also used as center point for mob search area MobId = GetAttributeAsNullable <int>("MobId", false, ConstrainAs.MobId, null) ?? 40147; // should be 40147 - Baron Geddon QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; // should be 25464 for http://www.wowhead.com/quest=25464 /* */ GetAttributeAs <string>("QuestName", false, ConstrainAs.StringNonEmpty, null); // (doc only - not used) QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete; QuestRequirementInLog = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog; Range = GetAttributeAsNullable("Range", false, ConstrainAs.Range, null) ?? 18; // should be 18 or less (see http://www.wowhead.com/spell=75192) // note: wowhead says 10, but actual testing shows 18+ which decreases damage taken _bombWait = new Stopwatch(); _castTime = new Stopwatch(); _isBehaviorDone = IsQuestComplete(); } 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 AbandonQuest(Dictionary <string, string> args) : base(args) { try { QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; Type = GetAttributeAsNullable <AbandonType>("Type", false, null, null) ?? AbandonType.Incomplete; } 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 SpellLocation(Dictionary <string, string> args) : base(args) { 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 <WoWPoint>("", false, ConstrainAs.WoWPointNonEmpty, null) ?? Me.Location; 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; Counter = 1; } catch (Exception except) { } }
/// <summary> /// For Vehicles you do not have to move, such as Cannons, Horses, Bombings, and even ground targeting cannons. /// ##Syntax## /// QuestId: Id of the quest. /// NpcMountID: MobId of the vehicle before it is mounted. /// VehicleId: Between 0 - 99 The lower the number the closer to the ground it will be /// TargetId, TargetId2, ...TargetIdN: Mob of the actual Vehicle, sometimes it will be the some but sometimes it will not be. /// SpellIndex: Button bar Number starting from 1 /// OftenToUse: This is used for a few quests that the mob is flying but respawns fast, So the bot can fire in the same spot over and over. /// TimesToUse: Where you want to be at when you fire. /// TypeId: Where you want to aim. /// PreviousFireLocation Coords: This should only be used if you are already inside of the vehicle when you call the behaviors again, and /// should be the same coords as FireLocation on the call before it, Check the Wiki for more info or examples. /// </summary> /// public NoControlVehicle(Dictionary <string, string> args) : base(args) { 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. AttackButton = GetAttributeAsNullable <int>("AttackButton", true, ConstrainAs.HotbarButton, new[] { "AttackIndex", "SpellIndex" }) ?? 0; AttackButton2 = GetAttributeAsNullable <int>("AttackButtonSecondary", false, ConstrainAs.HotbarButton, new[] { "AttackIndexSecondary", "SpellIndexSecondary" }) ?? 0; GoHomeButton = GetAttributeAsNullable <int>("GoHomeButton", false, ConstrainAs.HotbarButton, new[] { "HomeIndex" }) ?? 0; MaxRange = GetAttributeAsNullable <double>("MaxRange", false, ConstrainAs.Range, null) ?? 1; MountedPoint = WoWPoint.Empty; NumOfTimes = GetAttributeAsNullable <int>("NumOfTimes", false, ConstrainAs.RepeatCount, new[] { "TimesToUse" }) ?? 1; OftenToUse = GetAttributeAsNullable <int>("OftenToUse", false, ConstrainAs.Milliseconds, null) ?? 1000; QuestId = GetAttributeAsNullable <int>("QuestId", false, ConstrainAs.QuestId(this), null) ?? 0; SpellType = GetAttributeAsNullable <int>("TypeId", false, new ConstrainTo.Domain <int>(0, 5), null) ?? 2; TargetIds = GetNumberedAttributesAsArray <int>("TargetId", 1, ConstrainAs.MobId, new[] { "MobId", "NpcId" }); TargetIdsSecondary = GetNumberedAttributesAsArray <int>("TargetIdSecondary", 0, ConstrainAs.MobId, new[] { "MobIdSecondary", "NpcIdSecondary" }); VehicleId = GetAttributeAsNullable <int>("VehicleId", false, ConstrainAs.VehicleId, null) ?? 0; VehicleMountId = GetAttributeAsNullable <int>("VehicleMountId", false, ConstrainAs.VehicleId, new[] { "NpcMountId", "NpcMountID" }) ?? 1; WaitTime = GetAttributeAsNullable <int>("WaitTime", false, ConstrainAs.Milliseconds, null) ?? 0; Counter = 1; } 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 CannonControl(Dictionary <string, string> args) : base(args) { 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. Buttons = GetAttributeAsArray <int>("Buttons", true, new ConstrainTo.Domain <int>(-1, 12), null, null); ExitButton = GetAttributeAsNullable <int>("ExitButton", true, ConstrainAs.HotbarButton, null) ?? 0; MaxAngle = GetAttributeAsNullable <double>("MaxAngle", true, new ConstrainTo.Domain <double>(0.0, 1.5), null) ?? 0; MinAngle = GetAttributeAsNullable <double>("MinAngle", true, new ConstrainTo.Domain <double>(0.0, 1.5), null) ?? 0; QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete; QuestRequirementInLog = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog; VehicleId = GetAttributeAsNullable <int>("VehicleId", true, ConstrainAs.VehicleId, null) ?? 0; ExitButton += 120; for (int i = 0; i < Buttons.Length; ++i) { Buttons[i] += 120; } } 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 UseTaxi(Dictionary <string, string> args) : base(args) { /// UseTaxi by Vlad /// Accepted arguments: /// /// MobId: (Required) - Id of the Flight Master to use /// QuestId: (Optional) - associates a quest with this behavior. /// If the quest is complete or not in the quest log, this will not be executed. /// DestName: (Required if ViewNodesOnly is not specified) - specifies the destination NAME of the node on the TaxiMap. /// This should be a name string in the list of your TaxiMap node names. The argument is CASE SENSITIVE! /// ViewNodesOnly: (Optional) true/false - Use this option only to print the list of destinations of your TaxiMap, /// if you don't know exact names of locations. The list will be printed ingame. Default is false /// X, Y, Z: (Required) - Location of Flight Master Npc /// MobId = GetAttributeAsNullable <int>("MobId", true, ConstrainAs.MobId, new[] { "NpcId", "NpcID" }) ?? 0; QuestId = (uint?)GetAttributeAsNullable <int>("QuestId", false, ConstrainAs.QuestId(this), null) ?? 0; DestName = GetAttributeAs <string>("DestName", false, null, new[] { "NodeName" }) ?? ""; ViewNodesOnly = GetAttributeAsNullable <bool>("ViewNodesOnly", false, null, null) ?? false; Location = GetAttributeAsNullable <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty; Counter = 0; }
public BasicInteractWith(Dictionary <string, string> args) : base(args) { try { FactionId = GetAttributeAsNullable <int>("FactionId", false, ConstrainAs.FactionId, new[] { "Faction" }) ?? 0; IsMoveToMob = GetAttributeAsNullable <bool>("MoveTo", false, null, new[] { "UseCTM" }) ?? false;; MobId = GetAttributeAsNullable <int>("MobId", true, ConstrainAs.MobId, new[] { "NpcId", "NpcID" }) ?? 0; 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; UseLuaTarget = GetAttributeAsNullable <bool>("UseLuaTarget", false, null, new[] { "LUATarget" }) ?? false; WoWUnit mob = ObjectManager.GetObjectsOfType <WoWUnit>() .Where(unit => unit.Entry == MobId) .FirstOrDefault(); MobName = ((mob != null) && !string.IsNullOrEmpty(mob.Name)) ? mob.Name : ("Mob(" + MobId + ")"); } 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 FlyingVehicle(Dictionary <string, string> args) : base(args) { 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. Buttons = GetAttributeAsArray <int>("Buttons", false, ConstrainAs.HotbarButton, null, null); DropPassengerButton = GetAttributeAsNullable <int>("DropPassengerButton", false, ConstrainAs.HotbarButton, null) ?? 0; EndPath = GetAttributeAsArray <WoWPoint>("EndPath", true, ConstrainAs.WoWPointNonEmpty, null, null); HealButton = GetAttributeAsNullable <int>("HealButton", false, ConstrainAs.HotbarButton, null) ?? 0; HealPercent = GetAttributeAsNullable <double>("HealPercent", false, ConstrainAs.Percent, null) ?? 35.0; ItemId = GetAttributeAsNullable <int>("ItemId", false, ConstrainAs.ItemId, null) ?? 0; NpcList = GetAttributeAsArray <int>("NpcList", true, ConstrainAs.MobId, null, null); NpcScanRange = GetAttributeAsNullable <double>("NpcScanRange", false, ConstrainAs.Range, null) ?? 10000.0; Path = GetAttributeAsArray <WoWPoint>("Path", true, ConstrainAs.WoWPointNonEmpty, null, null); PickUpPassengerButton = GetAttributeAsNullable <int>("PickUpPassengerButton", false, ConstrainAs.HotbarButton, null) ?? 0; Precision = GetAttributeAsNullable <double>("Precision", false, new ConstrainTo.Domain <double>(2.0, 100.0), null) ?? 4.0; QuestId = GetAttributeAsNullable <int>("QuestId", true, ConstrainAs.QuestId(this), null) ?? 0; QuestRequirementComplete = GetAttributeAsNullable <QuestCompleteRequirement>("QuestCompleteRequirement", false, null, null) ?? QuestCompleteRequirement.NotComplete; QuestRequirementInLog = GetAttributeAsNullable <QuestInLogRequirement>("QuestInLogRequirement", false, null, null) ?? QuestInLogRequirement.InLog; SpeedButton = GetAttributeAsNullable <int>("SpeedButton", false, ConstrainAs.HotbarButton, null) ?? 0; StartPath = GetAttributeAsArray <WoWPoint>("StartPath", true, ConstrainAs.WoWPointNonEmpty, null, null); VehicleId = GetAttributeAsNullable <int>("VehicleId", true, ConstrainAs.VehicleId, null) ?? 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. LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }
public FollowNpcUntil(Dictionary <string, string> args) : base(args) { try { LogMessage("warning", "*****\n" + "* THIS BEHAVIOR IS DEPRECATED, and may be retired in a near, future release.\n" + "*\n" + "* Escort is the replacement behavior for FollowNpcUntil.\n" + "* Please update the profile to use Escort in preference to this behavior.\n" + "*****"); // 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 <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty; MovedToTarget = false; MobId = GetAttributeAsNullable <int>("MobId", true, ConstrainAs.MobId, new [] { "NpcId" }) ?? 0; MobName = GetAttributeAs <string>("MobName", false, ConstrainAs.StringNonEmpty, null) ?? string.Empty; 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; if (string.IsNullOrEmpty(MobName)) { WoWUnit mob = ObjectManager.GetObjectsOfType <WoWUnit>() .Where(unit => unit.Entry == MobId) .FirstOrDefault(); MobName = !string.IsNullOrEmpty(mob.Name) ? mob.Name : ("Mob(" + MobId + ")"); } } 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 FindAndBeatNpcs(Dictionary <string, string> args) : base(args) { 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. HealthPercent = GetAttributeAsNullable <double>("HealthPercent", false, ConstrainAs.Percent, null) ?? 25; Location = GetAttributeAsNullable <WoWPoint>("", true, ConstrainAs.WoWPointNonEmpty, null) ?? WoWPoint.Empty; MobIds = GetNumberedAttributesAsArray <int>("MobId", 1, ConstrainAs.MobId, null); 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. LogMessage("error", "BEHAVIOR MAINTENANCE PROBLEM: " + except.Message + "\nFROM HERE:\n" + except.StackTrace + "\n"); IsAttributeProblem = true; } }