Example #1
0
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }
            if (IsDone)
            {
                return(false);
            }

            if (await StartMovement.MoveTo())
            {
                return(true);
            }

            if (await Interaction())
            {
                return(true);
            }

            //if (_specialMovement != null && await _specialMovement.ClickToMove())
            //    return true;

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }
            if (IsDone)
            {
                return(false);
            }


            if (SalvagableGoods.Count == 0)
            {
                return(false);
            }

            if (await _movement.MoveTo(false))
            {
                return(true);
            }

            if (await Interaction())
            {
                return(true);
            }

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            return(false);
        }
Example #3
0
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }

            if (IsDone)
            {
                return(false);
            }

            if (await StartMovement.MoveTo())
            {
                return(true);
            }

            if (!InteractionObjectValid)
            {
                GarrisonBase.Err("Interaction Object Id {0} not valid or found!", InteractionEntryId);
                return(false);
            }

            if (GossipHelper.IsOpen)
            {
                int index = QuestHelper.GetAvailableQuestIndexFromGossipFrame(QuestID);
                if (index == -1)
                {
                    GarrisonBase.Err("Failed to find quest {0} in gossip frame!", QuestID);
                    return(false);
                }
                GossipFrame.Instance.SelectAvailableQuest(index);
                await CommonCoroutines.SleepForRandomUiInteractionTime();

                return(true);
            }

            if (await Movement())
            {
                return(true);
            }

            if (await Interaction())
            {
                return(true);
            }

            if (_specialMovement != null && await _specialMovement.ClickToMove())
            {
                return(true);
            }

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            IsDone = true;
            return(false);
        }
Example #4
0
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }
            if (IsDone)
            {
                return(false);
            }

            if (await StartMovement.MoveTo())
            {
                return(true);
            }

            if (await Movement())
            {
                return(true);
            }

            if (await Interaction())
            {
                return(true);
            }

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            return(false);
        }
Example #5
0
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }
            if (IsDone)
            {
                return(false);
            }

            if (await StartMovement.MoveTo())
            {
                return(true);
            }



            TargetManager.UpdateLootableTarget();

            if (_movement == null || _movement.CurrentMovementQueue.Count == 0)
            {
                if (_movementQueue.Count > 0)
                {
                    _movement = new Movement(_movementQueue.Dequeue(), 5f, name: "Herbing");
                }
            }

            if (ObjectCacheManager.FoundHerbObject)
            {
                if (_movementQueue.Count > 0)
                {
                    if (_movement != null)
                    {
                        if (await _movement.MoveTo())
                        {
                            return(true);
                        }
                    }

                    return(true);
                }
            }

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            BaseSettings.CurrentSettings.LastCheckedHerbString = LuaCommands.GetGameTime().ToString("yyyy-MM-ddTHH:mm:ss");
            BaseSettings.SerializeToXML(BaseSettings.CurrentSettings);
            TargetManager.ShouldLoot = false;

            return(false);
        }
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }
            if (IsDone)
            {
                return(false);
            }


            if (Building.Type == BuildingType.TradingPost && Building.WorkOrderNpcEntryId != -1)
            {
                if (!_checkedReagent)
                {
                    WorkOrder.TradePostReagentTypes workOrderReagent;
                    workOrderReagent = WorkOrder.GetTradePostNPCReagent(Building.WorkOrderNpcEntryId);
                    if (!BaseSettings.CurrentSettings.TradePostReagents.HasFlag(workOrderReagent))
                    {
                        //Does not have the current reagent set!
                        return(false);
                    }

                    var currency   = WorkOrder.GetTradePostItemAndQuanityRequired(workOrderReagent);
                    var totalCount = WorkOrder.GetTotalWorkorderStartups(currency);
                    if (totalCount <= 0)
                    {
                        //Not enough reagents.
                        return(false);
                    }

                    _checkedReagent = true;
                }
            }

            if (Building.Type == BuildingType.Barn && !Building.CheckedWorkOrderStartUp && CurrentBarnCurrceny == null)
            {
                //TODO:: Further Testing!
                //Gossip Dialog
                //0: Gossip
                //1: Gossip (Barn Level 2+ Only)
                //2: Gossip (Barn Level 3+ Only)
                //3: Fur
                //4: Fur Large
                //5: Leather
                //6: Leather Large
                //7: Meat
                //8: Meat Large

                bool found       = false;
                var  removalList = new List <int>();
                for (int i = 0; i < BarnWorkOrderCurrencies.Count; i++)
                {
                    Tuple <CraftingReagents, int>[] item = BarnWorkOrderCurrencies[i];
                    switch (item[0].Item1)
                    {
                    case CraftingReagents.CagedMightyWolf:
                    case CraftingReagents.FurryCagedBeast:
                        if (!BaseSettings.CurrentSettings.BarnWorkOrderFur)
                        {
                            removalList.Add(i);
                            continue;
                        }
                        break;

                    case CraftingReagents.CagedMightyClefthoof:
                    case CraftingReagents.LeatheryCagedBeast:
                        if (!BaseSettings.CurrentSettings.BarnWorkOrderLeather)
                        {
                            removalList.Add(i);
                            continue;
                        }
                        break;

                    case CraftingReagents.CagedMightyRiverbeast:
                    case CraftingReagents.MeatyCagedBeast:
                        if (!BaseSettings.CurrentSettings.BarnWorkOrderMeat)
                        {
                            removalList.Add(i);
                            continue;
                        }
                        break;
                    }

                    var totalCount = WorkOrder.GetTotalWorkorderStartups(item);
                    if (totalCount <= 0)
                    {
                        removalList.Add(i);
                        continue;
                    }

                    CurrentBarnCurrceny = item;
                    found = true;
                    break;
                }

                if (!found)
                {
                    Building.CheckedWorkOrderStartUp = true;
                    //if (_specialMovement != null)
                    //{
                    //    _specialMovement.UseDeqeuedPoints(true);
                    //    if (_specialMovement.CurrentMovementQueue.Count == 0)
                    //    {
                    //        return false;
                    //    }

                    //    return true;
                    //}

                    return(false);
                }


                _updateBarnGossipWorkOrderEntries();
                GarrisonBase.Debug("Staring Work Order for Barn using {0} at gossip index {1}", CurrentBarnCurrceny[0].Item1.ToString(), BarnGossipIndex);

                foreach (var i in removalList.OrderByDescending(i => i))
                {
                    BarnWorkOrderCurrencies.RemoveAt(i);
                }
            }

            if (await StartMovement.MoveTo())
            {
                return(true);
            }

            if (await Movement())
            {
                return(true);
            }

            if (await Interaction())
            {
                return(true);
            }

            //if (_specialMovement != null && await _specialMovement.ClickToMove())
            //    return true;

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            return(false);
        }
Example #7
0
        public override async Task <bool> BehaviorRoutine()
        {
            if (await base.BehaviorRoutine())
            {
                return(true);
            }
            if (IsDone)
            {
                return(false);
            }

            // ObjectCacheManager.UpdateLootableTarget();

            if (_movement == null || _movement.CurrentMovementQueue.Count == 0)
            {
                if (_movementQueue.Count > 0)
                {
                    //while (_movementQueue.Count > 0)
                    //{
                    //    if (ObjectCacheManager.GetGameObjectsNearPoint(_movementQueue.Peek(), 50f, WoWObjectTypes.OreVein).Count==0)
                    //    {
                    //        GarrisonBase.Debug("Dequeueing point from mine movement!");
                    //        _movementQueue.Dequeue();
                    //        continue;
                    //    }

                    //    break;
                    //}

                    if (_movementQueue.Count > 0)
                    {
                        _movement = new Movement(_movementQueue.Dequeue(), 5f, name: "Mining");
                        TargetManager.LootDistance += 10f;
                    }
                }
            }

            if (ObjectCacheManager.FoundOreObject)
            {
                if (_movementQueue.Count > 0)
                {
                    if (_movement != null)
                    {
                        if (await _movement.MoveTo())
                        {
                            return(true);
                        }
                    }

                    return(true);
                }
            }

            if (await EndMovement.MoveTo())
            {
                return(true);
            }

            BaseSettings.CurrentSettings.LastCheckedMineString = LuaCommands.GetGameTime().ToString("yyyy-MM-ddTHH:mm:ss");
            BaseSettings.SerializeToXML(BaseSettings.CurrentSettings);
            TargetManager.ShouldLoot = false;

            return(false);
        }