internal static Behavior[] GetGarrisonBehaviors() { var retBehaviorList = new List <Behavior> { new BehaviorGetMail(), new BehaviorMissionComplete(), new BehaviorCache() }; //Finalize Plots foreach (var b in Buildings.Values.Where(b => b.CanActivate)) { retBehaviorList.Add(new BehaviorFinalizePlots(b)); } #region Building First Quest Behaviors foreach (var b in Buildings.Values.Where(b => !b.FirstQuestCompleted && !b.IsBuilding && b.FirstQuestNpcId > -1 && b.FirstQuestId > -1)) { retBehaviorList.Add(QuestHelper.GetGarrisonBuildingFirstQuestArray(b, Player.IsAlliance)); } #endregion #region Herbing and Mining if (Buildings.Values.Any(b => b.Type == BuildingType.Mines)) { var miningMoveTo = new BehaviorMove(MovementCache.MinePlot59SafePoint); miningMoveTo.Criteria += () => !GarrisonMineZoneIds.Contains(Player.ZoneId.Value); var miningArray = new BehaviorArray(new Behavior[] { new BehaviorCustomAction(() => { TargetManager.LootType = TargetManager.LootFlags.Units | TargetManager.LootFlags.Ore; }), miningMoveTo, new BehaviorMine() }); miningArray.Criteria += () => (!Buildings[BuildingType.Mines].IsBuilding && !Buildings[BuildingType.Mines].CanActivate && Buildings[BuildingType.Mines].FirstQuestCompleted && LuaCommands.CheckForDailyReset(BaseSettings.CurrentSettings.LastCheckedMine) && BaseSettings.CurrentSettings.BehaviorMineGather); miningArray.DisposalAction = () => { TargetManager.LootType = TargetManager.LootFlags.None; }; retBehaviorList.Add(miningArray); retBehaviorList.Add(new BehaviorWorkOrderPickUp(Buildings[BuildingType.Mines])); retBehaviorList.Add(new BehaviorWorkOrderStartUp(Buildings[BuildingType.Mines])); } if (Buildings.Values.Any(b => b.Type == BuildingType.HerbGarden)) { var herbingArray = new BehaviorArray(new Behavior[] { new BehaviorCustomAction(() => { TargetManager.LootType = TargetManager.LootFlags.Units | TargetManager.LootFlags.Herbs; }), new BehaviorMove(MovementCache.GardenPlot63SafePoint), new BehaviorHerb() }); herbingArray.Criteria += () => (!Buildings[BuildingType.HerbGarden].IsBuilding && !Buildings[BuildingType.HerbGarden].CanActivate && Buildings[BuildingType.HerbGarden].FirstQuestCompleted && LuaCommands.CheckForDailyReset(BaseSettings.CurrentSettings.LastCheckedHerb) && BaseSettings.CurrentSettings.BehaviorHerbGather); herbingArray.DisposalAction = () => { TargetManager.LootType = TargetManager.LootFlags.None; }; retBehaviorList.Add(herbingArray); retBehaviorList.Add(new BehaviorWorkOrderPickUp(Buildings[BuildingType.HerbGarden])); retBehaviorList.Add(new BehaviorWorkOrderStartUp(Buildings[BuildingType.HerbGarden])); } #endregion #region Professions foreach (var profession in Player.Professions.ProfessionSkills.Values.Where(p => p.DailyCooldownSpellIds != null)) { if (profession.Skill == SkillLine.Inscription) { retBehaviorList.Add(new BehaviorMilling()); } int[] spellIds = profession.DailyCooldownSpellIds; retBehaviorList.Add(new BehaviorCraftingProfession(profession.Skill, spellIds[1])); retBehaviorList.Add(new BehaviorCraftingProfession(profession.Skill, spellIds[0])); } #endregion #region Salvaging if (Buildings.Values.Any(b => b.Type == BuildingType.SalvageYard)) { retBehaviorList.Add(new BehaviorSalvage()); } #endregion #region Work Order Pickup && Startup foreach (var b in Buildings.Values.Where(b => b.FirstQuestId <= 0 || b.FirstQuestCompleted).OrderBy(b => b.Plot)) { if (b.Type != BuildingType.Mines || b.Type != BuildingType.HerbGarden) { if (b.WorkOrder != null) { retBehaviorList.Add(new BehaviorWorkOrderPickUp(b)); if (b.Type == BuildingType.EnchantersStudy) { retBehaviorList.Add(new BehaviorDisenchant()); //Disenchanting! } else if (b.Type == BuildingType.ScribesQuarters) { retBehaviorList.Add(new BehaviorMilling()); //Milling! } else if (b.Type == BuildingType.Barn) { if (Player.Inventory.Trap != null) { GarrisonBase.Log("Adding Trapping Behavior"); if (Player.Inventory.Trap.TrapRank > 1) { retBehaviorList.Add(BehaviorManager.BehaviorArray_Trapping_Elites_Nagrand.Clone()); } if (Player.IsAlliance) { retBehaviorList.Add(BehaviorManager.BehaviorArray_Trapping_Leather_ShadowmoonVally.Clone()); retBehaviorList.Add(BehaviorManager.BehaviorArray_Trapping_Fur_ShadowmoonValley.Clone()); } else { retBehaviorList.Add(BehaviorManager.BehaviorArray_Trapping_Leather_FrostfireRidge.Clone()); retBehaviorList.Add(BehaviorManager.BehaviorArray_Trapping_Fur_Nagrand_Horde.Clone()); } retBehaviorList.Add(BehaviorManager.BehaviorArray_Trapping_Boars_Gorgond.Clone()); } } retBehaviorList.Add(new BehaviorWorkOrderStartUp(b)); if (b.Type == BuildingType.WarMillDwarvenBunker && b.Level == 3) { var questid = Player.IsAlliance ? 38175 : 38188; retBehaviorList.Add(QuestHelper.GetDailyQuestArray(Convert.ToUInt32(questid), Player.IsAlliance)); } else if (b.Type == BuildingType.AlchemyLab && b.HasFollowerWorking) { retBehaviorList.Add(QuestHelper.GetDailyQuestArray(Convert.ToUInt32(37270), Player.IsAlliance)); } } } } #endregion //Primal Spirit Exchange retBehaviorList.Add(new BehaviorPrimalTrader()); var forceBagCheck = new BehaviorCustomAction(() => { Common.ForceBagCheck = true; }); retBehaviorList.Add(forceBagCheck); //Finally, start some new missions! retBehaviorList.Add(new BehaviorMissionStartup()); //Optional follower behaviors (to unlock) retBehaviorList.Add(BehaviorArrayFollowers.Clone()); return(retBehaviorList.ToArray()); }
internal static BehaviorArray GetGarrisonBuildingFirstQuestArray(Building b, bool alliance) { if (b.Type == BuildingType.SalvageYard) { //var abandon = new Behaviors.BehaviorQuestAbandon(b.FirstQuestID); var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.SafeMovementPoint, b.WorkOrderNpcEntryId); var itemInteraction = new BehaviorItemInteraction(118473); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.SafeMovementPoint, b.WorkOrderNpcEntryId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, itemInteraction, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } else if (b.Type == BuildingType.TradingPost) { var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.SafeMovementPoint, b.WorkOrderNpcEntryId); var moveLoc = Player.IsAlliance ? new WoWPoint(1764.08, 150.39, 76.02) : new WoWPoint(5745.101, 4570.491, 138.8332); var moveto = new BehaviorMove(moveLoc, 7f); var npcId = Player.IsAlliance ? 87288 : 87260; var target = new BehaviorSelectTarget(moveLoc); var interact = new BehaviorItemInteraction(118418, true); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.SafeMovementPoint, b.WorkOrderNpcEntryId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, moveto, target, interact, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } else if (b.Type == BuildingType.Storehouse) { var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); List <WoWPoint> _hotSpots = new List <WoWPoint> { MovementCache.GarrisonEntrance, MovementCache.GardenPlot63SafePoint, MovementCache.MinePlot59SafePoint, MovementCache.MediumPlot22SafePoint, MovementCache.LargePlot23SafePoint, MovementCache.LargePlot24SafePoint, MovementCache.MediumPlot25SafePoint, MovementCache.SmallPlot18SafePoint, MovementCache.SmallPlot19SafePoint, MovementCache.SmallPlot20SafePoint, }; var looting = new BehaviorHotspotRunning(_hotSpots.ToArray(), BehaviorHotspotRunning.HotSpotType.Looting, () => BehaviorManager.HasQuestAndNotCompleted(b.FirstQuestId)); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, looting, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } else if (b.Type == BuildingType.Lumbermill) { var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); WoWPoint movementPoint; if (Player.IsAlliance) { movementPoint = new WoWPoint(1555.087, 173.8229, 72.59766); } else { movementPoint = new WoWPoint(6082.979, 4795.821, 149.1655); } var looting = new BehaviorHotspotRunning(new[] { movementPoint }, new uint[] { 234021, 233922 }, BehaviorHotspotRunning.HotSpotType.Looting, () => BehaviorManager.HasQuestAndNotCompleted(b.FirstQuestId)); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, looting, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } else if (b.Type == BuildingType.Mines) { var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); var looting = new BehaviorHotspotRunning(Player.IsAlliance ? MovementCache.Alliance_Mine_LevelOne.ToArray() : MovementCache.Horde_Mine_LevelOne.ToArray(), MineQuestMobIDs.ToArray(), BehaviorHotspotRunning.HotSpotType.Killing, () => BehaviorManager.HasQuestAndNotCompleted(b.FirstQuestId)); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, looting, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } else if (b.Type == BuildingType.HerbGarden) { var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); var looting = new BehaviorHotspotRunning(Player.IsAlliance ? MovementCache.Alliance_Herb_LevelOne.ToArray() : MovementCache.Horde_Herb_LevelOne.ToArray(), HerbQuestMobIDs.ToArray(), BehaviorHotspotRunning.HotSpotType.Killing, () => BehaviorManager.HasQuestAndNotCompleted(b.FirstQuestId)); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.EntranceMovementPoint, b.FirstQuestNpcId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, looting, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } else { var pickup = new BehaviorQuestPickup(b.FirstQuestId, b.SafeMovementPoint, b.FirstQuestNpcId); var workorder = new BehaviorQuestWorkOrder(b); var workorderPickup = new BehaviorQuestWorkOrderPickup(b); var turnin = new BehaviorQuestTurnin(b.FirstQuestId, b.SafeMovementPoint, b.WorkOrderNpcEntryId); var behaviorArray = new BehaviorArray(new Behavior[] { pickup, workorder, workorderPickup, turnin }); behaviorArray.Criteria += () => BaseSettings.CurrentSettings.BehaviorQuests; return(behaviorArray); } }