Esempio n. 1
0
        void Scan()
        {
            //Scan() runs in a BackgroundWorker thread, so it CANNOT access UI elements!

            //not running Archeage, no data
            if (ArcheBuddyCore == null)
            {
                return;
            }

            RadarTab settings = CurrentSettings.ActiveTab;

            if (settings.ShowDoodads || settings.ShowHarvestableTrees || settings.ShowHarvestablePlants || settings.ShowUprootable || settings.ShowTradePacks)
            {
                doodads = RadarScanner.ScanDoodads(settings, ArcheBuddyCore);
            }
            else
            {
                doodads = null;
            }

            if (settings.ShowAlliedPlayers || settings.ShowEnemyNPCs || settings.ShowEnemyPlayers || CurrentSettings.HouseScanSettings.ShowRealEstate || settings.ShowFriendlyNPCs)
            {
                creatures = RadarScanner.ScanCreatures(CurrentSettings, ArcheBuddyCore);
            }
            else
            {
                creatures = null;
            }
        }
Esempio n. 2
0
        void ShowAllButton_Click(object sender, RoutedEventArgs e)
        {
            RadarTab tab = (RadarTab)this.DataContext;

            foreach (PropertyInfo boolP in tab.GetType().GetProperties().Where(prop => prop.Name.StartsWith("Show")))
            {
                boolP.SetValue(tab, true);
            }
        }
Esempio n. 3
0
        public static List <ClassifiedObject> ScanDoodads(RadarTab settings, Core ArcheBuddyCore)
        {
            List <DoodadObject>     AllDoodads      = ArcheBuddyCore.getDoodads();
            List <ClassifiedObject> FilteredDoodads = new List <ClassifiedObject>(AllDoodads.Count);

            foreach (DoodadObject doodad in AllDoodads)
            {
                //ignore doodads that are in protected plant zones, or public farms
                if (doodad.plantZoneId != 0 || doodad.commonFarmId > 0)
                {
                    continue;
                }

                if (doodad.name.StartsWith("Thunderstruck"))
                {
                    FilteredDoodads.Add(new ClassifiedObject()
                    {
                        obj = doodad, category = ObjectCategory.ThunderstruckTree
                    });
                    continue;
                }

                if (doodad.name.StartsWith("Sunken Treasure") || doodad.name.StartsWith("Old Jar") || doodad.name.StartsWith("Old Relic"))
                {
                    FilteredDoodads.Add(new ClassifiedObject()
                    {
                        obj = doodad, category = ObjectCategory.Treasure
                    });
                    continue;
                }

                if (doodad.name.Contains("Schooling") || doodad.name.Contains("Feeding Frenzy"))
                {
                    FilteredDoodads.Add(new ClassifiedObject()
                    {
                        obj = doodad, category = ObjectCategory.FishSchool
                    });
                    continue;
                }
                //try to identify the doodad using its skills
                Skill        sk        = GetFirstDoodadSkill(doodad);
                List <Skill> allSkills = doodad.getUseSkills();
                if (sk == null)
                {
                    //doodad is not interactable at all, or is a buried treasure site
                    continue;
                }

                if (settings.ShowHarvestableTrees)
                {
                    if (allSkills.Any(s => s.name.StartsWith("Find Fruit")))
                    {
                        FilteredDoodads.Add(new ClassifiedObject()
                        {
                            obj = doodad, category = ObjectCategory.FruitedTree
                        });
                        continue;
                    }
                    if (allSkills.Any(s => s.name.StartsWith("Chop Tree")))
                    {
                        FilteredDoodads.Add(new ClassifiedObject()
                        {
                            obj = doodad, category = ObjectCategory.HarvestableTree
                        });
                        continue;
                    }
                }

                if (settings.ShowHarvestablePlants)
                {
                    if (sk.name.StartsWith("Gather") || sk.name.StartsWith("Harvest"))
                    {
                        FilteredDoodads.Add(new ClassifiedObject()
                        {
                            obj = doodad, category = ObjectCategory.HarvestablePlant
                        });
                        continue;
                    }

                    if (doodad.id == 1671)   //Both Iron and Fortuna veins seem to have this same id
                    {
                        FilteredDoodads.Add(new ClassifiedObject()
                        {
                            obj = doodad, category = ObjectCategory.Ore
                        });
                        continue;
                    }

                    if (sk.name.StartsWith("Butcher") && settings.ShowHarvestablePlants)
                    {
                        FilteredDoodads.Add(new ClassifiedObject()
                        {
                            obj = doodad, category = ObjectCategory.Butcherable
                        });
                        continue;
                    }
                }

                if (settings.ShowUprootable)
                {
                    if (sk.id == 13789 || sk.name.StartsWith("Uproot"))
                    {
                        FilteredDoodads.Add(new ClassifiedObject()
                        {
                            obj = doodad, category = ObjectCategory.Uprootable
                        });
                        continue;
                    }
                }

                if (settings.ShowTradePacks && TradePackNames.Any(doodad.name.Contains))
                {
                    if (sk.name.StartsWith("Collect"))
                    {
                        //trade pack could be bugged and at the bottom of the world or something.  IDK why but these show up a lot
                        if (Math.Abs(ArcheBuddyCore.me.Z - doodad.Z) < 200)
                        {
                            FilteredDoodads.Add(new ClassifiedObject()
                            {
                                obj = doodad, category = ObjectCategory.TradePack
                            });
                        }

                        continue;
                    }
                }
            }
            return(FilteredDoodads);

            //ArcheBuddyCore.Log("Scanned and found " + doodads.Count.ToString() + " doodads.");
        }