///<summary> ///Resets/Updates cache and misc vars ///</summary> private void InitObjectRefresh() { //Cache last target only if current target is not avoidance (Movement). LastCachedTarget = CurrentTarget != null ? CurrentTarget : ObjectCache.FakeCacheObject; //Traveling Flag Reset TravellingAvoidance = false; //Reset target CurrentTarget = null; //CurrentUnitTarget = null; //Kill Loot Radius Update UpdateKillLootRadiusValues(); // Refresh buffs (so we can check for wrath being up to ignore ice balls and anything else like that) Hotbar.RefreshHotbarBuffs(); // Reset the counters for monsters at various ranges Environment.Reset(); ////Check if we should trim our SNO cache.. //if (DateTime.Now.Subtract(ObjectCache.cacheSnoCollection.lastTrimming).TotalMilliseconds > FunkyBaseExtension.Settings.Plugin.UnusedSNORemovalRate) // ObjectCache.cacheSnoCollection.TrimOldUnusedEntries(); ////Check Cached Object Removal flag //if (RemovalCheck) //{ // //Remove flagged objects // var RemovalObjs = (from objs in ObjectCache.Objects.Values // where objs.NeedsRemoved // select objs.RAGUID).ToList(); // foreach (var item in RemovalObjs) // { // CacheObject thisObj = ObjectCache.Objects[item]; // //remove prioritized raguid // if (FunkyGame.Navigation.PrioritizedRAGUIDs.Contains(item)) // FunkyGame.Navigation.PrioritizedRAGUIDs.Remove(item); // //Blacklist flag check // if (thisObj.BlacklistFlag != BlacklistType.None) // BlacklistCache.AddObjectToBlacklist(thisObj.RAGUID, thisObj.BlacklistFlag); // ObjectCache.Objects.Remove(thisObj.RAGUID); // } // RemovalCheck = false; //} ////Increase counter, clear entries if overdue. //ObjectCache.Obstacles.AttemptToClearEntries(); //Non-Combat behavior we reset temp blacklist so we don't get killed by "ignored" units.. if (FunkyGame.IsInNonCombatBehavior) { BlacklistCache.CheckRefreshBlacklists(10); } //Check Gold Inactivity //Bot.Game.GoldTimeoutChecker.CheckTimeoutTripped(); }