Ejemplo n.º 1
0
        public override void Pulse()
        {
            try
            {
                #region Plugin deactivated if ...
                if (Rarekiller.ToonInvalid)
                {
                    return;
                }
                if (Battlegrounds.IsInsideBattleground || Me.IsInInstance)
                {
                    return;
                }
                #endregion

                #region Init
                if (!hasItBeenInitialized)
                {
                    Initialize();
                    hasItBeenInitialized = true;
                }
                #endregion

                #region Timer
                if (Settings.Keyer && !Checktimer.IsRunning && !Me.IsMoving)
                {
                    Checktimer.Start();
                }
                if (Settings.Keyer && Checktimer.IsRunning && Me.IsMoving)
                {
                    Checktimer.Reset();
                }
                if (Settings.Shadowmeld && !Shadowmeldtimer.IsRunning && !Me.IsMoving && !Me.HasAura("Shadowmeld"))
                {
                    Shadowmeldtimer.Start();
                }
                if (Settings.Shadowmeld && Shadowmeldtimer.IsRunning && Me.IsMoving)
                {
                    Shadowmeldtimer.Reset();
                }
                // Developer Thing (ToDo Remove)
                if (!DumpAuraTimer.IsRunning && Rarekiller.Settings.MoPRaresDeveloper)
                {
                    DumpAuraTimer.Reset();
                    DumpAuraTimer.Start();
                }


                #endregion

                #region Slowfall
                if (Me.IsFalling && Settings.UseSlowfall && !FallTimer.IsRunning)
                {
                    FallTimer.Start();
                }
                if (!Me.IsFalling && Settings.UseSlowfall && FallTimer.IsRunning)
                {
                    FallTimer.Reset();
                }
                if (Me.IsFalling && Settings.UseSlowfall && FallTimer.ElapsedMilliseconds > Convert.ToInt32(Rarekiller.Settings.Falltimer))
                {
                    FallTimer.Reset();
                    Slowfall.HelpFalling();
                }

                //if (Me.IsFalling && Settings.UseSlowfall)
                //{
                //    Thread.Sleep(Convert.ToInt32(Rarekiller.Settings.Falltimer));
                //    if (Me.IsFalling && !Me.IsDead && !Me.IsGhost)
                //        Slowfall.HelpFalling();
                //}
                #endregion

                if (!Me.Combat)
                {
                    #region Pulse Camel Figurine and NPC Interactor
                    if (Settings.Camel || Settings.TestFigurineInteract || Settings.AnotherMansTreasure || Settings.InteractNPC)
                    {
                        Camel.findAndInteractNPC();
                    }
                    // --> Dormus' Rage = 93269
                    if (Me.HasAura(93269) || Settings.Camel)
                    {
                        Camel.findAndKillDormus();
                    }
                    #endregion

                    #region Pulse Object Interactor
                    if (Settings.RaptorNest || Settings.TestRaptorNest || Settings.ObjectsCollector || Settings.AnotherMansTreasure || Settings.OnyxEgg)
                    {
                        Collector.findAndPickupObject();
                    }
                    #endregion

                    #region Pulse Tamer
                    if (((Me.Class == WoWClass.Hunter) && (Rarekiller.Settings.TameDefault || Rarekiller.Settings.TameByID)) || Rarekiller.Settings.TestcaseTamer)
                    {
                        if (Me.HealthPercent > 30)
                        {
                            Tamer.findAndTameMob();
                        }
                    }

                    if ((Me.Class == WoWClass.Hunter && Rarekiller.Settings.Footprints) || Rarekiller.Settings.TestcaseTamer)
                    {
                        Tamer.findandfollowFootsteps();
                    }
                    #endregion

                    #region Pulse Rarekiller
                    if (Settings.KillList || Settings.MOP || Settings.WOTLK || Settings.BC || Settings.CATA || Settings.TLPD || Settings.LowRAR || Settings.HUNTbyID || Settings.Poseidus)
                    {
                        Killer.findAndKillMob();
                    }
                    #endregion

                    #region Pulse Security
                    if (Settings.Keyer && !Me.IsMoving)
                    {
                        if (Checktimer.Elapsed.TotalSeconds > MoveTimer)
                        {
                            Checktimer.Reset();
                            MoveTimer = rnd.Next(360, 540);
                            Security.Movearound();
                        }
                    }

                    if (Settings.Shadowmeld && !Me.IsMoving)
                    {
                        if (Shadowmeldtimer.Elapsed.TotalSeconds > 5)
                        {
                            Shadowmeldtimer.Reset();
                            if (SpellManager.HasSpell("Shadowmeld") && SpellManager.CanCast("Shadowmeld") && !Me.HasAura("Shadowmeld"))
                            {
                                bool SpellSuccess = RarekillerSpells.CastSafe("Shadowmeld", Me, false);
                                //bool SpellSuccess = SpellManager.Cast("Shadowmeld");
                                Logging.Write(Colors.MediumPurple, "Rarekiller: Shadowmeld activated - {0}", SpellSuccess);
                            }
                        }
                    }
                    #endregion
                }
                else // In Combat with MoPRares / Dormus
                {
                    #region Hozen - working - but needs some luck
                    if (MoPRares.Hozen != null)
                    {
                        // Bananarang
                        if (MoPRares.Hozen.CastingSpellId == 125311)
                        {
                            MoPRares.AvoidEnemyCast(MoPRares.Hozen, 0, 50);
                        }
                        // Going Bananas
                        else if (MoPRares.Hozen.CastingSpellId == 125363)
                        {
                            while (MoPRares.Hozen.CastingSpellId == 125363 && MoPRares.Hozen.Location.Distance(Me.Location) > 5)
                            {
                                if (Me.IsSwimming)
                                {
                                    WoWMovement.ClickToMove(MoPRares.Hozen.Location);
                                }
                                else
                                {
                                    Navigator.MoveTo(MoPRares.Hozen.Location);
                                }
                                Thread.Sleep(80);
                                if (Rarekiller.ToonInvalid)
                                {
                                    return;
                                }
                            }
                        }
                    }
                    #endregion

                    #region Mogu Sorcerer - working
                    if (MoPRares.MoguSorcerer != null)
                    {
                        //Voidcloud
                        if (Me.HasAura("Voidcloud") && MoPRares.getVoidcloudList != null)
                        {
                            if (MoPRares.getVoidcloudList[0].Distance < (MoPRares.getVoidcloudList[0].Radius * 1.6f))
                            {
                                MoPRares.AvoidEnemyAOE(MoPRares.MoguSorcerer, "Voidcloud", 10, MoPRares.getVoidcloudList, 10, 3);
                            }
                        }
                    }
                    #endregion

                    #region Saurok - working
                    if (MoPRares.Saurok != null)
                    {
                        if (MoPRares.Saurok.Combat && MoPRares.Saurok.Location.Distance(Me.Location) > 15)
                        {
                            while (MoPRares.Saurok.Location.Distance(Me.Location) > 5)
                            {
                                if (Me.IsSwimming)
                                {
                                    WoWMovement.ClickToMove(MoPRares.Saurok.Location);
                                }
                                else
                                {
                                    Navigator.MoveTo(MoPRares.Saurok.Location);
                                }
                                Thread.Sleep(80);
                                if (Rarekiller.ToonInvalid)
                                {
                                    return;
                                }
                            }
                        }
                        if (Me.CurrentTarget != null && Me.CurrentTarget != MoPRares.Saurok && !MoPRares.Saurok.IsDead)
                        {
                            MoPRares.Saurok.Target();
                        }
                    }
                    #endregion

                    #region Jinyu - working - but needs some luck
                    if (MoPRares.Jinyu != null)
                    {
                        // Rain Dance
                        if (MoPRares.Jinyu.CastingSpellId == 124860 && SpellManager.CanCast(Spells.Stun))
                        {
                            RarekillerSpells.CastSafe(Spells.Stun, MoPRares.Jinyu, false);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: * {0}. - Stun", Spells.Stun);
                        }
                        else if (MoPRares.Jinyu.CastingSpellId == 124860)
                        {
                            MoPRares.AvoidEnemyMissiles(MoPRares.Jinyu, 0, 7, true, 10, 5);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Avoid Missiles");
                        }

                        // Torrent - interrupt
                        else if (MoPRares.Jinyu.CastingSpellId == 124935 && SpellManager.CanCast(Spells.Interrupt))
                        {
                            RarekillerSpells.CastSafe(Spells.Interrupt, MoPRares.Jinyu, false);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: * {0}. - Interrupt", Spells.Interrupt);
                        }
                    }
                    #endregion

                    #region Mogu Warrior - working
                    if (MoPRares.MoguWarrior != null)
                    {
                        while (MoPRares.MoguWarrior.Distance2D <= 15 && MoPRares.MoguWarrior.IsCasting && MoPRares.MoguWarrior.CastingSpellId == 124946 && !Me.IsSafelyBehind(MoPRares.MoguWarrior))
                        {
                            if (Me.IsSwimming)
                            {
                                WoWMovement.ClickToMove(MoPRares.getLocationBehindUnit(MoPRares.MoguWarrior));
                            }
                            else
                            {
                                Navigator.MoveTo(MoPRares.getLocationBehindUnit(MoPRares.MoguWarrior));
                            }
                            Thread.Sleep(80);
                            if (Rarekiller.ToonInvalid)
                            {
                                return;
                            }
                        }
                    }
                    #endregion

                    #region Mantid - working but Index Fehler
                    if (MoPRares.Mantid != null)
                    {
                        // Blade Flurry
                        while (MoPRares.Mantid.Location.Distance(Me.Location) <= 20 && MoPRares.Mantid.IsCasting && MoPRares.Mantid.CastingSpellId == 125370 && !Me.IsSafelyBehind(MoPRares.Mantid))
                        {
                            if (Me.IsSwimming)
                            {
                                WoWMovement.ClickToMove(MoPRares.getLocationBehindUnit(MoPRares.Mantid));
                            }
                            else
                            {
                                Navigator.MoveTo(MoPRares.getLocationBehindUnit(MoPRares.Mantid));
                            }
                            Thread.Sleep(80);
                            if (Rarekiller.ToonInvalid)
                            {
                                return;
                            }
                        }

                        // Tornados
                        if (MoPRares.getTornadoList != null)
                        {
                            if (MoPRares.getTornadoList[0].Distance < 7)
                            {
                                MoPRares.AvoidEnemyAOE(MoPRares.Mantid, 27, MoPRares.getTornadoList, 10, 5);
                            }
                        }
                    }
                    #endregion

                    #region Pandaren - don't work good
                    if (MoPRares.Pandaren != null)
                    {
                        // Spinning Crane Kick
                        if (MoPRares.Pandaren.CastingSpellId == 125799 && SpellManager.CanCast(Spells.Stun))
                        {
                            RarekillerSpells.CastSafe(Spells.Stun, MoPRares.Pandaren, false);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: * {0}. - Stun", Spells.Stun);
                        }
                        else if (MoPRares.Pandaren.CastingSpellId == 125799 && MoPRares.Pandaren.Location.Distance(Me.Location) < 25)
                        {
                            WoWMovement.Move(WoWMovement.MovementDirection.Backwards);
                            MoPRares.FleeingFromEnemy(MoPRares.Pandaren, 125799, 40, 10, 5);
                        }

                        // Healing Mists
                        else if (MoPRares.Pandaren.CastingSpellId == 125802 && SpellManager.CanCast(Spells.Interrupt))
                        {
                            RarekillerSpells.CastSafe(Spells.Interrupt, MoPRares.Pandaren, false);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: * {0}. - Interrupt", Spells.Interrupt);
                        }

                        // Chi Burst
                        else if (MoPRares.Pandaren.Combat && MoPRares.Pandaren.Location.Distance(Me.Location) > 15)
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Run to Pandaren because of Chistoß");
                            while (MoPRares.Pandaren.Location.Distance(Me.Location) > 5)
                            {
                                if (Me.IsSwimming)
                                {
                                    WoWMovement.ClickToMove(MoPRares.Pandaren.Location);
                                }
                                else
                                {
                                    Navigator.MoveTo(MoPRares.Pandaren.Location);
                                }
                                Thread.Sleep(80);
                                if (Rarekiller.ToonInvalid)
                                {
                                    return;
                                }

                                // Healing Mists
                                else if (MoPRares.Pandaren.CastingSpellId == 125802 && SpellManager.CanCast(Spells.Interrupt) && MoPRares.Pandaren.Location.Distance(Me.Location) < 30)
                                {
                                    RarekillerSpells.CastSafe(Spells.Interrupt, MoPRares.Pandaren, false);
                                    Logging.Write(Colors.MediumPurple, "Rarekiller: * {0}. - Interrupt", Spells.Interrupt);
                                }
                            }
                            WoWMovement.MoveStop();
                        }
                    }
                    #endregion

                    #region Yaungol - working
                    if (MoPRares.Yaungol != null)
                    {
                        // Yaungol Stomp
                        if (MoPRares.Yaungol.CastingSpellId == 124289 && MoPRares.Yaungol.Location.Distance(Me.Location) < 15)
                        {
                            MoPRares.FleeingFromEnemy(MoPRares.Yaungol, 124289, 17, 10, 5);
                        }

                        // Bellowing Rage
                        else if (MoPRares.Yaungol.HasAura("Bellowing Rage") && MoPRares.Yaungol.Location.Distance(Me.Location) < 25)
                        {
                            MoPRares.FleeingFromEnemy(MoPRares.Yaungol, 0, 30, 10, 5);
                        }

                        // Rushing Charge
                        else if (MoPRares.Yaungol.Combat && Me.Location.Distance(MoPRares.Yaungol.Location) > 20)
                        {
                            while (Me.Location.Distance(MoPRares.Yaungol.Location) > 10)
                            {
                                if (Me.IsSwimming)
                                {
                                    WoWMovement.ClickToMove(MoPRares.Yaungol.Location);
                                }
                                else
                                {
                                    Navigator.MoveTo(MoPRares.Yaungol.Location);
                                }
                                Thread.Sleep(80);
                                if (Rarekiller.ToonInvalid)
                                {
                                    return;
                                }
                            }
                        }
                    }
                    #endregion

                    #region Dormus Avoid Spit - working
                    if (Camel.Dormus != null)
                    {
                        // Developer Thing (ToDo Remove)
                        if (DumpAuraTimer.Elapsed.TotalSeconds > 5 && Rarekiller.Settings.MoPRaresDeveloper)
                        {
                            DumpAuraTimer.Reset();
                            MoPRares.DumpAOEEffect();
                        }

                        //94967 = Aura Spit
                        if (Me.HasAura(94967))
                        {
                            Camel.AvoidSpit(Camel.Dormus);
                        }

                        //if (Me.HasAura(94967) && Camel.getSpitList != null && Camel.getSpitList[0].Distance < (Camel.getSpitList[0].Radius * 1.6f))
                        //    MoPRares.AvoidEnemyAOE(Camel.Dormus, 0, 2, 20, Camel.getSpitList, 15, 3);
                    }

                    #endregion
                }
            }

            catch (ThreadAbortException) { }
            catch (Exception e)
            {
                Logging.WriteDiagnostic(Colors.Red, e.Message);
            }
        }
Ejemplo n.º 2
0
        public override void Pulse()
        {
            try
            {
// ------------ Deactivate if not in Game etc
                if (Me == null || RoutineManager.Current == null || !ObjectManager.IsInGame)
                {
                    return;
                }

// ------------ Deactivate Plugin in BGs, Inis, while Casting and on Transport
                if (Battlegrounds.IsInsideBattleground || Me.IsInInstance)
                {
                    return;
                }

// ------------ Part Init
                if (!hasItBeenInitialized)
                {
                    hasItBeenInitialized = true;
                    Initialize();
                }
// ------------ Start the Stopwatches
                if ((Settings.PlayerFollows || Settings.PlayerFollowsLogout) && !SWPlayerFollows.IsRunning)
                {
                    SWPlayerFollows.Start();
                }
                if (Settings.Keyer && !Checktimer.IsRunning)
                {
                    Checktimer.Start();
                }

// ------------ Part Slowfall
                if (Me.IsFalling && Settings.UseSlowfall)
                {
                    Thread.Sleep(Convert.ToInt32(Rarekiller.Settings.Falltimer));
                    if (Me.IsFalling && !Me.Dead && !Me.IsGhost)
                    {
                        Slowfall.HelpFalling();
                    }
                }
// ------------ Part Ride Aeonaxx
                if ((Me.IsOnTransport && Settings.Aeonaxx) || Settings.TestWelpTargeting || Settings.TestKillAeonaxx)
                {
                    Aeonaxx.KillAeonaxx();
                }

                if (Me.ActiveAuras.ContainsKey(Settings.TestAuraToID) && Settings.TestKillDormus)
                {
                    Camel.AvoidDormusSpit(Settings.TestAuraToID);
                }

// ------------ Part Rarekiller Aeonaxx hostile
                //if(Me.IsOnTransport && Settings.Aeonaxx)
                //	Killer.findAndKillMob();

                if (!inCombat)
                {
// ------------ Part Aeonaxx
                    if (!Me.IsOnTransport && (Settings.Aeonaxx || Settings.TestMountAeonaxx))
                    {
                        Aeonaxx.MountAeonaxx();
                    }
// ------------ Part Rarekiller
                    if (Settings.WOTLK || Settings.BC || Settings.CATA || Settings.TLPD || Settings.LowRAR || Settings.HUNTbyID || Settings.Poseidus)
                    {
                        Killer.findAndKillMob();
                    }

// ------------ Part The Tamer
                    if ((Me.Class == WoWClass.Hunter) && (Rarekiller.Settings.TameDefault || Rarekiller.Settings.TameByID))
                    {
                        if (Me.HealthPercent > 30)
                        {
                            Tamer.findAndTameMob();
                        }
                    }

// ------------ Part Camel Figurine
                    if (Settings.Camel || Settings.TestFigurineInteract)
                    {
                        Camel.findAndPickupObject();
                    }
                    if (Settings.Dormus || Settings.TestKillDormus)
                    {
                        Camel.findAndKillDormus();
                    }

// ------------ Part Raptor Nest
                    if (Settings.RaptorNest || Settings.TestRaptorNest)
                    {
                        RaptorNest.findAndPickupNest();
                    }

// ------------ Part Security - Log Out
                    if ((Settings.LogOut || Settings.KillWoW || Settings.JustAlert) && Settings.ContinentChange && (Me.MapId != Rarekiller.Settings.ContinentID))
                    {
                        Security.LogMeOut("Continent Change");
                    }

                    if (SWPlayerFollows.Elapsed.TotalSeconds > 20)
                    {
                        SWPlayerFollows.Reset();
                        SWPlayerFollows.Start();
                        if (Settings.PlayerFollows || Settings.PlayerFollowsLogout)
                        {
// ------------ Part Security - Player Followed
                            PlayerManager.update();
                            if (PlayerManager.needExit(Convert.ToInt64(Settings.PlayerFollowsTime)))
                            {
                                Security.HeartMe("Followed for too long by player " + PlayerManager.FollowingPlayer.Name + ". Followed for " + PlayerManager.players[PlayerManager.FollowingPlayer] + " seconds!");
                            }
                        }
                    }

// ------------ Part Security - Keypresser
                    if (Settings.Keyer)
                    {
                        if (!Checktimer.IsRunning || Checktimer.Elapsed.TotalSeconds > MoveTimer)
                        {
                            Checktimer.Reset();
                            Checktimer.Start();
                            MoveTimer = rnd.Next(90, 200);
                            if (!Me.IsMoving)
                            {
                                Security.Movearound();
                            }
                        }
                    }
                    if (Settings.LootSuccess || Settings.TestLogoutItem)
                    {
                        Security.LogoutForItem();
                    }
                }
                else if (inCombat)
                {
// ------------ Part Shoot Down Vyragosa
                    if (Settings.ShotVyra || Settings.TestShootMob)
                    {
                        Killer.ShootDownVyra();
                    }

// ------------ Part avoid Spit AOE of Dormus
                    if ((Me.ActiveAuras.ContainsKey(Settings.AuraToID) || Me.ActiveAuras.ContainsKey(Settings.AuraToID2)) && Settings.Dormus)
                    {
                        Camel.AvoidDormusSpit(Settings.AuraToID);
                    }
                }
            }

            catch (ThreadAbortException) { }
            catch (Exception e)
            {
                Logging.Write(System.Drawing.Color.Red, "Rarekiller: Exception in Pulse: {0}", e);
            }
        }