void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if (e.Changed.Id != Id)
                {
                    return;
                }

                if (e.Change == WorldChangeType.IdentReceived && ItemState == EquipmentTrackedItemState.Active && SecondsPerBurn > 0)
                {
                    burnTimer.Interval = (int)(SecondsPerBurn * 1000);
                    burnTimer.Start();
                }

                // Change object between IdentReceived and ManaChange will take some explaning.
                // It clarifies why we store timeOfLastManaIdent instead of just using wo.LastIdTime.
                // When an IdentReceived is received on an item, it updates the LastIdTime as well as the LongValueKey.CurrentMana value.
                // However, when ManaChange is received, LongValueKey.CurrentMana is updated but LastIdTime is not.
                // Because of this, if we received a ManaChange and used LastIdTime to recalculate against LongValueKey.CurrentMana, it would obviously be off.
                // So, we simply cache the time we received an ident OR a mana change, that way we have the time our LongValueKey.CurrentMana was last updated,
                // and for our calculations, thats all we need.
                if (e.Change == WorldChangeType.IdentReceived || e.Change == WorldChangeType.ManaChange)
                {
                    timeOfLastManaIdent = DateTime.UtcNow;

                    if (Changed != null)
                    {
                        Changed(this);
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #2
0
        public void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            if (e.Change.Equals(WorldChangeType.IdentReceived))
            {
                if (CharacterEquipment.Contains(e.Changed))
                {
                    for (int i = 0; i < CharacterEquipment.Count; i++)
                    {
                        if (CharacterEquipment[i].Id.Equals(e.Changed.Id))
                        {
                            CharacterEquipment[i] = e.Changed;
                            break;
                        }
                    }

                    bool complete = true;
                    foreach (WorldObject item in CharacterEquipment)
                    {
                        if (!item.HasIdData)
                        {
                            complete = false;
                            break;
                        }
                    }

                    if (complete && !FinishedInitialScan)
                    {
                        FinishedInitialScan = true;
                        Debug.ToChat($"Finished scanning your inventory. You can now build suits.");
                    }
                }
            }
        }
Exemple #3
0
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            if (!Settings.SettingsManager.InventoryManagement.InventoryLogger.Value)
            {
                return;
            }

            if (loggedInAndWaitingForIdData)
            {
                bool allInventoryHasIdData = true;

                foreach (WorldObject wo in CoreManager.Current.WorldFilter.GetInventory())
                {
                    if (!wo.HasIdData && ObjectClassNeedsIdent(wo.ObjectClass, wo.Name))
                    {
                        allInventoryHasIdData = false;
                        break;
                    }
                }

                if (allInventoryHasIdData)
                {
                    loggedInAndWaitingForIdData = false;
                    DumpInventoryToFile();
                    Debug.WriteToChat("Requesting id information for all armor/weapon inventory completed. Log file written.");
                }
            }
        }
		void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				if (Settings.SettingsManager.InventoryManagement.AetheriaRevealer.Value && e.Changed.ObjectClass == ObjectClass.Gem && e.Changed.Name == "Coalesced Aetheria")
					timer.Start();

				if (Settings.SettingsManager.InventoryManagement.HeartCarver.Value && e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name.EndsWith(" Heart"))
					timer.Start();

				if (Settings.SettingsManager.InventoryManagement.ShatteredKeyFixer.Value && e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name.StartsWith("Shattered ") && e.Changed.Name.EndsWith(" Key"))
					timer.Start();

				if (Settings.SettingsManager.InventoryManagement.KeyRinger.Value)
				{
					if (e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name == "Burning Sands Keyring")
					{
						if (e.Change == WorldChangeType.IdentReceived)
							timer.Start();
						else
							CoreManager.Current.Actions.RequestId(e.Changed.Id);
					}

					if (e.Changed.ObjectClass == ObjectClass.Key && e.Changed.Name == "Aged Legendary Key")
						timer.Start();
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if (e.Change != WorldChangeType.IdentReceived)
                {
                    return;
                }

                for (int row = 0; row < tinkeringList.RowCount; row++)
                {
                    int id;

                    if (int.TryParse(((HudStaticText)tinkeringList[row][6]).Text, out id) && id == e.Changed.Id)
                    {
                        MyWorldObject mwo = MyWorldObjectCreator.Create(e.Changed);

                        ((HudStaticText)tinkeringList[row][3]).Text = mwo.Workmanship.ToString(CultureInfo.InvariantCulture);
                        ((HudStaticText)tinkeringList[row][4]).Text = mwo.Tinks.ToString(CultureInfo.InvariantCulture);

                        return;
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            WorldObject wo = e.Changed;

            wtc($"{wo.Name} triggered WorldFilter_ChangeObject");
            scanIt(wo);
        }
		void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				if (e.Changed.Id != Id)
					return;

				if (e.Change == WorldChangeType.IdentReceived && ItemState == EquipmentTrackedItemState.Active && SecondsPerBurn > 0)
				{
					burnTimer.Interval = (int)(SecondsPerBurn * 1000);
					burnTimer.Start();
				}

				// Change object between IdentReceived and ManaChange will take some explaning.
				// It clarifies why we store timeOfLastManaIdent instead of just using wo.LastIdTime.
				// When an IdentReceived is received on an item, it updates the LastIdTime as well as the LongValueKey.CurrentMana value.
				// However, when ManaChange is received, LongValueKey.CurrentMana is updated but LastIdTime is not.
				// Because of this, if we received a ManaChange and used LastIdTime to recalculate against LongValueKey.CurrentMana, it would obviously be off.
				// So, we simply cache the time we received an ident OR a mana change, that way we have the time our LongValueKey.CurrentMana was last updated,
				// and for our calculations, thats all we need.
				if (e.Change == WorldChangeType.IdentReceived || e.Change == WorldChangeType.ManaChange)
				{
					timeOfLastManaIdent = DateTime.UtcNow;

					if (Changed != null)
						Changed(this);
				}

			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Exemple #8
0
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if (Settings.SettingsManager.InventoryManagement.AetheriaRevealer.Value && e.Changed.ObjectClass == ObjectClass.Gem && e.Changed.Name == "Coalesced Aetheria")
                {
                    timer.Start();
                }

                if (Settings.SettingsManager.InventoryManagement.HeartCarver.Value && e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name.EndsWith(" Heart"))
                {
                    timer.Start();
                }

                if (Settings.SettingsManager.InventoryManagement.ShatteredKeyFixer.Value && e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name.StartsWith("Shattered ") && e.Changed.Name.EndsWith(" Key"))
                {
                    timer.Start();
                }

                if (Settings.SettingsManager.InventoryManagement.KeyRinger.Value)
                {
                    if (e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name == "Burning Sands Keyring")
                    {
                        if (e.Change == WorldChangeType.IdentReceived)
                        {
                            timer.Start();
                        }
                        else
                        {
                            CoreManager.Current.Actions.RequestId(e.Changed.Id);
                        }
                    }

                    if (e.Changed.ObjectClass == ObjectClass.Key && e.Changed.Name == "Aged Legendary Key")
                    {
                        timer.Start();
                    }
                }

                if (Settings.SettingsManager.InventoryManagement.KeyDeringer.Value)
                {
                    if (e.Changed.ObjectClass == ObjectClass.Misc && e.Changed.Name == "Burning Sands Keyring")
                    {
                        if (e.Change == WorldChangeType.IdentReceived)
                        {
                            timer.Start();
                        }
                        else
                        {
                            CoreManager.Current.Actions.RequestId(e.Changed.Id);
                        }
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #9
0
        public void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                // This can get very spammy so I filted it to just print on ident received

                // Util.WriteToChat("WorldFilter_ChangeObject: " + e.Changed.Name + " " + e.Change);
            }
            catch (Exception ex) { Util.LogError(ex); }
        }
Exemple #10
0
        private void TradeObject_ObjectIDReceived(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                Util.WriteToChat("I am in TradeObject_ObjectIDReceived and msecondarysubroutine = " + msecondarysubRoutine);
                if (!msecondarysubRoutine.Contains("Tinking") && !msecondarysubRoutine.Contains("Crafting") && !msecondarysubRoutine.Contains("Salvage") && lstWaitingforID != null && lstWaitingforID.Count > 0)
                {
                    Core.WorldFilter.ChangeObject -= TradeObject_ObjectIDReceived;

                    int         tempnum = lstWaitingforID.Count;
                    WorldObject obj;
                    Util.WriteToChat("I am in function to report an id is received");
                    // if ((DateTime.Now - TimeIdObj).TotalSeconds > 10)

                    Util.WriteToChat("I am in objectidreceived and number of items in lstWaitingforId:  " + lstWaitingforID.Count.ToString());
                    if (tempnum > 0)
                    {
                        for (int x = 0; x < tempnum; x++)
                        {
                            // if (obj.Id == e.Changed.Id)
                            if (lstWaitingforID[x].HasIdData)
                            {
                                obj = lstWaitingforID[x];
                                lstTrdObjects.Add(obj);
                                lstWaitingforID.Remove(obj);

                                Util.WriteToChat(lstTrdObjects.Count + " items that have been id'd.");
                                Util.WriteToChat(lstWaitingforID.Count + " items that are waiting to be id'd.");

                                if (lstWaitingforID.Count == 0)
                                {
                                    lstWaitingforID.Clear();
                                    lstWaitingforID = null;
                                    Core.WorldFilter.ChangeObject -= TradeObject_ObjectIDReceived;
                                    Util.WriteToChat("Moving on to BotChores");
                                    unsubscribeTradeEvents();
                                }
                                //  else { CoreManager.Current.RenderFrame += new EventHandler<EventArgs>(RenderFrame_DotheIDing); }
                            }
                        }
                    }
                    else
                    {
                        Util.WriteToChat(lstWaitingforID.Count.ToString() + " items waiting to be id'd");
                        Core.WorldFilter.ChangeObject -= TradeObject_ObjectIDReceived;
                        // Core.WorldFilter.EndTrade += new EventHandler<EndTradeEventArgs>(WorldFilter_EndTrade);
                        unsubscribeTradeEvents();
                    }
                    //TimeIdObj = DateTime.Now;
                    //CoreManager.Current.RenderFrame += new EventHandler<EventArgs>(RenderFrame_DotheIDing);
                }
            }
            catch (Exception ex) { Util.LogError(ex); }
        }
Exemple #11
0
 private void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
 {
     try
     {
         if (e.Changed.ObjectClass == ObjectClass.Player)
         {
             this.TargetCache.AddOrUpdate(e.Changed);
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
Exemple #12
0
 private void LookupYotesWaitForItemUpdate(object sender, ChangeObjectEventArgs e)
 {
     try
     {
         if (e.Changed.Id == aceItem.id)
         {
             CoreManager.Current.WorldFilter.ChangeObject -= LookupYotesWaitForItemUpdate;
         }
     }
     catch (Exception ex) { Util.LogError(ex); }
 }
Exemple #13
0
 private void GetInfoWaitForItemUpdate(object sender, ChangeObjectEventArgs e)
 {
     try
     {
         if (e.Changed.Id == aceItem.id)
         {
             Util.SendChatCommand("/getinfo");
             CoreManager.Current.WorldFilter.ChangeObject -= GetInfoWaitForItemUpdate;
         }
     }
     catch (Exception ex) { Util.LogError(ex); }
 }
Exemple #14
0
 void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
 {
     /*
      * try
      * {
      *  // This can get very spammy so I filted it to just print on ident received
      *  if (e.Change == WorldChangeType.IdentReceived)
      *      Util.WriteToChat("WorldFilter_ChangeObject: " + e.Changed.Name + " " + e.Change);
      * }
      * catch (Exception ex) { Util.LogError(ex); }
      */
 }
Exemple #15
0
 private void DeleteItemWaitForItemUpdate(object sender, ChangeObjectEventArgs e)
 {
     try
     {
         if (e.Changed.Id == aceItem.id)
         {
             Util.SendChatCommand(Globals.ButtonCommand);
             CoreManager.Current.WorldFilter.ChangeObject -= DeleteItemWaitForItemUpdate;
             Globals.ButtonCommand = "NONE";
         }
     }
     catch (Exception ex) { Util.LogError(ex); }
 }
Exemple #16
0
 private void a(object A_0, ChangeObjectEventArgs A_1)
 {
     try
     {
         if ((PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_Changed().get_Id()) != null) && ((A_1.get_Change() == 2) && this.e.ContainsKey(A_1.get_Changed().get_Id())))
         {
             string input = A_1.get_Changed().Values(0x10, "");
             Match  match = this.f.Match(input);
             if (match.Success && (match.Groups[0].Index == 0))
             {
                 this.e[A_1.get_Changed().get_Id()].f = match.Groups[1].Value;
                 if (this.g.Match(input).Success)
                 {
                     this.e[A_1.get_Changed().get_Id()].e = true;
                 }
                 this.e[A_1.get_Changed().get_Id()].i = true;
                 Match match2 = this.h.Match(this.e[A_1.get_Changed().get_Id()].f);
                 if (match2.Success)
                 {
                     string b = match2.Groups[1].Value;
                     if (string.Equals(PluginCore.cq.aw.get_CharacterFilter().get_Name(), b, StringComparison.OrdinalIgnoreCase))
                     {
                         this.e[A_1.get_Changed().get_Id()].f = PluginCore.cq.aw.get_CharacterFilter().get_Name();
                     }
                     else if (PluginCore.cq.ai.c())
                     {
                         foreach (KeyValuePair <int, ar.a> pair in PluginCore.cq.ai.a)
                         {
                             if (string.Equals(pair.Value.b, b, StringComparison.OrdinalIgnoreCase))
                             {
                                 this.e[A_1.get_Changed().get_Id()].f = pair.Value.b;
                                 return;
                             }
                         }
                     }
                 }
             }
             else
             {
                 this.e[A_1.get_Changed().get_Id()].f = "";
                 this.e[A_1.get_Changed().get_Id()].e = true;
                 this.e[A_1.get_Changed().get_Id()].i = true;
             }
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }
Exemple #17
0
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if (!Settings.SettingsManager.CorpseTracker.Enabled.Value)
                {
                    return;
                }

                if (e.Change == WorldChangeType.IdentReceived)
                {
                    ProcessWorldObject(e.Changed);
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #18
0
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            // We don't run any actions until we're fully logged in
            if (!loginComplete)
            {
                return;
            }

            if (!Settings.SettingsManager.InventoryManagement.InventoryLogger.Value)
            {
                return;
            }

            if (loggedInAndWaitingForIdData)
            {
                bool allInventoryHasIdData = true;

                foreach (WorldObject wo in CoreManager.Current.WorldFilter.GetInventory())
                {
                    if (!wo.HasIdData && ObjectClassNeedsIdent(wo.ObjectClass, wo.Name))
                    {
                        allInventoryHasIdData = false;
                        break;
                    }
                }

                if (allInventoryHasIdData)
                {
                    loggedInAndWaitingForIdData = false;
                    DumpInventoryToFile();
                    Debug.WriteToChat("Requesting id information for all armor/weapon inventory completed. Log file written.");
                }
            }
            else
            {
                // Check if the player just received an item via trade that it needs id data for
                if (!e.Changed.HasIdData && ObjectClassNeedsIdent(e.Changed.ObjectClass, e.Changed.Name) && !requestedIds.Contains(e.Changed.Id))
                {
                    // Make sure its in our inventory
                    if (e.Changed.Container == CoreManager.Current.CharacterFilter.Id)
                    {
                        requestedIds.Add(e.Changed.Id);
                        CoreManager.Current.Actions.RequestId(e.Changed.Id);
                    }
                }
            }
        }
Exemple #19
0
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                /*
                 * Storage change is a goofy process.
                 * if (e.Changed.Name.Contains("White E")) Util.WriteToChat(e.Changed.Name + " " + e.Change + ", Container: " + e.Changed.Container + ", Slot: " + e.Changed.Values(LongValueKey.Slot, 0) + ", EquippedSlots: " + e.Changed.Values(LongValueKey.EquippedSlots));
                 *
                 * Dequip:
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 29, EquippedSlots: 262144
                 * <{Mag-Tools}>: AddItem
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 29, EquippedSlots: 262144
                 * <{Mag-Tools}>: AddItem
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 0, EquippedSlots: 0
                 * <{Mag-Tools}>: RemoveItem
                 *
                 * Equip:
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 0, EquippedSlots: 262144
                 * <{Mag-Tools}>: AddItem7
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 0, Slot: 0, EquippedSlots: 262144
                 * <{Mag-Tools}>: RemoveItem
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 0, EquippedSlots: 262144
                 * <{Mag-Tools}>: AddItem
                 * Enhanced White Empyrean Ring cast Incantation of Armor Other on you, surpassing Incantation of Armor Self
                 * <{Mag-Tools}>: Enhanced White Empyrean Ring IdentReceived, Container: 1343094282, Slot: 0, EquippedSlots: 262144
                 */

                // This is kind of a goofy check.
                // When we equip an item StorageChange is raised three times on that item.
                // The process will call AddItem, then RemoveItem, then AddItem
                if (e.Change == WorldChangeType.StorageChange && e.Changed.Values(LongValueKey.Container) != 0)
                {
                    if (ShoudlWeWatchItem(e.Changed))
                    {
                        AddItem(e.Changed);
                    }
                    else
                    {
                        RemoveItem(e.Changed);
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #20
0
        private void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if (e.Change != WorldChangeType.IdentReceived)
                {
                    return;
                }

                if (e.Changed.ObjectClass == ObjectClass.Monster)
                {
                    if (creaturesLogged.Contains(e.Changed.Name))
                    {
                        return;
                    }

                    // Make sure we have extended id information. Str/Coord, etc..

                    creaturesLogged.Add(e.Changed.Name);

                    LogCreature(e.Changed);
                }
                else if (e.Changed.ObjectClass != ObjectClass.MeleeWeapon && e.Changed.ObjectClass != ObjectClass.MissileWeapon && e.Changed.ObjectClass == ObjectClass.WandStaffOrb)
                {
                    string parentCreature = null;

                    // Make sure the item is held by a creature

                    if (parentCreature == null)
                    {
                        return;
                    }

                    // Make sure we have extended id information. Dmg, or some mod

                    itemsLogged.Add(new KeyValuePair <string, string>(parentCreature, e.Changed.Name));

                    LogCreatureItem(parentCreature, e.Changed);
                }
            }
            catch { }
        }
 private void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
 {
     try
     {
         if (e.Change == WorldChangeType.IdentReceived && e.Changed.Id == aco_door)
         {
             is_door_open     = e.Changed.Values(BoolValueKey.Open);
             action_completed = true;
         }
         if (e.Changed.Name == "Pathwarden Supply Key")
         {
             current_state    = STEELBOT_STATE.UNLOCKING_CHEST;
             action_completed = true;
         }
         if (e.Changed.Name == "Academy Exit Token")
         {
             current_state    = STEELBOT_STATE.ESCAPING;
             action_completed = true;
         }
     }
     catch (Exception ex) { }
 }
        void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if (!Settings.SettingsManager.ItemInfoOnIdent.Enabled.Value)
                {
                    return;
                }

                if (e.Change != WorldChangeType.IdentReceived)
                {
                    return;
                }

                // Remove id's that have been selected more than 10 seconds ago
                while (true)
                {
                    int idToRemove = 0;

                    foreach (KeyValuePair <int, DateTime> pair in itemsSelected)
                    {
                        if (pair.Value + TimeSpan.FromSeconds(10) < DateTime.UtcNow)
                        {
                            idToRemove = pair.Key;
                            break;
                        }
                    }

                    if (idToRemove == 0)
                    {
                        break;
                    }

                    itemsSelected.Remove(idToRemove);
                }

                if (!itemsSelected.ContainsKey(e.Changed.Id))
                {
                    return;
                }

                itemsSelected.Remove(e.Changed.Id);

                if (e.Changed.ObjectClass == ObjectClass.Corpse ||
                    e.Changed.ObjectClass == ObjectClass.Door ||
                    e.Changed.ObjectClass == ObjectClass.Foci ||
                    e.Changed.ObjectClass == ObjectClass.Housing ||
                    e.Changed.ObjectClass == ObjectClass.Lifestone ||
                    e.Changed.ObjectClass == ObjectClass.Npc ||
                    e.Changed.ObjectClass == ObjectClass.Portal ||
                    e.Changed.ObjectClass == ObjectClass.Vendor)
                {
                    return;
                }

                if (ItemIdentified != null)
                {
                    ItemInfoIdentArgs itemInfoIdentArgs = new ItemInfoIdentArgs(e.Changed);

                    ItemIdentified(this, itemInfoIdentArgs);
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #23
0
        private void Inventory_ObjectIDReceived(object sender, ChangeObjectEventArgs e)
        {
            //Use a list of waiting IDs so you don't process town criers and door knobs, etc
            foreach (WorldObject obj in mWaitingForID)
            {
                if (obj.Id == e.Changed.Id)
                {
              //      mWaitingForID.Remove(obj);
                    ProcessDataInventory();
                }

            }
        }
Exemple #24
0
 private void Corpse_ChangeObject(object sender, ChangeObjectEventArgs e)
 {
     try
     {
         if(e.Change != WorldChangeType.IdentReceived) {return;}
         if(e.Changed.ObjectClass == ObjectClass.Corpse)
         {
             if(!CorpseTrackingList.Any(x => x.Id == e.Changed.Id))
             {
                 CheckCorpse(new LandscapeObject(e.Changed));
             }
         }
     }
     catch (Exception ex){LogError(ex);}
 }
		void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				if (e.Change != WorldChangeType.IdentReceived)
					return;

				for (int row = 0; row < tinkeringList.RowCount; row++)
				{
					int id;

					if (int.TryParse(((HudStaticText)tinkeringList[row][6]).Text, out id) && id == e.Changed.Id)
					{
						MyWorldObject mwo = MyWorldObjectCreator.Create(e.Changed);

						((HudStaticText)tinkeringList[row][3]).Text = mwo.Workmanship.ToString(CultureInfo.InvariantCulture);
						((HudStaticText)tinkeringList[row][4]).Text = mwo.Tinks.ToString(CultureInfo.InvariantCulture);

						return;
					}
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Exemple #26
0
 void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
 {
     // DO STUFF HERE
 }
Exemple #27
0
    private void a(object A_0, ChangeObjectEventArgs A_1)
    {
        try
        {
            int num;
            if (PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_Changed().get_Id()) == null)
            {
                PluginCore.cq.n.a("RETURN NULL ITEM", e8.k);
                return;
            }
            if (A_1.get_Change() != 1)
            {
                return;
            }
            if (PluginCore.cq.q.m != PluginCore.cq.q.j)
            {
                PluginCore.cq.n.a("RETURN WRONG CORPSE (" + A_1.get_Changed().get_Name() + ")", e8.k);
                return;
            }
            if (dh.c(A_1.get_Changed().get_Id()) != PluginCore.cq.aw.get_CharacterFilter().get_Id())
            {
                goto Label_045B;
            }
            if (!this.d.ContainsKey(A_1.get_Changed().get_Id()) || !this.d[A_1.get_Changed().get_Id()].a)
            {
                goto Label_042B;
            }
            PluginCore.cq.n.a("Got item in lootlist (" + A_1.get_Changed().get_Name() + "," + this.d[A_1.get_Changed().get_Id()].f.a.ToString() + ")", e8.k);
            if (!PluginCore.cq.n.b)
            {
                goto Label_048B;
            }
            LootAction f = this.d[A_1.get_Changed().get_Id()].f;
            switch (f.a)
            {
            case eLootAction.Salvage:
                if ((A_1.get_Changed().Values(0xab, 0) == 0) && string.IsNullOrEmpty(A_1.get_Changed().Values(8, "")))
                {
                    if (A_1.get_Changed().Values(0x83, 0) != 0)
                    {
                        break;
                    }
                    ai.a("Warning: Lootplugin attempted to classify item " + A_1.get_Changed().get_Name() + " for salvaging, but that item does not have a salvage material. Ignoring it.");
                }
                goto Label_03E7;

            case eLootAction.Read:
                num = PluginCore.cq.aw.get_WorldFilter().get_Item(A_1.get_Changed().get_Id()).Values(0xd000008, 0);
                if (num != 0)
                {
                    if (A_1.get_Changed().get_ObjectClass() == 0x2a)
                    {
                        goto Label_02EF;
                    }
                    ai.a("Warning: Lootplugin attempted to classify item " + A_1.get_Changed().get_Name() + " for reading, but that item does not appear to be a scroll. Ignoring it.");
                }
                goto Label_03E7;

            case eLootAction.ManaStone:
                if (this.f > 0)
                {
                    this.f--;
                }
                PluginCore.cq.ab.b(A_1.get_Changed().get_Id());
                goto Label_03E7;

            case eLootAction.ManaTank:
                if ((A_1.get_Changed().Values(0xab, 0) == 0) && string.IsNullOrEmpty(A_1.get_Changed().Values(8, "")))
                {
                    if (this.g > 0)
                    {
                        this.g--;
                    }
                    PluginCore.cq.ab.c(A_1.get_Changed().get_Id());
                }
                goto Label_03E7;

            default:
                PluginCore.cq.n.g.Add(A_1.get_Changed().get_Id(), f.a);
                goto Label_03E7;
            }
            PluginCore.cq.t.c(A_1.get_Changed().get_Id());
            PluginCore.cq.n.a("S: Object \"" + A_1.get_Changed().get_Name() + "\" added.", e8.c);
            goto Label_03E7;
Label_02EF:
            if (!PluginCore.cq.n.h.ContainsKey(num))
            {
                PluginCore.cq.n.h.Add(num, A_1.get_Changed().get_Id());
            }
Label_03E7:
            if (this.e.ContainsKey(A_1.get_Changed().get_Name()))
            {
                Dictionary <string, int> dictionary;
                string str;
                (dictionary = this.e)[str = A_1.get_Changed().get_Name()] = dictionary[str] - 1;
            }
            goto Label_048B;
Label_042B:
            PluginCore.cq.n.a("ITEM NOT IN LOOTLIST (" + A_1.get_Changed().get_Name() + ")", e8.k);
            goto Label_048B;
Label_045B:
            PluginCore.cq.n.a("STORAGECHANGE NONINVENTORY (" + A_1.get_Changed().get_Name() + ")", e8.k);
            return;

Label_048B:
            if (this.d.ContainsKey(A_1.get_Changed().get_Id()))
            {
                this.d.Remove(A_1.get_Changed().get_Id());
            }
            if (this.c.ContainsKey(A_1.get_Changed().get_Id()))
            {
                this.c.Remove(A_1.get_Changed().get_Id());
            }
        }
        catch (Exception exception)
        {
            ad.a(exception);
        }
    }
Exemple #28
0
		private void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				if (mLoggedIn && e.Change == WorldChangeType.IdentReceived
						&& e.Changed.ObjectClass == ObjectClass.Portal)
				{
					if (mIdPrimaryTie == IdStep.Requested)
					{
						ProcessPortalTie(e.Changed, RouteStartType.PrimaryPortalTie);
						mIdPrimaryTie = IdStep.Idle;
					}
					if (mIdSecondaryTie == IdStep.Requested)
					{
						ProcessPortalTie(e.Changed, RouteStartType.SecondaryPortalTie);
						mIdSecondaryTie = IdStep.Idle;
					}
				}
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}
		void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				/*
				Storage change is a goofy process.
				if (e.Changed.Name.Contains("White E")) Util.WriteToChat(e.Changed.Name + " " + e.Change + ", Container: " + e.Changed.Container + ", Slot: " + e.Changed.Values(LongValueKey.Slot, 0) + ", EquippedSlots: " + e.Changed.Values(LongValueKey.EquippedSlots));

				Dequip:
				<{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 29, EquippedSlots: 262144
				<{Mag-Tools}>: AddItem
				<{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 29, EquippedSlots: 262144
				<{Mag-Tools}>: AddItem
				<{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 0, EquippedSlots: 0
				<{Mag-Tools}>: RemoveItem

				Equip:
				<{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 0, EquippedSlots: 262144
				<{Mag-Tools}>: AddItem7
				<{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 0, Slot: 0, EquippedSlots: 262144
				<{Mag-Tools}>: RemoveItem
				<{Mag-Tools}>: Enhanced White Empyrean Ring StorageChange, Container: 1343094282, Slot: 0, EquippedSlots: 262144
				<{Mag-Tools}>: AddItem
				Enhanced White Empyrean Ring cast Incantation of Armor Other on you, surpassing Incantation of Armor Self
				<{Mag-Tools}>: Enhanced White Empyrean Ring IdentReceived, Container: 1343094282, Slot: 0, EquippedSlots: 262144
				*/

				// This is kind of a goofy check.
				// When we equip an item StorageChange is raised three times on that item.
				// The process will call AddItem, then RemoveItem, then AddItem
				if (e.Change == WorldChangeType.StorageChange && e.Changed.Values(LongValueKey.Container) != 0)
				{
					if (ShoudlWeWatchItem(e.Changed))
						AddItem(e.Changed);
					else
						RemoveItem(e.Changed);
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Exemple #30
0
        private void FoundryChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if(e.Change == WorldChangeType.StorageChange && e.Changed.Values(LongValueKey.Unknown10) == 56)
                {
                    FoundryFillPackIDs();
                    foreach(int id in FoundryPackIds)
                    {
                        WriteToChat(Core.WorldFilter[id].Name + " " + id.ToString());
                    }

                }
            }catch(Exception ex){LogError(ex);}
        }
Exemple #31
0
		void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			if (!Settings.SettingsManager.InventoryManagement.InventoryLogger.Value)
				return;

			if (loggedInAndWaitingForIdData)
			{
				bool allInventoryHasIdData = true;

				foreach (WorldObject wo in CoreManager.Current.WorldFilter.GetInventory())
				{
					if (!wo.HasIdData && ObjectClassNeedsIdent(wo.ObjectClass, wo.Name))
					{
						allInventoryHasIdData = false;
						break;
					}
				}

				if (allInventoryHasIdData)
				{
					loggedInAndWaitingForIdData = false;
					DumpInventoryToFile();
					Debug.WriteToChat("Requesting id information for all armor/weapon inventory completed. Log file written.");
				}
			}
		}
Exemple #32
0
        private void TradeObject_ObjectIDReceived(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                Util.WriteToChat("I am in TradeObject_ObjectIDReceived and msecondarysubroutine = " + msecondarysubRoutine);
                if (!msecondarysubRoutine.Contains("Tinking") &&  !msecondarysubRoutine.Contains("Crafting") && !msecondarysubRoutine.Contains("Salvage") && lstWaitingforID !=null && lstWaitingforID.Count > 0)
                {
                    Core.WorldFilter.ChangeObject -= TradeObject_ObjectIDReceived;

                    int tempnum = lstWaitingforID.Count;
                    WorldObject obj;
                    Util.WriteToChat("I am in function to report an id is received");
                    // if ((DateTime.Now - TimeIdObj).TotalSeconds > 10)

                    Util.WriteToChat("I am in objectidreceived and number of items in lstWaitingforId:  " + lstWaitingforID.Count.ToString());
                    if (tempnum > 0)
                    {
                        for (int x = 0; x < tempnum; x++)
                        {
                            // if (obj.Id == e.Changed.Id)
                            if (lstWaitingforID[x].HasIdData)
                            {
                                obj = lstWaitingforID[x];
                                lstTrdObjects.Add(obj);
                                lstWaitingforID.Remove(obj);

                                Util.WriteToChat(lstTrdObjects.Count + " items that have been id'd.");
                                Util.WriteToChat(lstWaitingforID.Count + " items that are waiting to be id'd.");

                                if (lstWaitingforID.Count == 0)
                                {
                                    lstWaitingforID.Clear();
                                    lstWaitingforID = null;
                                    Core.WorldFilter.ChangeObject -= TradeObject_ObjectIDReceived;
                                    Util.WriteToChat("Moving on to BotChores");
                                    unsubscribeTradeEvents();

                                }
                              //  else { CoreManager.Current.RenderFrame += new EventHandler<EventArgs>(RenderFrame_DotheIDing); }

                            }
                        }
                    }
                    else
                    {
                        Util.WriteToChat(lstWaitingforID.Count.ToString() + " items waiting to be id'd");
                        Core.WorldFilter.ChangeObject -= TradeObject_ObjectIDReceived;
                       // Core.WorldFilter.EndTrade += new EventHandler<EndTradeEventArgs>(WorldFilter_EndTrade);
                        unsubscribeTradeEvents();

                    }
                    //TimeIdObj = DateTime.Now;
                    //CoreManager.Current.RenderFrame += new EventHandler<EventArgs>(RenderFrame_DotheIDing);

                }
            }
            catch (Exception ex) { Util.LogError(ex); }
        }
        //        private void ItemTracker_ServerDispatch(object sender, NetworkMessageEventArgs e)
        //        {
        //            try
        //            {
        //                if(e.Message.Type == AC_CREATE_OBJECT
        //                
        //                
        //                e.Message.Type == AC_GAME_EVENT;
        //                
        //                
        //            }catch(Exception ex){LogError(ex);}
        //        }
        //        Deadeye's Color System palette Code.
        //        private void Echo_CreateObject(IMessage2 msg) // F745
        //        {
        //            string test = "Start";
        //            object o = null;
        //            try
        //            {
        //                int guid = (int)msg.get_Value("object");
        //                //ITEM_CLASS eClass;
        //                test = "paletteCount";
        //                IMessageMember mem = msg.get_Struct(test = "model");
        //                int i;
        //                for (i=0; i< m_nKnownItems; i++)
        //                {
        //                    if (KnownItemArray[i].guid == guid) return;
        //                }
        //                o = mem.get_Value(test = "paletteCount");
        //                test = "cast paletteCount";
        //                int paletteCount = (byte)o;
        //                o = mem.get_Value(test = "textureCount");
        //                test = "case textureCount";
        //                int textureCount = (byte)o;
        //                IMessageIterator aPalettes = (IMessageIterator)mem.get_Struct(test = "palettes");
        //                IMessageIterator aTextures = (IMessageIterator)mem.get_Struct(test = "textures");
        //
        //                mem = msg.get_Struct(test = "game");
        //                o = mem.get_Value(test = "name");
        //                string name = o.ToString();
        //                
        //                o = mem.get_Value(test = "type");
        //                int model = (int)o;
        //
        //                o = mem.get_Value(test = "icon");
        //                int icon = (int)o;
        //
        //                o = mem.get_Value(test = "category");
        //                int nTypeFlags = (int)o;
        //                if ((nTypeFlags & 0x06)==0) return;   // Only Armor and Clothing
        //
        //                int pyrealvalue;
        //                int coverage;
        //                int burden;
        //                try { pyrealvalue  = (int)mem.get_Value("value");    }catch{pyrealvalue=0;}
        //                try { coverage     = (int)mem.get_Value("coverage1");}catch{coverage   =0;}
        //                try { burden       = (int)mem.get_Value("burden");   }catch{burden     =0;}
        //            
        //                int[]  Color = new int[paletteCount];
        //                for(i=0; i<paletteCount; i++)
        //                {
        //                    if (m_bStats)
        //                    {
        //                        test = "palette iteration #"+i.ToString();
        //                        IMessageIterator palette = aPalettes.NextObjectIndex;
        //                        int iOS = palette.get_NextInt(test="palette");
        //                        int iOffset = palette.get_NextInt(test="offset");
        //                        int iSize = palette.get_NextInt(test ="length");
        //                        Color[i] = iOS; //  + palette.get_NextInt("length") * 256;
        //                        //if (ColorTable.Contains(Color[i]) == false)
        //                        {
        //                            test = Color[i].ToString()
        //                                + "," + iOffset.ToString()
        //                                + "," + iSize.ToString();
        //                            m_Hooks.AddChatText("DCS: Color " + test + " on " + name, 14, 1);
        //                            StreamWriter sw = new StreamWriter(/*m_sAssemblyPath+*/"F:\\ColorTrap.csv",true);
        //                            sw.Write(name+","+model.ToString()+",#"+coverage.ToString("X8")+","+i.ToString()+","+test+m_sEOL);
        //                            sw.Flush();
        //                            sw.Close();
        //                        }
        //                    }
        //                    else
        //                    {
        //                        test = "palette iteration #"+i.ToString();
        //                        IMessageIterator palette = aPalettes.NextObjectIndex;
        //                        Color[i] = palette.get_NextInt(test = "palette");
        //                    }
        //                }
        //
        //                COLOR_INFO NewColor;
        //                //AC_MODEL   acModel;
        //                ushort     iModel = (ushort)model;
        //                /*
        //                eClass = ITEM_CLASS.NONE;
        //                switch (coverage)
        //                {
        //                    case 0x00200000:  // Shield
        //                        return;
        //                    case 0x00000400:  // Girth
        //                        eClass |= ITEM_CLASS.GIRTH;
        //                        acModel = new AC_MODEL(iModel, "AB", name);
        //                        break;
        //                    case 0x00000200:  // Breastplate
        //                        eClass |= ITEM_CLASS.BREASTPLATE;
        //                        acModel = new AC_MODEL(iModel, "AB", name);
        //                        break;
        //                    case 0x00001800:  // Sleeves
        //                        eClass |= ITEM_CLASS.SLEEVES;
        //                        acModel = new AC_MODEL(iModel, "AC", name);
        //                        break;
        //                    case 0x00000600:  // Curaiss
        //                        eClass |= ITEM_CLASS.CURAISS;
        //                        acModel = new AC_MODEL(iModel, "AC", name);
        //                        break;
        //                    case 0x00000E00:  // Short Sleeve Shirt
        //                        eClass |= ITEM_CLASS.OVERSHIRT;
        //                        acModel = new AC_MODEL(iModel, "AD", name);
        //                        break;
        //                    case 0x00001A00:  // Coat
        //                        eClass |= ITEM_CLASS.COAT;
        //                        acModel = new AC_MODEL(iModel, "ABD", name);
        //                        break;
        //                    case 0x00002000:  // Tassets (have no color)
        //                        acModel = new AC_MODEL(iModel, "", name);
        //                        break;
        //                    case 0x00007F00:  // Robe
        //                    case 0x00007F01:  // Hooded Robe
        //                        eClass |= ITEM_CLASS.ROBE;
        //                        acModel = new AC_MODEL(iModel, "ABDE", name);
        //                        break;
        //                    case 0x00001E00:  // Hauberk
        //                        eClass |= ITEM_CLASS.HAUBERK;
        //                        acModel = new AC_MODEL(iModel, "AE", name);
        //                        break;
        //                    case 0x00006400:  // Pants
        //                        eClass |= ITEM_CLASS.OVERPANTS;
        //                        if (model == 6004)
        //                            acModel = new AC_MODEL(iModel, "ACDE", name);
        //                        else
        //                            acModel = new AC_MODEL(iModel, "AC", name);
        //                        break;
        //                    default:
        //                        acModel = new AC_MODEL(iModel, "ABCD", name);
        //                        break;
        //                }
        //                */
        //
        //                
        //                /*if (ModelTable.Contains(model))
        //                {
        //                    AC_MODEL acModel = (AC_MODEL)ModelTable[model];
        //                    NewColor = new COLOR_INFO(guid,name,model,icon,coverage,acModel.Colors);
        //                    for (i=0; i < acModel.Colors; i++)
        //                    {
        //                        NewColor.SetColor(i,Color[acModel.GetColor(i)]);
        //                    }
        //                }
        //                else
        //                { */
        //                    NewColor = new COLOR_INFO(guid,name,model,icon,coverage,4);
        //                    string sColors = "";
        //                    string sColorCodes = ",";
        //                    if (paletteCount > 0)
        //                    {
        //                        sColors = "A";
        //                        sColorCodes = ","+Color[0].ToString();
        //                        NewColor.SetColor(0,Color[0]);
        //                        for (i=1; i < paletteCount; i++)
        //                        {
        //                            sColorCodes += ","+Color[i].ToString();
        //                            if (sColors.Length < 4)
        //                            {
        //                                if (Color[i] != Color[i-1])
        //                                {
        //                                    NewColor.SetColor(sColors.Length,Color[i]);
        //                                    sColors += (char)('A' + i);
        //                                }
        //                            }
        //                        }
        //                    }
        //                    if (m_bDebug)
        //                    {
        //                        ModelTable[model] = new AC_MODEL(iModel,sColors,name);
        //                        StreamWriter sw = new StreamWriter(m_sAssemblyPath+"\\ModelTrap.csv",true);
        //                        sw.WriteLine(model.ToString()+",\""+name+"\",#"+coverage.ToString("X8")+sColorCodes);
        //                        sw.Flush();
        //                        sw.Close();
        //                        m_Hooks.AddChatText(model.ToString()+",\""+name+"\",#"+coverage.ToString("X8")+","+sColors+sColorCodes,7,1);
        //                    }
        //                /*}*/
        //                
        //                if (m_nKnownItems > MAX_ITEMS)
        //                {
        //                    CheckKnown();
        //                }
        //                else if (m_nKnownItems > MAX_ITEMS)
        //                {
        //                    m_Hooks.AddChatText("DCS: ****ERROR*** Inventory Overflow",10,1);
        //                    return;
        //                }
        //                int ins = m_nKnownItems;
        //                while (ins>0)
        //                {
        //                    ins--;
        //                    if (KnownItemArray[ins].coverage > coverage) {ins++; break;}
        //                    if (KnownItemArray[ins].coverage == coverage)
        //                    {
        //                        if( KnownItemArray[ins].model < model) {ins++; break;}
        //                        if( KnownItemArray[ins].model == model)
        //                        {
        //                            if( KnownItemArray[ins].icon < icon) {ins++; break;}
        //                            if( KnownItemArray[ins].icon == icon)
        //                            {
        //                                if( KnownItemArray[ins].name.CompareTo(name)<=0) {ins++; break;}
        //                            }
        //                        }
        //                    }
        //                }
        //                int iPos;
        //                for (iPos=m_nKnownItems-1;iPos>=ins;iPos--)
        //                {
        //                    KnownItemArray[iPos+1] = KnownItemArray[iPos];
        //                }
        //                //				m_Hooks.AddChatText(name,4);
        //                //				for (iPos--;iPos>=0;iPos--)
        //                //				{
        //                //					m_Hooks.AddChatText(KnownItemArray[iPos].name,7);
        //                //				}
        //
        //                KnownItemArray[ins] = NewColor;
        //                m_nKnownItems++;
        //                if (cbAll.Checked)
        //                {
        //                    m_Hooks.IDQueueAdd(guid);
        //                }
        //            }
        //            catch (Exception ex)
        //            {
        //                /*if (m_bDebug)*/ m_Hooks.AddChatText("DCS: Error on " + test + "--" + ex.Message + "( object is "+o.GetType().ToString()+")",7,1);
        //            }
        //        }
        private void ItemTrackerActions_ObjectChanged(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if(e.Change != WorldChangeType.IdentReceived) {return;}

                if(e.Changed.Id == Host.Actions.CurrentSelection)
                {
                    ManualCheckItemForMatches(new LootObject(e.Changed));
                    return;
                }
                else if(LOList.Any(x => x.Id == e.Changed.Id && x.Listen))
                {
                    LootObject lo = LOList.Find(x => x.Id == e.Changed.Id);
                    lo.Listen = false;
                    CheckItemForMatches(lo.Id);
                    return;
                }
            }catch(Exception ex){LogError(ex);}
        }
Exemple #34
0
 void WorldFilter_ChangeObject2(object sender, ChangeObjectEventArgs e)
 {
 }
Exemple #35
0
        private void CollectTask_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            try
            {
                if(e.Change != WorldChangeType.StorageChange && e.Change != WorldChangeType.SizeChange) {return;}
                int ChangeIndex = mKTSet.MyCollectTasks.FindIndex(x => x.Item == e.Changed.Name);
                if(ChangeIndex > -1)
                {
                    List<WorldObject> inventory = Core.WorldFilter.GetInventory().Where(x => @x.Name == @mKTSet.MyCollectTasks[ChangeIndex].Item).ToList();
                    int colcount = 0;
                    foreach(WorldObject item in inventory)
                    {
                        colcount += item.Values(LongValueKey.StackCount);
                    }
                    mKTSet.MyCollectTasks[ChangeIndex].CurrentCount = colcount;

                    if(mKTSet.MyCollectTasks[ChangeIndex].CurrentCount >= mKTSet.MyCollectTasks[ChangeIndex].CompleteCount)
                    {
                        mKTSet.MyCollectTasks[ChangeIndex].complete = true;
                    }

                }

                UpdateTaskPanel();

            }catch(Exception ex){LogError(ex);}
        }
        internal void WriteObject(ChangeObjectEventArgs obj)
        {
            if (ActiveSettings.Instance.DebugLevel == DebugLevel.None)
                return;

            lock (this._writeLock)
            {
                using (StreamWriter stream = new StreamWriter(this._currentPath, true))
                {
                    this.LogRawMessage(this.FormatWithPrefix("ChangeObjectEventArgs"), stream);
                    this.LogRawMessage(string.Format("  Changed (WObj) = {0}", obj.Changed.Name), stream);
                    this.LogRawMessage(string.Format("    Id = {0}", obj.Changed.Id), stream);
                    this.LogRawMessage(string.Format("  WorldChangeType = {0}", obj.Change.ToString()), stream);

                    //this.WriteCurrentStateStuff(stream, false);

                    this.LogRawMessage("", stream);
                }
            }
        }
Exemple #37
0
        private void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
        {
            WorldObject changed = e.Changed;

            if ((LowComps == true) && (changed.ObjectClass == ObjectClass.SpellComponent))
            {
                int[] comps = new int[9];

                foreach (WorldObject worldObject in Core.WorldFilter.GetByObjectClass(ObjectClass.SpellComponent))
                {
                    if (worldObject.Name == "Prismatic Taper")
                    {
                        comps[0] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Lead Scarab")
                    {
                        comps[1] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Iron Scarab")
                    {
                        comps[2] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Copper Scarab")
                    {
                        comps[3] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Silver Scarab")
                    {
                        comps[4] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Gold Scarab")
                    {
                        comps[5] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Pyreal Scarab")
                    {
                        comps[6] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Platinum Scarab")
                    {
                        comps[7] += worldObject.Values(LongValueKey.StackCount);
                    }

                    if (worldObject.Name == "Mana Scarab")
                    {
                        comps[8] += worldObject.Values(LongValueKey.StackCount);
                    }
                }

                foreach (int comp in comps)
                {
                    if ((comp != 0) && (comp <= 5))
                    {
                        DelayLogout.Interval = NewRand();
                        DelayLogout.Start();
                    }
                }
            }
        }
		void WorldFilter_ChangeObject(object sender, ChangeObjectEventArgs e)
		{
			try
			{
				if (!Settings.SettingsManager.ItemInfoOnIdent.Enabled.Value)
					return;

				if (e.Change != WorldChangeType.IdentReceived)
					return;

				// Remove id's that have been selected more than 10 seconds ago
				while (true)
				{
					int idToRemove = 0;

					foreach (KeyValuePair<int, DateTime> pair in itemsSelected)
					{
						if (pair.Value + TimeSpan.FromSeconds(10) < DateTime.Now)
						{
							idToRemove = pair.Key;
							break;
						}
					}

					if (idToRemove == 0)
						break;
					
					itemsSelected.Remove(idToRemove);
				}

				if (!itemsSelected.ContainsKey(e.Changed.Id))
					return;

				itemsSelected.Remove(e.Changed.Id);

				if (e.Changed.ObjectClass == ObjectClass.Corpse ||
					e.Changed.ObjectClass == ObjectClass.Door ||
					e.Changed.ObjectClass == ObjectClass.Foci ||
					e.Changed.ObjectClass == ObjectClass.Housing ||
					e.Changed.ObjectClass == ObjectClass.Lifestone ||
					e.Changed.ObjectClass == ObjectClass.Npc ||
					e.Changed.ObjectClass == ObjectClass.Portal ||
					e.Changed.ObjectClass == ObjectClass.Vendor)
					return;

				if (ItemIdentified != null)
				{
					ItemInfoIdentArgs itemInfoIdentArgs = new ItemInfoIdentArgs(e.Changed);

					ItemIdentified(this, itemInfoIdentArgs);
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}