private void FightLoopHandler(WoWUnit unit, CancelEventArgs cancel)
        {
            if (specialization.RotationType == Enums.RotationType.Party &&
                _moveBehindTimer.IsReady)
            {
                if (ToolBox.StandBehindTargetCombat())
                {
                    _moveBehindTimer = new Timer(4000);
                }
            }
            else
            {
                if (IsTargetStunned() &&
                    !MovementManager.InMovement &&
                    Me.IsAlive &&
                    !Me.IsCast &&
                    ObjectManager.Target.IsAlive)
                {
                    Vector3 position = ToolBox.BackofVector3(ObjectManager.Target.Position, ObjectManager.Target, 2.5f);
                    MovementManager.Go(PathFinder.FindPath(position), false);

                    while (MovementManager.InMovement &&
                           StatusChecker.BasicConditions() &&
                           IsTargetStunned())
                    {
                        // Wait follow path
                        Thread.Sleep(200);
                    }
                }
            }
        }
        private void Rotation()
        {
            while (Main.isLaunched)
            {
                try
                {
                    if (Me.HaveBuff("Feign Death"))
                    {
                        Thread.Sleep(500);
                        Move.Backward(Move.MoveAction.PressKey, 100);
                        cast.OnTarget(AutoShot);
                    }

                    if (StatusChecker.BasicConditions() &&
                        !Me.IsMounted &&
                        !Me.HaveBuff("Food") &&
                        !Me.HaveBuff("Drink"))
                    {
                        if (_canOnlyMelee)
                        {
                            RangeManager.SetRangeToMelee();
                        }
                        else
                        {
                            RangeManager.SetRange(AutoShot.MaxRange - 1);
                        }

                        if (Me.Level >= 10)
                        {
                            PetManager();
                        }
                    }

                    if (StatusChecker.OutOfCombat(RotationRole))
                    {
                        specialization.BuffRotation();
                    }

                    if (StatusChecker.InPull())
                    {
                        specialization.Pull();
                    }

                    if (StatusChecker.InCombat())
                    {
                        specialization.CombatRotation();
                    }
                }
                catch (Exception arg)
                {
                    Logging.WriteError("ERROR: " + arg, true);
                }
                Thread.Sleep(ToolBox.GetLatency() + settings.ThreadSleepCycle);
            }
            Logger.Log("Stopped.");
        }
Ejemplo n.º 3
0
        private void Rotation()
        {
            while (Main.isLaunched)
            {
                try
                {
                    if (StatusChecker.BasicConditions() && !ObjectManager.Me.HaveBuff("Drink") && !ObjectManager.Me.HaveBuff("Food"))
                    {
                        ApplyEnchantWeapon();
                        _totemManager.CheckForTotemicCall();
                    }

                    if (StatusChecker.OutOfCombat(RotationRole))
                    {
                        specialization.BuffRotation();
                    }

                    if (StatusChecker.InPull())
                    {
                        specialization.Pull();
                    }

                    if (StatusChecker.InCombat())
                    {
                        specialization.CombatRotation();
                    }

                    if (AIOParty.GroupAndRaid.Any(p => p.InCombatFlagOnly && p.GetDistance < 50))
                    {
                        specialization.HealerCombat();
                    }
                }
                catch (Exception arg)
                {
                    Logging.WriteError("ERROR: " + arg, true);
                }
                Thread.Sleep(ToolBox.GetLatency() + settings.ThreadSleepCycle);
            }
            Logger.Log("Stopped.");
        }
Ejemplo n.º 4
0
        private void Rotation()
        {
            while (Main.isLaunched)
            {
                try
                {
                    if (StatusChecker.BasicConditions() &&
                        _polymorphedEnemy != null &&
                        !ObjectManager.Me.InCombatFlagOnly)
                    {
                        _polymorphedEnemy = null;
                    }

                    if (StatusChecker.OutOfCombat(RotationRole))
                    {
                        specialization.BuffRotation();
                    }

                    if (StatusChecker.InPull())
                    {
                        specialization.Pull();
                    }

                    if (StatusChecker.InCombat() &&
                        !cast.IsBackingUp &&
                        !_isPolymorphing &&
                        (!ObjectManager.Target.HaveBuff("Polymorph") || ObjectManager.GetNumberAttackPlayer() < 1))
                    {
                        specialization.CombatRotation();
                    }
                }
                catch (Exception arg)
                {
                    Logging.WriteError("ERROR: " + arg, true);
                }
                Thread.Sleep(ToolBox.GetLatency() + settings.ThreadSleepCycle);
            }
            Logger.Log("Stopped.");
        }
        // Pet thread
        private void PetThread(object sender, DoWorkEventArgs args)
        {
            while (Main.isLaunched)
            {
                try
                {
                    if (StatusChecker.BasicConditions() &&
                        !Me.IsOnTaxi &&
                        ObjectManager.Pet.IsValid &&
                        ObjectManager.Pet.IsAlive &&
                        !Me.IsMounted)
                    {
                        // OOC
                        if (!Fight.InFight &&
                            !Me.InCombatFlagOnly)
                        {
                            // Feed
                            if (Lua.LuaDoString <int>("happiness, damagePercentage, loyaltyRate = GetPetHappiness() return happiness", "") < 3 &&
                                settings.FeedPet)
                            {
                                Feed();
                            }

                            // Switch Auto Growl
                            if (ObjectManager.Pet.IsValid &&
                                ToolBox.PetSpellIsAutocast("Growl") != settings.AutoGrowl)
                            {
                                ToolBox.TogglePetSpellAuto("Growl", settings.AutoGrowl);
                            }

                            ToolBox.TogglePetSpellAuto("Charge", true);
                        }

                        // In fight
                        if ((Fight.InFight || Me.InCombatFlagOnly) &&
                            !ObjectManager.Pet.HaveBuff("Feed Pet Effect") &&
                            Me.Target > 0UL)
                        {
                            bool multiAggroImTargeted = false;

                            // Pet Switch target on multi aggro
                            if (Me.InCombatFlagOnly &&
                                !(specialization is BeastMasteryParty) &&
                                ObjectManager.GetNumberAttackPlayer() > 1)
                            {
                                Lua.LuaDoString("PetDefensiveMode();");
                                // Get list of units targeting me in a multiaggro situation
                                List <WoWUnit> unitsAttackingMe = ObjectManager.GetUnitAttackPlayer()
                                                                  .OrderBy(u => u.Guid)
                                                                  .Where(u => u.TargetObject.Guid == Me.Guid)
                                                                  .ToList();

                                foreach (WoWUnit unit in unitsAttackingMe)
                                {
                                    multiAggroImTargeted = true;
                                    if (unit.Guid != ObjectManager.Pet.TargetObject.Guid &&
                                        ObjectManager.Pet.TargetObject.Target == ObjectManager.Pet.Guid)
                                    {
                                        Logger.Log($"Forcing pet aggro on {unit.Name}");
                                        Me.FocusGuid = unit.Guid;
                                        cast.PetSpell("PET_ACTION_ATTACK", true);
                                        cast.PetSpell("Growl", true);
                                        Lua.LuaDoString("ClearFocus();");
                                    }
                                }
                            }

                            // Pet attack on single aggro
                            if ((Me.InCombatFlagOnly || Fight.InFight) &&
                                Me.Target > 0 &&
                                !multiAggroImTargeted)
                            {
                                Lua.LuaDoString("PetAttack();", false);
                            }

                            // Pet Growl
                            if ((ObjectManager.Target.Target == Me.Guid || ObjectManager.Pet.Target != Me.Target) &&
                                !settings.AutoGrowl &&
                                !(specialization is BeastMasteryParty))
                            {
                                if (cast.PetSpell("Growl"))
                                {
                                    continue;
                                }
                            }

                            // Pet damage spells
                            if (cast.PetSpellIfEnoughForGrowl("Bite", 35))
                            {
                                continue;
                            }
                            if (cast.PetSpellIfEnoughForGrowl("Gore", 25))
                            {
                                continue;
                            }
                            if (cast.PetSpellIfEnoughForGrowl("Scorpid Poison", 30))
                            {
                                continue;
                            }
                            if (cast.PetSpellIfEnoughForGrowl("Claw", 25))
                            {
                                continue;
                            }
                            if (cast.PetSpellIfEnoughForGrowl("Screech", 20))
                            {
                                continue;
                            }
                            if (cast.PetSpellIfEnoughForGrowl("Lightning Breath", 50))
                            {
                                continue;
                            }
                        }
                    }
                }
                catch (Exception arg)
                {
                    Logging.WriteError(string.Concat(arg), true);
                }
                Thread.Sleep(300);
            }
        }
        // Pet thread
        protected void PetThread(object sender, DoWorkEventArgs args)
        {
            while (Main.isLaunched)
            {
                try
                {
                    if (StatusChecker.BasicConditions() &&
                        ObjectManager.Pet.IsValid &&
                        ObjectManager.Pet.IsAlive)
                    {
                        bool multiAggroImTargeted = false;
                        // Pet Switch target on multi aggro
                        if (Me.InCombatFlagOnly &&
                            ObjectManager.GetNumberAttackPlayer() > 1)
                        {
                            Lua.LuaDoString("PetDefensiveMode();");
                            // Get list of units targeting me in a multiaggro situation
                            List <WoWUnit> unitsAttackingMe = ObjectManager.GetUnitAttackPlayer()
                                                              .OrderBy(u => u.Guid)
                                                              .Where(u => u.TargetObject.Guid == Me.Guid)
                                                              .ToList();

                            foreach (WoWUnit unit in unitsAttackingMe)
                            {
                                multiAggroImTargeted = true;
                                if (unit.Guid != ObjectManager.Pet.TargetObject.Guid &&
                                    ObjectManager.Pet.TargetObject.Target == ObjectManager.Pet.Guid)
                                {
                                    Logger.Log($"Forcing pet aggro on {unit.Name}");
                                    Me.FocusGuid = unit.Guid;
                                    cast.PetSpell("PET_ACTION_ATTACK", true);
                                    if (WarlockPetAndConsumables.MyWarlockPet().Equals("Voidwalker"))
                                    {
                                        cast.PetSpell("Torment", true);
                                        cast.PetSpell("Suffering", true);
                                    }
                                    if (WarlockPetAndConsumables.MyWarlockPet().Equals("Felguard"))
                                    {
                                        cast.PetSpell("Anguish", true);
                                    }
                                    Lua.LuaDoString("ClearFocus();");
                                }
                            }
                        }

                        // Pet attack on single aggro
                        if ((Me.InCombatFlagOnly || Fight.InFight) &&
                            Me.Target > 0 &&
                            !multiAggroImTargeted)
                        {
                            Lua.LuaDoString("PetAttack();", false);
                        }

                        // Voidwalker Torment + Felguard Anguish
                        if ((!settings.AutoTorment || !settings.AutoAnguish) &&
                            ObjectManager.Target.Target == Me.Guid &&
                            Me.InCombatFlagOnly)
                        {
                            if (WarlockPetAndConsumables.MyWarlockPet().Equals("Voidwalker"))
                            {
                                if (cast.PetSpell("Torment") || cast.PetSpell("Suffering"))
                                {
                                    continue;
                                }
                            }
                            if (WarlockPetAndConsumables.MyWarlockPet().Equals("Felguard"))
                            {
                                if (cast.PetSpell("Anguish"))
                                {
                                    continue;
                                }
                            }
                        }

                        // Switch Auto Torment & Suffering off
                        if (WarlockPetAndConsumables.MyWarlockPet().Equals("Voidwalker"))
                        {
                            ToolBox.TogglePetSpellAuto("Torment", settings.AutoTorment);
                            ToolBox.TogglePetSpellAuto("Suffering", false);
                        }

                        // Switch Felguard Auto Cleave/Anguish
                        if (WarlockPetAndConsumables.MyWarlockPet().Equals("Felguard") && specialization.RotationType == Enums.RotationType.Solo)
                        {
                            ToolBox.TogglePetSpellAuto("Cleave", settings.FelguardCleave);
                            ToolBox.TogglePetSpellAuto("Anguish", settings.AutoAnguish);
                        }
                    }
                }
                catch (Exception arg)
                {
                    Logging.WriteError(string.Concat(arg), true);
                }
                Thread.Sleep(300);
            }
        }