Beispiel #1
0
        void aetheriaTracker_SurgeEvent(Aetheria.SurgeEventArgs obj)
        {
            //Debug.WriteToChat("Aetheria: SourceName: " + obj.SourceName + ", TargetName: " + obj.TargetName + ", SurgeType: " + obj.SurgeType);

            // We only track our own surge events
            if (obj.SourceName != CoreManager.Current.CharacterFilter.Name)
            {
                return;
            }

            AetheriaInfo aetheriaInfo = aetheriaInfos.Find(i => i.SourceName == obj.SourceName && i.TargetName == obj.TargetName);

            if (aetheriaInfo == null)
            {
                aetheriaInfo = new AetheriaInfo(obj.SourceName, obj.TargetName);

                aetheriaInfos.Add(aetheriaInfo);
            }

            aetheriaInfo.AddFromSurgeEventArgs(obj);

            if (AetheriaInfoUpdated != null)
            {
                AetheriaInfoUpdated(aetheriaInfo);
            }
        }
Beispiel #2
0
		public void AddFromSurgeEventArgs(SurgeEventArgs surgeEventArgs)
		{
			TotalSurges++;
		}
Beispiel #3
0
		void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (String.IsNullOrEmpty(e.Text))
					return;

				if (Util.IsChat(e.Text))
					return;

				string sourceName = String.Empty;
				string targetName = String.Empty;

				// For messages where your aetheria casts a spell on the target, we cannot track whose aetheria
				// actually cast the spell so we do not know the source.

				// Aetheria surges on PlayerName with the power of Surge of Destruction!
				// Aetheria surges on Pyreal Target Drudge with the power of Surge of Festering!
				//
				// You cast Surge of Destruction on yourself
				// Aetheria surges on MyCharactersName with the power of Surge of Destruction!
				// Surge of Destruction has expired.
				//
				// You cast Surge of Festering on yourself
				// Aetheria surges on MyCharactersName with the power of Surge of Festering!

				// Prevent duplicate event raises for the same aetheria surge
				if (e.Text.StartsWith("You cast") || e.Text.Contains("has expired."))
					return;

				if (e.Text.StartsWith("Aetheria surges on ") && e.Text.Contains(" with the "))
				{
					targetName = e.Text.Replace("Aetheria surges on ", "");
					targetName = targetName.Substring(0, targetName.IndexOf(" with the "));

					// These surges can only be cast on yourself
					if (e.Text.Contains("Surge of Destruction"))	sourceName = targetName;
					if (e.Text.Contains("Surge of Protection"))		sourceName = targetName;
					if (e.Text.Contains("Surge of Regeneration"))	sourceName = targetName;
				}

				SurgeType surgeType = SurgeType.Unknown;

				if (e.Text.Contains("Surge of Destruction"))	surgeType = SurgeType.SurgeOfDestruction;
				if (e.Text.Contains("Surge of Protection"))		surgeType = SurgeType.SurgeOfProtection;
				if (e.Text.Contains("Surge of Regeneration"))	surgeType = SurgeType.SurgeOfRegeneration;
				if (e.Text.Contains("Surge of Affliction"))		surgeType = SurgeType.SurgeOfAffliction;
				if (e.Text.Contains("Surge of Festering"))		surgeType = SurgeType.SurgeOfFestring;

				if (surgeType == SurgeType.Unknown)
					return;

				SurgeEventArgs surgeEventArgs = new SurgeEventArgs(sourceName, targetName, surgeType);

				if (SurgeEvent != null)
					SurgeEvent(surgeEventArgs);
			}
			catch (Exception ex) { Debug.LogException(ex, e.Text); }
		}
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(e.Text))
                {
                    return;
                }

                if (Util.IsChat(e.Text))
                {
                    return;
                }

                string sourceName = String.Empty;
                string targetName = String.Empty;

                // For messages where your aetheria casts a spell on the target, we cannot track whose aetheria
                // actually cast the spell so we do not know the source.

                // Aetheria surges on PlayerName with the power of Surge of Destruction!
                // Aetheria surges on Pyreal Target Drudge with the power of Surge of Festering!
                //
                // You cast Surge of Destruction on yourself
                // Aetheria surges on MyCharactersName with the power of Surge of Destruction!
                // Surge of Destruction has expired.
                //
                // You cast Surge of Festering on yourself
                // Aetheria surges on MyCharactersName with the power of Surge of Festering!

                // Prevent duplicate event raises for the same aetheria surge
                if (e.Text.StartsWith("You cast") || e.Text.Contains("has expired."))
                {
                    return;
                }

                if (e.Text.StartsWith("Aetheria surges on ") && e.Text.Contains(" with the "))
                {
                    targetName = e.Text.Replace("Aetheria surges on ", "");
                    targetName = targetName.Substring(0, targetName.IndexOf(" with the "));

                    // These surges can only be cast on yourself
                    if (e.Text.Contains("Surge of Destruction"))
                    {
                        sourceName = targetName;
                    }
                    if (e.Text.Contains("Surge of Protection"))
                    {
                        sourceName = targetName;
                    }
                    if (e.Text.Contains("Surge of Regeneration"))
                    {
                        sourceName = targetName;
                    }
                }

                SurgeType surgeType = SurgeType.Unknown;

                if (e.Text.Contains("Surge of Destruction"))
                {
                    surgeType = SurgeType.SurgeOfDestruction;
                }
                if (e.Text.Contains("Surge of Protection"))
                {
                    surgeType = SurgeType.SurgeOfProtection;
                }
                if (e.Text.Contains("Surge of Regeneration"))
                {
                    surgeType = SurgeType.SurgeOfRegeneration;
                }
                if (e.Text.Contains("Surge of Affliction"))
                {
                    surgeType = SurgeType.SurgeOfAffliction;
                }
                if (e.Text.Contains("Surge of Festering"))
                {
                    surgeType = SurgeType.SurgeOfFestring;
                }

                if (surgeType == SurgeType.Unknown)
                {
                    return;
                }

                SurgeEventArgs surgeEventArgs = new SurgeEventArgs(sourceName, targetName, surgeType);

                if (SurgeEvent != null)
                {
                    SurgeEvent(surgeEventArgs);
                }
            }
            catch (Exception ex) { Debug.LogException(ex, e.Text); }
        }