Exemple #1
0
        private void timer_Tick(object sender, EventArgs e)
        {
            try
            {
                ACDActor acd = finder.FindBestItem();
                if (acd != null)
                {
                    if (acd.ACDType == ACDType.Item)
                    {
                        Item item = new Item(acd);
                        switch (item.Quality)
                        {
                        case ItemQuality.CraftingPlan: Sounds.PlaySound(Sound.Crafting); break;

                        case ItemQuality.Rare: Sounds.PlaySound(Sound.Rare); break;

                        case ItemQuality.Magic: Sounds.PlaySound(Sound.Magic); break;

                        case ItemQuality.Legendary: Sounds.PlaySound(Sound.Legendary); break;
                        }
                    }
                    else if (acd.IsGoblin())
                    {
                        Sounds.PlaySound(Sound.Goblin);
                    }
                }
            }
            catch (Exception ex)
            {
                SetStatus(false);
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
            }
        }
Exemple #2
0
 public static bool ShouldPlay(ACDActor a)
 {
     foreach (Filter t in filters)
     {
         if (t.CheckActor(a) == true)
             return true;
     }
     return false;
 }
Exemple #3
0
 public override bool Equals(object obj)
 {
     if (obj is ACDActor)
     {
         ACDActor other = (ACDActor)obj;
         return(base.Equals(obj) && other.ACDID == CachedACDID && other.ACDAddress == ACDAddress);
     }
     return(false);
 }
Exemple #4
0
 public static void PlaySoundForActor(ACDActor a)
 {
     foreach (Filter t in filters)
     {
         if (t.CheckActor(a) == true)
         {
             t.sound.Play();
             return;
         }
     }
 }
Exemple #5
0
 public static void PlaySoundForActor(ACDActor a)
 {
     foreach (Filter t in filters)
     {
         if (t.CheckActor(a) == true)
         {
             t.sound.Play();
             return;
         }
     }
 }
Exemple #6
0
 public static bool ShouldPlay(ACDActor a)
 {
     foreach (Filter t in filters)
     {
         if (t.CheckActor(a) == true)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #7
0
 private void timer_Tick(object sender, EventArgs e)
 {
     try
     {
         ACDActor acd = finder.FindBestItem();
         if (acd != null)
         {
             Settings.PlaySoundForActor(acd);
         }
     }
     catch (Exception ex)
     {
         SetStatus(false);
         MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
     }
 }
Exemple #8
0
        public ACDActor FindBestItem()
        {
            if (d3.Valid == false)
            {
                return(null);
            }
            ACDActor player = d3.Player();

            if (player == null || player.IsValid() == false)
            {
                return(null);
            }

            if (LastLevelArea != d3.CurrentLevelArea())
            {
                IgnoreList.Clear();
                LastLevelArea = d3.CurrentLevelArea();
            }

            foreach (ACDActor a in d3.GetACDActors())
            {
                if (a.IsValid() == false)
                {
                    continue;
                }
                if (IgnoreList.Contains(a))
                {
                    continue;
                }

                if (a.ACDType == ACDType.Item)
                {
                    Item        item = new Item(a);
                    ItemQuality q    = item.Quality;

                    if (q == ItemQuality.Legendary && Settings.PlayOnLegendary)
                    {
                        IgnoreList.Add(a);
                        return(a);
                    }
                    if (q == ItemQuality.Rare && Settings.PlayOnRare)
                    {
                        bool Max62 = item.MaximumLevel() == 62;
                        if ((Max62 && item.ItemLevel >= Settings.Min62s) ||
                            (!Max62 && item.ItemLevel >= Settings.Min63s) ||
                            item.IsJewelry() && item.ItemLevel >= Settings.MinJewelry)
                        {
                            IgnoreList.Add(a);
                            return(a);
                        }
                    }
                    if (q == ItemQuality.Magic && Settings.PlayOnMagic)
                    {
                        if (item.ItemLevel >= Settings.MinMagic)
                        {
                            IgnoreList.Add(a);
                            return(a);
                        }
                    }

                    if (q == ItemQuality.CraftingPlan && Settings.PlayOnCrafting)
                    {
                        IgnoreList.Add(a);
                        return(a);
                    }
                }

                else if (Settings.PlayOnGoblin && a.IsGoblin())
                {
                    IgnoreList.Add(a);
                    return(a);
                }
            }
            return(null);
        }