public void Init(object sender, CreateObjectEventArgs e) { try { ProcessWorldObject(e.New); } catch (Exception ex) { _logger.Error(ex); } }
private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { if (e.New.Container == Core.CharacterFilter.Id) { WantToSyncItems = true; } }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { WorldObject wo = e.New; wtc($"{wo.Name} triggered WorldFilter_CreateObject"); scanIt(wo); }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { if (Settings.SettingsManager.InventoryManagement.AetheriaRevealer.Value && e.New.ObjectClass == ObjectClass.Gem && e.New.Name == "Coalesced Aetheria") { timer.Start(); } if (Settings.SettingsManager.InventoryManagement.HeartCarver.Value && e.New.ObjectClass == ObjectClass.Misc && e.New.Name.EndsWith(" Heart")) { timer.Start(); } if (Settings.SettingsManager.InventoryManagement.ShatteredKeyFixer.Value && e.New.ObjectClass == ObjectClass.Misc && e.New.Name.StartsWith("Shattered ") && e.New.Name.EndsWith(" Key")) { timer.Start(); } if (Settings.SettingsManager.InventoryManagement.KeyRinger.Value) { if (e.New.ObjectClass == ObjectClass.Misc && e.New.Name == "Burning Sands Keyring") { CoreManager.Current.Actions.RequestId(e.New.Id); } if (e.New.ObjectClass == ObjectClass.Key && e.New.Name == "Aged Legendary Key") { timer.Start(); } } } catch (Exception ex) { Debug.LogException(ex); } }
private void a(object A_0, CreateObjectEventArgs A_1) { try { if (A_1.get_New().get_ObjectClass() == 0x1b) { CoordsObject obj2 = A_1.get_New().Coordinates(); dz dz = dz.a(obj2.get_EastWest(), obj2.get_NorthSouth(), 0.0); if (this.e.ContainsKey(A_1.get_New().get_Id()) && (dz.a(this.e[A_1.get_New().get_Id()].l, false) > 0.004167)) { this.e.Remove(A_1.get_New().get_Id()); } if (!this.e.ContainsKey(A_1.get_New().get_Id())) { b5.a a = new b5.a { l = dz, h = A_1.get_New().get_Name() == ("Corpse of " + CoreManager.get_Current().get_CharacterFilter().get_Name()) }; this.e.Add(A_1.get_New().get_Id(), a); PluginCore.cq.u.a(A_1.get_New().get_Id(), b0.a.c); } else { this.e[A_1.get_New().get_Id()].d = DateTimeOffset.Now; this.e[A_1.get_New().get_Id()].a = false; } } } catch (Exception exception) { ad.a(exception); } }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { ProcessObject(e.New); } catch (Exception ex) { Debug.LogException(ex); } }
//[BaseEvent("CreateObject", "WorldFilter")] private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { WorldObject worldObject = e.New; if (e.New.ObjectClass == ObjectClass.Player) { PlayerDiscovered.ProcessPlayer(worldObject, Globals.Core.CharacterFilter.Monarch.Id, LogOnUnknownFlag, LogOnFriendlyFlag, LogOnPkFlag); } }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { if (ShoudlWeWatchItem(e.New)) { AddItem(e.New); } } catch (Exception ex) { Debug.LogException(ex); } }
private void HandleCreateObject(object sender, CreateObjectEventArgs args) { var objView = AddViewInstance(args.objectType); if (objView.Model == null) { SetViewModel(objView, args.objectType); } objView.Model.Position = WORLD_OBJECT_START_POSITION; }
private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { if (e.New.ObjectClass == ObjectClass.Player) { this.TargetCache.AddOrUpdate(e.New); } } catch (Exception ex) { Repo.RecordException(ex); } }
private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { if (e.New.Name == "Pathwarden Supply Key") { current_state = STEELBOT_STATE.UNLOCKING_CHEST; action_completed = true; } if (e.New.Name == "Academy Exit Token") { current_state = STEELBOT_STATE.ESCAPING; action_completed = true; } }
private void a(object A_0, CreateObjectEventArgs A_1) { try { if (this.b && (PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_New().get_Id()) != null)) { this.a(A_1.get_New()); } } catch (Exception exception) { ad.a(exception); } }
private void InventoryCreated(object sender, CreateObjectEventArgs e) { try { if(!FoundryInventoryCheck(e.New.Id)) {return;} if(e.New.ObjectClass == ObjectClass.Salvage && e.New.Values(LongValueKey.UsesRemaining) < 100) { FoundryLoadAction(FoundryActionTypes.SalvageCombine, e.New.Id); } if(e.New.Name.ToLower() == "pyreal sliver" || e.New.Name.ToLower() == "pyreal nugget") { if(GISettings.AutoProcess) FoundryLoadAction(FoundryActionTypes.MoteCombine, e.New.Id); InitiateFoundryActions(); } }catch(Exception ex){LogError(ex);} }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { //In 2960 we need to do this to make sure the vendor object isn't initialized, //which can cause crashes at vendors. if (CoreManager.Current.WorldFilter[e.New.Id] == null) { return; } //Create the object and add it to our list ObjectTrackerObject myobject = new ObjectTrackerObject(e.New.Icon, e.New.Name, e.New.Id); objects.Add(myobject); //Notify anyone listening if (NewObjectDetected != null) { NewObjectDetected(myobject); } }
private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { // We don't run any actions until we're fully logged in if (!loginComplete) { return; } if (!Settings.SettingsManager.InventoryManagement.InventoryLogger.Value) { return; } // Check if the player just received an item via give that it needs id data for if (!e.New.HasIdData && ObjectClassNeedsIdent(e.New.ObjectClass, e.New.Name) && !requestedIds.Contains(e.New.Id)) { // Make sure its in our inventory if (e.New.Container == CoreManager.Current.CharacterFilter.Id) { requestedIds.Add(e.New.Id); CoreManager.Current.Actions.RequestId(e.New.Id); } } }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { if (Settings.SettingsManager.InventoryManagement.AetheriaRevealer.Value && e.New.ObjectClass == ObjectClass.Gem && e.New.Name == "Coalesced Aetheria") timer.Start(); if (Settings.SettingsManager.InventoryManagement.HeartCarver.Value && e.New.ObjectClass == ObjectClass.Misc && e.New.Name.EndsWith(" Heart")) timer.Start(); if (Settings.SettingsManager.InventoryManagement.ShatteredKeyFixer.Value && e.New.ObjectClass == ObjectClass.Misc && e.New.Name.StartsWith("Shattered ") && e.New.Name.EndsWith(" Key")) timer.Start(); if (Settings.SettingsManager.InventoryManagement.KeyRinger.Value) { if (e.New.ObjectClass == ObjectClass.Misc && e.New.Name == "Burning Sands Keyring") CoreManager.Current.Actions.RequestId(e.New.Id); if (e.New.ObjectClass == ObjectClass.Key && e.New.Name == "Aged Legendary Key") timer.Start(); } } catch (Exception ex) { Debug.LogException(ex); } }
private void CombatHud_CreateObject(object sender, CreateObjectEventArgs e) { try { if(e == null) {return;} if(Core.WorldFilter[e.New.Id].ObjectClass == ObjectClass.Monster) { if(!CombatHudMobTrackingList.Any(x => x.Id == e.New.Id)) { CombatHudMobTrackingList.Add(new MonsterObject(e.New)); } UpdateTactician(); } }catch(Exception ex){LogError(ex);} }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { if (ShoudlWeWatchItem(e.New)) AddItem(e.New); } catch (Exception ex) { Debug.LogException(ex); } }
private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { if (!mLoggedIn) return; try { int isMansion = -1; if (chkAutoUpdateRecalls.Checked) { isMansion = e.New.Values(LongValueKey.HouseOwner) == MonarchId && (e.New.Name.EndsWith("'s Mansion") || e.New.Name.EndsWith("'s Villa")) ? 1 : 0; if (isMansion == 1) { UpdateStartLocation(e.New, RouteStartType.MansionRecall); } else if (mRecallingToBindstone == RecallStep.EnteredPortal && e.New.Name == "Bind Stone") { UpdateStartLocation(e.New, RouteStartType.AllegianceBindstone); } else if (mRecallingToLSBind == RecallStep.EnteredPortal && e.New.ObjectClass == ObjectClass.Lifestone) { UpdateStartLocation(e.New, RouteStartType.LifestoneBind); } else if (mRecallingToLSTie == RecallStep.EnteredPortal && e.New.ObjectClass == ObjectClass.Lifestone) { UpdateStartLocation(e.New, RouteStartType.LifestoneTie); } } if (chkAutoDetectPortalDevices.Checked) { if (isMansion == 1 || (isMansion == -1 && e.New.Values(LongValueKey.HouseOwner) == MonarchId && (e.New.Name.EndsWith("'s Mansion") || e.New.Name.EndsWith("'s Villa")))) { // Look for every portal device foreach (PortalDevice device in mPortalDevices.Values) { bool found = false; foreach (WorldObject obj in Core.WorldFilter.GetByName(device.Name)) { if (obj.Values(LongValueKey.HouseOwner) == MonarchId) { device.Coords = new Coordinates(obj.Coordinates(), 2); found = true; break; } } if (!found) { device.Coords = Coordinates.NO_COORDINATES; } } } else if (e.New.Values(LongValueKey.HouseOwner) == MonarchId) { // See if it matches any portal device PortalDevice device; if (mPortalDevices.TryGetValue(e.New.Name, out device)) { device.Coords = new Coordinates(e.New.Coordinates(), 2); } } } } catch (Exception ex) { Util.HandleException(ex); } }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { //In 2960 we need to do this to make sure the vendor object isn't initialized, //which can cause crashes at vendors. if (CoreManager.Current.WorldFilter[e.New.Id] == null) return; //Create the object and add it to our list ObjectTrackerObject myobject = new ObjectTrackerObject(e.New.Icon, e.New.Name, e.New.Id); objects.Add(myobject); //Notify anyone listening if (NewObjectDetected != null) NewObjectDetected(myobject); }
private void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { WorldObject worldObject = e.New; if (worldObject.ObjectClass == ObjectClass.Player) { if (worldObject.Id != Core.CharacterFilter.Id) { int monarchID = worldObject.Values(LongValueKey.Monarch); string coords = worldObject.Coordinates().ToString(); if (monarchID == MyMonarch) { friendly = true; } else if (Friends.ContainsKey(worldObject.Id)) { friendly = true; } else { friendly = false; } if (friendly == false) { if (PKAlert == true) { PlayerListAdd(worldObject.Name, monarchID, worldObject.Id, Core.CharacterFilter.Name, coords); Host.Actions.InvokeChatParser("/a -=[Enemy: (" + worldObject.Name + ") detected at: " + coords + "!]=-"); if (PlaySounds == true) { Enemy.Play(); } } else { PlayerListAdd(worldObject.Name, monarchID, worldObject.Id, Core.CharacterFilter.Name, coords); Host.Actions.AddChatText("-=[Enemy: (" + worldObject.Name + ") detected at: " + coords + "]=-", 10); if (PlaySounds == true) { Enemy.Play(); } } if (PKLogout == true) { DelayLogout.Interval = NewRand(); DelayLogout.Start(); } } else if (friendly == true) { Host.Actions.AddChatText("-=[Ally: (" + worldObject.Name + ") detected at: " + coords + "]=-", 13); if (PlaySounds == true) { Ally.Play(); } } } } }
internal void WriteObject(CreateObjectEventArgs obj) { lock (this._writeLock) { using (StreamWriter stream = new StreamWriter(this._currentPath, true)) { this.LogRawMessage(this.FormatWithPrefix("CreateObjectEventArgs"), stream); this.LogRawMessage(string.Format(" New (WObj) = {0}", obj.New.Name), stream); this.LogRawMessage(string.Format(" Id = {0}", obj.New.Id), stream); //this.WriteCurrentStateStuff(stream, false); this.LogRawMessage("", stream); } } }
protected void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { try { WorldObject @new = e.New; if (@new.ObjectClass == ObjectClass.Corpse) { AddWorldObject(@new, MainView.CorpseList); } if (@new.ObjectClass == ObjectClass.Portal) { AddWorldObject(@new, MainView.PortalList); } if (@new.ObjectClass == ObjectClass.Player && @new.Id == lib.MyCore.CharacterFilter.Id) { AddWorldObject(@new, MainView.GuildList); } if (@new.ObjectClass == ObjectClass.Player) { if (@new.Id == lib.MyCore.CharacterFilter.Id) { AddWorldObject(@new, MainView.GuildList); if (!lib.DistanceCheck.Contains(@new.Id)) { lib.DistanceCheck.Add(@new.Id); } } if (IsFriend(@new)) { AddWorldObject(@new, MainView.GuildList); if (!lib.DistanceCheck.Contains(@new.Id)) { lib.DistanceCheck.Add(@new.Id); } } if (IsEnemy(@new)) { AddWorldObject(@new, MainView.PlayerList); if (!lib.LogList.Contains(@new.Id)) { lib.LogList.Add(@new.Id); } if (!lib.DistanceCheck.Contains(@new.Id)) { lib.DistanceCheck.Add(@new.Id); } } if (@new.Values(LongValueKey.Monarch) == lib.moncheck && !IsEnemy(@new) && @new.Id != lib.MyCore.CharacterFilter.Id) { AddWorldObject(@new, MainView.GuildList); if (!lib.DistanceCheck.Contains(@new.Id)) { lib.DistanceCheck.Add(@new.Id); } } if (@new.Values(LongValueKey.Monarch) != lib.moncheck && !IsFriend(@new) && @new.Id != lib.MyCore.CharacterFilter.Id) { AddWorldObject(@new, MainView.PlayerList); if (!lib.LogList.Contains(@new.Id)) { lib.LogList.Add(@new.Id); } if (!lib.DistanceCheck.Contains(@new.Id)) { lib.DistanceCheck.Add(@new.Id); } } if (MainView.PlayerList.RowCount - MainView.GuildList.RowCount >= 3) { Utility.AddChatText("WARNING! Odds Overwhelming: " + MainView.PlayerList.RowCount + " enemies!", 6); if (lib.UseAlertOdds == true) { Sounds.Odds.Play(); } } } } catch (Exception ex) { Repo.RecordException(ex); } }
void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e) { // DO STUFF HERE }
private static void PkDetection(object sender, CreateObjectEventArgs e) { try { if (e.New.ObjectClass == ObjectClass.Player && lib.LogList.Contains(e.New.Id)) { if (lib.UseAlertSPK) { Sounds.Pk.Play(); } if (lib.Mode != 3) { WorldObject obj = e.New; CoordsObject coordsObject = obj.Coordinates(); string text; if (coordsObject.NorthSouth >= 0.0) { text = string.Format("{0:N1}", coordsObject.NorthSouth) + "N, "; } else { text = string.Format("{0:N1}", coordsObject.NorthSouth * -1.0) + "S, "; } if (coordsObject.EastWest >= 0.0) { text = text + string.Format("{0:N1}", coordsObject.EastWest) + "E"; } else { text = text + string.Format("{0:N1}", coordsObject.EastWest * -1.0) + "W"; } string key = obj.Values(LongValueKey.Landblock).ToString("X8").Substring(0, 4); List <string> Landblock = (from f in lib.LocKey.Split(new char[] { ',' }) select f.Trim()).ToList <string>(); if (lib.LocKey.Contains(key)) { foreach (string el in Landblock) { if (el.Contains(key)) { string elloc = el.Split(new string[] { "=" }, StringSplitOptions.None)[1]; Utility.AddChatText("Enemy Detected: " + obj.Name + " at " + text + " (" + elloc + ")", 6); if (lib.UseAlertPF == true) { Utility.InvokeTextF("Enemy Detected: " + obj.Name + " at " + text + " (" + elloc + ")"); } if (lib.UseAlertPA == true) { Utility.InvokeTextA("Enemy Detected: " + obj.Name + " at " + text + " (" + elloc + ")"); } } } } else { Utility.AddChatText("Enemy Detected: " + obj.Name + " at " + text + " (" + key + " : Unset)", 6); if (lib.UseAlertPF == true) { Utility.InvokeTextF("Enemy Detected: " + obj.Name + " at " + text + " (" + key + " : Unset)"); } if (lib.UseAlertPA == true) { Utility.InvokeTextA("Enemy Detected: " + obj.Name + " at " + text + " (" + key + " : Unset)"); } } } } } catch (Exception ex2) { Repo.RecordException(ex2); } }