// 5d08d21286f774736e7c94c3 // private void isOnUpdate() { if (LocalPlayer.Base == null) { return; } inumDoorList = LocationScene.GetAllObjects <WorldInteractiveObject>(false); try { TempList = Prioritize.SortData(inumDoorList.Cast <WorldInteractiveObject>().ToList()); tmpDoorList = new List <WorldInteractiveObject>(); for (int i = 0; i < TempList.Count; i++) { if (TempList[i] is Door || TempList[i] is LootableContainer) { if (TempList[i].KeyId == "") { continue; } //if (excludedList.IndexOf(TempList[i].KeyId) == -1) continue; if (Settings.CDoor.Distance < (int)Vector3.Distance(Camera.main.transform.position, TempList[i].transform.position)) { continue; } //if (TempList[i].Id.IndexOf("autoId") == -1) continue; tmpDoorList.Add(TempList[i]); } } DoorList = tmpDoorList; autoSelectedCloseDoor = DoorList.FirstOrDefault(); Settings.CDoor.SelectedDoor = autoSelectedCloseDoor.Id.Replace("autoId_", "").Replace("0", ""); } catch { errorCount1++; } if (Input.GetKeyDown(KeyCode.F6) && KeyRestored) { LocalPlayerKey = LocalPlayer.Features.GetLocalPlayerKeys(); if (LocalPlayerKey != default(Item) && autoSelectedCloseDoor.KeyId != "") { SelectedKeyID = LocalPlayerKey.Template._id; KeyRestored = false; LocalPlayerKey.Template._id = autoSelectedCloseDoor.KeyId; StartCoroutine(RevokeMechanicalKey(5f)); } } }
private void isOnUpdate() { if (LocalPlayer.Base == null) { return; } try { // creater list of players only on screen less ressource hungry // it can also be done using FOV * 2 to add to list vars.tPlayers = new List <Player>(); vars.list_tmp = CGameWorld.Base.RegisteredPlayers.GetEnumerator(); vars.countObj = 0; while (vars.list_tmp.MoveNext()) { vars.tmpItem = vars.list_tmp.Current; if (vars.tmpItem == null) { continue; } vars.tmpHeadPos = vars.tmpItem.PlayerBones.Head.position; if (MaociScreen.onScreenStrict(Camera.main.WorldToScreenPoint(vars.tmpHeadPos))) { // if players head is on screen then .Add if (Settings.CAimH.Distance > Vector3.Distance(Camera.main.transform.position, vars.tmpHeadPos)) { // if players distance is in range if (!CPlayer.Function.inGroup(vars.tmpItem)) { // exclude players in group vars.tPlayers.Add(vars.tmpItem); vars.countObj++; } } } } vars.tPlayers = Prioritize.SortData(vars.tPlayers); vars.l_Player = vars.tPlayers; } catch { } if (vars.countObj == 0) { return; } vars.PlayerAimedAt = func.ChooseTarget(Settings.CAimH.ForceAim); }
public void Update() { if (!Settings.CContainer.Enable) // if not activated { return; } if (LocalPlayer.Base == null) // if gameworld is not initiated already { return; } try { lootlist = CGameWorld.Base.LootItems.GetValuesEnumerator().GetEnumerator(); WorldList = LocationScene.GetAllObjects <WorldInteractiveObject>(false); tmpContainerList = Prioritize.SortData(WorldList.Cast <WorldInteractiveObject>().ToList()); ContainerList = new List <LootableContainer>(); for (int i = 0; i < tmpContainerList.Count; i++) { if (tmpContainerList[i] is LootableContainer) { var tempDistanceToObject = Vector3.Distance(Camera.main.transform.position, tmpContainerList[i].transform.position); if (tempDistanceToObject < Settings.CContainer.Distance) { var tempLootContainer = tmpContainerList[i] as LootableContainer; IEnumerable <Item> tmpList = tempLootContainer.ItemOwner.RootItem.GetAllItems(false); if (Settings.CContainer.SearchFor == "" || !Settings.switches.sb_searchForContainers) { var enumerator = tmpList.GetEnumerator(); int count = 0; while (enumerator.MoveNext()) { if (count == 0) { count++; continue; } var item = enumerator.Current; #region ~~Super rare search + name search if (Settings.CItem.DisplayLootSrare) // selected super rare { if (item.Template.Rarity == JsonType.ELootRarity.Superrare) { if (Settings.CItem.SearchFor == "") { ContainerList.Add(tempLootContainer); continue; } else { if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0) { ContainerList.Add(tempLootContainer); continue; } } } } #endregion #region ~~Everything disabled and/or search for item if (!Settings.CItem.DisplayLootSrare && !Settings.CItem.DisplayLootCustom1 && !Settings.CItem.DisplayLootCustom2 && !Settings.CItem.DisplayLootCustom3) { if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems) { ContainerList.Add(tempLootContainer); continue; } else if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0) { ContainerList.Add(tempLootContainer); continue; } } #endregion #region ~~Custom1 file search + name search if (Settings.CItem.DisplayLootCustom1) // custom search from file { if (Settings.CItem.CustomDistance1 > tempDistanceToObject) // limit number of items on screen also checking distance { if (Array.IndexOf(CItems.IDTable1, item.TemplateId) != -1 || Array.IndexOf(CItems.IDTable1, item.Template._parent) != -1) { if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems) { ContainerList.Add(tempLootContainer); } else { if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0) { ContainerList.Add(tempLootContainer); } } } } } #endregion #region ~~Custom2 file search + name search if (Settings.CItem.DisplayLootCustom2) // custom search from file { if (Settings.CItem.CustomDistance2 > tempDistanceToObject) // limit number of items on screen also checking distance { if (Array.IndexOf(CItems.IDTable2, item.TemplateId) != -1 || Array.IndexOf(CItems.IDTable2, item.Template._parent) != -1) { if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems) { ContainerList.Add(tempLootContainer); continue; } else { if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0) { ContainerList.Add(tempLootContainer); continue; } } } } } #endregion #region ~~Custom3 file search + name search if (Settings.CItem.DisplayLootCustom3) // custom search from file { if (Settings.CItem.CustomDistance3 > tempDistanceToObject) // limit number of items on screen also checking distance { if (Array.IndexOf(CItems.IDTable3, item.TemplateId) != -1 || Array.IndexOf(CItems.IDTable3, item.Template._parent) != -1) { if (Settings.CItem.SearchFor == "" || !Settings.switches.sb_searchForItems) { ContainerList.Add(tempLootContainer); continue; } else { if ((item.ShortName.Localized() + item.Name.Localized()).ToLower().IndexOf(Settings.CItem.SearchFor) >= 0) { ContainerList.Add(tempLootContainer); continue; } } } } } #endregion } } else { if (tempLootContainer.ItemOwner.Name.Localized().IndexOf(Settings.CContainer.SearchFor) != -1) { ContainerList.Add(tempLootContainer); continue; } } } } } DrawingList = ContainerList; } catch { } }