Ejemplo n.º 1
0
        public override void Run()
        {
            if (MasterContainer.engageGuid != ObjectManager.TargetObject.guid)
            {
                blacklistCount             = 0;
                MasterContainer.engageGuid = ObjectManager.TargetObject.guid;
                BlacklistTimer.Reset();
            }
            if (BlacklistTimer.IsReady())
            {
                blacklistCount = blacklistCount + 1;
                if (blacklistCount == 1)
                {
                    MasterContainer.IsStuck = true;
                }
            }
            if (blacklistCount >= 2)
            {
                MasterContainer.blacklistGuid.Add(ObjectManager.TargetObject.guid);
                blacklistCount = 0;
                BlacklistTimer.Reset();
                Calls.SetTarget(0);
            }

            MasterFightMovement.Handle();
            SpellManager.CheckSpells();
            CCManager.FightPulse();
            Ingame.CastFinal();
            MasterContainer.AfterFight = true;
        }
Ejemplo n.º 2
0
        public override void Run()
        {
            if (curHealthPercent == (int)ObjectManager.TargetObject.healthPercent)
            {
                if (BlackListTimer.IsReady())
                {
                    BlackListCounter = BlackListCounter + 1;
                    if (BlackListCounter == 2)
                    {
                        GrindbotContainer.blacklistGuid.Add(ObjectManager.TargetObject.guid);
                        BlackListCounter = 0;
                        BlackListTimer.Reset();
                        Calls.SetTarget(0);
                    }
                    else
                    {
                        GrindbotContainer.IsStuck = true;
                    }
                }
            }
            else
            {
                curHealthPercent = (int)ObjectManager.TargetObject.healthPercent;
                BlackListTimer.Reset();
                BlackListCounter = 0;
            }

            if (ObjectManager.TargetObject.healthPercent == 100)
            {
                int curHealth = (int)ObjectManager.TargetObject.healthPercent;
            }

            GrindbotFightMovement.Handle();
            if (ObjectManager.IsTargetOnMe())
            {
                SpellManager.CheckSpells();
                CCManager.FightPulse();
                Ingame.CastFinal();
                GrindbotContainer.AfterFight = true;
            }
            else
            {
                UInt64 guid = 0x0;
                try
                {
                    guid = ObjectManager.AggroMobs()[0];
                }
                catch { }
                Calls.SetTarget(guid);
            }
        }
Ejemplo n.º 3
0
 public override void Run()
 {
     {
         if (ObjectManager.IsUnitOnGroup(attTarget.targetGuid, attTarget.isTapped, attTarget.healthPercent))
         {
             clientConnect.requestWait();
         }
         FightMovement.Handle();
         SpellManager.CheckSpells();
         CCManager.FightPulse();
         Ingame.CastFinal();
         AssistContainer.AfterFight = true;
     }
 }
Ejemplo n.º 4
0
        internal override void Run()
        {
            API.Helper.MoveOutOfCampfire();


            if (Grinder.Access.Info.Vendor.GoBackToGrindAfterVendor ||
                Grinder.Access.Info.Vendor.TravelingToVendor)
            {
                Grinder.Access.Info.Vendor.RegenerateSubPath = true;
            }

            Grinder.Access.Info.PathAfterFightToWaypoint.SetAfterFightMovement();
            Grinder.Access.Info.Combat.LastFightTick = Environment.TickCount + ran.Next(50, 100);
            Grinder.Access.Info.Loot.RemoveRespawnedMobsFromBlacklist(Grinder.Access.Info.Combat.Attackers);
            Grinder.Access.Info.Target.SearchDirect = true;

            if (Grinder.Access.Info.BreakHelper.NeedToBreak)
            {
                if (CanceledLogout)
                {
                    Functions.DoString("CancelLogout()");
                    CanceledLogout = false;
                }
            }
            else
            {
                CanceledLogout = true;
            }

            target = ObjectManager.Target;
            if (target != null)
            {
                var player = ObjectManager.Player;
                //reset resources so they dont get blacklisted because of a fight
                player.DiscoveredResources = new Dictionary <WoWGameObject, TimeSpan>();

                var IsCasting        = !(player.Casting == 0 && player.Channeling == 0);
                var targetIsMoving   = (target.MovementState & 0x1) == 0x1;
                var playerIsMoving   = (player.MovementState & 0x1) == 0x1;
                var distanceToTarget =
                    Calc.Distance3D(player.Position, target.Position);

                if (!Grinder.Access.Info.Combat.IsAttacker(target.Guid) && !API.BParty.IsInParty)
                {
                    var tmp = Grinder.Access.Info.Combat.Attackers.OrderBy(i => i.Health).FirstOrDefault();
                    if (tmp == null)
                    {
                        return;
                    }
                    ObjectManager.Player.SetTarget(tmp);
                    ObjectManager.Player.Spells.StopCasting();
                    return;
                }

                if (ObjectManager.Player.IsCtmIdle &&
                    (ObjectManager.Player.MovementState & (uint)Enums.MovementFlags.Back) != (uint)Enums.MovementFlags.Back &&
                    ObjectManager.Player.MovementState != 0)
                {
                    ObjectManager.Player.StopMovement(Enums.ControlBits.All);
                    ObjectManager.Player.CtmStopMovement();
                }

                if (distanceToTarget >= Grinder.Access.Info.Target.CombatDistance && ((!IsCasting
                                                                                       &&
                                                                                       !Grinder.Access.Info.Combat
                                                                                       .IsMoving) ||
                                                                                      !Grinder.Access.Info.Target
                                                                                      .InSightWithTarget))
                {
                    var tu = Grinder.Access.Info.PathToUnit.ToUnit(target);
                    if (tu.Item1)
                    {
                        player.CtmTo(tu.Item2);
                    }
                }
                else
                {
                    if (!Grinder.Access.Info.Combat.IsMoving)
                    {
                        if (playerIsMoving)
                        {
                            if (!(Grinder.Access.Info.Target.CombatDistance < 4 && IsCasting && targetIsMoving))
                            {
                                player.CtmStopMovement();
                            }
                        }
                        else
                        {
                            ObjectManager.Player.CtmSetToIdle();
                            player.Face(target);
                        }
                        Wait.Remove("FixFacingTimer");
                    }
                    else
                    {
                        if (Grinder.Access.Info.Combat.IsMovingBack)
                        {
                        }
                        else if (Grinder.Access.Info.Target.FixFacing)
                        {
                            FixFacing();
                        }
                    }
                    CCManager.FightPulse(ref target);
                }
            }
            else
            {
                var tmp = Grinder.Access.Info.Combat.Attackers.OrderBy(i => i.Health).FirstOrDefault();
                if (tmp == null)
                {
                    return;
                }
                ObjectManager.Player.SetTarget(tmp);
            }
        }