private static bool RefreshStepCheckBlacklists(bool AddToCache) { if (!DataDictionary.Avoidances.Contains(CurrentCacheObject.ActorSNO) && !DataDictionary.AvoidanceBuffs.Contains(CurrentCacheObject.ActorSNO) && !CurrentCacheObject.IsBountyObjective && !CurrentCacheObject.IsQuestMonster) { // See if it's something we should always ignore like ravens etc. if (!c_IsObstacle && DataDictionary.BlackListIds.Contains(CurrentCacheObject.ActorSNO)) { AddToCache = false; c_IgnoreSubStep = "Blacklist"; return(AddToCache); } // Temporary ractor GUID ignoring, to prevent 2 interactions in a very short time which can cause stucks if (_ignoreTargetForLoops > 0 && _ignoreRactorGuid == CurrentCacheObject.RActorGuid) { AddToCache = false; c_IgnoreSubStep = "IgnoreRactorGUID"; return(AddToCache); } // Check our extremely short-term destructible-blacklist if (_destructible3SecBlacklist.Contains(CurrentCacheObject.RActorGuid)) { AddToCache = false; c_IgnoreSubStep = "Destructible3SecBlacklist"; return(AddToCache); } // Check our extremely short-term destructible-blacklist if (Blacklist3Seconds.Contains(CurrentCacheObject.RActorGuid)) { AddToCache = false; c_IgnoreSubStep = "hashRGUIDBlacklist3"; return(AddToCache); } // See if it's on our 90 second blacklist (from being stuck targeting it), as long as it's distance is not extremely close if (Blacklist90Seconds.Contains(CurrentCacheObject.RActorGuid)) { AddToCache = false; c_IgnoreSubStep = "Blacklist90Seconds"; return(AddToCache); } // 60 second blacklist if (Blacklist60Seconds.Contains(CurrentCacheObject.RActorGuid)) { AddToCache = false; c_IgnoreSubStep = "Blacklist60Seconds"; return(AddToCache); } // 15 second blacklist if (Blacklist15Seconds.Contains(CurrentCacheObject.RActorGuid)) { AddToCache = false; c_IgnoreSubStep = "Blacklist15Seconds"; return(AddToCache); } } else { AddToCache = true; } return(AddToCache); }
/// <summary> /// Adds Legendary & Set Minimap Markers to ObjectCache /// </summary> private static void RefreshCacheMarkers() { const int setItemMarkerTexture = 404424; const int legendaryItemMarkerTexture = 275968; if (!BrainBehavior.IsVendoring && !WantToTownRun && !ForceVendorRunASAP && Settings.Loot.Pickup.PickupLegendaries) { var legendaryItemMarkers = ZetaDia.Minimap.Markers.CurrentWorldMarkers.Where(m => m.IsValid && m.Position.Distance2D(Player.Position) >= 45f && m.Position.Distance2D(Player.Position) < 300f && (m.MinimapTexture == setItemMarkerTexture || m.MinimapTexture == legendaryItemMarkerTexture) && !Blacklist60Seconds.Contains(m.NameHash)).ToList(); foreach (var marker in legendaryItemMarkers) { var name = (marker.MinimapTexture == setItemMarkerTexture ? "Set Item" : "Legendary Item") + " Minimap Marker"; var cacheObject = new TrinityCacheObject { Position = new Vector3((float)Math.Floor(marker.Position.X), (float)Math.Floor(marker.Position.Y), (float)Math.Floor(marker.Position.Z)), InternalName = name, ActorSNO = marker.NameHash, RActorGuid = marker.MinimapTexture, Distance = marker.Position.Distance(Player.Position), ActorType = ActorType.Item, Type = TrinityObjectType.Item, ItemQuality = ItemQuality.Legendary, Radius = 2f, Weight = 50, IsMarker = true }; cacheObject.ObjectHash = HashGenerator.GenerateItemHash(cacheObject); if (GenericBlacklist.ContainsKey(cacheObject.ObjectHash)) { Logger.LogDebug(LogCategory.CacheManagement, "Ignoring Marker because it's blacklisted {0} {1} at {2} distance {3}", name, marker.MinimapTexture, marker.Position, marker.Position.Distance(Player.Position)); continue; } Logger.LogDebug(LogCategory.CacheManagement, "Adding {0} {1} at {2} distance {3}", name, marker.MinimapTexture, marker.Position, marker.Position.Distance(Player.Position)); ObjectCache.Add(cacheObject); } if (legendaryItemMarkers.Any() && TrinityItemManager.FindValidBackpackLocation(true) != new Vector2(-1, -1)) { var legendaryItems = ZetaDia.Actors.GetActorsOfType <DiaItem>().Where(i => i.IsValid && i.IsACDBased && i.Position.Distance2D(ZetaDia.Me.Position) < 5f && legendaryItemMarkers.Any(im => i.Position.Distance2D(i.Position) < 2f)); foreach (var diaItem in legendaryItems) { Logger.LogDebug(LogCategory.CacheManagement, "Adding Legendary Item from Marker {0} dist={1} ActorSNO={2} ACD={3} RActor={4}", diaItem.Name, diaItem.Distance, diaItem.ActorSNO, diaItem.ACDGuid, diaItem.RActorGuid); ObjectCache.Add(new TrinityCacheObject() { Position = diaItem.Position, InternalName = diaItem.Name, RActorGuid = diaItem.RActorGuid, ActorSNO = diaItem.ActorSNO, ACDGuid = diaItem.ACDGuid, HasBeenNavigable = true, HasBeenInLoS = true, Distance = diaItem.Distance, ActorType = ActorType.Item, Type = TrinityObjectType.Item, Radius = 2f, Weight = 50, ItemQuality = ItemQuality.Legendary, }); } } } bool isRiftGuardianQuestStep = ZetaDia.CurrentQuest.QuestSNO == 337492 && ZetaDia.CurrentQuest.StepId == 16; if (isRiftGuardianQuestStep) { // Add Rift Guardian POI's or Markers to ObjectCache const int riftGuardianMarkerTexture = 81058; Func <MinimapMarker, bool> riftGuardianMarkerFunc = m => m.IsValid && (m.IsPointOfInterest || m.MinimapTexture == riftGuardianMarkerTexture) && !Blacklist60Seconds.Contains(m.NameHash); foreach (var marker in ZetaDia.Minimap.Markers.CurrentWorldMarkers.Where(riftGuardianMarkerFunc)) { Logger.LogDebug(LogCategory.CacheManagement, "Adding Rift Guardian POI, distance {0}", marker.Position.Distance2D(Player.Position)); ObjectCache.Add(new TrinityCacheObject() { Position = marker.Position, InternalName = "Rift Guardian", Distance = marker.Position.Distance(Player.Position), RActorGuid = marker.NameHash, ActorType = ActorType.Monster, Type = TrinityObjectType.Unit, Radius = 10f, Weight = 5000, }); } } if (isRiftGuardianQuestStep || Player.ParticipatingInTieredLootRun) // X1_LR_DungeonFinder { foreach (var marker in ZetaDia.Minimap.Markers.CurrentWorldMarkers.Where(m => m.IsPointOfInterest && !Blacklist60Seconds.Contains(m.NameHash))) { ObjectCache.Add(new TrinityCacheObject() { Position = marker.Position, InternalName = "Rift Guardian", Distance = marker.Position.Distance(Player.Position), RActorGuid = marker.NameHash, ActorType = ActorType.Monster, Type = TrinityObjectType.Unit, Radius = 10f, Weight = 5000, }); } } }