Пример #1
0
        /// <summary>
        /// Function to Find and Kill Mobs
        /// </summary>
        public void findAndKillMob(WoWUnit Enemy)
        {
            bool CastSuccess = false;

            if (!Enemy.IsDead)
            {
                #region don't kill if
                // Don't kill Pandaria Rares with Low Health
                if ((Enemy.Entry == 50828 || Enemy.Entry == 50836 || Enemy.Entry == 50840 || Enemy.Entry == 50823 ||
                     Enemy.Entry == 50831 || Enemy.Entry == 50830 || Enemy.Entry == 50832 || Enemy.Entry == 50750 ||
                     Enemy.Entry == 50768 || Enemy.Entry == 50772 || Enemy.Entry == 50766 || Enemy.Entry == 50769 ||
                     Enemy.Entry == 50780 || Enemy.Entry == 50776 || Enemy.Entry == 50739 || Enemy.Entry == 50749 ||
                     Enemy.Entry == 50734 || Enemy.Entry == 50364 || Enemy.Entry == 50363 || Enemy.Entry == 50733 ||
                     Enemy.Entry == 50388 || Enemy.Entry == 50341 || Enemy.Entry == 50349 || Enemy.Entry == 50340 ||
                     Enemy.Entry == 50347 || Enemy.Entry == 50338 || Enemy.Entry == 50344 || Enemy.Entry == 50339 ||
                     Enemy.Entry == 50354 || Enemy.Entry == 50351 || Enemy.Entry == 50355 || Enemy.Entry == 50356 ||
                     Enemy.Entry == 50350 || Enemy.Entry == 50352 || Enemy.Entry == 50359 || Enemy.Entry == 50821 ||
                     Enemy.Entry == 50817 || Enemy.Entry == 50822 || Enemy.Entry == 50816 || Enemy.Entry == 50811 ||
                     Enemy.Entry == 50808 || Enemy.Entry == 50820 || Enemy.Entry == 50787 || Enemy.Entry == 50806 ||
                     Enemy.Entry == 50789 || Enemy.Entry == 50805 || Enemy.Entry == 50783 || Enemy.Entry == 50782 ||
                     Enemy.Entry == 50791 || Enemy.Entry == 51059 || Enemy.Entry == 50334 || Enemy.Entry == 51078 ||
                     Enemy.Entry == 50331 || Enemy.Entry == 50332 || Enemy.Entry == 50333 || Enemy.Entry == 50336) &&
                    Me.HealthPercent < 80)
                {
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Find a hunted Mob called {0} ID {1}, but don't Kill Pandaria Mob with Health < 80%", Enemy.Name, Enemy.Entry);
                    return;
                }
                if (Rarekiller.Settings.NotKillTameable && Enemy.IsTameable) // ... I want to tame him :)
                {
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Find a hunted Mob called {0} ID {1}, but kill tameable", Enemy.Name, Enemy.Entry);
                    return;
                }
                #endregion

                Logging.WriteQuiet(Colors.MediumPurple, "Rarekiller: Find a hunted Mob called {0} ID {1}", Enemy.Name, Enemy.Entry);
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Mob Location: {0} / {1} / {2}", Convert.ToString(Enemy.X), Convert.ToString(Enemy.Y), Convert.ToString(Enemy.Z));
                if (Rarekiller.Settings.LUAoutput)
                {
                    Lua.DoString("print('NPCScan: Find {0} ID {1}')", Enemy.Name, Enemy.Entry);
                }

                #region don't kill if ...
                if (Rarekiller.Settings.PullCounter >= Rarekiller.Settings.MaxPullCounter)
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but I pulled him now {1} Times", Enemy.Name, Rarekiller.Settings.PullCounter);
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist15));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 15 Minutes, MoP Rares will be deactivated");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: I pulled now {0} times, blacklist')", Rarekiller.Settings.PullCounter);
                    }
                    Rarekiller.Settings.PullCounter     = 0;
                    Rarekiller.Settings.GuidCurrentPull = 0;
                    Rarekiller.Settings.BlacklistCounter++;
                    Rarekiller.Settings.DeactivateMoPRare(Enemy);
                    return;
                }
                // Don't kill Pandaria Rares with Level < 90
                if ((Enemy.Entry == 50828 || Enemy.Entry == 50836 || Enemy.Entry == 50840 || Enemy.Entry == 50823 ||
                     Enemy.Entry == 50831 || Enemy.Entry == 50830 || Enemy.Entry == 50832 || Enemy.Entry == 50750 ||
                     Enemy.Entry == 50768 || Enemy.Entry == 50772 || Enemy.Entry == 50766 || Enemy.Entry == 50769 ||
                     Enemy.Entry == 50780 || Enemy.Entry == 50776 || Enemy.Entry == 50739 || Enemy.Entry == 50749 ||
                     Enemy.Entry == 50734 || Enemy.Entry == 50364 || Enemy.Entry == 50363 || Enemy.Entry == 50733 ||
                     Enemy.Entry == 50388 || Enemy.Entry == 50341 || Enemy.Entry == 50349 || Enemy.Entry == 50340 ||
                     Enemy.Entry == 50347 || Enemy.Entry == 50338 || Enemy.Entry == 50344 || Enemy.Entry == 50339 ||
                     Enemy.Entry == 50354 || Enemy.Entry == 50351 || Enemy.Entry == 50355 || Enemy.Entry == 50356 ||
                     Enemy.Entry == 50350 || Enemy.Entry == 50352 || Enemy.Entry == 50359 || Enemy.Entry == 50821 ||
                     Enemy.Entry == 50817 || Enemy.Entry == 50822 || Enemy.Entry == 50816 || Enemy.Entry == 50811 ||
                     Enemy.Entry == 50808 || Enemy.Entry == 50820 || Enemy.Entry == 50787 || Enemy.Entry == 50806 ||
                     Enemy.Entry == 50789 || Enemy.Entry == 50805 || Enemy.Entry == 50783 || Enemy.Entry == 50782 ||
                     Enemy.Entry == 50791 || Enemy.Entry == 51059 || Enemy.Entry == 50334 || Enemy.Entry == 51078 ||
                     Enemy.Entry == 50331 || Enemy.Entry == 50332 || Enemy.Entry == 50333 || Enemy.Entry == 50336) &&
                    Me.Level < 90)
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but my level is to Low to kill him", Enemy.Name);
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: My Level is to low')", Enemy.Name);
                    }
                    return;
                }

                if (Enemy.TaggedByOther && !Rarekiller.TaggedMobsList.ContainsKey(Convert.ToInt32(Enemy.Entry)))
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but he's tagged by another Player", Enemy.Name);
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: NPC is tagged')", Enemy.Name);
                    }
                    return;
                }
                //if not known ID of Inhouse Pandaria Rare --> don't kill
                if (!(Enemy.Entry == 50817 || Enemy.Entry == 50768 ||
                      Enemy.Entry == 50836 || Enemy.Entry == 50782 || Enemy.Entry == 50331 || Enemy.Entry == 51078 ||
                      Enemy.Entry == 50822 || Enemy.Entry == 50831 || Enemy.Entry == 50832 || Enemy.Entry == 50769))
                {
                    if (Me.IsFlying && Me.IsOutdoors && Enemy.IsIndoors)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Mob is Indoors and I fly Outdoors, so blacklist him to prevent Problems");
                        Logging.Write(Colors.MediumPurple, "Rarekiller: You have to place me next to the Spawnpoint, if you want me to hunt this Mob.");
                        Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: NPC is Indoors')", Enemy.Name);
                        }
                        return;
                    }
                }
                if (Enemy.Level > (Me.Level + 4))                 // ... 4 Levels higher them me
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: His Level is 5 over mine, better not to kill him.");
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                    return;
                }
                if (Enemy.IsFriendly)                 // ... is Friendly
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but he's friendly", Enemy.Name);
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: NPC is friendly')", Enemy.Name);
                    }
                    return;
                }
                if ((Enemy.Entry == 32630) && !Rarekiller.Settings.Vyragosa)                 // ... my Settings say don't kill Vyragosa
                {
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Config says: don't kill Vyragosa.");
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: don't kill NPC')", Enemy.Name);
                    }
                    return;
                }
                if ((Enemy.Entry == 50057) && !Rarekiller.Settings.Blazewing)                 // ... my Settings say don't kill Blazewing
                {
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Config says: don't kill Blazewing.");
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: don't kill NPC')", Enemy.Name);
                    }
                    return;
                }
                if ((Enemy.Entry == 596) || (Enemy.Entry == 599) || Me.IsInInstance)
                {
                    // ... Instance Mobs, don't run wild in Instances
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Don't run wild because of RareMobs in Instances.");
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                    return;
                }
                if (Rarekiller.BlacklistMobsList.ContainsKey(Convert.ToInt32(Enemy.Entry)))
                // ... Mob is Blacklisted in Rarekiller/config/BlacklistedMobs.xml
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: {0} is Member of the BlacklistedMobs.xml", Enemy.Name);
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist15));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 15 Minutes.");
                    return;
                }
                if (Rarekiller.DontInteract)
                {
                    return;
                }
                #endregion

                if (Rarekiller.Settings.Alert)
                {
                    Rarekiller.Alert();
                }

                #region fly to Helperpoint for some Pandaria Rares
                if (Me.IsFlying && (Enemy.Entry == 50817 || Enemy.Entry == 50768 ||
                                    Enemy.Entry == 50836 || Enemy.Entry == 50782 || Enemy.Entry == 50331 || Enemy.Entry == 51078 ||
                                    Enemy.Entry == 50822 || Enemy.Entry == 50831 || Enemy.Entry == 50832 || Enemy.Entry == 50769 ||
                                    Enemy.Entry == 50749 || Enemy.Entry == 50334 || Enemy.Entry == 50347 || Enemy.Entry == 50811 ||
                                    Enemy.Entry == 50821 || Enemy.Entry == 50808 || Enemy.Entry == 50820))
                {
                    WoWPoint Helperpoint = Enemy.Location;
                    if (Enemy.Entry == 50817)
                    {
                        Helperpoint = LandingPoint50817;
                    }
                    if (Enemy.Entry == 50768)
                    {
                        Helperpoint = LandingPoint50768;
                    }
                    if (Enemy.Entry == 50836)
                    {
                        Helperpoint = LandingPoint50836;
                    }
                    if (Enemy.Entry == 50782)
                    {
                        Helperpoint = LandingPoint50782;
                    }
                    if (Enemy.Entry == 50831)
                    {
                        Helperpoint = LandingPoint50831;
                    }
                    if (Enemy.Entry == 50832)
                    {
                        Helperpoint = LandingPoint50832;
                    }
                    if (Enemy.Entry == 50769)
                    {
                        Helperpoint = LandingPoint50769;
                    }
                    if (Enemy.Entry == 50822)
                    {
                        Helperpoint = LandingPoint50822;
                    }
                    if (Enemy.Entry == 50331)
                    {
                        Helperpoint = LandingPoint50331;
                    }
                    if (Enemy.Entry == 51078)
                    {
                        Helperpoint = LandingPoint51078;
                    }
                    if (Enemy.Entry == 50749)
                    {
                        Helperpoint = LandingPoint50749;
                    }
                    if (Enemy.Entry == 50334)
                    {
                        Helperpoint = LandingPoint50334;
                    }
                    if (Enemy.Entry == 50347)
                    {
                        Helperpoint = LandingPoint50347;
                    }
                    if (Enemy.Entry == 50811)
                    {
                        Helperpoint = LandingPoint50811;
                    }
                    if (Enemy.Entry == 50821)
                    {
                        Helperpoint = LandingPoint50821;
                    }
                    if (Enemy.Entry == 50808)
                    {
                        Helperpoint = LandingPoint50808;
                    }
                    if (Enemy.Entry == 50820)
                    {
                        Helperpoint = LandingPoint50820;
                    }

                    if (!Rarekiller.MoveTo(Helperpoint, Enemy, 5, false))
                    {
                        return;
                    }
                    Rarekiller.Dismount();
                }
                #endregion

                #region Check PullRange

                string UsedPullRange = Rarekiller.Settings.Range;

                // Range to 27 because of Inhouse Pandaria Mob
                if (SpellManager.HasSpell(Rarekiller.Spells.RangedPullspell) && (
                        Enemy.Entry == 50836 || Enemy.Entry == 50782 || Enemy.Entry == 50331 || Enemy.Entry == 51078 ||
                        Enemy.Entry == 50822 || Enemy.Entry == 50831 || Enemy.Entry == 50832 || Enemy.Entry == 50768 ||
                        Enemy.Entry == 50749 || Enemy.Entry == 50334 || Enemy.Entry == 50347 || Enemy.Entry == 50811 ||
                        Enemy.Entry == 50821 || Enemy.Entry == 50808 || Enemy.Entry == 50820))
                {
                    UsedPullRange = "27";
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to 27 because of Inhouse Pandaria Rare");
                }
                // Range to 3 for other Pandaria Mobs
                //else if (o.Entry == 50828 || o.Entry == 50836 || o.Entry == 50840 || o.Entry == 50823 ||
                //o.Entry == 50831 || o.Entry == 50830 || o.Entry == 50832 || o.Entry == 50750 ||
                //o.Entry == 50768 || o.Entry == 50772 || o.Entry == 50766 || o.Entry == 50769 ||
                //o.Entry == 50780 || o.Entry == 50776 || o.Entry == 50739 || o.Entry == 50749 ||
                //o.Entry == 50734 || o.Entry == 50364 || o.Entry == 50363 || o.Entry == 50733 ||
                //o.Entry == 50388 || o.Entry == 50341 || o.Entry == 50349 || o.Entry == 50340 ||
                //o.Entry == 50347 || o.Entry == 50338 || o.Entry == 50344 || o.Entry == 50339 ||
                //o.Entry == 50354 || o.Entry == 50351 || o.Entry == 50355 || o.Entry == 50356 ||
                //o.Entry == 50350 || o.Entry == 50352 || o.Entry == 50359 || o.Entry == 50821 ||
                //o.Entry == 50817 || o.Entry == 50822 || o.Entry == 50816 || o.Entry == 50811 ||
                //o.Entry == 50808 || o.Entry == 50820 || o.Entry == 50787 || o.Entry == 50806 ||
                //o.Entry == 50789 || o.Entry == 50805 || o.Entry == 50783 || o.Entry == 50782 ||
                //o.Entry == 50791 || o.Entry == 51059 || o.Entry == 50334 || o.Entry == 51078 ||
                //o.Entry == 50331 || o.Entry == 50332 || o.Entry == 50333 || o.Entry == 50336)
                //{
                //    UsedPullRange = "3";
                //    Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to 3 because of other Pandaria Rares");
                //}

                else if (!Rarekiller.Settings.DefaultPull && (Convert.ToInt64(UsedPullRange) > Convert.ToInt64(Rarekiller.Spells.RangeCheck(Rarekiller.Settings.Pull))))
                {
                    UsedPullRange = Rarekiller.Spells.RangeCheck(Rarekiller.Settings.Pull);
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to {0} because of Low-Ranged Customized Spell", Rarekiller.Spells.RangeCheck(Rarekiller.Settings.Pull));
                }

                else if (Rarekiller.Settings.DefaultPull && (Convert.ToInt64(UsedPullRange) > Convert.ToInt64(Rarekiller.Spells.RangeCheck(Rarekiller.Spells.FastPullspell))))
                {
                    UsedPullRange = Rarekiller.Spells.RangeCheck(Rarekiller.Spells.FastPullspell);
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to {0} because of Low-Ranged Default Spell", Rarekiller.Spells.RangeCheck(Rarekiller.Spells.FastPullspell));
                }
                #endregion

                #region Move To Mob
                if (Enemy.Entry == 50817 || Enemy.Entry == 50768 ||
                    Enemy.Entry == 50836 || Enemy.Entry == 50782 || Enemy.Entry == 50331 || Enemy.Entry == 51078 ||
                    Enemy.Entry == 50822 || Enemy.Entry == 50831 || Enemy.Entry == 50832 || Enemy.Entry == 50769 ||
                    Enemy.Entry == 50749 || Enemy.Entry == 50334 || Enemy.Entry == 50347 || Enemy.Entry == 50811 ||
                    Enemy.Entry == 50821 || Enemy.Entry == 50808 || Enemy.Entry == 50820)
                {
                    if (!Rarekiller.MoveTo(Enemy, Convert.ToInt64(UsedPullRange), true))
                    {
                        return;
                    }
                }
                else
                {
                    if (!Rarekiller.MoveTo(Enemy, Convert.ToInt64(UsedPullRange), false))
                    {
                        return;
                    }
                }
                #endregion

                #region Special Behavior Nal'lak
                //if (Me.Combat && o.Entry == 50364) //Nal'lak
                //{
                //    WoWMovement.MoveStop();
                //    Thread.Sleep(100);
                //    if (Me.IsFlying)
                //    {
                //        WoWUnit GroundUnit = ObjectManager.GetObjectsOfType<WoWUnit>().Where(u => (!u.IsFlying)).OrderBy(u => u.Distance).FirstOrDefault(); ;
                //        if (!Rarekiller.DescendToLand(GroundUnit)) return;
                //    }
                //    Rarekiller.Dismount();
                //}
                #endregion

                #region Special Behavior Clean up Area
                if (Enemy.Entry == 50749 || Enemy.Entry == 50334 || Enemy.Entry == 50347)
                {
                    List <WoWUnit> AddList = ObjectManager.GetObjectsOfType <WoWUnit>().Where(Add => !Add.IsDead && Add.IsHostile && (Add != Enemy) && Add.Location.Distance(Enemy.Location) < 27 && Add.Location.Distance(Me.Location) < 27).OrderBy(Add => Add.Distance).ToList();
                    foreach (WoWUnit Add in AddList)
                    {
                        if (SpellManager.HasSpell(Rarekiller.Spells.RangedPullspell))
                        {
                            CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.RangedPullspell, Add, true);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Clean up Area, pull Add: {0}", Add.Name);
                            return;
                        }
                    }
                }
                #endregion

                #region Pull Mob
                Logging.Write(Colors.MediumPurple, "Rarekiller: Pull at Mob Location: {0} / {1} / {2}", Convert.ToString(Enemy.X), Convert.ToString(Enemy.Y), Convert.ToString(Enemy.Z));
                Logging.Write(Colors.MediumPurple, "Rarekiller: ... my Location: {0} / {1} / {2}", Convert.ToString(Me.X), Convert.ToString(Me.Y), Convert.ToString(Me.Z));
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Target is Flying - {0}", Enemy.IsFlying);

                Enemy.Target();
                if (SpellManager.HasSpell(Rarekiller.Spells.RangedPullspell) &&
                    (Enemy.Entry == 50817 || Enemy.Entry == 50768 ||
                     Enemy.Entry == 50836 || Enemy.Entry == 50782 || Enemy.Entry == 50331 || Enemy.Entry == 51078 ||
                     Enemy.Entry == 50822 || Enemy.Entry == 50831 || Enemy.Entry == 50832 || Enemy.Entry == 50769 ||
                     Enemy.Entry == 50749 || Enemy.Entry == 50334 || Enemy.Entry == 50347 || Enemy.Entry == 50811 ||
                     Enemy.Entry == 50821 || Enemy.Entry == 50808 || Enemy.Entry == 50820))
                {
                    CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.RangedPullspell, Enemy, true);
                }

                else if (!(Rarekiller.Settings.DefaultPull) && SpellManager.HasSpell(Rarekiller.Settings.Pull))
                {
                    CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Settings.Pull, Enemy, false);
                }
                else if (SpellManager.HasSpell(Rarekiller.Spells.FastPullspell))
                {
                    CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.FastPullspell, Enemy, false);
                }
                else
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: I have no valid Pullspell - sorry");
                }

                if (Me.CurrentTarget != Enemy)
                {
                    Enemy.Target();
                }
                #endregion

                #region Quick Slowfall for known flying Mobs
                if (Rarekiller.Settings.UseSlowfall && ((Enemy.Entry == 29753) || (Enemy.Entry == 32491) || (Enemy.Entry == 32630) || (Enemy.Entry == 33687) || (Enemy.Entry == 50364)))
                {
                    Thread.Sleep(500);
                    if (Me.IsFalling)
                    {
                        Rarekiller.Slowfall.HelpFalling();
                    }
                }
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Use Quick Slowfall: {0} Mob: {1}", Me.IsFalling, Enemy.Name);
                #endregion

                #region Pulltimer and Pullcounter
                WaitAfterPullTimer.Reset();
                WaitAfterPullTimer.Start();
                while (WaitAfterPullTimer.IsRunning && !Rarekiller.ToonInvalidCombat && WaitAfterPullTimer.ElapsedMilliseconds < 2000)
                {
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Wait for Combat now {0} ms", WaitAfterPullTimer.ElapsedMilliseconds);
                    Thread.Sleep(100);
                }

                if (CastSuccess && Me.Combat)
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Successfully pulled {0}", Enemy.Name);
                }

                if (Enemy.Entry != 32491 && Enemy.Entry != 50005 && (Rarekiller.Settings.GuidCurrentPull != Enemy.Guid) && Me.Combat)
                {
                    Rarekiller.Settings.PullCounter     = 1;
                    Rarekiller.Settings.GuidCurrentPull = Enemy.Guid;
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Pulled {0} now first time", Enemy.Name);
                }
                else if (Me.Combat)
                {
                    Rarekiller.Settings.PullCounter++;
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Pulled {0} now {1} times", Enemy.Name, Rarekiller.Settings.PullCounter);

                    if ((Enemy.Entry == 50828 || Enemy.Entry == 50836 || Enemy.Entry == 50840 || Enemy.Entry == 50823 ||
                         Enemy.Entry == 50831 || Enemy.Entry == 50830 || Enemy.Entry == 50832 || Enemy.Entry == 50750 ||
                         Enemy.Entry == 50768 || Enemy.Entry == 50772 || Enemy.Entry == 50766 || Enemy.Entry == 50769 ||
                         Enemy.Entry == 50780 || Enemy.Entry == 50776 || Enemy.Entry == 50739 || Enemy.Entry == 50749 ||
                         Enemy.Entry == 50734 || Enemy.Entry == 50364 || Enemy.Entry == 50363 || Enemy.Entry == 50733 ||
                         Enemy.Entry == 50388 || Enemy.Entry == 50341 || Enemy.Entry == 50349 || Enemy.Entry == 50340 ||
                         Enemy.Entry == 50347 || Enemy.Entry == 50338 || Enemy.Entry == 50344 || Enemy.Entry == 50339 ||
                         Enemy.Entry == 50354 || Enemy.Entry == 50351 || Enemy.Entry == 50355 || Enemy.Entry == 50356 ||
                         Enemy.Entry == 50350 || Enemy.Entry == 50352 || Enemy.Entry == 50359 || Enemy.Entry == 50821 ||
                         Enemy.Entry == 50817 || Enemy.Entry == 50822 || Enemy.Entry == 50816 || Enemy.Entry == 50811 ||
                         Enemy.Entry == 50808 || Enemy.Entry == 50820 || Enemy.Entry == 50787 || Enemy.Entry == 50806 ||
                         Enemy.Entry == 50789 || Enemy.Entry == 50805 || Enemy.Entry == 50783 || Enemy.Entry == 50782 ||
                         Enemy.Entry == 50791 || Enemy.Entry == 51059 || Enemy.Entry == 50334 || Enemy.Entry == 51078 ||
                         Enemy.Entry == 50331 || Enemy.Entry == 50332 || Enemy.Entry == 50333 || Enemy.Entry == 50336) &&
                        Me.Level < 90)
                    {
                        RoutineManager.Current.Combat();
                    }
                }
                #endregion

                #region Move to a Save Fighting Area after Pull for some Pandaria Rares
                if ((Enemy.Entry == 50768 || Enemy.Entry == 50832) && Me.Combat)
                {
                    WoWPoint SaveHelperpoint = Enemy.Location;
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Move to Save Fighting Point", Enemy.Entry);

                    if (Enemy.Entry == 50768)
                    {
                        SaveHelperpoint = SavePoint50768;
                    }

                    if (Enemy.Entry == 50832)
                    {
                        SaveHelperpoint = SavePoint50832;
                    }

                    if (Navigator.CanNavigateFully(Me.Location, SaveHelperpoint))
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Move to Save Fighting Point");
                        while (Me.Location.Distance(SaveHelperpoint) > 5)
                        {
                            if (Me.IsSwimming)
                            {
                                WoWMovement.ClickToMove(SaveHelperpoint);
                            }
                            else
                            {
                                Navigator.MoveTo(SaveHelperpoint);
                            }
                            Thread.Sleep(100);
                            if (Rarekiller.ToonInvalid)
                            {
                                return;
                            }
                        }
                    }
                    else
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Wasn't able to Move to Save Fighting Point", Enemy.Entry);
                    }
                }
                #endregion

                return;
            }
            else
            {
                if (Enemy.Guid == Rarekiller.Settings.GuidCurrentPull)
                {
                    Rarekiller.Settings.PullCounter     = 0;
                    Rarekiller.Settings.GuidCurrentPull = 0;
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Set PullCounter to {0}", Rarekiller.Settings.PullCounter);
                }

                if (Enemy.CanLoot)
                {
                    if (!Rarekiller.Loothelper(Enemy))
                    {
                        return;
                    }
                }

                if (!Blacklist.Contains(Enemy.Guid, Rarekiller.Settings.Flags))
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but sadly he's dead", Enemy.Name);
                    Blacklist.Add(Enemy.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                }
            }
        }
Пример #2
0
        public static WoWPoint SavePoint50832 = new WoWPoint(1749.258, 3209.693, 316.2377);  // The Yowler
        #endregion

        /// <summary>
        /// Function to Find and Kill Mobs
        /// </summary>
        public void findAndKillMob()
        {
            bool CastSuccess = false;

            #region create List of Mobs in Reach
            // ----------------- Generate a List with all wanted Rares found in Object Manager ---------------------
            ObjectManager.Update();
            List <WoWUnit> objList = ObjectManager.GetObjectsOfType <WoWUnit>()
                                     .Where(o => (!Blacklist.Contains(o.Guid, Rarekiller.Settings.Flags) && (
                                                      (Rarekiller.Settings.CATA && (Rarekiller.CataRaresList.ContainsKey(Convert.ToInt32(o.Entry)))) ||
                                                      (Rarekiller.Settings.Poseidus && ((o.Entry == 50005) || // Poseidus
                                                                                        (o.Entry == 9999999))) || // Platzhalter
                                                      (Rarekiller.Settings.TLPD && ((o.Entry == 32491) ||         // Timelost Protodrake
                                                                                    (o.Entry == 32630))) ||       // Vyragosa
                                                      (Rarekiller.Settings.WOTLK && (Rarekiller.FrostbittenList.ContainsKey(Convert.ToInt32(o.Entry)))) ||
                                                      (Rarekiller.Settings.BC && (Rarekiller.BloodyRareList.ContainsKey(Convert.ToInt32(o.Entry)))) ||
                                                      (Rarekiller.Settings.KillList && (Rarekiller.KillMobsList.ContainsKey(Convert.ToInt32(o.Entry)))) || //Kill Mobs from List
                                                      (Rarekiller.Settings.KillList && o.TaggedByOther && (Rarekiller.TaggedMobsList.ContainsKey(Convert.ToInt32(o.Entry)))) || //Kill Tagged Mobs from List
                                                      ((o.Level < Rarekiller.Settings.Level) && Rarekiller.Settings.LowRAR && (o.CreatureRank == Styx.WoWUnitClassificationType.Rare)) || // every single Rare Mob < Level 61 is hunted
                                                      (Rarekiller.Settings.HUNTbyID && (o.Entry == Convert.ToInt64(Rarekiller.Settings.MobID))) // Hunt special IDs
                                                      // Pandaria Rares
                                                      || (Rarekiller.Settings.MOP && (
                                                              (o.Entry == 50828 && Rarekiller.Settings.Bonobos50828) || //
                                                              (o.Entry == 50836 && Rarekiller.Settings.IkIk50836) || //
                                                              (o.Entry == 50840 && Rarekiller.Settings.Nanners50840) || //
                                                              (o.Entry == 50823 && Rarekiller.Settings.Ferocious50823) || //
                                                              (o.Entry == 50831 && Rarekiller.Settings.Scritch50831) || //
                                                              (o.Entry == 50830 && Rarekiller.Settings.Spriggin50830) || //
                                                              (o.Entry == 50832 && Rarekiller.Settings.Yowler50832) || //
                                                              (o.Entry == 50750 && Rarekiller.Settings.Aethis50750) || //
                                                              (o.Entry == 50768 && Rarekiller.Settings.Cournith50768) || //
                                                              (o.Entry == 50772 && Rarekiller.Settings.Eshelon50772) || //
                                                              (o.Entry == 50766 && Rarekiller.Settings.Selena50766) || //
                                                              (o.Entry == 50769 && Rarekiller.Settings.Zai50769) || //
                                                              (o.Entry == 50780 && Rarekiller.Settings.Sahn50780) || //
                                                              (o.Entry == 50776 && Rarekiller.Settings.Nalash50776) || //
                                                              (o.Entry == 50739 && Rarekiller.Settings.Garlok50739) || //
                                                              (o.Entry == 50749 && Rarekiller.Settings.Kaltik50749) || //
                                                              (o.Entry == 50734 && Rarekiller.Settings.Lithik50734) || //
                                                              (o.Entry == 50364 && Rarekiller.Settings.Nallak50364) || //
                                                              (o.Entry == 50363 && Rarekiller.Settings.Kraxik50363) || //
                                                              (o.Entry == 50733 && Rarekiller.Settings.Skithik50733) || //
                                                              (o.Entry == 50388 && Rarekiller.Settings.Torik50388) || //
                                                              (o.Entry == 50341 && Rarekiller.Settings.Borginn50341) || //
                                                              (o.Entry == 50349 && Rarekiller.Settings.Kang50349) || //
                                                              (o.Entry == 50340 && Rarekiller.Settings.Gaarn50340) || //
                                                              (o.Entry == 50347 && Rarekiller.Settings.Karr50347) || //
                                                              (o.Entry == 50338 && Rarekiller.Settings.Kornas50338) || //
                                                              (o.Entry == 50344 && Rarekiller.Settings.Norlaxx50344) || //
                                                              (o.Entry == 50339 && Rarekiller.Settings.Sulikshor50339) || //
                                                              (o.Entry == 50354 && Rarekiller.Settings.Havak50354) || //
                                                              (o.Entry == 50351 && Rarekiller.Settings.JonnDar50351) || //
                                                              (o.Entry == 50355 && Rarekiller.Settings.Kahtir50355) || //
                                                              (o.Entry == 50356 && Rarekiller.Settings.Krol50356) || //
                                                              (o.Entry == 50350 && Rarekiller.Settings.Morgrinn50350) || //
                                                              (o.Entry == 50352 && Rarekiller.Settings.Qunas50352) || //
                                                              (o.Entry == 50359 && Rarekiller.Settings.Urgolax50359) || //
                                                              (o.Entry == 50821 && Rarekiller.Settings.AiLi50821) || //
                                                              (o.Entry == 50817 && Rarekiller.Settings.Ahone50817) || //
                                                              (o.Entry == 50822 && Rarekiller.Settings.AiRan50822) || //
                                                              (o.Entry == 50816 && Rarekiller.Settings.Ruun50816) || //
                                                              (o.Entry == 50811 && Rarekiller.Settings.Nasra50811) || //
                                                              (o.Entry == 50808 && Rarekiller.Settings.Urobi50808) || //
                                                              (o.Entry == 50820 && Rarekiller.Settings.Yul50820) || //
                                                              (o.Entry == 50787 && Rarekiller.Settings.Arness50787) || //
                                                              (o.Entry == 50806 && Rarekiller.Settings.Moldo50806) || //
                                                              (o.Entry == 50789 && Rarekiller.Settings.Nessos50789) || //
                                                              (o.Entry == 50805 && Rarekiller.Settings.Omnis50805) || //
                                                              (o.Entry == 50783 && Rarekiller.Settings.Salyin50783) || //
                                                              (o.Entry == 50782 && Rarekiller.Settings.Sarnak50782) || //
                                                              (o.Entry == 50791 && Rarekiller.Settings.Siltriss50791) || //
                                                              (o.Entry == 51059 && Rarekiller.Settings.Blackhoof51059) || //
                                                              (o.Entry == 50334 && Rarekiller.Settings.Dak50334) || //
                                                              (o.Entry == 51078 && Rarekiller.Settings.Ferdinand51078) || //
                                                              (o.Entry == 50331 && Rarekiller.Settings.GoKan50331) || //
                                                              (o.Entry == 50332 && Rarekiller.Settings.Korda50332) || //
                                                              (o.Entry == 50333 && Rarekiller.Settings.Lon50333) || //
                                                              (o.Entry == 50336 && Rarekiller.Settings.Yorik50336) //
                                                              ))
                                                      )))
                                     .OrderBy(o => o.Distance).ToList();
            #endregion

            foreach (WoWUnit o in objList)
            {
                if (!o.IsDead && !o.IsPet)
                {
                    #region don't kill if
                    // Don't kill Pandaria Rares with Low Health
                    if ((o.Entry == 50828 || o.Entry == 50836 || o.Entry == 50840 || o.Entry == 50823 ||
                         o.Entry == 50831 || o.Entry == 50830 || o.Entry == 50832 || o.Entry == 50750 ||
                         o.Entry == 50768 || o.Entry == 50772 || o.Entry == 50766 || o.Entry == 50769 ||
                         o.Entry == 50780 || o.Entry == 50776 || o.Entry == 50739 || o.Entry == 50749 ||
                         o.Entry == 50734 || o.Entry == 50364 || o.Entry == 50363 || o.Entry == 50733 ||
                         o.Entry == 50388 || o.Entry == 50341 || o.Entry == 50349 || o.Entry == 50340 ||
                         o.Entry == 50347 || o.Entry == 50338 || o.Entry == 50344 || o.Entry == 50339 ||
                         o.Entry == 50354 || o.Entry == 50351 || o.Entry == 50355 || o.Entry == 50356 ||
                         o.Entry == 50350 || o.Entry == 50352 || o.Entry == 50359 || o.Entry == 50821 ||
                         o.Entry == 50817 || o.Entry == 50822 || o.Entry == 50816 || o.Entry == 50811 ||
                         o.Entry == 50808 || o.Entry == 50820 || o.Entry == 50787 || o.Entry == 50806 ||
                         o.Entry == 50789 || o.Entry == 50805 || o.Entry == 50783 || o.Entry == 50782 ||
                         o.Entry == 50791 || o.Entry == 51059 || o.Entry == 50334 || o.Entry == 51078 ||
                         o.Entry == 50331 || o.Entry == 50332 || o.Entry == 50333 || o.Entry == 50336) &&
                        Me.HealthPercent < 80)
                    {
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Find a hunted Mob called {0} ID {1}, but don't Kill Pandaria Mob with Health < 80%", o.Name, o.Entry);
                        return;
                    }
                    if (Rarekiller.Settings.NotKillTameable && o.IsTameable) // ... I want to tame him :)
                    {
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Find a hunted Mob called {0} ID {1}, but kill tameable", o.Name, o.Entry);
                        return;
                    }
                    #endregion

                    Logging.WriteQuiet(Colors.MediumPurple, "Rarekiller: Find a hunted Mob called {0} ID {1}", o.Name, o.Entry);
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Mob Location: {0} / {1} / {2}", Convert.ToString(o.X), Convert.ToString(o.Y), Convert.ToString(o.Z));
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: Find {0} ID {1}')", o.Name, o.Entry);
                    }

                    #region don't kill if ...
                    if (Rarekiller.Settings.PullCounter >= Rarekiller.Settings.MaxPullCounter)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but I pulled him now {1} Times", o.Name, Rarekiller.Settings.PullCounter);
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist15));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 15 Minutes, MoP Rares will be deactivated");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: I pulled now {0} times, blacklist')", Rarekiller.Settings.PullCounter);
                        }
                        Rarekiller.Settings.PullCounter     = 0;
                        Rarekiller.Settings.GuidCurrentPull = 0;
                        Rarekiller.Settings.BlacklistCounter++;
                        Rarekiller.Settings.DeactivateMoPRare(o);
                        return;
                    }
                    // Don't kill Pandaria Rares with Level < 90
                    if ((o.Entry == 50828 || o.Entry == 50836 || o.Entry == 50840 || o.Entry == 50823 ||
                         o.Entry == 50831 || o.Entry == 50830 || o.Entry == 50832 || o.Entry == 50750 ||
                         o.Entry == 50768 || o.Entry == 50772 || o.Entry == 50766 || o.Entry == 50769 ||
                         o.Entry == 50780 || o.Entry == 50776 || o.Entry == 50739 || o.Entry == 50749 ||
                         o.Entry == 50734 || o.Entry == 50364 || o.Entry == 50363 || o.Entry == 50733 ||
                         o.Entry == 50388 || o.Entry == 50341 || o.Entry == 50349 || o.Entry == 50340 ||
                         o.Entry == 50347 || o.Entry == 50338 || o.Entry == 50344 || o.Entry == 50339 ||
                         o.Entry == 50354 || o.Entry == 50351 || o.Entry == 50355 || o.Entry == 50356 ||
                         o.Entry == 50350 || o.Entry == 50352 || o.Entry == 50359 || o.Entry == 50821 ||
                         o.Entry == 50817 || o.Entry == 50822 || o.Entry == 50816 || o.Entry == 50811 ||
                         o.Entry == 50808 || o.Entry == 50820 || o.Entry == 50787 || o.Entry == 50806 ||
                         o.Entry == 50789 || o.Entry == 50805 || o.Entry == 50783 || o.Entry == 50782 ||
                         o.Entry == 50791 || o.Entry == 51059 || o.Entry == 50334 || o.Entry == 51078 ||
                         o.Entry == 50331 || o.Entry == 50332 || o.Entry == 50333 || o.Entry == 50336) &&
                        Me.Level < 90)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but my level is to Low to kill him", o.Name);
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: My Level is to low')", o.Name);
                        }
                        return;
                    }

                    if (o.TaggedByOther && !Rarekiller.TaggedMobsList.ContainsKey(Convert.ToInt32(o.Entry)))
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but he's tagged by another Player", o.Name);
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: NPC is tagged')", o.Name);
                        }
                        return;
                    }
                    //if not known ID of Inhouse Pandaria Rare --> don't kill
                    if (!(o.Entry == 50817 || o.Entry == 50768 ||
                          o.Entry == 50836 || o.Entry == 50782 || o.Entry == 50331 || o.Entry == 51078 ||
                          o.Entry == 50822 || o.Entry == 50831 || o.Entry == 50832 || o.Entry == 50769))
                    {
                        if (Me.IsFlying && Me.IsOutdoors && o.IsIndoors)
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Mob is Indoors and I fly Outdoors, so blacklist him to prevent Problems");
                            Logging.Write(Colors.MediumPurple, "Rarekiller: You have to place me next to the Spawnpoint, if you want me to hunt this Mob.");
                            Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                            Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                            if (Rarekiller.Settings.LUAoutput)
                            {
                                Lua.DoString("print('NPCScan: NPC is Indoors')", o.Name);
                            }
                            return;
                        }
                    }
                    if (o.Level > (Me.Level + 4))                     // ... 4 Levels higher them me
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: His Level is 5 over mine, better not to kill him.");
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                        return;
                    }
                    if (o.IsFriendly)                     // ... is Friendly
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but he's friendly", o.Name);
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: NPC is friendly')", o.Name);
                        }
                        return;
                    }
                    if ((o.Entry == 32630) && !Rarekiller.Settings.Vyragosa)                     // ... my Settings say don't kill Vyragosa
                    {
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Config says: don't kill Vyragosa.");
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: don't kill NPC')", o.Name);
                        }
                        return;
                    }
                    if ((o.Entry == 50057) && !Rarekiller.Settings.Blazewing)                     // ... my Settings say don't kill Blazewing
                    {
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Config says: don't kill Blazewing.");
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 5 Minutes.");
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: don't kill NPC')", o.Name);
                        }
                        return;
                    }
                    if ((o.Entry == 596) || (o.Entry == 599) || Me.IsInInstance)
                    {
                        // ... Instance Mobs, don't run wild in Instances
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Don't run wild because of RareMobs in Instances.");
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                        return;
                    }
                    if (Rarekiller.BlacklistMobsList.ContainsKey(Convert.ToInt32(o.Entry)))
                    // ... Mob is Blacklisted in Rarekiller/config/BlacklistedMobs.xml
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: {0} is Member of the BlacklistedMobs.xml", o.Name);
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist15));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 15 Minutes.");
                        return;
                    }
                    if (Rarekiller.DontInteract)
                    {
                        return;
                    }
                    #endregion

                    if (Rarekiller.Settings.Alert)
                    {
                        Rarekiller.Alert();
                    }

                    #region fly to Helperpoint for some Pandaria Rares
                    if (Me.IsFlying && (o.Entry == 50817 || o.Entry == 50768 ||
                                        o.Entry == 50836 || o.Entry == 50782 || o.Entry == 50331 || o.Entry == 51078 ||
                                        o.Entry == 50822 || o.Entry == 50831 || o.Entry == 50832 || o.Entry == 50769 ||
                                        o.Entry == 50749 || o.Entry == 50334 || o.Entry == 50347 || o.Entry == 50811 ||
                                        o.Entry == 50821 || o.Entry == 50808 || o.Entry == 50820))
                    {
                        WoWPoint Helperpoint = o.Location;
                        if (o.Entry == 50817)
                        {
                            Helperpoint = LandingPoint50817;
                        }
                        if (o.Entry == 50768)
                        {
                            Helperpoint = LandingPoint50768;
                        }
                        if (o.Entry == 50836)
                        {
                            Helperpoint = LandingPoint50836;
                        }
                        if (o.Entry == 50782)
                        {
                            Helperpoint = LandingPoint50782;
                        }
                        if (o.Entry == 50831)
                        {
                            Helperpoint = LandingPoint50831;
                        }
                        if (o.Entry == 50832)
                        {
                            Helperpoint = LandingPoint50832;
                        }
                        if (o.Entry == 50769)
                        {
                            Helperpoint = LandingPoint50769;
                        }
                        if (o.Entry == 50822)
                        {
                            Helperpoint = LandingPoint50822;
                        }
                        if (o.Entry == 50331)
                        {
                            Helperpoint = LandingPoint50331;
                        }
                        if (o.Entry == 51078)
                        {
                            Helperpoint = LandingPoint51078;
                        }
                        if (o.Entry == 50749)
                        {
                            Helperpoint = LandingPoint50749;
                        }
                        if (o.Entry == 50334)
                        {
                            Helperpoint = LandingPoint50334;
                        }
                        if (o.Entry == 50347)
                        {
                            Helperpoint = LandingPoint50347;
                        }
                        if (o.Entry == 50811)
                        {
                            Helperpoint = LandingPoint50811;
                        }
                        if (o.Entry == 50821)
                        {
                            Helperpoint = LandingPoint50821;
                        }
                        if (o.Entry == 50808)
                        {
                            Helperpoint = LandingPoint50808;
                        }
                        if (o.Entry == 50820)
                        {
                            Helperpoint = LandingPoint50820;
                        }

                        if (!Rarekiller.MoveTo(Helperpoint, o, 5, false))
                        {
                            return;
                        }
                        Rarekiller.Dismount();
                    }
                    #endregion

                    #region Check PullRange
                    if (SpellManager.HasSpell(Rarekiller.Spells.RangedPullspell) && (
                            o.Entry == 50836 || o.Entry == 50782 || o.Entry == 50331 || o.Entry == 51078 ||
                            o.Entry == 50822 || o.Entry == 50831 || o.Entry == 50832 || o.Entry == 50768 ||
                            o.Entry == 50749 || o.Entry == 50334 || o.Entry == 50347 || o.Entry == 50811 ||
                            o.Entry == 50821 || o.Entry == 50808 || o.Entry == 50820))
                    {
                        Rarekiller.Settings.Range = "27";
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to 27 because of Inhouse Pandaria Rare");
                    }
                    else if (o.Entry == 50828 || o.Entry == 50836 || o.Entry == 50840 || o.Entry == 50823 ||
                             o.Entry == 50831 || o.Entry == 50830 || o.Entry == 50832 || o.Entry == 50750 ||
                             o.Entry == 50768 || o.Entry == 50772 || o.Entry == 50766 || o.Entry == 50769 ||
                             o.Entry == 50780 || o.Entry == 50776 || o.Entry == 50739 || o.Entry == 50749 ||
                             o.Entry == 50734 || o.Entry == 50364 || o.Entry == 50363 || o.Entry == 50733 ||
                             o.Entry == 50388 || o.Entry == 50341 || o.Entry == 50349 || o.Entry == 50340 ||
                             o.Entry == 50347 || o.Entry == 50338 || o.Entry == 50344 || o.Entry == 50339 ||
                             o.Entry == 50354 || o.Entry == 50351 || o.Entry == 50355 || o.Entry == 50356 ||
                             o.Entry == 50350 || o.Entry == 50352 || o.Entry == 50359 || o.Entry == 50821 ||
                             o.Entry == 50817 || o.Entry == 50822 || o.Entry == 50816 || o.Entry == 50811 ||
                             o.Entry == 50808 || o.Entry == 50820 || o.Entry == 50787 || o.Entry == 50806 ||
                             o.Entry == 50789 || o.Entry == 50805 || o.Entry == 50783 || o.Entry == 50782 ||
                             o.Entry == 50791 || o.Entry == 51059 || o.Entry == 50334 || o.Entry == 51078 ||
                             o.Entry == 50331 || o.Entry == 50332 || o.Entry == 50333 || o.Entry == 50336)
                    {
                        Rarekiller.Settings.Range = "3";
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to 3 because of other Pandaria Rares");
                    }

                    else if (!Rarekiller.Settings.DefaultPull && (Convert.ToInt64(Rarekiller.Settings.Range) > Convert.ToInt64(Rarekiller.Spells.RangeCheck(Rarekiller.Settings.Pull))))
                    {
                        Rarekiller.Settings.Range = Rarekiller.Spells.RangeCheck(Rarekiller.Settings.Pull);
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to {0} because of Low-Ranged Customized Spell", Rarekiller.Spells.RangeCheck(Rarekiller.Settings.Pull));
                    }

                    else if (Rarekiller.Settings.DefaultPull && (Convert.ToInt64(Rarekiller.Settings.Range) > Convert.ToInt64(Rarekiller.Spells.RangeCheck(Rarekiller.Spells.FastPullspell))))
                    {
                        Rarekiller.Settings.Range = Rarekiller.Spells.RangeCheck(Rarekiller.Spells.FastPullspell);
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Set Range to {0} because of Low-Ranged Default Spell", Rarekiller.Spells.RangeCheck(Rarekiller.Spells.FastPullspell));
                    }
                    #endregion

                    #region Move To Mob
                    if (o.Entry == 50817 || o.Entry == 50768 ||
                        o.Entry == 50836 || o.Entry == 50782 || o.Entry == 50331 || o.Entry == 51078 ||
                        o.Entry == 50822 || o.Entry == 50831 || o.Entry == 50832 || o.Entry == 50769 ||
                        o.Entry == 50749 || o.Entry == 50334 || o.Entry == 50347 || o.Entry == 50811 ||
                        o.Entry == 50821 || o.Entry == 50808 || o.Entry == 50820)
                    {
                        if (!Rarekiller.MoveTo(o, Convert.ToInt64(Rarekiller.Settings.Range), true))
                        {
                            return;
                        }
                    }
                    else
                    {
                        if (!Rarekiller.MoveTo(o, Convert.ToInt64(Rarekiller.Settings.Range), false))
                        {
                            return;
                        }
                    }
                    #endregion

                    #region Special Behavior Nal'lak
                    //if (Me.Combat && o.Entry == 50364) //Nal'lak
                    //{
                    //    WoWMovement.MoveStop();
                    //    Thread.Sleep(100);
                    //    if (Me.IsFlying)
                    //    {
                    //        WoWUnit GroundUnit = ObjectManager.GetObjectsOfType<WoWUnit>().Where(u => (!u.IsFlying)).OrderBy(u => u.Distance).FirstOrDefault(); ;
                    //        if (!Rarekiller.DescendToLand(GroundUnit)) return;
                    //    }
                    //    Rarekiller.Dismount();
                    //}
                    #endregion

                    #region Special Behavior Clean up Area
                    if (o.Entry == 50749 || o.Entry == 50334 || o.Entry == 50347)
                    {
                        ObjectManager.Update();
                        List <WoWUnit> AddList = ObjectManager.GetObjectsOfType <WoWUnit>().Where(Add => !Add.IsDead && Add.IsHostile && (Add != o) && Add.Location.Distance(o.Location) < 27 && Add.Location.Distance(Me.Location) < 27).OrderBy(Add => Add.Distance).ToList();
                        foreach (WoWUnit Add in AddList)
                        {
                            if (SpellManager.HasSpell(Rarekiller.Spells.RangedPullspell))
                            {
                                CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.RangedPullspell, Add, true);
                                Logging.Write(Colors.MediumPurple, "Rarekiller: Clean up Area, pull Add: {0}", Add.Name);
                                return;
                            }
                        }
                    }
                    #endregion

                    #region Pull Mob
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Pull at Mob Location: {0} / {1} / {2}", Convert.ToString(o.X), Convert.ToString(o.Y), Convert.ToString(o.Z));
                    Logging.Write(Colors.MediumPurple, "Rarekiller: ... my Location: {0} / {1} / {2}", Convert.ToString(Me.X), Convert.ToString(Me.Y), Convert.ToString(Me.Z));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Target is Flying - {0}", o.IsFlying);

                    o.Target();
                    if (SpellManager.HasSpell(Rarekiller.Spells.RangedPullspell) &&
                        (o.Entry == 50817 || o.Entry == 50768 ||
                         o.Entry == 50836 || o.Entry == 50782 || o.Entry == 50331 || o.Entry == 51078 ||
                         o.Entry == 50822 || o.Entry == 50831 || o.Entry == 50832 || o.Entry == 50769 ||
                         o.Entry == 50749 || o.Entry == 50334 || o.Entry == 50347 || o.Entry == 50811 ||
                         o.Entry == 50821 || o.Entry == 50808 || o.Entry == 50820))
                    {
                        CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.RangedPullspell, o, true);
                    }

                    else if (!(Rarekiller.Settings.DefaultPull) && SpellManager.HasSpell(Rarekiller.Settings.Pull))
                    {
                        CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Settings.Pull, o, false);
                    }
                    else if (SpellManager.HasSpell(Rarekiller.Spells.FastPullspell))
                    {
                        CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.FastPullspell, o, false);
                    }
                    else
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: I have no valid Pullspell - sorry");
                    }

                    if (Me.CurrentTarget != o)
                    {
                        o.Target();
                    }
                    #endregion

                    #region Quick Slowfall for known flying Mobs
                    if (Rarekiller.Settings.UseSlowfall && ((o.Entry == 29753) || (o.Entry == 32491) || (o.Entry == 32630) || (o.Entry == 33687) || (o.Entry == 50364)))
                    {
                        Thread.Sleep(500);
                        if (Me.IsFalling)
                        {
                            Rarekiller.Slowfall.HelpFalling();
                        }
                    }
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Use Quick Slowfall: {0} Mob: {1}", Me.IsFalling, o.Name);
                    #endregion

                    #region Pulltimer and Pullcounter
                    WaitAfterPullTimer.Reset();
                    WaitAfterPullTimer.Start();
                    while (WaitAfterPullTimer.IsRunning && !Rarekiller.ToonInvalidCombat && WaitAfterPullTimer.ElapsedMilliseconds < 2000)
                    {
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Wait for Combat now {0} ms", WaitAfterPullTimer.ElapsedMilliseconds);
                        Thread.Sleep(100);
                    }

                    if (CastSuccess && Me.Combat)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Successfully pulled {0}", o.Name);
                    }

                    if (o.Entry != 32491 && o.Entry != 50005 && (Rarekiller.Settings.GuidCurrentPull != o.Guid) && Me.Combat)
                    {
                        Rarekiller.Settings.PullCounter     = 1;
                        Rarekiller.Settings.GuidCurrentPull = o.Guid;
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Pulled {0} now first time", o.Name);
                    }
                    else if (Me.Combat)
                    {
                        Rarekiller.Settings.PullCounter++;
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Pulled {0} now {1} times", o.Name, Rarekiller.Settings.PullCounter);

                        if ((o.Entry == 50828 || o.Entry == 50836 || o.Entry == 50840 || o.Entry == 50823 ||
                             o.Entry == 50831 || o.Entry == 50830 || o.Entry == 50832 || o.Entry == 50750 ||
                             o.Entry == 50768 || o.Entry == 50772 || o.Entry == 50766 || o.Entry == 50769 ||
                             o.Entry == 50780 || o.Entry == 50776 || o.Entry == 50739 || o.Entry == 50749 ||
                             o.Entry == 50734 || o.Entry == 50364 || o.Entry == 50363 || o.Entry == 50733 ||
                             o.Entry == 50388 || o.Entry == 50341 || o.Entry == 50349 || o.Entry == 50340 ||
                             o.Entry == 50347 || o.Entry == 50338 || o.Entry == 50344 || o.Entry == 50339 ||
                             o.Entry == 50354 || o.Entry == 50351 || o.Entry == 50355 || o.Entry == 50356 ||
                             o.Entry == 50350 || o.Entry == 50352 || o.Entry == 50359 || o.Entry == 50821 ||
                             o.Entry == 50817 || o.Entry == 50822 || o.Entry == 50816 || o.Entry == 50811 ||
                             o.Entry == 50808 || o.Entry == 50820 || o.Entry == 50787 || o.Entry == 50806 ||
                             o.Entry == 50789 || o.Entry == 50805 || o.Entry == 50783 || o.Entry == 50782 ||
                             o.Entry == 50791 || o.Entry == 51059 || o.Entry == 50334 || o.Entry == 51078 ||
                             o.Entry == 50331 || o.Entry == 50332 || o.Entry == 50333 || o.Entry == 50336) &&
                            Me.Level < 90)
                        {
                            RoutineManager.Current.Combat();
                        }
                    }
                    #endregion

                    #region Move to a Save Fighting Area after Pull for some Pandaria Rares
                    if ((o.Entry == 50768 || o.Entry == 50832) && Me.Combat)
                    {
                        WoWPoint SaveHelperpoint = o.Location;
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Move to Save Fighting Point", o.Entry);

                        if (o.Entry == 50768)
                        {
                            SaveHelperpoint = SavePoint50768;
                        }

                        if (o.Entry == 50832)
                        {
                            SaveHelperpoint = SavePoint50832;
                        }

                        if (Navigator.CanNavigateFully(Me.Location, SaveHelperpoint))
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Move to Save Fighting Point");
                            while (Me.Location.Distance(SaveHelperpoint) > 5)
                            {
                                if (Me.IsSwimming)
                                {
                                    WoWMovement.ClickToMove(SaveHelperpoint);
                                }
                                else
                                {
                                    Navigator.MoveTo(SaveHelperpoint);
                                }
                                Thread.Sleep(100);
                                if (Rarekiller.ToonInvalid)
                                {
                                    return;
                                }
                            }
                        }
                        else
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Wasn't able to Move to Save Fighting Point", o.Entry);
                        }
                    }
                    #endregion

                    return;
                }
                else if (o.IsDead)
                {
                    if (o.Guid == Rarekiller.Settings.GuidCurrentPull)
                    {
                        Rarekiller.Settings.PullCounter     = 0;
                        Rarekiller.Settings.GuidCurrentPull = 0;
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Set PullCounter to {0}", Rarekiller.Settings.PullCounter);
                    }

                    if (o.CanLoot)
                    {
                        if (!Rarekiller.Loothelper(o))
                        {
                            return;
                        }
                    }

                    if (!Blacklist.Contains(o.Guid, Rarekiller.Settings.Flags))
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but sadly he's dead", o.Name);
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Mob for 60 Minutes.");
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Function to Find and Tame Mobs
        /// </summary>
        public void findAndTameMob(WoWUnit tamePet)
        {
            if (Me.Class != WoWClass.Hunter && !Rarekiller.Settings.TestcaseTamer)
            {
                return;
            }

            if (!tamePet.IsDead)
            {
                Logging.WriteQuiet(Colors.MediumPurple, "Rarekiller: Found a new Pet {0} ID {1}", tamePet.Name, tamePet.Entry);
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Unit Location: {0} / {1} / {2}", Convert.ToString(tamePet.X), Convert.ToString(tamePet.Y), Convert.ToString(tamePet.Z));
                if (Rarekiller.Settings.LUAoutput)
                {
                    Lua.DoString("print('NPCScan: Find {0} ID {1}')", tamePet.Name, tamePet.Entry);
                }

                #region don't tame if
                // Don't tame the Rare if ...
                if (Me.IsFlying && Me.IsOutdoors && tamePet.IsIndoors)
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Unit is Indoors and I fly Outdoors, so blacklist him to prevent Problems");
                    Logging.Write(Colors.MediumPurple, "Rarekiller: You have to place me next to the Spawnpoint, if you want me to hunt this Unit.");
                    Blacklist.Add(tamePet.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    Logging.WriteDiagnostic(Colors.MediumPurple, " Part TamerRarekiller: Blacklist Unit for 5 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: NPC is Indoors')", tamePet.Name);
                    }
                    return;
                }
                if (Me.Level < tamePet.Level)
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Unit Level is higher then mine, can't tame the Unit.");
                    Blacklist.Add(tamePet.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Unit for 60 Minutes.");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: NPC Level is to high to tame')", tamePet.Name);
                    }
                    return;
                }
                if (Rarekiller.BlacklistMobsList.ContainsKey(Convert.ToInt32(tamePet.Entry)))
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: {0} is Member of the BlacklistedMobs.xml", tamePet.Name);
                    Blacklist.Add(tamePet.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist15));
                    Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Blacklist Unit for 15 Minutes.");
                    return;
                }
                if (Rarekiller.DontInteract)
                {
                    return;
                }
                #endregion

                //Dismiss Pet
                if (Me.Class == WoWClass.Hunter && Me.Pet != null)
                {
                    RarekillerSpells.CastSafe("Dismiss Pet", Me, false);
                    //SpellManager.Cast("Dismiss Pet");
                    Thread.Sleep(3000);
                }

                if (Rarekiller.Settings.Alert)
                {
                    Rarekiller.Alert();
                }

                #region Move to tameable Unit
                if (!Rarekiller.MoveTo(tamePet, 20, false))
                {
                    return;
                }
                if (Me.IsFlying)
                {
                    if (!Rarekiller.DescendToLand(tamePet))
                    {
                        return;
                    }
                }
                Rarekiller.Dismount();
                #endregion

                tamePet.Target();
                if (Me.Class == WoWClass.Hunter)
                {
                    #region Tame
                    while (!tamePet.IsPet)
                    {
                        if (tamePet.IsDead)
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Oh no, I accidently killed him !!! ");
                            return;
                        }
                        if (Me.HealthPercent < 10)
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Health < 10% , Use Feign Death !!! ");
                            if (SpellManager.CanCast("Feign Death"))
                            {
                                RarekillerSpells.CastSafe("Feign Death", Me, false);
                            }
                            //SpellManager.Cast("Feign Death");
                            return;
                        }

                        if (!(Me.CastingSpellId == 1515))
                        {
                            WoWMovement.MoveStop();
                            RarekillerSpells.CastSafe("Tame Beast", tamePet, true);
                            //SpellManager.Cast(1515);
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Try to tame Beast {0}", tamePet.Name);
                            Thread.Sleep(500);
                        }
                    }
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Sucessfully tamed Beast {0}", tamePet.Name);
                    #endregion
                }

                else
                {
                    #region Testcase for my Shammi
                    while (!tamePet.IsDead)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller Test: Try to tame Beast", tamePet.Name);
                        Thread.Sleep(1500);
                    }
                    #endregion
                }
            }
            else if (tamePet.IsPet)
            {
                return;
            }
            else if (Blacklist.Contains(tamePet.Guid, Rarekiller.Settings.Flags))
            {
                return;
            }
            else
            {
                Logging.Write(Colors.MediumPurple, "Rarekiller: Find a Unit, but sadly he's dead or not tameable: {0}", tamePet.Name);
                Blacklist.Add(tamePet.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                Logging.Write(Colors.MediumPurple, "Rarekiller: Blacklist Unit for 5 Minutes.");
                return;
            }
        }
Пример #4
0
        /// <summary>
        /// Function to Find and Alert for Footsteps (Pandaria Rares to Tame)
        /// </summary>
        public void findandfollowFootsteps()
        {
            if (Me.Class != WoWClass.Hunter && !Rarekiller.Settings.TestcaseTamer)
            {
                return;
            }

            #region create a List with Objects in Reach
            // ----------------- Generate a List with all wanted Nests found in Object Manager ---------------------
            WoWGameObject Footprint = ObjectManager.GetObjectsOfType <WoWGameObject>()
                                      .Where(o => (!Blacklist.Contains(o.Guid, Rarekiller.Settings.Flags) && (
                                                       (o.Entry == 214430) || //patrannache footprint
                                                       (o.Entry == 214429) || //rockhide the immovable footprint
                                                       (o.Entry == 214431) || //bloodtooth footprint
                                                       (o.Entry == 214432) || //hexapos footprint
                                                       (o.Entry == 214433) || //stompy footprint
                                                       (o.Entry == 214434) || //bristlespine footprint
                                                       (o.Entry == 214435) || //portent footprint
                                                       (o.Entry == 214436) || //savage footprint
                                                       (o.Entry == 214437) || //glimmer footprint
                                                       ((o.Entry == 210565) && Rarekiller.Settings.TestcaseTamer) //Testcase for Developer
                                                       )))
                                      .OrderBy(o => o.Distance).FirstOrDefault();
            #endregion

            List <WoWUnit> RareList = ObjectManager.GetObjectsOfType <WoWUnit>()
                                      .Where(r => ((r.CreatureRank == Styx.WoWUnitClassificationType.Rare) && r.Level > 85 && !r.IsDead)).OrderBy(r => r.Distance).ToList();

            Logging.Write(Colors.MediumPurple, "Rarekiller: Found a Footprint {0} ID {1}", Footprint.Name, Footprint.Entry);
            Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Footprint Location: {0} / {1} / {2}", Convert.ToString(Footprint.X), Convert.ToString(Footprint.Y), Convert.ToString(Footprint.Z));
            if (Rarekiller.Settings.LUAoutput)
            {
                Lua.DoString("print('NPCScan: Find {0} ID {1}')", Footprint.Name, Footprint.Entry);
            }

            if (Rarekiller.Settings.Alert)
            {
                Rarekiller.Alert();
            }

            #region don't follow, if ...
            // ----------------- don't collect if Rare Pandaria Elite Around
            if (RareList != null)
            {
                foreach (WoWUnit r in RareList)
                {
                    if (r.Location.Distance(Footprint.Location) < 30)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach Footprint because there's a Rare Elite around, Blacklist and move on", Footprint.Name);
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: Footprint Elite Rare around')", Footprint.Name);
                        }
                        Blacklist.Add(Footprint.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        return;
                    }
                }
            }
            if (Rarekiller.DontInteract)
            {
                return;
            }
            #endregion

            while (Footprint != null)
            {
                if (Rarekiller.ToonInvalidCombat)
                {
                    return;
                }
                Rarekiller.MoveTo(Footprint, 10, false);

                #region Alert
                if (!Alerttimer.IsRunning)
                {
                    Alerttimer.Reset();
                    Alerttimer.Start();
                }
                // ----------------- Alert ---------------------
                if (Rarekiller.Settings.Alert && Alerttimer.Elapsed.TotalSeconds > 20)
                {
                    Rarekiller.Alert();
                    Alerttimer.Reset();
                    Alerttimer.Start();
                }
                #endregion

                #region create a List with Objects in Reach
                // ----------------- Generate a List with all wanted Nests found in Object Manager ---------------------
                Footprint = ObjectManager.GetObjectsOfType <WoWGameObject>()
                            .Where(o => (!Blacklist.Contains(o.Guid, Rarekiller.Settings.Flags) && (
                                             (o.Entry == 214430) || //patrannache footprint
                                             (o.Entry == 214429) || //rockhide the immovable footprint
                                             (o.Entry == 214431) || //bloodtooth footprint
                                             (o.Entry == 214432) || //hexapos footprint
                                             (o.Entry == 214433) || //stompy footprint
                                             (o.Entry == 214434) || //bristlespine footprint
                                             (o.Entry == 214435) || //portent footprint
                                             (o.Entry == 214436) || //savage footprint
                                             (o.Entry == 214437) || //glimmer footprint
                                             ((o.Entry == 210565) && Rarekiller.Settings.TestcaseTamer) //Testcase for Developer
                                             )))
                            .OrderBy(o => o.Distance).FirstOrDefault();
                #endregion
            }
        }
        /// <summary>
        /// Function to Find and Kill Dormus
        /// </summary>
        public void findAndKillDormus()
        {
            bool CastSuccess = false;
            //Testcases --> 51756 = Blutelfenjunge --> 52008 = Resortangestellter --> 50245 = Dormus
            int IDDormus = 50245;
            //Testcases --> 6346 = Fear Ward --> 974 = Earthsschild --> Dormus' Rage = 93269
            int IDDormusAura = 93269;

            ObjectManager.Update();
            WoWUnit Dormus = ObjectManager.GetObjectsOfType <WoWUnit>().Where(u => u.Entry == IDDormus).OrderBy(u => u.Distance).FirstOrDefault();

            #region Move to Dormus Helperpoint
            while (Me.HasAura(IDDormusAura) && Dormus == null && !Me.Combat && Me.Location.Distance(DormusPoint) > 5 && Me.Location.Distance(DormusPoint) < 500)
            {
                WoWMovement.ClickToMove(DormusPoint);
                Logging.Write(Colors.MediumPurple, "Rarekiller: Dormus not in sight, Swim to Dormus Helper Point");
                Thread.Sleep(500);

                ObjectManager.Update();
                Dormus = ObjectManager.GetObjectsOfType <WoWUnit>().Where(u => u.Entry == IDDormus).OrderBy(u => u.Distance).FirstOrDefault();
            }
            #endregion

            if (Dormus != null)
            {
                if (!Dormus.IsDead)
                {
                    Logging.WriteQuiet(Colors.MediumPurple, "Rarekiller: Find {0}", Dormus.Name);

                    if (Rarekiller.Settings.Alert)
                    {
                        Rarekiller.Alert();
                    }

                    Dormus.Target();

                    #region Move to Dormus
                    // ------------- Move to Dormus with Klick to Move -------------------

                    while (DormusPoint.Distance(Me.Location) > 5 && Me.HasAura(IDDormusAura) && !Dormus.IsDead && !Rarekiller.Settings.ReachedDormusHelperpoint)
                    {
                        WoWMovement.ClickToMove(DormusPoint);
                        Thread.Sleep(100);
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Move out of Water to Helperpoint");
                        if (Rarekiller.ToonInvalidCombat)
                        {
                            return;
                        }
                    }
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Reached Dormus Helperpoint");
                    Rarekiller.Settings.ReachedDormusHelperpoint = true;

                    while (Dormus.Location.Distance(Me.Location) > 3 && Me.HasAura(IDDormusAura) && !Dormus.IsDead)
                    {
                        if (Navigator.CanNavigateFully(Me.Location, Dormus.Location))
                        {
                            Navigator.MoveTo(Dormus.Location);
                        }
                        else
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Navigation Issue, use Click to Move");
                            WoWMovement.ClickToMove(Dormus.Location);
                        }
                        Thread.Sleep(100);
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Move to Dormus");
                        if (Rarekiller.ToonInvalidCombat)
                        {
                            return;
                        }
                    }
                    WoWMovement.MoveStop();
                    #endregion

                    #region Pull Dormus
                    // ------------- pull Dormus  -------------------
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Distance: {0}", Dormus.Location.Distance(Me.Location));
                    Dormus.Target();
                    Dormus.Face();
                    Thread.Sleep(100);


                    if (!(Rarekiller.Settings.DefaultPull) && SpellManager.HasSpell(Rarekiller.Settings.Pull))
                    {
                        CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Settings.Pull, Dormus, false);
                    }
                    //CastSuccess = SpellManager.Cast(Rarekiller.Settings.Pull, Dormus);
                    else if (SpellManager.HasSpell(Rarekiller.Spells.FastPullspell))
                    {
                        CastSuccess = RarekillerSpells.CastSafe(Rarekiller.Spells.FastPullspell, Dormus, false);
                    }
                    //CastSuccess = SpellManager.Cast(Rarekiller.Spells.FastPullspell, Dormus);
                    else
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: I have no Pullspell");
                    }
                    if (!CastSuccess && SpellManager.HasSpell("Shoot"))
                    {
                        CastSuccess = RarekillerSpells.CastSafe("Shoot", Dormus, true);
                    }
                    //CastSuccess = SpellManager.Cast("Shoot", Dormus);
                    if (CastSuccess)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: successfully pulled Dormus");
                        Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Pull Distance: {0}", Dormus.Location.Distance(Me.Location));
                        return;
                    }
                    else if (!CastSuccess && Me.Combat)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: got Aggro");
                    }
                    else
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Pull Fails --> next try");
                    }
                    #endregion
                }
                else if (!Blacklist.Contains(Dormus.Guid, Rarekiller.Settings.Flags))
                {
                    if (Dormus.CanLoot)
                    {
                        if (!Rarekiller.Loothelper(Dormus))
                        {
                            return;
                        }
                    }

                    if (!Blacklist.Contains(Dormus.Guid, Rarekiller.Settings.Flags))
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Find {0}, but sadly he's dead", Dormus.Name);
                        Blacklist.Add(Dormus.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Blacklist Unit for 60 Minutes.");
                    }
                }
            }
        }
        /// <summary>
        /// Function to Find and Interact with NPCs
        /// </summary>
        public void findAndInteractNPC(WoWUnit InteractNPC)
        {
            List <WoWUnit> RareList = ObjectManager.GetObjectsOfType <WoWUnit>()
                                      .Where(r => ((r.CreatureRank == Styx.WoWUnitClassificationType.Rare) && r.Level > 85 && !r.IsDead)).OrderBy(r => r.Distance).ToList();

            bool Forceground = false;

            Logging.WriteQuiet(Colors.MediumPurple, "Rarekiller: Find NPC {0} ID {1}", InteractNPC.Name, InteractNPC.Entry);
            Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: NPC Location: {0} / {1} / {2}", Convert.ToString(InteractNPC.X), Convert.ToString(InteractNPC.Y), Convert.ToString(InteractNPC.Z));
            if (Rarekiller.Settings.LUAoutput)
            {
                Lua.DoString("print('NPCScan: Find {0} ID {1}')", InteractNPC.Name, InteractNPC.Entry);
            }

            if (Rarekiller.Settings.Alert)
            {
                Rarekiller.Alert();
            }

            #region don't collect if ...
            // ----------------- Underground ----------
            //if not ID of Underground NPCs of Another Mans Treasure --> don't collect
            if (!(InteractNPC.Entry == 64227))
            {
                if (InteractNPC.IsIndoors && Me.IsFlying && Me.IsOutdoors && (InteractNPC.Location.Distance(Me.Location) > 30))
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach NPC because it is Indoors and I fly Outdoors {0}, Blacklist and Move on", InteractNPC.Name);
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: NPC is Indoors')", InteractNPC.Name);
                    }
                    Blacklist.Add(InteractNPC.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    return;
                }
            }
// -----------------  don't collect if Rare Pandaria Elite Around
            if (RareList != null)
            {
                foreach (WoWUnit r in RareList)
                {
                    if (r.Location.Distance(InteractNPC.Location) < 30)
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach NPC because there's a Rare Elite around, Blacklist and move on", InteractNPC.Name);
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: NPC Elite Rare around')", InteractNPC.Name);
                        }
                        Blacklist.Add(InteractNPC.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        return;
                    }
                }
            }
            if (Rarekiller.Settings.PlayerScan && RarekillerSecurity.PlayerAround(InteractNPC))
            {
                Logging.Write(Colors.MediumPurple, "Rarekiller: There are other Players around, so move on");
                if (Rarekiller.Settings.LUAoutput)
                {
                    Lua.DoString("print('NPCScan: Other Players around')");
                }
                Blacklist.Add(InteractNPC.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                return;
            }
            if (Rarekiller.DontInteract)
            {
                return;
            }
            #endregion

            #region Move to Helperpoint if found known Figurine under a Tent
            if (Me.IsFlying && ((InteractNPC.Location.Distance(ProblemCamel1) < 10) || (InteractNPC.Location.Distance(ProblemCamel2) < 10) ||
                                (InteractNPC.Location.Distance(ProblemCamel3) < 10) || (InteractNPC.Location.Distance(ProblemCamel4) < 20)))
            {
                WoWPoint HelperPointCamel = InteractNPC.Location;
                HelperPointCamel.X = HelperPointCamel.X + 20;
                HelperPointCamel.Z = HelperPointCamel.Z + 5;
                Logging.Write(Colors.MediumPurple, "Rarekiller: Found a Problem Figurine {0} so dismount and walk", InteractNPC.Entry);
                if (!Rarekiller.MoveTo(HelperPointCamel, 3, false))
                {
                    return;
                }
                //if (!Rarekiller.DescendToLand(o)) return;
                Rarekiller.Dismount();
                Forceground = true;
            }
            #endregion

            #region Move to Helperpoint if known Underground NPC
            if (Me.IsFlying && InteractNPC.Entry == 64227)
            {
                if (!Rarekiller.MoveTo(LandingPoint64227, 5, false))
                {
                    return;
                }
                Rarekiller.Dismount();
                Forceground = true;
            }
            #endregion

            #region Move to NPC
            if (Me.IsFlying && Forceground)
            {
                Logging.Write(Colors.MediumPurple, "Rarekiller: Failure in Programming. Fly again to Helperpoint and Dismount", InteractNPC.Entry);
                return;
            }
            if (!Rarekiller.MoveTo(InteractNPC, 4, Forceground))
            {
                return;
            }
            Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: NPC Location: {0} / {1} / {2}", Convert.ToString(InteractNPC.X), Convert.ToString(InteractNPC.Y), Convert.ToString(InteractNPC.Z));
            Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: My Location: {0} / {1} / {2}", Convert.ToString(Me.X), Convert.ToString(Me.Y), Convert.ToString(Me.Z));
            Rarekiller.Dismount();
            #endregion

            InteractNPC.Interact();
            InteractNPC.Interact();
            InteractNPC.Interact();
            Logging.Write(Colors.MediumPurple, "Rarekiller: Interact with NPC - ID {0}", InteractNPC.Entry);
            Thread.Sleep(300);

            //Another Mans Treasure NPCs
            if (InteractNPC.Entry == 65552 || InteractNPC.Entry == 64272 || InteractNPC.Entry == 64004 || InteractNPC.Entry == 64191 || InteractNPC.Entry == 64227)
            {
                Thread.Sleep(1000);
                Lua.DoString("RunMacroText(\"/click GossipTitleButton1\");");
                Thread.Sleep(1000);
            }
            //Blingtron
            if (InteractNPC.Entry == 43929)
            {
                Thread.Sleep(1000);
                Lua.DoString("SelectGossipAvailableQuest(GetNumGossipAvailableQuests())");
                Thread.Sleep(1000);
                Lua.DoString("RunMacroText(\"/click QuestFrameCompleteQuestButton\")");
                Thread.Sleep(1000);
                Blacklist.Add(InteractNPC.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist60));
            }
        }
        /// <summary>
        /// Function Find and Pickup Objects
        /// </summary>
        public void findAndPickupObject()
        {
            #region create a List with Objects in Reach
            // ----------------- Generate a List with all wanted Nests found in Object Manager ---------------------
            ObjectManager.Update();
            List <WoWGameObject> objList = ObjectManager.GetObjectsOfType <WoWGameObject>()
                                           .Where(o => (!Blacklist.Contains(o.Guid, Rarekiller.Settings.Flags) && (((o.Entry == 202082) && Rarekiller.Settings.RaptorNest) ||
                                                                                                                   ((o.Entry == 202080) && Rarekiller.Settings.RaptorNest) ||
                                                                                                                   ((o.Entry == 202083) && Rarekiller.Settings.RaptorNest) ||
                                                                                                                   ((o.Entry == 202081) && Rarekiller.Settings.RaptorNest) ||
                                                                                                                   ((o.Entry == 210565) && Rarekiller.Settings.DarkSoil) ||
                                                                                                                   ((o.Entry == 214945) && Rarekiller.Settings.OnyxEgg) ||
                                                                                                                   (Rarekiller.AnotherMansTreasureList.ContainsKey(Convert.ToInt32(o.Entry)) && Rarekiller.Settings.AnotherMansTreasure && o.Entry > 200000) ||
                                                                                                                   (Rarekiller.CollectObjectsList.ContainsKey(Convert.ToInt32(o.Entry)) && Rarekiller.Settings.ObjectsCollector) ||
                                                                                                                   ((o.Entry == 206195) && Rarekiller.Settings.TestRaptorNest) //Testcase Thundermar Ale Keg
                                                                                                                   )))
                                           .OrderBy(o => o.Distance).ToList();
            List <WoWUnit> RareList = ObjectManager.GetObjectsOfType <WoWUnit>()
                                      .Where(r => ((r.CreatureRank == Styx.WoWUnitClassificationType.Rare) && r.Level > 85 && !r.IsDead)).OrderBy(r => r.Distance).ToList();
            #endregion

            foreach (WoWGameObject o in objList)
            {
                Logging.WriteQuiet(Colors.MediumPurple, "Rarekiller: Find A Object to collect {0} ID {1}", o.Name, o.Entry);
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Object Location: {0} / {1} / {2}", Convert.ToString(o.X), Convert.ToString(o.Y), Convert.ToString(o.Z));
                if (Rarekiller.Settings.LUAoutput)
                {
                    Lua.DoString("print('NPCScan: Find {0} ID {1}')", o.Name, o.Entry);
                }

                if (Rarekiller.Settings.Alert)
                {
                    Rarekiller.Alert();
                }

                #region don't collect, if ...
                if (o.Entry == 213970 || o.Entry == 213362)
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach Object because it is under Water {0}, Blacklist and Move on", o.Name);
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: Object is under Water')");
                    }
                    Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    return;
                }

// ----------------- Underground Object ----------
                //if not ID of known Underground Object of Another Mans Treasure --> don't collect
                if (!(o.Entry == 213364 || o.Entry == 214337 || o.Entry == 213649 || o.Entry == 213650 || o.Entry == 214340 || o.Entry == 213651 ||
                      o.Entry == 213750 || o.Entry == 214325 || o.Entry == 213768 || o.Entry == 213751 || o.Entry == 213770 || o.Entry == 213793 ||
                      o.Entry == 213769 || o.Entry == 214438 || o.Entry == 214407 || o.Entry == 213956))  // || o.Entry == 213970  || o.Entry == 213362
                {
                    if (o.IsIndoors && Me.IsFlying && Me.IsOutdoors && (o.Location.Distance(Me.Location) > 30))
                    {
                        Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach Object because it is Indoors and I fly Outdoors {0}, Blacklist and Move on", o.Name);
                        if (Rarekiller.Settings.LUAoutput)
                        {
                            Lua.DoString("print('NPCScan: Object is Indoors')");
                        }
                        Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                        return;
                    }
                }
// ----------------- don't collect if Rare Pandaria Elite Around
                if (RareList != null)
                {
                    foreach (WoWUnit r in RareList)
                    {
                        if (r.Location.Distance(o.Location) < 30)
                        {
                            Logging.Write(Colors.MediumPurple, "Rarekiller: Can't reach Object because there's a Rare Elite around, Blacklist and move on", o.Name);
                            if (Rarekiller.Settings.LUAoutput)
                            {
                                Lua.DoString("print('NPCScan: Object Elite Rare around')", o.Name);
                            }
                            Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                            return;
                        }
                    }
                }

                if (Rarekiller.Settings.PlayerScan && RarekillerSecurity.PlayerAround(o))
                {
                    Logging.Write(Colors.MediumPurple, "Rarekiller: There are other Players around, so move on");
                    if (Rarekiller.Settings.LUAoutput)
                    {
                        Lua.DoString("print('NPCScan: Other Players around')");
                    }
                    Blacklist.Add(o.Guid, Rarekiller.Settings.Flags, TimeSpan.FromSeconds(Rarekiller.Settings.Blacklist5));
                    return;
                }
                if (Rarekiller.DontInteract)
                {
                    return;
                }
                #endregion

                #region fly to Helperpoint if known Underground Object
                //ToDo IDs of Underground NPCs
                if (Me.IsFlying && (o.Entry == 213364 || o.Entry == 214337 || o.Entry == 213649 || o.Entry == 213650 || o.Entry == 214340 || o.Entry == 213651 ||
                                    o.Entry == 213750 || o.Entry == 214325 || o.Entry == 213768 || o.Entry == 213751 || o.Entry == 213770 || o.Entry == 213793 ||
                                    o.Entry == 213769 || o.Entry == 214438 || o.Entry == 214407 || o.Entry == 213956 || o.Entry == 213970 || o.Entry == 213362))
                {
                    WoWPoint Helperpoint = o.Location;
                    if (o.Entry == 213364)
                    {
                        Helperpoint = LandingPoint213364;
                    }
                    if (o.Entry == 214337)
                    {
                        Helperpoint = LandingPoint214337;
                    }
                    if (o.Entry == 213649)
                    {
                        Helperpoint = LandingPoint213649;
                    }
                    if (o.Entry == 213650)
                    {
                        Helperpoint = LandingPoint213650;
                    }
                    if (o.Entry == 214340)
                    {
                        Helperpoint = LandingPoint214340;
                    }
                    if (o.Entry == 213651)
                    {
                        Helperpoint = LandingPoint213651;
                    }
                    if (o.Entry == 213750)
                    {
                        Helperpoint = LandingPoint213750;
                    }
                    if (o.Entry == 214325)
                    {
                        Helperpoint = LandingPoint214325;
                    }
                    if (o.Entry == 213768)
                    {
                        Helperpoint = LandingPoint213768;
                    }
                    if (o.Entry == 213751)
                    {
                        Helperpoint = LandingPoint213751;
                    }
                    if (o.Entry == 213770)
                    {
                        Helperpoint = LandingPoint213770;
                    }
                    if (o.Entry == 213793)
                    {
                        Helperpoint = LandingPoint213793;
                    }
                    if (o.Entry == 213769)
                    {
                        Helperpoint = LandingPoint213769;
                    }
                    if (o.Entry == 214438)
                    {
                        Helperpoint = LandingPoint214438;
                    }
                    if (o.Entry == 214407)
                    {
                        Helperpoint = LandingPoint214407;
                    }
                    if (o.Entry == 213956)
                    {
                        Helperpoint = LandingPoint213956;
                    }
                    if (o.Entry == 213970)
                    {
                        Helperpoint = LandingPoint213970;
                    }
                    if (o.Entry == 213362)
                    {
                        Helperpoint = LandingPoint213362;
                    }

                    if (!Rarekiller.MoveTo(Helperpoint, 5, false))
                    {
                        return;
                    }
                    Rarekiller.Dismount();
                }
                #endregion

                #region Move to Object
                // ----------------- Move to Object Part ---------------------
                if (o.Entry == 213364 || o.Entry == 214337 || o.Entry == 213649 || o.Entry == 213650 || o.Entry == 214340 || o.Entry == 213651 ||
                    o.Entry == 213750 || o.Entry == 214325 || o.Entry == 213768 || o.Entry == 213751 || o.Entry == 213770 || o.Entry == 213793 ||
                    o.Entry == 213769 || o.Entry == 214438 || o.Entry == 214407 || o.Entry == 213956 || o.Entry == 213970 || o.Entry == 213362)
                {
                    if (!Rarekiller.MoveTo(o, 4, true))
                    {
                        return;
                    }
                }
                else
                {
                    if (!Rarekiller.MoveTo(o, 4, false))
                    {
                        return;
                    }
                }
                #endregion

                // Collect Object
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: Object Location: {0} / {1} / {2}", Convert.ToString(o.X), Convert.ToString(o.Y), Convert.ToString(o.Z));
                Logging.WriteDiagnostic(Colors.MediumPurple, "Rarekiller: My Location: {0} / {1} / {2}", Convert.ToString(Me.X), Convert.ToString(Me.Y), Convert.ToString(Me.Z));
                Rarekiller.Dismount();
                if (Rarekiller.ToonInvalidCombat)
                {
                    return;
                }
                Thread.Sleep(1000);
                o.Interact();
                o.Interact();
                o.Interact();
                Thread.Sleep(1000);
                Lua.DoString("RunMacroText(\"/click StaticPopup1Button1\");");
                Thread.Sleep(1000);
                Logging.Write(Colors.MediumPurple, "Rarekiller: Interact with {0} - ID {1}", o.Name, o.Entry);
            }
        }