Пример #1
0
        internal bool Prepare(string parProfilePath, Action parCallback)
        {
            if (!ObjectManager.EnumObjects() || !API.BMain.IsInGame)
            {
                return(false);
            }

            if (!string.IsNullOrEmpty(parProfilePath))
            {
                Profile = new GrindProfile(parProfilePath);
            }
            else
            {
                Profile = new GrindProfile();
            }


            if (!CCManager.ChooseCustomClassByWowClass((byte)ObjectManager.Player.Class))
            {
                Helpers.Logger.Append($"Couldnt find a usable Custom Class for the { ObjectManager.Player.Class } class! Aborting..");
                return(false);
            }

            StuckHelper = new _StuckHelper();
            Info        = new SessionContainer();
            if (Profile.ProfileValid)
            {
                Info.Waypoints.LoadFirstWaypointsAsync(parCallback);
            }

            var tmpStates = new List <State>
            {
                new StateFishing(700),
                new StateMountUp(699),
                new stateWaitForMembers(600),
                new StateFollowLeader(450),
                new StateIdle(int.MinValue),
                new StateWalkToGather(460),
                new StateFight(850),
                new StateRest(800),
                new StateBuff(750),
                new StateReleaseSpirit(950),
                new StateGhostWalk(900),
                new StateWalkBackToGrind(550),
                new StateAfterFightToPath(330),
                new StateWaitAfterFight(650),
                new StateDoRandomShit(190)
            };

            if (Profile.Factions != null)
            {
                tmpStates.Add(new StateFindTarget(200));
                tmpStates.Add(new StateApproachTarget(340));
            }

            if (Profile.Hotspots != null)
            {
                tmpStates.Add(new StateLoadNextHotspot(150));
                tmpStates.Add(new StateLoadNextWaypoint(140));
                tmpStates.Add(new StateWalk(100));
            }

            if (Settings.Settings.LootUnits)
            {
                tmpStates.Add(new StateLoot(500));
            }

            if (Profile.RepairNPC != null)
            {
                tmpStates.Add(new StateWalkToRepair(410));
                tmpStates.Add(new StateRepair(400));
            }

            if (Settings.Settings.BreakFor != 0 && Settings.Settings.ForceBreakAfter != 0)
            {
                Info.BreakHelper.SetBreakAt(60000);
                tmpStates.Add(new StateStartBreak(1500));
            }

            tmpStates.Sort();

            Engine = new _Engine(tmpStates);

            return(true);
        }
Пример #2
0
        internal bool Prepare(string parProfilePath, Action parCallback)
        {
            if (!ObjectManager.EnumObjects())
            {
                return(false);
            }
            Profile = new GrindProfile(parProfilePath);
            if (!Profile.ProfileValid)
            {
                return(false);
            }

            if (!CCManager.ChooseCustomClassByWowClass((byte)ObjectManager.Player.Class))
            {
                MessageBox.Show("Couldnt find a Custom Class we can use");
                return(false);
            }

            StuckHelper = new _StuckHelper();
            Info        = new _Info();
            Info.Waypoints.LoadFirstWaypointsAsync(parCallback);

            var tmpStates = new List <State>
            {
                new StateIdle(),
                new StateLoadNextHotspot(),
                new StateLoadNextWaypoint(),
                new StateWalk(),
                new StateFindTarget(),
                new StateApproachTarget(),
                new StateFight(),
                new StateRest(),
                new StateBuff()
            };

            if (Options.LootUnits)
            {
                tmpStates.Add(new StateLoot());
            }
            tmpStates.Add(new StateReleaseSpirit());
            tmpStates.Add(new StateGhostWalk());
            tmpStates.Add(new StateWalkToRepair());
            tmpStates.Add(new StateWalkBackToGrind());
            tmpStates.Add(new StateAfterFightToPath());
            tmpStates.Add(new StateWaitAfterFight());
            tmpStates.Add(new StateDoRandomShit());

            if (Options.BreakFor != 0 && Options.ForceBreakAfter != 0)
            {
                Info.BreakHelper.SetBreakAt(60000);
                tmpStates.Add(new StateStartBreak());
            }

            if (Profile.RepairNPC != null)
            {
                tmpStates.Add(new StateRepair());
            }
            tmpStates.Sort();

            Engine = new _Engine(tmpStates);
            return(true);
        }