public bool ExecuteTactic(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking)
        {
            if (role == CombatClassRole.Dps)
            {
                WowUnit       wowUnit = WowInterface.ObjectManager.GetClosestWowUnitByDisplayId(DragonDisplayId, false);
                WowGameobject portal  = NearestPortal;

                if (wowUnit != null)
                {
                    if (portal != null && WowInterface.ObjectManager.Player.HealthPercentage > 80.0)
                    {
                        preventMovement = true;
                        allowAttacking  = false;

                        UsePortal(portal);

                        return(true);
                    }
                }
                else if (portal != null && WowInterface.ObjectManager.Player.HealthPercentage < 25.0)
                {
                    preventMovement = true;
                    allowAttacking  = false;

                    UsePortal(portal);

                    return(true);
                }
            }

            preventMovement = false;
            allowAttacking  = true;
            return(false);
        }
Exemple #2
0
        public bool ExecuteTactic(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking)
        {
            preventMovement = false;
            allowAttacking  = true;

            WowUnit wowUnit = WowInterface.I.ObjectManager.GetClosestWowUnitByDisplayId(IckDisplayId, false);

            if (wowUnit != null)
            {
                if (wowUnit.CurrentlyCastingSpellId == 68987 || wowUnit.CurrentlyChannelingSpellId == 68987) // chasing
                {
                    ChasingActivated = DateTime.UtcNow;
                    return(true);
                }
                else if (ChasingActive && wowUnit.TargetGuid == WowInterface.I.ObjectManager.PlayerGuid && wowUnit.Position.GetDistance(WowInterface.I.ObjectManager.Player.Position) < 7.0f)
                {
                    WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Fleeing, wowUnit.Position);

                    preventMovement = true;
                    allowAttacking  = false;
                    return(true);
                }

                WowUnit unitOrb = WowInterface.I.ObjectManager.WowObjects.OfType <WowUnit>()
                                  .OrderBy(e => e.Position.GetDistance(WowInterface.I.ObjectManager.Player.Position))
                                  .FirstOrDefault(e => e.DisplayId == 11686 && e.HasBuffById(69017) && e.Position.GetDistance(WowInterface.I.ObjectManager.Player.Position) < 3.0f);

                if (unitOrb != null) // orbs
                {
                    WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Fleeing, unitOrb.Position);

                    preventMovement = true;
                    allowAttacking  = false;
                    return(true);
                }

                if (role == CombatClassRole.Tank)
                {
                    if (wowUnit.TargetGuid == WowInterface.I.ObjectManager.PlayerGuid)
                    {
                        Vector3 modifiedCenterPosition = BotUtils.MoveAhead(MidPosition, BotMath.GetFacingAngle(WowInterface.I.ObjectManager.MeanGroupPosition, MidPosition), 8.0f);
                        float   distanceToMid          = WowInterface.I.ObjectManager.Player.Position.GetDistance(modifiedCenterPosition);

                        if (distanceToMid > 5.0f && WowInterface.I.ObjectManager.Player.Position.GetDistance(wowUnit.Position) < 3.5)
                        {
                            // move the boss to mid
                            WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Moving, modifiedCenterPosition);

                            preventMovement = true;
                            allowAttacking  = false;
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
 public bool ExecuteTactic(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking)
 {
     return(role switch
     {
         CombatClassRole.Tank => DoTank(out preventMovement, out allowAttacking),
         CombatClassRole.Heal => DoDpsHeal(false, out preventMovement, out allowAttacking),
         CombatClassRole.Dps => DoDpsHeal(isMelee, out preventMovement, out allowAttacking),
         _ => throw new NotImplementedException(), // should never happen
     });
        public bool ExecuteTactic(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking)
        {
            preventMovement = false;
            allowAttacking  = true;

            WowUnit wowUnit = WowInterface.I.ObjectManager.GetClosestWowUnitByDisplayId(DevourerOfSoulsDisplayId, false);

            if (wowUnit != null)
            {
                if (wowUnit.DisplayId == 30150)
                {
                    // make sure we avoid the lazer
                    // we only care about being on the reight side of him because the lazer spins clockwise
                    float angleDiff = BotMath.GetAngleDiff(wowUnit.Position, wowUnit.Rotation, WowInterface.I.ObjectManager.Player.Position);

                    if (angleDiff < 0.5f)
                    {
                        WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Move, BotMath.CalculatePositionAround(wowUnit.Position, wowUnit.Rotation, MathF.PI, isMelee ? 5.0f : 22.0f));

                        preventMovement = true;
                        allowAttacking  = false;
                        return(true);
                    }
                }

                if (role == CombatClassRole.Tank)
                {
                    Vector3 modifiedCenterPosition = BotUtils.MoveAhead(MidPosition, BotMath.GetFacingAngle(WowInterface.I.ObjectManager.MeanGroupPosition, MidPosition), 8.0f);
                    float   distanceToMid          = WowInterface.I.ObjectManager.Player.Position.GetDistance(modifiedCenterPosition);

                    if (wowUnit.TargetGuid == WowInterface.I.ObjectManager.PlayerGuid)
                    {
                        if (distanceToMid > 5.0f && WowInterface.I.ObjectManager.Player.Position.GetDistance(wowUnit.Position) < 3.5)
                        {
                            // move the boss to mid
                            WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Move, modifiedCenterPosition);

                            preventMovement = true;
                            allowAttacking  = false;
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
        public bool Execute(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking)
        {
            if (Tactics.Count > 0)
            {
                foreach (ITactic tactic in Tactics.Values)
                {
                    if (tactic.ExecuteTactic(role, isMelee, out preventMovement, out allowAttacking))
                    {
                        return(true);
                    }
                }
            }

            preventMovement = false;
            allowAttacking  = true;
            return(false);
        }
        public bool ExecuteTactic(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking)
        {
            preventMovement = false;
            allowAttacking  = true;

            WowUnit wowUnit = WowInterface.I.ObjectManager.GetClosestWowUnitByDisplayId(BronjahmDisplayId, false);

            if (wowUnit != null)
            {
                if (wowUnit.CurrentlyCastingSpellId == 68872 || wowUnit.CurrentlyChannelingSpellId == 68872 || wowUnit.HasBuffById(68872)) // soulstorm
                {
                    if (WowInterface.I.ObjectManager.Player.Position.GetDistance(MidPosition) > 8.0)
                    {
                        WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Moving, BotUtils.MoveAhead(MidPosition, BotMath.GetFacingAngle(WowInterface.I.ObjectManager.Player.Position, MidPosition), -5.0f));

                        preventMovement = true;
                        allowAttacking  = true;
                        return(true);
                    }

                    // stay at the mid
                    return(false);
                }

                if (role == CombatClassRole.Tank)
                {
                    if (wowUnit.TargetGuid == WowInterface.I.ObjectManager.PlayerGuid)
                    {
                        Vector3 modifiedCenterPosition = BotUtils.MoveAhead(MidPosition, BotMath.GetFacingAngle(WowInterface.I.ObjectManager.MeanGroupPosition, MidPosition), 8.0f);
                        float   distanceToMid          = WowInterface.I.ObjectManager.Player.Position.GetDistance(modifiedCenterPosition);

                        // flee from the corrupted souls target
                        bool needToFlee = wowUnit.CurrentlyChannelingSpellId == 68839 ||
                                          WowInterface.I.ObjectManager.WowObjects.OfType <WowUnit>().Any(e => e.DisplayId == 30233 && e.IsInCombat);

                        if (needToFlee)
                        {
                            if (distanceToMid < 16.0f)
                            {
                                WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Fleeing, modifiedCenterPosition);

                                preventMovement = true;
                                allowAttacking  = false;
                                return(true);
                            }

                            // we cant run away further
                            preventMovement = true;
                            return(false);
                        }

                        if (distanceToMid > 5.0f && WowInterface.I.ObjectManager.Player.Position.GetDistance(wowUnit.Position) < 3.5)
                        {
                            // move the boss to mid
                            WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Moving, modifiedCenterPosition);

                            preventMovement = true;
                            allowAttacking  = false;
                            return(true);
                        }
                    }
                }
                else if (role == CombatClassRole.Dps || role == CombatClassRole.Heal)
                {
                    float distanceToMid = WowInterface.I.ObjectManager.Player.Position.GetDistance(MidPosition);

                    if (!isMelee && distanceToMid < 20.0f)
                    {
                        // move to the outer ring of the arena
                        WowInterface.I.MovementEngine.SetMovementAction(MovementAction.Moving, BotUtils.MoveAhead(MidPosition, BotMath.GetFacingAngle(WowInterface.I.ObjectManager.Player.Position, MidPosition), -22.0f));

                        preventMovement = true;
                        allowAttacking  = false;
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #7
0
 public bool ExecuteTactic(CombatClassRole role, bool isMelee, out bool preventMovement, out bool allowAttacking) => role switch
 {