Exemple #1
0
        public void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Text.Equals("Quest list is empty.\n") || e.Text.Equals("The command \"myquests\" is not currently enabled on this server.\n"))
                {
                    GettingQuests              = false;
                    Core.RenderFrame          -= Core_RenderFrame;
                    UIQuestListRefresh.Visible = true;
                    ShouldEat = false;
                    return;
                }

                if (QuestFlag.MyQuestRegex.IsMatch(e.Text))
                {
                    e.Eat         = ShouldEat;
                    GotFirstQuest = true;
                    var questFlag = QuestFlag.FromMyQuestsLine(e.Text);

                    if (questFlag != null)
                    {
                        QuestFlags[questFlag.Id] = questFlag;
//                        UpdateQuestFlag(questFlag);
                    }
                    lastHeartbeat = DateTime.UtcNow;
                }
            }
            catch (Exception ex) { Logger.LogException(ex); }
        }
Exemple #2
0
        /// <summary>
        /// The parser of all messages. It is subscribed to only while the bot is in operation.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            Match localMatch      = LocalMatch.Match(e.Text);
            Match allegianceMatch = AllegianceMatch.Match(e.Text);
            Match tellMatch       = TellMatch.Match(e.Text);
            Match giftMatch       = GiftMatch.Match(e.Text);

            if (localMatch.Success)
            {
                HandleChat(localMatch);
            }
            else if (allegianceMatch.Success)
            {
                HandleChat(allegianceMatch);
            }
            else if (tellMatch.Success)
            {
                HandleTell(tellMatch);
            }
            else if (giftMatch.Success)
            {
                SendTell(giftMatch.Groups["name"].Value, $"Thank you for the {giftMatch.Groups["gift"].Value}!");
                Machine.Utility.SaveGiftToLog(e.Text);
            }
        }
Exemple #3
0
 private void a(MySpell A_0, int A_1, bool A_2, bool A_3, ChatTextInterceptEventArgs A_4)
 {
     if ((A_1 == this.a) && (A_1 != 0))
     {
         this.i();
         if (!A_0.HitsMultipleTargets)
         {
             if (A_2)
             {
                 this.b(0);
             }
             else
             {
                 foreach (ei.a a in k)
                 {
                     if (A_4.get_Color() == a.b)
                     {
                         int   num;
                         Match match = a.a.Match(A_4.get_Text());
                         if (match.Success && int.TryParse(match.Groups[1].Value, out num))
                         {
                             this.a((int)(this.b - num));
                             this.c = num;
                             break;
                         }
                     }
                 }
             }
         }
     }
 }
		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); }
		}
Exemple #5
0
		void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (e.Text.Contains("The Mana Stone gives"))
					Stop();
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Exemple #6
0
 void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
 {
     try
     {
         if (e.Text.Contains("The Mana Stone gives"))
         {
             Stop();
         }
     }
     catch (Exception ex) { Debug.LogException(ex); }
 }
Exemple #7
0
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                // Do we even have a receiver?
                if (LogItem == null)
                {
                    return;
                }

                if (Util.IsChat(e.Text, Util.ChatFlags.NpcSays | Util.ChatFlags.NpcTellsYou))
                {
                    return;
                }

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

                LoggedChat item;

                if (Util.IsChat(e.Text, Util.ChatFlags.PlayerTellsYou | Util.ChatFlags.YouTell))
                {
                    item = new LoggedChat(DateTime.Now, Util.ChatChannels.Tells, e.Text);
                }
                else if (Util.IsChat(e.Text, Util.ChatFlags.PlayerSaysLocal | Util.ChatFlags.YouSay))
                {
                    item = new LoggedChat(DateTime.Now, Util.ChatChannels.Area, e.Text);
                }
                else if (Util.IsChat(e.Text, Util.ChatFlags.PlayerSaysChannel))
                {
                    Util.ChatChannels channel = Util.GetChatChannel(e.Text);

                    if (channel == Util.ChatChannels.None)
                    {
                        return;
                    }

                    item = new LoggedChat(DateTime.Now, channel, e.Text);
                }
                else
                {
                    //item = new LoggedChat(DateTime.Now, Util.ChatChannels.None, e.Text);
                    return;
                }

                if (LogItem != null)
                {
                    LogItem(item);
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #8
0
 private void Logoff_Request2(object sender, ChatTextInterceptEventArgs e)
 {
     try
     {
         if (e.Color == 0 && e.Text.Contains("Logging off..."))
         {
             lib.logging = true;
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
Exemple #9
0
        // Methods
        private void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (ChatMessages.GetWeenieInfo(e.Text, out string wcid))
                {
                    TextboxExportJsonWCID = (HudTextBox)view["TextboxExportJsonWCID"];
                    TextboxExportSQLWCID  = (HudTextBox)view["TextboxExportSQLWCID"];

                    LabelGetInfo               = (HudStaticText)view["LabelGetInfo"];
                    LabelGetInfo.Text          = e.Text;
                    TextboxExportJsonWCID.Text = wcid;
                    TextboxExportSQLWCID.Text  = wcid;
                    Globals.YotesWCID          = wcid;
                    if (Globals.ButtonCommand == "YotesLookup")
                    {
                        Util.WriteToChat("Opening Browser");
                        Globals.ButtonCommand = "";
                        System.Diagnostics.Process.Start("http://ac.yotesfan.com/weenies/items/" + wcid);
                        Globals.ButtonCommand = "NONE";
                    }
                    if (Globals.ButtonCommand == "PCAPsLookup")
                    {
                        Util.WriteToChat("Opening Browser");
                        Globals.ButtonCommand = "";
                        System.Diagnostics.Process.Start("https://github.com/ACEmulator/ACE-PCAP-Exports/search?q=filename:" + wcid);
                        Globals.ButtonCommand = "NONE";
                    }
                    // Util.WriteToChat(e.Text);
                }
                if (ChatMessages.FileExport(e.Text))
                {
                    JsonChoiceListLoadFiles();
                    SqlChoiceListLoadFiles();
                    Util.WriteToChat("ListRefresh");
                }
                if (ChatMessages.LogMyLocations(e.Text, out string location))
                {
                    if (TextboxCreateWCID.Text == "")
                    {
                        Util.LogLocation("BlankWCID, " + location);
                    }
                    else
                    {
                        Util.LogLocation(TextboxCreateWCID.Text + ", " + location);
                    }
                }
            }
            catch (Exception ex)
            {
                Util.WriteToChat("ChatBoxMessage Error - " + ex);
            }
        }
        private void ChatBoxTextMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if(ChatChannelPass.Contains(e.Color)) {return;}
                else if(mGeneralSettings.EnableTextFiltering)
                {
                    e.Eat = true;
                    return;
                }

            }catch(Exception ex){LogError(ex);}
        }
Exemple #11
0
 private void a(object A_0, ChatTextInterceptEventArgs A_1)
 {
     try
     {
         if ((A_1.get_Color() == 0) && this.b.IsMatch(A_1.get_Text()))
         {
             this.c.Clear();
             PluginCore.cq.n.a("Mana Stone use detected.", e8.e);
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }
        public static bool TryCreateFrom(ChatTextInterceptEventArgs eventArgs, Util.ChatFlags chatTypeFilter, out ParsedChatTextInterceptEventArgs parsedEventArgs)
        {
            if (Util.IsChat(eventArgs.Text, chatTypeFilter))
            {
                Util.ChatChannels channel = ChatParsingUtilities.GetChatChannel(eventArgs.Text);
                ChatMessageType messageType = ChatParsingUtilities.GetChatMessageType(eventArgs.Text);
                string source = ChatParsingUtilities.GetSourceOfChat(eventArgs.Text);

                parsedEventArgs = new ParsedChatTextInterceptEventArgs(eventArgs, source, channel, messageType);
                return true;
            }

            parsedEventArgs = null;
            return false;
        }
Exemple #13
0
 public static void Core_RemoteTarget(object sender, ChatTextInterceptEventArgs x)
 {
     try
     {
         if (lib.Mode == 0 && x.Text.Contains("TargetID: ") && x.Color == 3)
         {
             int num = int.Parse(x.Text.Split(new string[] { ": " }, StringSplitOptions.None)[3]);
             if (lib.MyCore.Actions.IsValidObject(num))
             {
                 CoreManager.Current.Actions.SelectItem(num);
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
Exemple #14
0
		void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (e.Text.StartsWith("You say, ") || e.Text.Contains("says, \""))
					return;

				if (e.Text.ToLower().Contains(CoreManager.Current.CharacterFilter.Name.ToLower() + " autopack"))
				{
					e.Eat = true;
					Start();
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
Exemple #15
0
		void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (!Settings.SettingsManager.ManaManagement.AutoRecharge.Value)
					return;

				if (e.Text.StartsWith("You say, ") || e.Text.Contains("says, \""))
					return;

				// Your Gold Olthoi Koujia Sleeves is low on Mana.
				if (e.Text.Contains("Your") && e.Text.Contains(" is low on Mana."))
					ManaRecharger.Instance.Start();
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Text.StartsWith("You say, ") || e.Text.Contains("says, \""))
                {
                    return;
                }

                if (e.Text.ToLower().Contains(CoreManager.Current.CharacterFilter.Name.ToLower() + " autopack"))
                {
                    e.Eat = true;
                    Start();
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #17
0
 private static void a(object A_0, ChatTextInterceptEventArgs A_1)
 {
     try
     {
         if (((PluginCore.cq != null) && PluginCore.cq.n.b) && er.j("EnableMeta"))
         {
             a2.a item = new a2.a {
                 b = A_1.get_Color(),
                 c = A_1.get_Target(),
                 a = A_1.get_Text()
             };
             a.Add(item);
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Text.StartsWith("You say, ") || e.Text.Contains("says, \""))
                {
                    return;
                }

                WorldObject wo = CoreManager.Current.WorldFilter[Id];

                if (wo == null)
                {
                    return;
                }

                // The Mana Stone is destroyed.
                // The Mana Stone gives 11,376 points of mana to the following items: Satin Flared Shirt, Steel Chainmail Bracers, Velvet Trousers, Leather Loafers, Copper Chainmail Greaves, Enhanced White Empyrean Ring, Enhanced Red Empyrean Ring, Iron Diforsa Pauldrons, Bronze Chainmail Tassets, Copper Heavy Bracelet, Silver Olthoi Amuli Gauntlets, Ivory Heavy Bracelet, Steel Coronet, Emerald Amulet, Silver Puzzle Box, Sunstone Fire Sceptre
                // Your items are fully charged.
                if (e.Text.Contains("The Mana Stone gives "))
                {
                    if (e.Text.Contains(wo.Name))
                    {
                        CoreManager.Current.Actions.RequestId(Id);
                    }
                }

                // This is triggered when an item has 2 minutes left of mana.
                // Your Gold Olthoi Koujia Sleeves is low on Mana.
                // Your Bronze Haebrean Breastplate is out of Mana.
                if (e.Text.Contains("Your ") && (e.Text.Contains(" is low on Mana.") || e.Text.Contains(" is out of Mana.")))
                {
                    if (e.Text.Contains(wo.Name))
                    {
                        CoreManager.Current.Actions.RequestId(Id);
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #19
0
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (!Settings.SettingsManager.ManaManagement.AutoRecharge.Value)
                {
                    return;
                }

                if (e.Text.StartsWith("You say, ") || e.Text.Contains("says, \""))
                {
                    return;
                }

                // Your Gold Olthoi Koujia Sleeves is low on Mana.
                if (e.Text.Contains("Your") && e.Text.Contains(" is low on Mana."))
                {
                    ManaRecharger.Instance.Start();
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #20
0
        private void Core_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (ChatPatterns != null)
                {
                    foreach (ChatPattern pattern in ChatPatterns)
                    {
                        if (!pattern.Match(e))
                        {
                            continue;
                        }

                        // Messages sometimes have newlines in them
                        TriggerWebhooksForEvent(pattern.Event, e.Text.Replace("\n", ""));
                    }
                }


                if (ChatTriggers != null)
                {
                    foreach (ChatTrigger trigger in ChatTriggers)
                    {
                        if (!trigger.Match(e))
                        {
                            continue;
                        }

                        // Messages sometimes have newlines in them
                        TriggerWebhooksForChatTrigger(trigger, e.Text.Replace("\n", ""));
                    }
                }
            }
            catch (Exception ex)
            {
                Util.LogError(ex);
            }
        }
Exemple #21
0
        public static void RecallDetection(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (lib.UseMacroLogic == true && lib.Mode == 3)
                {
                    if (e.Color == 0 && (e.Text.Contains(lib.MyName + " is going") || e.Text.Contains(lib.MyName + " is recalling")) || (e.Color == 17 && e.Text.Contains("You say, \"Shurov")))
                    {
                        lib.Mode = 0;
                        MainView.Mode.Current = 0;
                        Report.LogEvent("ModeSwitch");

                        if (lib.vtank == true)
                        {
                            Utility.DispatchChatToBoxWithPluginIntercept("/vt stop");
                            Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " : " + lib.authtype + " : Current mode: SLAVE - Zone change detected at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("ZONE CHANGE DETECTED! Mode switched: SLAVE!", 6);
                        }
                    }
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
Exemple #22
0
        private void Core_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            if ((e.Text.Trim().ToString() == "Logging off...") && (relog == true))
            {
                relog = false;
                RelogTimer.Start();
            }

            if (e.Text.Contains("You have created the Fellowship") || e.Text.Contains("You are now the leader of your Fellowship"))
            {
                FellowLeader = true;
            }

            if (e.Text.Contains("is now the leader of your Fellowship."))
            {
                FellowLeader = false;
            }

            if (e.Text.Contains("[Seek]:") && (FellowTarget == true) && (FellowLeader == false))
            {
                string text1            = e.Text;
                int    num1             = text1.LastIndexOf(" ");
                int    CalledTargetGUID = (Convert.ToInt32(text1.Substring(num1 + 1, 10)));
                string str = CalledTargetGUID.ToString();

                if (e.Text.Contains("-"))
                {
                    Host.Actions.SelectItem(Convert.ToInt32(text1.Substring(num1 + 1, 11)));
                }
                else
                {
                    Host.Actions.SelectItem(Convert.ToInt32(text1.Substring(num1 + 1, 10)));
                }

                Host.Actions.CastSpell(0x709, Host.Actions.CurrentSelection);
            }
        }
Exemple #23
0
        private void InboundChat(object sender, ChatTextInterceptEventArgs e)
        {
            Match match = Regex.Match(e.Text, @"^(\[.+\] |)\<Tell\:IIDString\:([0-9]+)\:([^\>]*)\>[^\<]*\<\\Tell\> ([^,]+), \""([^\n]*)\""\n*$");

            if (match.Success)
            {
                ChatMessage chatMessage = new ChatMessage()
                {
                    Channel     = match.Groups[1].Value.Trim(),
                    ChatterId   = int.Parse(match.Groups[2].Value.Trim()),
                    ChatterName = match.Groups[3].Value.Trim(),
                    Verb        = match.Groups[4].Value.Trim(),
                    Message     = match.Groups[5].Value.Trim()
                };
                match = Regex.Match(chatMessage.Message, "^(switch|search|retrieve|tag|tags|help|add|xadd|show|clear)(.*)", RegexOptions.IgnoreCase);
                if (match.Success)
                {
                    chatMessage.ParseSuccess     = true;
                    chatMessage.ParsedCommand    = match.Groups[1].Value.Trim();
                    chatMessage.ParsedParameters = match.Groups[2].Value.Trim();
                }
                HandleChatMessage(chatMessage);
            }
        }
        private void Foundry_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {

                if(e.Color == 0)
                {
                    if(e.Text.Trim() == "You have successfully picked the lock!  It is now unlocked.")
                    {
                        FoundryActionList[(int)FoundryActionTypes.UseLockPick].ToDoList.Clear();
                    }

            //					if(e.Text.Trim() == "A sigil rises to the surface as you bathe the aetheria in mana.")
            //					{
            //						FoundryActionList[(int)FoundryActionTypes.Reveal].ToDoList.RemoveAt(0);
            //					}

                }

            }catch(Exception ex){LogError(ex);}
        }
Exemple #25
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;

                // First person intercepts
                // You cast Cloaked in Skill on yourself
                // The cloak of MyPlayerName weaves the magic of Cloaked in Skill!
                //
                // You cast Shroud of Darkness (Melee) on Invading Iron Blade Knight
                // You cast Shroud of Darkness (Magic) on Infernal Zefir
                // Your cloak reduced the damage from 162 down to 0!

                // Third person intercepts
                // The cloak of PlayerName weaves the magic of Shroud of Darkness (Melee)!
                // The cloak of PlayerName weaves the magic of Cloaked in Skill!

                if (e.Text.StartsWith("You cast ") || e.Text.StartsWith("Your cloak "))
                {
                    if (e.Text.Contains("Shroud of Darkness") && !e.Text.Contains("yourself"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;

                        if (e.Text.Contains(" on "))
                        {
                            targetName = e.Text.Remove(0, e.Text.IndexOf(" on ") + 4);
                        }
                    }

                    if (e.Text.Contains("Cloaked in Skill"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;
                        targetName = CoreManager.Current.CharacterFilter.Name;
                    }

                    if (e.Text.Contains("Your cloak reduced the damage"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;
                        targetName = CoreManager.Current.CharacterFilter.Name;
                    }
                }

                SurgeType surgeType = SurgeType.Unknown;

                if (e.Text.Contains("Shroud of Darkness (Melee)"))
                {
                    surgeType = SurgeType.ShroudOfDarknessMelee;
                }
                if (e.Text.Contains("Shroud of Darkness (Missile)"))
                {
                    surgeType = SurgeType.ShroudOfDarknessMissile;
                }
                if (e.Text.Contains("Shroud of Darkness (Magic)"))
                {
                    surgeType = SurgeType.ShroudOfDarknessMagic;
                }

                if (e.Text.Contains("Cloaked in Skill"))
                {
                    surgeType = SurgeType.CloakedInSkill;
                }
                if (e.Text.Contains("Your cloak reduced the damage"))
                {
                    surgeType = SurgeType.DamageReduction;
                }

                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); }
        }
Exemple #26
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;

                AttackType    attackType     = AttackType.Unknown;
                DamageElement damageElemenet = DamageElement.Unknown;

                bool isFailedAttack = false;
                bool isCriticalHit  = e.Text.Contains("Critical hit!");
                bool isOverpower    = e.Text.Contains("Overpower!");
                bool isSneakAttack  = e.Text.Contains("Sneak Attack!");
                bool isRecklessness = e.Text.Contains("Recklessness!");
                bool isKillingBlow  = false;

                int damageAmount = 0;

                // You evaded Remoran Corsair!
                // Ruschk S****t evaded your attack.
                // You resist the spell cast by Remoran Corsair
                // Sentient Crystal Shard resists your spell
                if (CombatMessages.IsFailedAttack(e.Text))
                {
                    isFailedAttack = true;

                    string parsedName = string.Empty;

                    foreach (Regex regex in CombatMessages.FailedAttacks)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            parsedName = match.Groups["targetname"].Value;
                            break;
                        }
                    }

                    if (e.Text.StartsWith("You evaded "))
                    {
                        sourceName = parsedName;
                        targetName = CoreManager.Current.CharacterFilter.Name;
                        attackType = AttackType.MeleeMissle;
                    }
                    else if (e.Text.Contains(" evaded your attack"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;
                        targetName = parsedName;
                        attackType = AttackType.MeleeMissle;
                    }
                    else if (e.Text.StartsWith("You resist the spell cast by "))
                    {
                        sourceName = parsedName;
                        targetName = CoreManager.Current.CharacterFilter.Name;
                        attackType = AttackType.Magic;
                    }
                    else if (e.Text.Contains(" resists your spell"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;
                        targetName = parsedName;
                        attackType = AttackType.Magic;
                    }
                }
                // You flatten Noble Remains's body with the force of your assault!
                // Your killing blow nearly turns Shivering Crystalline Wisp inside-out!
                // The thunder of crushing Pyre Minion is followed by the deafening silence of death!
                // Old Bones is shattered by your assault!
                else if (CombatMessages.IsKilledByMeMessage(e.Text))
                {
                    isKillingBlow = true;

                    sourceName = CoreManager.Current.CharacterFilter.Name;

                    foreach (Regex regex in CombatMessages.TargetKilledByMe)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            targetName = match.Groups["targetname"].Value;

                            break;
                        }
                    }
                }
                else
                {
                    foreach (Regex regex in CombatMessages.MeleeMissileReceivedAttacks)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            sourceName     = match.Groups["targetname"].Value;
                            targetName     = CoreManager.Current.CharacterFilter.Name;
                            attackType     = AttackType.MeleeMissle;
                            damageElemenet = GetElementFromText(e.Text);
                            int.TryParse(match.Groups["points"].Value, out damageAmount);
                            goto Found;
                        }
                    }

                    foreach (Regex regex in CombatMessages.MeleeMissileGivenAttacks)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            sourceName     = CoreManager.Current.CharacterFilter.Name;
                            targetName     = match.Groups["targetname"].Value;
                            attackType     = AttackType.MeleeMissle;
                            damageElemenet = GetElementFromText(e.Text);
                            int.TryParse(match.Groups["points"].Value, out damageAmount);
                            goto Found;
                        }
                    }

                    foreach (Regex regex in CombatMessages.MagicReceivedAttacks)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            sourceName     = match.Groups["targetname"].Value;
                            targetName     = CoreManager.Current.CharacterFilter.Name;
                            attackType     = AttackType.Magic;
                            damageElemenet = GetElementFromText(e.Text);
                            int.TryParse(match.Groups["points"].Value, out damageAmount);
                            goto Found;
                        }
                    }

                    foreach (Regex regex in CombatMessages.MagicGivenAttacks)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            sourceName     = CoreManager.Current.CharacterFilter.Name;
                            targetName     = match.Groups["targetname"].Value;
                            attackType     = AttackType.Magic;
                            damageElemenet = GetElementFromText(e.Text);
                            int.TryParse(match.Groups["points"].Value, out damageAmount);
                            goto Found;
                        }
                    }

                    foreach (Regex regex in CombatMessages.MagicCastAttacks)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            sourceName     = CoreManager.Current.CharacterFilter.Name;
                            targetName     = match.Groups["targetname"].Value;
                            attackType     = AttackType.Magic;
                            damageElemenet = DamageElement.None;
                            goto Found;
                        }
                    }

                    Found :;
                }

                if (sourceName == String.Empty && targetName == String.Empty)
                {
                    return;
                }

                if (!isKillingBlow && attackType == AttackType.Unknown)
                {
                    Debug.WriteToChat("Unable to parse attack type from: " + e.Text);
                }

                if (!isKillingBlow && !isFailedAttack && damageElemenet == DamageElement.Unknown)
                {
                    Debug.WriteToChat("Unable to parse damage element from: " + e.Text);
                }

                CombatEventArgs combatEventArgs = new CombatEventArgs(sourceName, targetName, attackType, damageElemenet, isFailedAttack, isCriticalHit, isOverpower, isSneakAttack, isRecklessness, isKillingBlow, damageAmount);

                if (CombatEvent != null)
                {
                    CombatEvent(combatEventArgs);
                }
            }
            catch (Exception ex) { Debug.LogException(ex, e.Text); }
        }
 public static bool TryCreateFrom(ChatTextInterceptEventArgs eventArgs, out ParsedChatTextInterceptEventArgs parsedEventArgs)
 {
     return TryCreateFrom(eventArgs, Util.ChatFlags.All, out parsedEventArgs);
 }
Exemple #28
0
        private void KillTask_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {

                if(e.Color != 0 && e.Color != 3) {return;}
                if(e.Color == 0)
                {

                    //	You have killed 20 Frozen Wights! Your task is complete!
                    //	You have killed 18 Gurog Soldiers! You must kill 20 to complete your task.

                    if([email protected]("You have killed")){return;}

                    int mobskilled = 0;
                    int totalmobs = 0;
                    string mobname = String.Empty;
                    bool taskcomplete = false;

                    nibble = e.Text.Remove(0, 16);
                    Int32.TryParse(nibble.Substring(0, nibble.IndexOf(' ')), out mobskilled);

                    nibble = nibble.Remove(0, nibble.IndexOf(' '));
                    mobname = (@nibble.Substring(0, nibble.IndexOf('!'))).Trim();

                    if(@mobname.EndsWith("ies"))
                    {
                        @mobname = @mobname.Replace("ies","y").Trim();
                    }
                    else if(@mobname.EndsWith("xes"))
                    {
                        @mobname = @mobname.Remove(mobname.Length - 2, 2).Trim();
                    }
                    else if(@mobname.EndsWith("s"))
                    {
                        @mobname = @mobname.Remove(mobname.Length -1, 1).Trim();
                    }
                    else if(mobname.EndsWith("men"))
                    {
                        @mobname = @mobname.Replace("men","man");
                    }

                    nibble = nibble.Remove(0, nibble.IndexOf('!') + 2).Trim();

                    if(nibble.IndexOf("Your task is complete") == -1)
                    {
                        nibble = nibble.Remove(0, 14).Trim();
                        Int32.TryParse(nibble.Substring(0, nibble.IndexOf(' ')), out totalmobs);
                    }
                    else
                    {
                        totalmobs = mobskilled;
                        taskcomplete = true;
                    }

                    int TaskIndex = mKTSet.MyKillTasks.FindIndex(x => x.CompleteCount == totalmobs && x.MobNames.Any(y => y == mobname));

                    if(TaskIndex == -1)
                    {
                        WriteKillTaskFailureToFile(mobname, mobskilled, totalmobs);
                        WriteToChat("Caught an untrackable killtask.");
                        WriteToChat("You Killed " + mobname + " and need to kill " + totalmobs);
                        WriteToChat("Results saved to file for future inclusion in kill task tracker.");
                        return;
                    }

                    mKTSet.MyKillTasks[TaskIndex].CurrentCount = mobskilled;
                    mKTSet.MyKillTasks[TaskIndex].complete = taskcomplete;
                    mKTSet.MyKillTasks[TaskIndex].active = true;

                    UpdateTaskPanel();

                    e.Eat = true;
                }
                if(e.Color == 3)
                {
                    int CollectTasksCount = mKTSet.MyCollectTasks.Count(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y)));
                    int KillTasksCount = mKTSet.MyKillTasks.Count(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y)));

                    if (CollectTasksCount > 0)
                    {
                        int CollectTaskIndex = -1;

                        if(CollectTasksCount == 1)
                        {
                            CollectTaskIndex = 	mKTSet.MyCollectTasks.FindIndex(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y)));
                        }
                        else
                        {
                            CollectTaskIndex = mKTSet.MyCollectTasks.FindIndex(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y)) &&
                                                 	(@e.Text.Contains(@x.NPCYellowFlagText) || @e.Text.Contains(@x.NPCYellowCompleteText)));
                        }

                        if(CollectTaskIndex == -1) {return;}

                        bool flag = @e.Text.Contains(@mKTSet.MyCollectTasks[CollectTaskIndex].NPCYellowFlagText);
                        bool complete = @e.Text.Contains(@mKTSet.MyCollectTasks[CollectTaskIndex].NPCYellowCompleteText);

                        if(flag)
                        {
                            mKTSet.MyCollectTasks[CollectTaskIndex].active = true;
                            mKTSet.MyCollectTasks[CollectTaskIndex].complete = false;
                            UpdateTaskPanel();
                            return;
                        }
                        if(complete)
                        {
                            mKTSet.MyCollectTasks[CollectTaskIndex].active = false;
                            mKTSet.MyCollectTasks[CollectTaskIndex].complete = false;

                            try
                            {
                                foreach(CollectTask coltsk in mKTSet.MyCollectTasks)
                                {
                                    int colcount = 0;
                                    if(GearFoundry.Globals.Core.WorldFilter.GetInventory().Any(x => @x.Name == @coltsk.Item))
                                    {
                                        List<WorldObject> inventory = Core.WorldFilter.GetInventory().Where(x => @x.Name == @coltsk.Item).ToList();

                                        foreach(WorldObject item in inventory)
                                        {
                                            colcount += item.Values(LongValueKey.StackCount);
                                        }

                                    }
                                    coltsk.CurrentCount = colcount;
                                    if(coltsk.CurrentCount >= coltsk.CompleteCount)
                                    {
                                        coltsk.complete = true;
                                    }
                                }
                            }catch(Exception ex){LogError(ex);}
                            UpdateTaskPanel();
                            return;
                        }
                    }

                    if (KillTasksCount > 0)
                    {
                        int KillTaskIndex = -1;

                        if(CollectTasksCount == 1)
                        {
                            KillTaskIndex = mKTSet.MyKillTasks.FindIndex(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y)));
                        }
                        else
                        {
                            KillTaskIndex = mKTSet.MyKillTasks.FindIndex(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y)) &&
                                                 	(@e.Text.Contains(@x.NPCYellowFlagText) || @e.Text.Contains(@x.NPCYellowCompleteText)));
                        }

                        if(KillTaskIndex == -1) {return;}

                        bool flag = @e.Text.Contains(@mKTSet.MyKillTasks[KillTaskIndex].NPCYellowFlagText);
                        bool complete = @e.Text.Contains(@mKTSet.MyKillTasks[KillTaskIndex].NPCYellowCompleteText);

                        if(flag)
                        {
                            mKTSet.MyKillTasks[KillTaskIndex].active = true;
                            mKTSet.MyKillTasks[KillTaskIndex].complete = false;
                            return;
                        }
                        if(complete)
                        {
                            mKTSet.MyKillTasks[KillTaskIndex].active = false;
                            mKTSet.MyKillTasks[KillTaskIndex].complete = false;
                            return;
                        }
                    }
                    UpdateTaskPanel();
                }
            }catch(Exception ex){LogError(ex);}
        }
Exemple #29
0
    private void a(object A_0, ChatTextInterceptEventArgs A_1)
    {
        try
        {
            string str;
            string str2;
            if ((this.a() == s.b.d) || (this.a() == s.b.e))
            {
                if (A_1.get_Color() != 7)
                {
                    goto Label_0152;
                }
                Match match  = this.q.Match(A_1.get_Text());
                Match match2 = this.p.Match(A_1.get_Text());
                str  = "";
                str2 = "";
                if (match.Success)
                {
                    str  = match.Groups[1].Value;
                    str2 = match.Groups[2].Value;
                    goto Label_00B2;
                }
                if (match2.Success)
                {
                    str  = match2.Groups[1].Value;
                    str2 = match2.Groups[2].Value;
                    goto Label_00B2;
                }
            }
            return;

Label_00B2:
            if (str == this.i.Name)
            {
                WorldObject obj2 = CoreManager.get_Current().get_WorldFilter().get_Item(this.h);
                if ((obj2 == null) || (str2 == obj2.get_Name()))
                {
                    PluginCore.cq.n.a("WandCaster: Spell success reset (" + A_1.get_Text() + ")", e8.i);
                    this.a(s.b.a);
                    if (this.a != null)
                    {
                        this.a(this.i, this.h, false, false);
                    }
                }
            }
            return;

Label_0152:
            if (A_1.get_Color() == 0)
            {
                for (int i = 0; i < PluginCore.cq.f.c.Count; i++)
                {
                    if (PluginCore.cq.f.c[i].Match(A_1.get_Text()).Success)
                    {
                        PluginCore.cq.n.a("WandCaster: Spell success reset (" + A_1.get_Text() + ")", e8.i);
                        this.a(s.b.a);
                        if (this.a != null)
                        {
                            this.a(this.i, this.h, true, !this.i.HitsMultipleTargets);
                        }
                        return;
                    }
                }
            }
        }
        catch (Exception exception)
        {
            ad.a(exception);
        }
    }
Exemple #30
0
		private void ChatLinkHandler(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (chkLinkCoords.Checked)
				{
					MatchCollection matches = Coordinates.FindAllCoords(e.Text);
					if (matches.Count > 0)
					{
						string replacementText = e.Text;
						for (int i = matches.Count - 1; i >= 0; i--)
						{
							Match m = matches[i];

							// Workaround for a "bug" in AC where, if two links are right next to 
							// each other (w/out space), the second will not be parsed into a link 
							// and the markup will be displayed
							string spacer = "";
							if (i > 0 && (matches[i - 1].Index + matches[i - 1].Length) == m.Index)
								spacer = " ";

							//<Tell:IIDString:1342670765:Digero>Digero<\Tell>
							replacementText = replacementText.Substring(0, m.Index) + spacer
								+ MakeCoordsChatLink(m.Value) + replacementText.Substring(m.Index + m.Length);
						}
						e.Eat = true;
						Host.Actions.AddChatText(replacementText, e.Color);
					}
				}
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}
Exemple #31
0
        private void OnChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            if (!enabled)
                return;

            e.Eat = true;

            string output = e.Text;
            matches = regex.Match(output);

            if (matches.Success)
            {
                string player = matches.Groups["player"].ToString();
                string player_name = Regex.Match(player, @">(.*)<").Groups[1].ToString();

                if (Aliases.ContainsKey(player_name))
                {
                    output = matches.Groups["pre"] + "<" + Aliases[player_name] + "> " + matches.Groups["player"] + matches.Groups["post"];
                }
            }

            WriteToChat(output, e.Color, e.Target);
        }
Exemple #32
0
        private static void Core_RemoteCommands(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Text.Contains("Logging::") && lib.Logger != lib.MyName)
                {
                    e.Eat = true;
                }

                if (e.Color == 3 && e.Text.Contains("DFcom"))
                {
                    string pass = DateTime.Now.Ticks.ToString();
                    if (pass.Length > 9)
                    {
                        pass = pass.Substring(0, 9);
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Log:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            lib.reason = "ADMINISTRATOR";
                            Utility.InvokeTextA("Force-Logged by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("Force-Logged by " + lib.reason + "!", 6);

                            LogMethod.Logout();
                            lib.RemoteLogInstance++;
                        }
                        else if (lib.RemoteLogInstance != 0)
                        {
                            Utility.InvokeTextA("Already processing Force-Log request!");
                        }
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Relog:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            lib.reason = "ADMINISTRATOR";
                            Utility.InvokeTextA("Force-Relogged by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("Force-Relogged by " + lib.reason + "!", 6);
                            WorldObject obj = lib.MyCore.WorldFilter[lib.MyID];
                            LogMethod.ReLogout(obj);
                            lib.RemoteLogInstance++;
                        }
                        else if (lib.RemoteLogInstance != 0)
                        {
                            Utility.InvokeTextA("Already processing Force-Relog request!");
                        }
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Location:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            WorldObject  obj          = lib.MyCore.WorldFilter[lib.MyID];
                            CoordsObject coordsObject = obj.Coordinates();
                            string       coords;

                            if (coordsObject.NorthSouth >= 0.0)
                            {
                                coords = string.Format("{0:N1}", coordsObject.NorthSouth) + "N, ";
                            }
                            else
                            {
                                coords = string.Format("{0:N1}", coordsObject.NorthSouth * -1.0) + "S, ";
                            }
                            if (coordsObject.EastWest >= 0.0)
                            {
                                coords = coords + string.Format("{0:N1}", coordsObject.EastWest) + "E";
                            }
                            else
                            {
                                coords = coords + 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>();

                            string elloc = null;
                            if (lib.LocKey.Contains(key))
                            {
                                foreach (string el in Landblock)
                                {
                                    if (el.Contains(key))
                                    {
                                        elloc = el.Split(new string[] { "=" }, StringSplitOptions.None)[1];
                                    }
                                }
                            }
                            else
                            {
                                elloc = key;
                            }
                            CoreManager.Current.Actions.InvokeChatParser("/r [Defiance]: I am currently at " + coords + " (" + elloc + ")");
                        }
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Die:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            lib.reason = "ADMINISTRATOR";
                            Utility.InvokeTextA("Smitten by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("Smitten by " + lib.reason + "!", 6);

                            Utility.DispatchChatToBoxWithPluginIntercept("/die");
                            Utility.ClickYes();
                            lib.reason = "user";
                        }
                    }
                    e.Eat = true;
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
 public void WriteObject(ChatTextInterceptEventArgs obj)
 {
     this.WriteLoggable(obj.MinimumRequiredDebugLevel(), obj.ToLoggableFormat);
 }
        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); }
        }
 public static bool TryParse(ChatTextInterceptEventArgs eventArgs, out ICommand command)
 {
     return TryParse(eventArgs.Text, out command);
 }
        private void CombatHud_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                //WriteToChat("Echo (" + e.Color + ") " + e.Text);

                if(e.Color == 7) {e.Eat = true; return;}
                if(e.Color != 17){return;}
                if(e.Text.Trim().StartsWith("You say,")) {e.Eat = true; return;}

                if(!OtherCastQuickKeepString.Any(x => @e.Text.Contains(x))) {return;}
                if(AnimationList.Any(x => @e.Text.Contains(x.SpellCastWords)))
                {
                    OtherDebuffCastInfo odci = new OtherDebuffCastInfo();

                    var tanimation = AnimationList.Find(x => @e.Text.Contains(x.SpellCastWords));
                    odci.HeardTime = DateTime.Now;
                    odci.SpellWords = tanimation.SpellCastWords;
                    odci.SpellId = tanimation.SpellId;
                    odci.Animation = tanimation.SpellAnimation;
                    odci.SpellSchool = SpellIndex[odci.SpellId].spellschool;

                    switch(SpellIndex[odci.SpellId].spellschool.ToLower())
                    {
                        case "item enchantment":
                            if(!gtSettings.bCombatHudTrackItemDebuffs) {return;}
                            break;
                        case "creature enchantment":
                            if(!gtSettings.bCombatHudTrackCreatureDebuffs) {return;}
                            break;
                        case "life magic":
                            if(!gtSettings.bCombatHudTrackLifeDebuffs) {return;}
                            break;
                        case "void magic":
                            if(!gtSettings.bCombatHudTrackVoidDebuffs){return;}
                            break;
                        default:
                            return;
                    }
                    OtherCastList.Add(odci);
                }
                e.Eat = true;
            }catch(Exception ex){LogError(ex);}
        }
Exemple #37
0
    private void a(object A_0, ChatTextInterceptEventArgs A_1)
    {
        try
        {
            int num;
            switch (this.h)
            {
            case dv.d.a:
                return;

            case dv.d.b:
                if (((A_1.get_Text().Length >= 9) && (A_1.get_Text().Substring(0, 9).CompareTo("You say, ") == 0)) && (A_1.get_Color() == 0x11))
                {
                    string str = this.g.Match(A_1.get_Text()).Value.Substring(1);
                    str = str.Substring(0, str.Length - 1).ToLowerInvariant().Replace(" ", "");
                    if (!(this.k.e.b(this.f.Id).Saying == str))
                    {
                        break;
                    }
                    this.a(dv.d.c);
                }
                return;

            case dv.d.c:
                if ((A_1.get_Color() != 0) || !this.f.CanKill)
                {
                    goto Label_0231;
                }
                num = 0;
                goto Label_0216;

            default:
                return;
            }
            this.a(dv.d.a);
            return;

Label_0101:
            if (this.k.f.c[num].Match(A_1.get_Text()).Success)
            {
                A_1.set_Eat(true);
                if (!this.f.HitsMultipleTargets)
                {
                    if (this.a != null)
                    {
                        this.a(this.f, this.e, true, true, A_1);
                    }
                    if (this.b != null)
                    {
                        this.b(this.f, this.e, true, true);
                    }
                }
                else
                {
                    if (this.a != null)
                    {
                        this.a(this.f, this.e, false, true, A_1);
                    }
                    if (this.b != null)
                    {
                        this.b(this.f, this.e, false, true);
                    }
                }
                PluginCore.cq.n.a("SpellCaster: Spell kill reset (" + A_1.get_Text() + ")", e8.i);
                this.a(dv.d.a);
                PluginCore.cq.am.a(this.e);
                return;
            }
            num++;
Label_0216:
            if (num < this.k.f.c.Count)
            {
                goto Label_0101;
            }
Label_0231:
            if (A_1.get_Color() == 7)
            {
                for (int i = 0; i < this.k.f.a.Count; i++)
                {
                    if (this.k.f.a[i].Match(A_1.get_Text()).Success)
                    {
                        PluginCore.cq.n.a("SpellCaster: Spell fail reset (" + A_1.get_Text() + ")", e8.i);
                        this.a(dv.d.a);
                        return;
                    }
                }
                for (int j = 0; j < this.k.f.b.Count; j++)
                {
                    Match match = this.k.f.b[j].Match(A_1.get_Text());
                    if (match.Success)
                    {
                        Group group = match.Groups["spellname"];
                        if (!group.Success || this.f.Name.Equals(group.Value, StringComparison.Ordinal))
                        {
                            Group group2 = match.Groups["targetname"];
                            if ((!group2.Success || string.IsNullOrEmpty(this.d)) || this.d.Equals(group2.Value, StringComparison.OrdinalIgnoreCase))
                            {
                                PluginCore.cq.n.a("SpellCaster: Spell success reset (" + A_1.get_Text() + ")", e8.i);
                                if (this.a != null)
                                {
                                    this.a(this.f, this.e, false, false, A_1);
                                }
                                if (this.b != null)
                                {
                                    this.b(this.f, this.e, false, false);
                                }
                                this.a(dv.d.a);
                                PluginCore.cq.am.a(this.e);
                                return;
                            }
                        }
                    }
                }
            }
        }
        catch (Exception exception)
        {
            ad.a(exception);
        }
    }
Exemple #38
0
		private void RecallChatTextHandler(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (chkAutoUpdateRecalls.Checked)
				{
					string text = e.Text.Trim();

					// Spell Casting
					if (e.Color == 7)
					{
						if (text == "You successfully link with the portal!" || text == "You successfully link with the lifestone!")
						{
							WorldObject spellTarget = Core.WorldFilter[mLastSpellTarget];
							if (spellTarget != null)
							{
								if (mLastSpellId == Spells.PrimaryPortalTie)
								{
									if (spellTarget.HasIdData)
									{
										ProcessPortalTie(spellTarget, RouteStartType.PrimaryPortalTie);
									}
									else
									{
										Host.Actions.RequestId(mLastSpellTarget);
										mIdPrimaryTie = IdStep.Requested;
										if (mRecallTimeout.Enabled)
											RecallTimeout_Tick(null, null);
										mRecallTimeout.Interval = 10000; // 10 seconds
										mRecallTimeout.Start();
									}
								}
								else if (mLastSpellId == Spells.SecondaryPortalTie)
								{
									if (spellTarget.HasIdData)
									{
										ProcessPortalTie(spellTarget, RouteStartType.SecondaryPortalTie);
									}
									else
									{
										Host.Actions.RequestId(mLastSpellTarget);
										mIdSecondaryTie = IdStep.Requested;
										if (mRecallTimeout.Enabled)
											RecallTimeout_Tick(null, null);
										mRecallTimeout.Interval = 10000; // 10 seconds
										mRecallTimeout.Start();
									}
								}
								else if (mLastSpellId == Spells.LifestoneTie)
								{
									UpdateStartLocation(spellTarget, RouteStartType.LifestoneTie);
								}
							}
						}
						else if (e.Text.StartsWith("You have attuned your spirit to this Lifestone."))
						{
							WorldObject lifestone = Core.WorldFilter[Host.Actions.CurrentSelection];
							Coordinates coords;
							RouteStart startLoc = GetStartLocationByType(RouteStartType.LifestoneBind);
							if (lifestone == null || lifestone.ObjectClass != ObjectClass.Lifestone)
							{
								coords = PlayerCoords;
							}
							else
							{
								coords = new Coordinates(lifestone.Coordinates(), 1);
							}
							if (startLoc.Coords != coords)
							{
								startLoc.Coords = coords;
								RefreshStartLocationListCoords();
								if (startLoc.Enabled)
									Util.Message(startLoc.Name + " start location set to " + startLoc.Coords);
							}
						}
					}

					// Recall Text
					else if (e.Color == 23)
					{
						string name = Core.CharacterFilter.Name;
						if (text == name + " is going to the Allegiance hometown.")
						{
							mRecallingToBindstone = RecallStep.RecallStarted;
							if (mRecallTimeout.Enabled)
								RecallTimeout_Tick(null, null);
							mRecallTimeout.Interval = 40000; // 40 seconds
							mRecallTimeout.Start();
						}
						else if (text == name + " is recalling to the lifestone.")
						{
							mRecallingToLSBind = RecallStep.RecallStarted;
							if (mRecallTimeout.Enabled)
								RecallTimeout_Tick(null, null);
							mRecallTimeout.Interval = 40000; // 40 seconds
							mRecallTimeout.Start();
						}
					}
				}
			}
			catch (Exception ex) { Util.HandleException(ex); }
		}
Exemple #39
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;

				// First person intercepts
				// You cast Cloaked in Skill on yourself
				// The cloak of MyPlayerName weaves the magic of Cloaked in Skill!
				//
				// You cast Shroud of Darkness (Melee) on Invading Iron Blade Knight
				// You cast Shroud of Darkness (Magic) on Infernal Zefir
				// Your cloak reduced the damage from 162 down to 0!

				// Third person intercepts
				// The cloak of PlayerName weaves the magic of Shroud of Darkness (Melee)!
				// The cloak of PlayerName weaves the magic of Cloaked in Skill!

				if (e.Text.StartsWith("You cast ") || e.Text.StartsWith("Your cloak "))
				{
					if (e.Text.Contains("Shroud of Darkness") && !e.Text.Contains("yourself"))
					{
						sourceName = CoreManager.Current.CharacterFilter.Name;

						if (e.Text.Contains(" on "))
							targetName = e.Text.Remove(0, e.Text.IndexOf(" on ") + 4);
					}

					if (e.Text.Contains("Cloaked in Skill"))
					{
						sourceName = CoreManager.Current.CharacterFilter.Name;
						targetName = CoreManager.Current.CharacterFilter.Name;
					}

					if (e.Text.Contains("Your cloak reduced the damage"))
					{
						sourceName = CoreManager.Current.CharacterFilter.Name;
						targetName = CoreManager.Current.CharacterFilter.Name;
					}
				}

				SurgeType surgeType = SurgeType.Unknown;

				if (e.Text.Contains("Shroud of Darkness (Melee)"))		surgeType = SurgeType.ShroudOfDarknessMelee;
				if (e.Text.Contains("Shroud of Darkness (Missile)"))	surgeType = SurgeType.ShroudOfDarknessMissile;
				if (e.Text.Contains("Shroud of Darkness (Magic)"))		surgeType = SurgeType.ShroudOfDarknessMagic;

				if (e.Text.Contains("Cloaked in Skill"))				surgeType = SurgeType.CloakedInSkill;
				if (e.Text.Contains("Your cloak reduced the damage"))	surgeType = SurgeType.DamageReduction;

				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); }
		}
Exemple #40
0
        public void Core_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            if (e.Text.StartsWith(COMMAND_PREFIX_1))
            {
                string[] cmd = e.Text.Substring(COMMAND_LENGTH_1).Trim().TrimEnd('"').ToLower().Split(' ');

                if (cmd[0].Equals("jump"))
                {
                    int ThisJumpStyle = 0;

                    if (cmd[1].Equals("shift"))
                    {
                        ThisJumpStyle = ThisJumpStyle + 10;
                    }
                    else if (cmd[1].Equals("long"))
                    {
                        ThisJumpStyle = ThisJumpStyle + 20;
                    }
                    else
                    {
                        WriteToChat("Tank Commander: ", "Input Error on CMD1!");
                    }

                    if (cmd[2].Equals("up"))
                    {
                        ThisJumpStyle = ThisJumpStyle + 1;
                    }
                    else if (cmd[2].Equals("down"))
                    {
                        ThisJumpStyle = ThisJumpStyle + 2;
                    }
                    else if (cmd[2].Equals("left"))
                    {
                        ThisJumpStyle = ThisJumpStyle + 3;
                    }
                    else if (cmd[2].Equals("right"))
                    {
                        ThisJumpStyle = ThisJumpStyle + 4;
                    }
                    else
                    {
                        WriteToChat("Tank Commander: ", "Input Error on CMD2!");
                    }

                    if (ThisJumpStyle > 10 & ThisJumpStyle < 25)
                    {
                        e.Eat     = true;
                        JumpState = eJumpState.IDLE;
                        int ThisJumpPower = Convert.ToInt32(cmd[3]);
                        startKeyPress(ThisJumpStyle, ThisJumpPower);
                    }
                    else
                    {
                        WriteToChat("Tank Commander: ", "Input Error on CMD3!");
                    }
                }

                else if (cmd[0].Equals("vtank"))
                {
                    e.Eat = true;
                    int[] myMessage = { 54 };
                    sendKey(myMessage);
                }

                else if (cmd[0].Equals("target"))  // per Virindi, try putting a WM_Activate in here before sending keys....
                {
                    if (cmd[1] != "off")
                    {
                        e.Eat = true;
                        int GroupTarget = Convert.ToInt32(cmd[1]);
                        /*      /vicc thelastpaladins, /f /vt opt set targetlock true      */
                        //int[] myMessage ={48,39,22,20,49,15,16,20,49,19,5,20,49,20,1,18,7,5,20,12,15,3,11,49,20,18,21,5,48};
                        //sendKey(myMessage);
                        Host.Actions.SelectItem(GroupTarget);
                    }
                    else
                    {
                        e.Eat = true;
                        /*      /vicc thelastpaladins, /f /vt opt set targetlock false      */
                        //int[] myMessage ={48,39,22,20,49,15,16,20,49,19,5,20,49,20,1,18,7,5,20,12,15,3,11,49,6,1,12,19,5,48};
                        int[] myMessage = { 55 };
                        sendKey(myMessage);
                    }
                }

                else if (cmd[0].Equals("lineup"))
                {
                    e.Eat = true;
                    if (LineUpActive == false && IsCommander == false)
                    {
                        LineUpActive = true;
                        MyCoordsNS   = Convert.ToDouble(cmd[1]);
                        MyCoordsEW   = Convert.ToDouble(cmd[2]);
                        MyHeading    = Convert.ToDouble(cmd[3]);
                        startTimeOutTimer(8000);
                        LineThemUp(MyCoordsNS, MyCoordsEW);
                    }
                    else if (LineUpActive == true && IsCommander == false)
                    {
                        int[] HitEnter = { 48 };
                        sendKey(HitEnter);
                        CreateKeyString("/f lineup in progress, please wait.");
                        sendKey(HitEnter);
                    }
                    else if (LineUpActive == false && IsCommander == true)
                    {
                        IsCommander = false;
                    }
                    else
                    {
                        WriteToChat("LineUp:", "Invalid Conditions found!");
                    }
                }

                else if (cmd[0].Equals("combatmode"))
                {
                    e.Eat = true;
                    if (CoreManager.Current.Actions.CombatMode == CombatState.Peace)
                    {
                        int[] myMessage = { 49 };
                        sendKey(myMessage);
                    }
                }

                else if (cmd[0].Equals("peacemode"))
                {
                    if (CoreManager.Current.Actions.CombatMode != CombatState.Peace)
                    {
                        int[] myMessage = { 49 };
                        sendKey(myMessage);
                    }
                    e.Eat = true;
                }

                else
                {
                    e.Eat = false;
                }
            }
            else
            {
                e.Eat = false;
            }
        }
 private void a(object A_0, ChatTextInterceptEventArgs A_1)
 {
 }
Exemple #42
0
		void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (e.Eat || string.IsNullOrEmpty(e.Text))
					return;

				bool isChat = Util.IsChat(e.Text);

				if (e.Eat == false && Settings.SettingsManager.Filters.AttackEvades.Value)
				{
					// Ruschk S****t evaded your attack.
					if (!isChat && e.Text.Contains(" evaded your attack."))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.DefenseEvades.Value)
				{
					// You evaded Ruschk S****t!
					if (!isChat && e.Text.StartsWith("You evaded "))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.AttackResists.Value)
				{
					// Sentient Crystal Shard resists your spell
					// Invading Silver Scope Knight resists your spell
					if (!isChat && e.Text.Contains(" resists your spell"))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.DefenseResists.Value)
				{
					// You resist the spell cast by Sentient Crystal Shard
					if (!isChat && e.Text.StartsWith("You resist the spell cast by "))
						e.Eat = true;

					// You have no appropriate targets equipped for Ruschk Warlord's spell.
					if (!isChat && e.Text.StartsWith("You have no appropriate target") && e.Text.Contains("spell"))
						e.Eat = true;

					// You are an invalid target for the spell of Ruschk Warlord.
					if (!isChat && e.Text.StartsWith("You are an invalid target for the spell"))
						e.Eat = true;

					// Ruschk Warlord tried to cast a spell on you, but was too far away!
					if (!isChat && e.Text.Contains("tried to cast a spell on you, but was too far away!"))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.NPKFails.Value)
				{
					if (!isChat && e.Text.StartsWith("You fail to affect ") && e.Text.Contains(" you are not a player killer!"))
						e.Eat = true;

					if (!isChat && e.Text.Contains("fails to affect you") && e.Text.Contains(" is not a player killer!"))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.DirtyFighting.Value)
				{
					// Dirty Fighting! [player] delivers a Traumatic Assault to [mob]!
					// Dirty Fighting! [player] delivers a Bleeding Assault to [mob]!
					// Dirty Fighting! [player] delivers a Unbalancing Assault to [mob]!
					// Dirty Fighting! [player] delivers a Blinding Assault to [mob]!
					if (!isChat && e.Text.StartsWith("Dirty Fighting! ") && e.Text.Contains(" delivers a "))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.MonsterDeaths.Value)
				{
					if (Trackers.Combat.Standard.CombatMessages.IsKilledByMeMessage(e.Text))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.SpellCastingMine.Value)
				{
					// You say, "Zojak 
					if (Util.IsSpellCastingMessage(e.Text, true, false))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.SpellCastingOthers.Value)
				{
					// Fat Guy In A Little Coat says, "Zojak
					if (Util.IsSpellCastingMessage(e.Text, false))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.SpellCastFizzles.Value)
				{
					// Your spell fizzled.
					if (!isChat && e.Text.StartsWith("Your spell fizzled."))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.CompUsage.Value)
				{
					// The spell consumed the following components:
					if (!isChat && e.Text.StartsWith("The spell consumed the following components"))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.SpellExpires.Value)
				{
					// Don't filter rare expires
					if (!isChat && !e.Text.Contains("Brilliance") && !e.Text.Contains("Prodigal") && !e.Text.Contains("Spectral"))
					{
						// The spell Defender VI on Brass Sceptre has expired.
						// Focus Self VI has expired.
						if (e.Text.Contains("has expired.") || e.Text.Contains("have expired."))
							e.Eat = true;
					}
				}


				if (e.Eat == false && Settings.SettingsManager.Filters.HealingKitSuccess.Value)
				{
					// You heal yourself for 88 Health points. Your treated Healing Kit has 16  uses left.
					// You expertly heal yourself for 123 Health points. Your Treated Healing Kit has 41 uses left.
					if (!isChat && e.Text.StartsWith("You ") && e.Text.Contains(" heal yourself for "))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.HealingKitFail.Value)
				{
					// You fail to heal yourself. Your Treated Healing Kit has 18 uses left.
					if (!isChat && e.Text.StartsWith("You fail to heal yourself. "))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.Salvaging.Value)
				{
					// You obtain 9 granite (ws 8.00) using your knowledge of Salvaging
					if (!isChat && e.Text.StartsWith("You obtain ") && e.Text.Contains(" using your knowledge of "))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.SalvagingFails.Value)
				{
					// Salvaging Failed!
					if (!isChat && e.Text.StartsWith("Salvaging Failed!"))
						e.Eat = true;

					//  The following were not suitable for salvaging: Salvaged Sunstone (79), Salvaged Sunstone (7).
					if (!isChat && e.Text.Contains("The following were not suitable for salvaging: "))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.AuraOfCraftman.Value)
				{
					// Your Aura of the Craftman augmentation increased your skill by 5!
					if (!isChat && e.Text.StartsWith("Your Aura of the Craftman augmentation increased your skill by 5!"))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.ManaStoneUsage.Value)
				{
					// The Mana Stone gives 6,127 points of mana to the following items: 
					if (!isChat && e.Text.StartsWith("The Mana Stone gives "))
						e.Eat = true;
					// You need 6,833 more mana to fully charge your items.
					if (!isChat && e.Text.StartsWith("You need ") && e.Text.Trim().EndsWith(" more mana to fully charge your items."))
						e.Eat = true;
					// The Mana Stone drains 3,153 points of mana from the Fez.
					if (!isChat && e.Text.StartsWith("The Mana Stone drains "))
						e.Eat = true;
					// The Fez is destroyed.
					if (!isChat && e.Text.StartsWith("The ") && e.Text.Trim().EndsWith(" is destroyed."))
						e.Eat = true;
				}


				if (e.Eat == false && Settings.SettingsManager.Filters.TradeBuffBotSpam.Value)
				{
					if (Util.IsChat(e.Text, Util.ChatFlags.PlayerSaysLocal) && (e.Text.Trim().EndsWith("-t-\"") || e.Text.Trim().EndsWith("-b-\"")))
						e.Eat = true;

					// Trade bot emotes
					if (!isChat && (e.Text.Trim().EndsWith("-t-") || e.Text.Trim().EndsWith("-b-")))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.FailedAssess.Value)
				{
					// Someone tried and failed to assess you!
					if (!isChat && e.Text.Trim().EndsWith("tried and failed to assess you!"))
						e.Eat = true;
				}


				if (e.Eat == false && Settings.SettingsManager.Filters.KillTaskComplete.Value)
				{
					// You have killed 50 Drudge Raveners! Your task is complete!
					if (!isChat && e.Text.StartsWith("You have killed ") && e.Text.Trim().EndsWith("Your task is complete!"))
						e.Eat = true;
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.VendorTells.Value)
				{
					if (Util.IsChat(e.Text, Util.ChatFlags.NpcTellsYou))
					{
						string sourceName = Util.GetSourceOfChat(e.Text);

						if (!string.IsNullOrEmpty(sourceName))
						{
							WorldObjectCollection collection = CoreManager.Current.WorldFilter.GetByName(sourceName);

							if (collection.Count >= 1 && collection.First.ObjectClass == ObjectClass.Vendor)
								e.Eat = true;
						}
					}
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.MonsterTell.Value)
				{
					if (Util.IsChat(e.Text, Util.ChatFlags.NpcTellsYou))
					{
						string sourceName = Util.GetSourceOfChat(e.Text);

						if (!string.IsNullOrEmpty(sourceName))
						{
							WorldObjectCollection collection = CoreManager.Current.WorldFilter.GetByName(sourceName);

							if (collection.Count >= 1 && collection.First.ObjectClass == ObjectClass.Monster)
								e.Eat = true;
						}
					}
				}

				if (e.Eat == false && Settings.SettingsManager.Filters.NpcChatter.Value)
				{
					if (Util.IsChat(e.Text, Util.ChatFlags.NpcSays))
					{
						string sourceName = Util.GetSourceOfChat(e.Text);

						if (!string.IsNullOrEmpty(sourceName))
						{
							WorldObjectCollection collection = CoreManager.Current.WorldFilter.GetByName(sourceName);

							if (collection.Count >= 1 && collection.First.ObjectClass == ObjectClass.Npc)
								e.Eat = true;
						}
					}
				}

				if (e.Eat == false && (Settings.SettingsManager.Filters.MasterArbitratorSpam.Value || Settings.SettingsManager.Filters.AllMasterArbitratorChat.Value))
				{
					if (isChat)
					{
						if (Util.GetSourceOfChat(e.Text) == "Master Arbitrator")
						{
							/*
							(We don't filter these)
							Master Arbitrator tells you, "If you wish to fight as a gladiator in the Arena I will require you to purchase a ticket from the Ticket Vendors over there. We do need to keep the place running don't we?"
							Master Arbitrator tells you, "Also, I warn you now. Prepare your fellowship ahead of time. Once you pay me you cannot change your registered group and only that group will be allowed into the Arena I assign you. After you enter the Arena you must wait one hour before recieving your reward. Our gladiators need time to rest between fights."

							(We don't filter these)
							20:57:15 Master Arbitrator tells you, "Your fellowship's Arena battles still continue. I cannot reward anyone in your fellowship while they still have time left in the Colosseum. (4s)"
							20:57:17 Master Arbitrator tells you, "Your fellowship's Arena battles still continue. I cannot reward anyone in your fellowship while they still have time left in the Colosseum. (2s)"
							20:57:20 Master Arbitrator tells you, "You fought in the Colosseum's Arenas too recently. I cannot reward you for 4s."

							(In this set of messages, we don't filter the Well done!)
							20:57:24 Master Arbitrator tells you, "Well done! I was greatly impressed with your performance in the arenas."
							20:57:24 Master Arbitrator tells you, "You shall be known to all as a "Colosseum Champion"!"
							20:57:24 Master Arbitrator tells you, "Take this knowledge and this Colosseum Vault Key as a reward for your accomplishments Champion."
							20:57:24 Master Arbitrator tells you, "Use the the key to open the Colosseum Vault and claim some of our treasury for yourself."

							(In this set of messages, we don't filter the Good Luck!)
							21:01:14 Your fellowship is now locked.  You may not recruit new members.  If you leave the fellowship, you have 15 minutes to be recruited back into the fellowship.
							21:01:16 [Fellowship] Master Arbitrator says, "Your fellowship will be battling in Arena One."
							21:01:17 [Fellowship] Master Arbitrator says, "Use one of the two portals to enter your Arena. If every member of your group is powerful enough you may skip the lower battles by using the Advanced Colosseum Arena, but any one member of your fellow may be restricted from using that portal so be careful or you may be split up."
							21:01:17 [Fellowship] Master Arbitrator says, "Don't forget that you must wait one full hour after the time you enter the colosseum before I will reward you for your achievements in the Arenas."
							21:01:17 [Fellowship] Master Arbitrator says, "Good Luck!"
							*/

							if (Settings.SettingsManager.Filters.MasterArbitratorSpam.Value)
							{
								if (Util.IsChat(e.Text, Util.ChatFlags.NpcTellsYou))
								{
									if (e.Text.Contains("\"You shall be known") || e.Text.Contains("\"Take this knowledge") || e.Text.Contains("\"Use the the key"))
										e.Eat = true;
								}
								else if (Util.IsChat(e.Text, Util.ChatFlags.PlayerSaysChannel))
								{
									if (e.Text.Contains("\"Your fellowship") || e.Text.Contains("\"Use one of the") || e.Text.Contains("\"Don't forget"))
										e.Eat = true;
								}
							}

							if (Settings.SettingsManager.Filters.AllMasterArbitratorChat.Value)
								e.Eat = true;
						}
					}

					if (Settings.SettingsManager.Filters.AllMasterArbitratorChat.Value && e.Text.StartsWith("Your fellowship is now locked.") && e.Text.Contains("you have 15 minutes to be recruited"))
						e.Eat = true;
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
        private void KillTask_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if(e.Color != 0 && e.Color != 3) {return;}
                if(e.Color == 0)
                {
                    //	You have killed 20 Frozen Wights! Your task is complete!
                    //	You have killed 18 Gurog Soldiers! You must kill 20 to complete your task.

                    if([email protected]("You have killed")){return;}

                    int mobskilled = 0;
                    int totalmobs = 0;
                    string mobname = String.Empty;
                    bool taskcomplete = false;

                    nibble = e.Text.Remove(0, 16);
                    Int32.TryParse(nibble.Substring(0, nibble.IndexOf(' ')), out mobskilled);

                    nibble = nibble.Remove(0, nibble.IndexOf(' '));
                    mobname = (@nibble.Substring(0, nibble.IndexOf('!'))).Trim();

                    if(@mobname.EndsWith("ies")){@mobname = @mobname.Replace("ies","y").Trim();}
                    else if(@mobname.EndsWith("xes")){@mobname = @mobname.Remove(mobname.Length - 2, 2).Trim();}
                    else if(@mobname.EndsWith("s")){@mobname = @mobname.Remove(mobname.Length -1, 1).Trim();}
                    else if(mobname.EndsWith("men")){@mobname = @mobname.Replace("men","man");}

                    nibble = nibble.Remove(0, nibble.IndexOf('!') + 2).Trim();

                    if(nibble.IndexOf("Your task is complete") == -1)
                    {
                        nibble = nibble.Remove(0, 14).Trim();
                        Int32.TryParse(nibble.Substring(0, nibble.IndexOf(' ')), out totalmobs);
                    }
                    else
                    {
                        totalmobs = mobskilled;
                        taskcomplete = true;
                    }

                    if(LastKillTask == null || !LastKillTask.MobNames.Contains(@mobname))
                    {
                        LastKillTask = mGeneralSettings.GearTaskerSettings.MasterKillTaskHash.Where(x => x.CompleteCount == totalmobs && x.MobNames.Any(y => y == mobname)).FirstOrDefault();
                        if(LastKillTask == null)
                        {
                            WriteKillTaskFailureToFile(mobname, mobskilled, totalmobs);
                            WriteToChat("Caught an untrackable killtask.");
                            WriteToChat("You Killed " + mobname + " and need to kill " + totalmobs);
                            WriteToChat("Results saved to file for future inclusion in kill task tracker.");
                            return;
                        }
                    }

                    if(LastKillStatus == null || LastKillStatus.TaskId != LastKillTask.KillTaskId)
                    {
                        LastKillStatus = mCharacterSettings.KillTaskStatus.Where(x => x.TaskId == LastKillTask.KillTaskId).FirstOrDefault();
                        if(LastKillStatus == null)
                        {
                            LastKillStatus = new TaskStatus();
                            LastKillStatus.TaskId = LastKillTask.KillTaskId;
                            mCharacterSettings.KillTaskStatus.Add(LastKillStatus);
                        }
                    }

                    LastKillStatus.CurrentCount = mobskilled;
                    LastKillStatus.complete = taskcomplete;
                    LastKillStatus.active = true;

                    iLockerUpdate.bSubmitCharacterSettings = true;
                    UpdateTaskPanel();

                }
                if(e.Color == 3)
                {
                    List<CollectTask> coltsklst = mGeneralSettings.GearTaskerSettings.MasterCollectTaskHash.Where(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y))).ToList();
                    List<KillTask> kiltsklst = mGeneralSettings.GearTaskerSettings.MasterKillTaskHash.Where(x => x.NPCNames.Any(y => @e.Text.StartsWith(@y))).ToList();

                    if (coltsklst.Count != 0)
                    {
                        CollectTask coltsk;
                        if(coltsklst.Count == 1)
                        {
                            coltsk = coltsklst.FirstOrDefault();
                        }
                        else
                        {
                            coltsk = coltsklst.Where(x => (@e.Text.Contains(@x.NPCYellowFlagText) || @e.Text.Contains(@x.NPCYellowCompleteText))).FirstOrDefault();
                        }
                        if(coltsk == null) {return;}

                        bool flag = @e.Text.Contains(@coltsk.NPCYellowFlagText);
                        bool complete = @e.Text.Contains(@coltsk.NPCYellowCompleteText);
                        if(!flag && !complete) {return;}

                        TaskStatus status = mCharacterSettings.CollectTaskStatus.Where(x => x.TaskId == coltsk.CollectTaskId).FirstOrDefault();
                        if(status == null)
                        {
                            status = new TaskStatus();
                            status.TaskId = coltsk.CollectTaskId;
                            mCharacterSettings.CollectTaskStatus.Add(status);
                        }

                        if(flag)
                        {
                            status.active = true;
                            status.complete = false;
                        }
                        if(complete)
                        {
                            status.active = false;
                            status.complete = false;
                        }
                        try
                        {
                            foreach(CollectTask ctsk in mGeneralSettings.GearTaskerSettings.MasterCollectTaskHash)
                            {
                                if(mCurrentInventory.AllInventory.Any(x => @x.Name == @ctsk.Item))
                                {
                                    TaskStatus stat = mCharacterSettings.CollectTaskStatus.Where(x => x.TaskId == ctsk.CollectTaskId).FirstOrDefault();
                                    if(stat == null)
                                    {
                                        stat = new TaskStatus();
                                        stat.TaskId = ctsk.CollectTaskId;
                                        stat.active = true;
                                        mCharacterSettings.CollectTaskStatus.Add(stat);
                                    }
                                    stat.CurrentCount = (int)AetherObjects.Inventory.Where(x => @x.Name == @coltsk.Item).Select(x => x.StackCount).ToArray().Sum();
                                    if(stat.CurrentCount > ctsk.CompleteCount)
                                    {
                                        stat.complete = true;
                                    }

                                }
                            }
                        }catch(Exception ex){LogError(ex);}
                        iLockerUpdate.bSubmitCharacterSettings = true;
                        UpdateTaskPanel();
                        return;
                    }

                    if (kiltsklst.Count > 0)
                    {
                        KillTask kiltsk;

                        if(kiltsklst.Count == 1)
                        {
                            kiltsk = kiltsklst.FirstOrDefault();
                        }
                        else
                        {
                            kiltsk = kiltsklst.Where(x => (@e.Text.Contains(@x.NPCYellowFlagText) || @e.Text.Contains(@x.NPCYellowCompleteText))).FirstOrDefault();
                        }
                        if(kiltsk == null) {return;}

                        bool flag = @e.Text.Contains(kiltsk.NPCYellowFlagText);
                        bool complete = @e.Text.Contains(kiltsk.NPCYellowCompleteText);
                        if(!flag && !complete) {return;}

                        TaskStatus status = mCharacterSettings.KillTaskStatus.Where(x => x.TaskId == kiltsk.KillTaskId).FirstOrDefault();
                        if(status == null)
                        {
                            status = new TaskStatus();
                            status.TaskId = kiltsk.KillTaskId;
                            mCharacterSettings.KillTaskStatus.Add(status);
                        }

                        if(flag)
                        {
                            status.active = true;
                            status.complete = false;
                            status.CurrentCount = 0;
                        }
                        if(complete)
                        {
                            status.active = false;
                            status.complete = false;
                            status.CurrentCount = 0;
                        }
                    }
                    iLockerUpdate.bSubmitCharacterSettings = true;
                    UpdateTaskPanel();
                }
            }catch(Exception ex){LogError(ex);}
        }
Exemple #44
0
    private void a(object A_0, ChatTextInterceptEventArgs A_1)
    {
        try
        {
            string str;
            string str2;
            string str10;
            string str11;
            y.b    b;
            int    e;
            if ((PluginCore.cq.n.b && er.j("AutoFellowManagement")) && ((A_1.get_Color() == 3) && this.f.c()))
            {
                Match match = this.x.Match(A_1.get_Text());
                if (match.Success)
                {
                    str  = match.Groups["name"].Value;
                    str2 = match.Groups["msg"].Value;
                    if (string.Compare(str2, "xp", true) == 0)
                    {
                        if (!this.a(str))
                        {
                            foreach (KeyValuePair <int, ar.a> pair in this.f.a)
                            {
                                if (pair.Value.b == str)
                                {
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] You are already in the fellowship.  -v-");
                                    return;
                                }
                            }
                            if (this.j.Contains(str.ToLowerInvariant()))
                            {
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Sorry, but you have been banned from this fellowship.  -v-");
                            }
                            else if (!this.l && !this.f.d())
                            {
                                string str3 = "????";
                                if (this.f.a.ContainsKey(this.f.b()))
                                {
                                    str3 = this.f.a[this.f.b()].b;
                                }
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] I'm sorry, but the fellowship is closed and I am not the leader. The leader is currently: " + str3 + "  -v-");
                            }
                            else if (this.l)
                            {
                                if (this.k.Contains(str))
                                {
                                    if (this.m)
                                    {
                                        if (this.u.ContainsKey(str))
                                        {
                                            if (!this.p.Contains(str))
                                            {
                                                this.p.Add(str);
                                            }
                                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Please wait nearby. I will try to recruit you in a moment.  -v-");
                                        }
                                        else
                                        {
                                            int num = this.k.IndexOf(str) + 1;
                                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] You are already number " + num.ToString() + " of " + this.k.Count.ToString() + " on the waiting list.  -v-");
                                        }
                                    }
                                    else
                                    {
                                        PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Please wait nearby. I will try to recruit you in a moment.  -v-");
                                    }
                                }
                                else if (this.m)
                                {
                                    this.k.Add(str);
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] The fellow is full, and I am the leader. I am adding you to the waiting list at position " + this.k.Count.ToString() + "  -v-");
                                }
                                else
                                {
                                    this.k.Add(str);
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] I will recruit you in a moment. Please stand close to me.  -v-");
                                }
                            }
                            else if ((!this.l && this.f.d()) && !this.a())
                            {
                                if (!this.k.Contains(str))
                                {
                                    this.k.Add(str);
                                }
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Please wait nearby. I will try to recruit you in a moment.  -v-");
                            }
                            else if ((!this.l && this.f.d()) && this.a())
                            {
                                string str4 = "????";
                                if (this.f.a.ContainsKey(this.f.b()))
                                {
                                    str4 = this.f.a[this.f.b()].b;
                                }
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] I'm sorry, but the fellowship is full. The leader is currently: " + str4 + "  -v-");
                            }
                        }
                    }
                    else if (((string.Compare(str2, "line", true) == 0) || (string.Compare(str2, "list", true) == 0)) || (string.Compare(str2, "status", true) == 0))
                    {
                        if (!this.a(str))
                        {
                            if (this.l)
                            {
                                if (!this.m)
                                {
                                    string[] strArray7 = new string[] { "/t ", str, ", [VT Fellow Manager] There is no waiting list. The fellowship has ", (this.f.a.Count + 1).ToString(), " members.  -v-" };
                                    PluginCore.cq.ah.b(string.Concat(strArray7));
                                }
                                else if (this.k.Contains(str))
                                {
                                    int num2 = this.k.IndexOf(str) + 1;
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] You are number " + num2.ToString() + " of " + this.k.Count.ToString() + " on the waiting list.  -v-");
                                }
                                else
                                {
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] The waiting list contains " + this.k.Count.ToString() + " players. You are not on it.  -v-");
                                }
                            }
                            else
                            {
                                string str5;
                                if (this.f.d())
                                {
                                    str5 = "open";
                                }
                                else
                                {
                                    str5 = "closed";
                                }
                                string str6 = "????";
                                if (this.f.a.ContainsKey(this.f.b()))
                                {
                                    str6 = this.f.a[this.f.b()].b;
                                }
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] The leader is currently: " + str6 + ". The fellowship is " + str5 + ".  -v-");
                            }
                        }
                    }
                    else if (string.Compare(str2, "remove", true) == 0)
                    {
                        if (!this.a(str))
                        {
                            string item = str;
                            if (this.k.Contains(item))
                            {
                                this.k.Remove(item);
                            }
                            if (this.p.Contains(item))
                            {
                                this.p.Remove(item);
                            }
                            if (this.u.ContainsKey(item))
                            {
                                this.u.Remove(item);
                            }
                            this.b();
                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] You have been removed from the list.  -v-");
                        }
                    }
                    else if (string.Compare(str2, "leader", true) == 0)
                    {
                        if (!this.a(str))
                        {
                            string str8;
                            if (this.f.d())
                            {
                                str8 = "open";
                            }
                            else
                            {
                                str8 = "closed";
                            }
                            if (this.l)
                            {
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] I am the fellowship leader. The fellowship is " + str8 + ".  -v-");
                            }
                            else
                            {
                                string str9 = "????";
                                if (this.f.a.ContainsKey(this.f.b()))
                                {
                                    str9 = this.f.a[this.f.b()].b;
                                }
                                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] The leader is currently: " + str9 + ". The fellowship is " + str8 + ".  -v-");
                            }
                        }
                    }
                    else if (string.Compare(str2, "help", true) == 0)
                    {
                        if (!this.a(str))
                        {
                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Available commands: xp, line, remove, leader, startvote, vote, location, help  -v-");
                        }
                    }
                    else if (string.Compare(str2, "help startvote", true) == 0)
                    {
                        if (!this.a(str))
                        {
                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Usage: startvote [votetype] [parameter]. Possible vote types: kick, ban, giveleader, setopen.  -v-");
                        }
                    }
                    else if (string.Compare(str2, "help vote", true) == 0)
                    {
                        if (!this.a(str))
                        {
                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Usage: vote [vote id] [yes/no]  -v-");
                        }
                    }
                    else
                    {
                        if (!str2.StartsWith("startvote "))
                        {
                            goto Label_1027;
                        }
                        if ((!this.a(str) && this.b(str)) && !this.j.Contains(str.ToLowerInvariant()))
                        {
                            if (this.q.ContainsKey(str) && (this.q[str] > DateTimeOffset.Now))
                            {
                                string[] strArray13 = new string[] { "/t ", str, ", [VT Fellow Manager] You have initiated a vote too recently (wait another ", (this.q[str] - DateTimeOffset.Now).ToString(), ").  -v-" };
                                PluginCore.cq.ah.b(string.Concat(strArray13));
                            }
                            else
                            {
                                string[] strArray = str2.Split(new char[] { ' ' });
                                if (strArray.Length < 3)
                                {
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Not enough parameters to startvote command. Tell me 'help startvote' for more information.  -v-");
                                }
                                else
                                {
                                    str10 = strArray[1];
                                    StringBuilder builder = new StringBuilder();
                                    for (int i = 2; i < strArray.Length; i++)
                                    {
                                        if (i > 2)
                                        {
                                            builder.Append(" ");
                                        }
                                        builder.Append(strArray[i]);
                                    }
                                    str11 = builder.ToString();
                                    b     = new y.b {
                                        b = str11.ToLowerInvariant()
                                    };
                                    if (string.Compare(str10, "kick", true) == 0)
                                    {
                                        if (!this.b(str11))
                                        {
                                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Cannot vote to kick " + str11 + ", that player is not in the fellow.  -v-");
                                            return;
                                        }
                                        b.a = y.a.a;
                                        goto Label_0CE0;
                                    }
                                    if (string.Compare(str10, "ban", true) == 0)
                                    {
                                        if (!this.b(str11))
                                        {
                                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Cannot vote to ban " + str11 + ", that player is not in the fellow.  -v-");
                                            return;
                                        }
                                        b.a = y.a.b;
                                        goto Label_0CE0;
                                    }
                                    if (string.Compare(str10, "giveleader", true) == 0)
                                    {
                                        if (!this.b(str11))
                                        {
                                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Cannot vote to give leader to " + str11 + ", that player is not in the fellow.  -v-");
                                            return;
                                        }
                                        b.a = y.a.c;
                                        goto Label_0CE0;
                                    }
                                    if (string.Compare(str10, "setopen", true) == 0)
                                    {
                                        if ((str11 != "true") && (str11 != "false"))
                                        {
                                            PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] A setopen vote call must be followed by 'true' or 'false'.  -v-");
                                            return;
                                        }
                                        b.a = y.a.d;
                                        goto Label_0CE0;
                                    }
                                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Unknown vote type. Tell me 'help startvote' for more information.  -v-");
                                }
                            }
                        }
                    }
                }
            }
            return;

Label_0CE0:
            e = 0;
            foreach (KeyValuePair <y.b, List <MyPair <string, bool> > > pair2 in this.r)
            {
                if (pair2.Key.a(b) == 0)
                {
                    e = pair2.Key.e;
                    break;
                }
            }
            if (e != 0)
            {
                PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] An identical vote is already in progress! (Vote ID " + e.ToString() + ")  -v-");
            }
            else
            {
                b.c = DateTimeOffset.Now + TimeSpan.FromMinutes(2.0);
                string[] strArray3 = new string[] { "/f [VT Fellow Manager] ", str, " has called a new vote: ", str10.ToLowerInvariant(), " ", str11, "! To vote, either tell me 'vote ", b.e.ToString(), " yes' or 'vote ", b.e.ToString(), " no'. You have ", 2.0.ToString(), " minutes.  -v-" };
                PluginCore.cq.ah.b(string.Concat(strArray3));
                this.r.Add(b, new List <MyPair <string, bool> >());
                MyPair <string, bool> pair3 = new MyPair <string, bool> {
                    a = str,
                    b = true
                };
                this.r[b].Add(pair3);
                this.q[str] = DateTimeOffset.Now + TimeSpan.FromMinutes(4.0);
                PluginCore.cq.ah.b("/f [VT Fellow Manager] Vote total for '" + str10.ToLowerInvariant() + " " + str11 + "' (ID " + b.e.ToString() + "): 1/0  -v-");
                PluginCore.e("Vote called by " + str + ": " + b.ToString() + ". [" + a.a("Vote Yes", new string[] { "fvote", b.e.ToString(), "yes" }) + "] [" + a.a("Vote No", new string[] { "fvote", b.e.ToString(), "no" }) + "] [" + a.a("Abort Vote", new string[] { "fvote", b.e.ToString(), "abort" }) + "]");
            }
            return;

Label_1027:
            if (str2.StartsWith("vote "))
            {
                if ((!this.a(str) && this.b(str)) && !this.j.Contains(str.ToLowerInvariant()))
                {
                    int      num5;
                    string[] strArray2 = str2.Split(new char[] { ' ' });
                    if ((strArray2.Length != 3) || !int.TryParse(strArray2[1], out num5))
                    {
                        PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Invalid vote command. Votes should look like: vote idnumber yes, or: vote idnumber no  -v-");
                        return;
                    }
                    bool flag = false;
                    if (string.Compare(strArray2[2], "yes", true) == 0)
                    {
                        flag = true;
                    }
                    else if (string.Compare(strArray2[2], "no", true) == 0)
                    {
                        flag = false;
                    }
                    else
                    {
                        PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Invalid vote command. Votes should look like: vote idnumber yes, or: vote idnumber no  -v-");
                        return;
                    }
                    y.b key = null;
                    List <MyPair <string, bool> > list = null;
                    foreach (KeyValuePair <y.b, List <MyPair <string, bool> > > pair4 in this.r)
                    {
                        if (pair4.Key.e == num5)
                        {
                            key  = pair4.Key;
                            list = pair4.Value;
                            break;
                        }
                    }
                    if (key == null)
                    {
                        PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Invalid vote ID number. Votes should look like: vote idnumber yes, or: vote idnumber no  -v-");
                        return;
                    }
                    bool flag2 = false;
                    foreach (MyPair <string, bool> pair5 in list)
                    {
                        if (pair5.a == str)
                        {
                            flag2   = true;
                            pair5.b = flag;
                            break;
                        }
                    }
                    if (!flag2)
                    {
                        MyPair <string, bool> pair6 = new MyPair <string, bool> {
                            a = str,
                            b = flag
                        };
                        list.Add(pair6);
                    }
                    int num6 = 0;
                    int num7 = 0;
                    foreach (MyPair <string, bool> pair7 in list)
                    {
                        if (pair7.b)
                        {
                            num6++;
                        }
                        else
                        {
                            num7++;
                        }
                    }
                    PluginCore.cq.ah.b("/f [VT Fellow Manager] Vote total for " + key.ToString() + ": " + num6.ToString() + "/" + num7.ToString() + "  -v-");
                }
            }
            else
            {
                if ((string.Compare(str2, "location", true) != 0) || this.a(str))
                {
                    return;
                }
                bool flag3 = false;
                foreach (KeyValuePair <int, ar.a> pair8 in this.f.a)
                {
                    if (pair8.Value.b == str)
                    {
                        flag3 = true;
                        break;
                    }
                }
                if (flag3)
                {
                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] I am currently located in landcell: " + PluginCore.cq.p.d(PluginCore.cg).w.d().ToString("X8") + "  -v-");
                }
                else
                {
                    PluginCore.cq.ah.b("/t " + str + ", [VT Fellow Manager] Sorry, I can only send my location to members of the fellowship.  -v-");
                }
            }
        }
        catch (Exception exception)
        {
            ad.a(exception);
        }
    }
Exemple #45
0
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Eat || string.IsNullOrEmpty(e.Text))
                {
                    return;
                }

                bool isChat = Util.IsChat(e.Text);

                if (e.Eat == false && Settings.SettingsManager.Filters.AttackEvades.Value)
                {
                    // Ruschk S****t evaded your attack.
                    if (!isChat && e.Text.Contains(" evaded your attack."))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.DefenseEvades.Value)
                {
                    // You evaded Ruschk S****t!
                    if (!isChat && e.Text.StartsWith("You evaded "))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.AttackResists.Value)
                {
                    // Sentient Crystal Shard resists your spell
                    // Invading Silver Scope Knight resists your spell
                    if (!isChat && e.Text.Contains(" resists your spell"))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.DefenseResists.Value)
                {
                    // You resist the spell cast by Sentient Crystal Shard
                    if (!isChat && e.Text.StartsWith("You resist the spell cast by "))
                    {
                        e.Eat = true;
                    }

                    // You have no appropriate targets equipped for Ruschk Warlord's spell.
                    if (!isChat && e.Text.StartsWith("You have no appropriate target") && e.Text.Contains("spell"))
                    {
                        e.Eat = true;
                    }

                    // You are an invalid target for the spell of Ruschk Warlord.
                    if (!isChat && e.Text.StartsWith("You are an invalid target for the spell"))
                    {
                        e.Eat = true;
                    }

                    // Ruschk Warlord tried to cast a spell on you, but was too far away!
                    if (!isChat && e.Text.Contains("tried to cast a spell on you, but was too far away!"))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.NPKFails.Value)
                {
                    if (!isChat && e.Text.StartsWith("You fail to affect ") && e.Text.Contains(" you are not a player killer!"))
                    {
                        e.Eat = true;
                    }

                    if (!isChat && e.Text.Contains("fails to affect you") && e.Text.Contains(" is not a player killer!"))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.DirtyFighting.Value)
                {
                    // Dirty Fighting! [player] delivers a Traumatic Assault to [mob]!
                    // Dirty Fighting! [player] delivers a Bleeding Assault to [mob]!
                    // Dirty Fighting! [player] delivers a Unbalancing Assault to [mob]!
                    // Dirty Fighting! [player] delivers a Blinding Assault to [mob]!
                    if (!isChat && e.Text.StartsWith("Dirty Fighting! ") && e.Text.Contains(" delivers a "))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.MonsterDeaths.Value)
                {
                    if (Trackers.Combat.Standard.CombatMessages.IsKilledByMeMessage(e.Text))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.SpellCastingMine.Value)
                {
                    // You say, "Zojak
                    if (Util.IsSpellCastingMessage(e.Text, true, false))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.SpellCastingOthers.Value)
                {
                    // Fat Guy In A Little Coat says, "Zojak
                    if (Util.IsSpellCastingMessage(e.Text, false))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.SpellCastFizzles.Value)
                {
                    // Your spell fizzled.
                    if (!isChat && e.Text.StartsWith("Your spell fizzled."))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.CompUsage.Value)
                {
                    // The spell consumed the following components:
                    if (!isChat && e.Text.StartsWith("The spell consumed the following components"))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.SpellExpires.Value)
                {
                    // Don't filter rare expires
                    if (!isChat && !e.Text.Contains("Brilliance") && !e.Text.Contains("Prodigal") && !e.Text.Contains("Spectral"))
                    {
                        // The spell Defender VI on Brass Sceptre has expired.
                        // Focus Self VI has expired.
                        if (e.Text.Contains("has expired.") || e.Text.Contains("have expired."))
                        {
                            e.Eat = true;
                        }
                    }
                }


                if (e.Eat == false && Settings.SettingsManager.Filters.HealingKitSuccess.Value)
                {
                    // You heal yourself for 88 Health points. Your treated Healing Kit has 16  uses left.
                    // You expertly heal yourself for 123 Health points. Your Treated Healing Kit has 41 uses left.
                    if (!isChat && e.Text.StartsWith("You ") && e.Text.Contains(" heal yourself for "))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.HealingKitFail.Value)
                {
                    // You fail to heal yourself. Your Treated Healing Kit has 18 uses left.
                    if (!isChat && e.Text.StartsWith("You fail to heal yourself. "))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.Salvaging.Value)
                {
                    // You obtain 9 granite (ws 8.00) using your knowledge of Salvaging
                    if (!isChat && e.Text.StartsWith("You obtain ") && e.Text.Contains(" using your knowledge of "))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.SalvagingFails.Value)
                {
                    // Salvaging Failed!
                    if (!isChat && e.Text.StartsWith("Salvaging Failed!"))
                    {
                        e.Eat = true;
                    }

                    //  The following were not suitable for salvaging: Salvaged Sunstone (79), Salvaged Sunstone (7).
                    if (!isChat && e.Text.Contains("The following were not suitable for salvaging: "))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.AuraOfCraftman.Value)
                {
                    // Your Aura of the Craftman augmentation increased your skill by 5!
                    if (!isChat && e.Text.StartsWith("Your Aura of the Craftman augmentation increased your skill by 5!"))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.ManaStoneUsage.Value)
                {
                    // The Mana Stone gives 6,127 points of mana to the following items:
                    if (!isChat && e.Text.StartsWith("The Mana Stone gives "))
                    {
                        e.Eat = true;
                    }
                    // You need 6,833 more mana to fully charge your items.
                    if (!isChat && e.Text.StartsWith("You need ") && e.Text.Trim().EndsWith(" more mana to fully charge your items."))
                    {
                        e.Eat = true;
                    }
                    // The Mana Stone drains 3,153 points of mana from the Fez.
                    if (!isChat && e.Text.StartsWith("The Mana Stone drains "))
                    {
                        e.Eat = true;
                    }
                    // The Fez is destroyed.
                    if (!isChat && e.Text.StartsWith("The ") && e.Text.Trim().EndsWith(" is destroyed."))
                    {
                        e.Eat = true;
                    }
                }


                if (e.Eat == false && Settings.SettingsManager.Filters.TradeBuffBotSpam.Value)
                {
                    if (Util.IsChat(e.Text, Util.ChatFlags.PlayerSaysLocal) && (e.Text.Trim().EndsWith("-t-\"") || e.Text.Trim().EndsWith("-b-\"")))
                    {
                        e.Eat = true;
                    }

                    // Trade bot emotes
                    if (!isChat && (e.Text.Trim().EndsWith("-t-") || e.Text.Trim().EndsWith("-b-")))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.FailedAssess.Value)
                {
                    // Someone tried and failed to assess you!
                    if (!isChat && e.Text.Trim().EndsWith("tried and failed to assess you!"))
                    {
                        e.Eat = true;
                    }
                }


                if (e.Eat == false && Settings.SettingsManager.Filters.KillTaskComplete.Value)
                {
                    // You have killed 50 Drudge Raveners! Your task is complete!
                    if (!isChat && e.Text.StartsWith("You have killed ") && e.Text.Trim().EndsWith("Your task is complete!"))
                    {
                        e.Eat = true;
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.VendorTells.Value)
                {
                    if (Util.IsChat(e.Text, Util.ChatFlags.NpcTellsYou))
                    {
                        string sourceName = Util.GetSourceOfChat(e.Text);

                        if (!string.IsNullOrEmpty(sourceName))
                        {
                            WorldObjectCollection collection = CoreManager.Current.WorldFilter.GetByName(sourceName);

                            if (collection.Count >= 1 && collection.First.ObjectClass == ObjectClass.Vendor)
                            {
                                e.Eat = true;
                            }
                        }
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.MonsterTell.Value)
                {
                    if (Util.IsChat(e.Text, Util.ChatFlags.NpcTellsYou))
                    {
                        string sourceName = Util.GetSourceOfChat(e.Text);

                        if (!string.IsNullOrEmpty(sourceName))
                        {
                            WorldObjectCollection collection = CoreManager.Current.WorldFilter.GetByName(sourceName);

                            if (collection.Count >= 1 && collection.First.ObjectClass == ObjectClass.Monster)
                            {
                                e.Eat = true;
                            }
                        }
                    }
                }

                if (e.Eat == false && Settings.SettingsManager.Filters.NpcChatter.Value)
                {
                    if (Util.IsChat(e.Text, Util.ChatFlags.NpcSays))
                    {
                        string sourceName = Util.GetSourceOfChat(e.Text);

                        if (!string.IsNullOrEmpty(sourceName))
                        {
                            WorldObjectCollection collection = CoreManager.Current.WorldFilter.GetByName(sourceName);

                            if (collection.Count >= 1 && collection.First.ObjectClass == ObjectClass.Npc)
                            {
                                e.Eat = true;
                            }
                        }
                    }
                }

                if (e.Eat == false && (Settings.SettingsManager.Filters.MasterArbitratorSpam.Value || Settings.SettingsManager.Filters.AllMasterArbitratorChat.Value))
                {
                    if (isChat)
                    {
                        if (Util.GetSourceOfChat(e.Text) == "Master Arbitrator")
                        {
                            /*
                             * (We don't filter these)
                             * Master Arbitrator tells you, "If you wish to fight as a gladiator in the Arena I will require you to purchase a ticket from the Ticket Vendors over there. We do need to keep the place running don't we?"
                             * Master Arbitrator tells you, "Also, I warn you now. Prepare your fellowship ahead of time. Once you pay me you cannot change your registered group and only that group will be allowed into the Arena I assign you. After you enter the Arena you must wait one hour before recieving your reward. Our gladiators need time to rest between fights."
                             *
                             * (We don't filter these)
                             * 20:57:15 Master Arbitrator tells you, "Your fellowship's Arena battles still continue. I cannot reward anyone in your fellowship while they still have time left in the Colosseum. (4s)"
                             * 20:57:17 Master Arbitrator tells you, "Your fellowship's Arena battles still continue. I cannot reward anyone in your fellowship while they still have time left in the Colosseum. (2s)"
                             * 20:57:20 Master Arbitrator tells you, "You fought in the Colosseum's Arenas too recently. I cannot reward you for 4s."
                             *
                             * (In this set of messages, we don't filter the Well done!)
                             * 20:57:24 Master Arbitrator tells you, "Well done! I was greatly impressed with your performance in the arenas."
                             * 20:57:24 Master Arbitrator tells you, "You shall be known to all as a "Colosseum Champion"!"
                             * 20:57:24 Master Arbitrator tells you, "Take this knowledge and this Colosseum Vault Key as a reward for your accomplishments Champion."
                             * 20:57:24 Master Arbitrator tells you, "Use the the key to open the Colosseum Vault and claim some of our treasury for yourself."
                             *
                             * (In this set of messages, we don't filter the Good Luck!)
                             * 21:01:14 Your fellowship is now locked.  You may not recruit new members.  If you leave the fellowship, you have 15 minutes to be recruited back into the fellowship.
                             * 21:01:16 [Fellowship] Master Arbitrator says, "Your fellowship will be battling in Arena One."
                             * 21:01:17 [Fellowship] Master Arbitrator says, "Use one of the two portals to enter your Arena. If every member of your group is powerful enough you may skip the lower battles by using the Advanced Colosseum Arena, but any one member of your fellow may be restricted from using that portal so be careful or you may be split up."
                             * 21:01:17 [Fellowship] Master Arbitrator says, "Don't forget that you must wait one full hour after the time you enter the colosseum before I will reward you for your achievements in the Arenas."
                             * 21:01:17 [Fellowship] Master Arbitrator says, "Good Luck!"
                             */

                            if (Settings.SettingsManager.Filters.MasterArbitratorSpam.Value)
                            {
                                if (Util.IsChat(e.Text, Util.ChatFlags.NpcTellsYou))
                                {
                                    if (e.Text.Contains("\"You shall be known") || e.Text.Contains("\"Take this knowledge") || e.Text.Contains("\"Use the the key"))
                                    {
                                        e.Eat = true;
                                    }
                                }
                                else if (Util.IsChat(e.Text, Util.ChatFlags.PlayerSaysChannel))
                                {
                                    if (e.Text.Contains("\"Your fellowship") || e.Text.Contains("\"Use one of the") || e.Text.Contains("\"Don't forget"))
                                    {
                                        e.Eat = true;
                                    }
                                }
                            }

                            if (Settings.SettingsManager.Filters.AllMasterArbitratorChat.Value)
                            {
                                e.Eat = true;
                            }
                        }
                    }

                    if (Settings.SettingsManager.Filters.AllMasterArbitratorChat.Value && e.Text.StartsWith("Your fellowship is now locked.") && e.Text.Contains("you have 15 minutes to be recruited"))
                    {
                        e.Eat = true;
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Exemple #46
0
        private void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (ChatMessages.IsKilledByMeMessage(e.Text))
                {
                    foreach (Regex regex in ChatMessages.TargetKilledByMe)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success)
                        {
                            killValue++;
                            killrate.Text = killValue + "";
                            break;
                        }
                    }
                }
                else if (ChatMessages.IsRareFindMessage(e.Text))
                {
                    string rareName = "";
                    foreach (Regex regex in ChatMessages.RareFind)
                    {
                        Match match = regex.Match(e.Text);

                        if (match.Success && match.Groups["targetname"].Value.Equals(Core.CharacterFilter.Name))
                        {
                            raresValue++;
                            rares.Text = raresValue + "";

                            int killstoObtain = killValue - killssincelast;
                            killssincelast = killValue;
                            string playerName = match.Groups["targetname"].Value;

                            rareName = match.Groups["rarename"].Value;

                            if (!addingToList)
                            {
                                addingToList = true;
                                HudList.HudListRowAccessor testRow = raresFound.InsertRow(0);
                                ((HudStaticText)testRow[0]).Text = raresFound.RowCount + "";
                                ((HudStaticText)testRow[1]).Text = rareName;
                                ((HudStaticText)testRow[2]).Text = killstoObtain + "";
                                ((HudStaticText)testRow[3]).Text = DateTime.Now.ToShortTimeString();
                                ((HudStaticText)testRow[4]).Text = DateTime.Today.ToString("MM/dd/yy");

                                string[] export = new string[raresFound.RowCount];
                                int      count  = 0;
                                for (int i = raresFound.RowCount - 1; i >= 0; i--)
                                {
                                    export[count] = ((HudStaticText)raresFound[i][0]).Text + "," + ((HudStaticText)raresFound[i][1]).Text + "," + ((HudStaticText)raresFound[i][2]).Text + "," + ((HudStaticText)raresFound[i][3]).Text + "," + ((HudStaticText)raresFound[i][4]).Text;
                                    count++;
                                }

                                Util.ExportCSV(export, false);

                                addingToList = false;
                            }

                            if (rareName != "" && tierActive(rareName.Replace('!', ' ').Trim()))
                            {
                                //IF FOUND RARE : SEND EMAIL
                                if (SendEmail && !emailSending)
                                {
                                    emailSending = true;
                                    EmailSender.sendEmail("NEW RARE! " + rareName, Core.CharacterFilter.Name + " has discovered the " + rareName);
                                }

                                //IF FOUND RARE : SEND DISCORD
                                if (SendDiscord && !discordSending)
                                {
                                    discordSending = true;
                                    DiscordSender.sendMsg(Core.CharacterFilter.Name + " has discovered the " + rareName);
                                }
                            }
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Util.WriteToChat("x Error: " + ex.Message + "\n " + ex.Source + "\n " + ex.StackTrace);
            }
        }
Exemple #47
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;

				AttackType attackType = AttackType.Unknown;
				DamageElement damageElemenet = DamageElement.Unknown;

				bool isFailedAttack = false;
				bool isCriticalHit = e.Text.Contains("Critical hit!");
				bool isOverpower = e.Text.Contains("Overpower!");
				bool isKillingBlow = false;

				int damageAmount = 0;

				// You evaded Remoran Corsair!
				// Ruschk S****t evaded your attack.
				// You resist the spell cast by Remoran Corsair
				// Sentient Crystal Shard resists your spell
				if (CombatMessages.IsFailedAttack(e.Text))
				{
					isFailedAttack = true;

					string parsedName = string.Empty;

					foreach (Regex regex in CombatMessages.FailedAttacks)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							parsedName = match.Groups["targetname"].Value;
							break;
						}
					}

					if (e.Text.StartsWith("You evaded "))
					{
						sourceName = parsedName;
						targetName = CoreManager.Current.CharacterFilter.Name;
						attackType = AttackType.MeleeMissle;
					}
					else if (e.Text.Contains(" evaded your attack"))
					{
						sourceName = CoreManager.Current.CharacterFilter.Name;
						targetName = parsedName;
						attackType = AttackType.MeleeMissle;
					}
					else if (e.Text.StartsWith("You resist the spell cast by "))
					{
						sourceName = parsedName;
						targetName = CoreManager.Current.CharacterFilter.Name;
						attackType = AttackType.Magic;
					}
					else if (e.Text.Contains(" resists your spell"))
					{
						sourceName = CoreManager.Current.CharacterFilter.Name;
						targetName = parsedName;
						attackType = AttackType.Magic;
					}
				}
				// You flatten Noble Remains's body with the force of your assault!
				// Your killing blow nearly turns Shivering Crystalline Wisp inside-out!
				// The thunder of crushing Pyre Minion is followed by the deafening silence of death!
				// Old Bones is shattered by your assault!
				else if (CombatMessages.IsKilledByMeMessage(e.Text))
				{
					isKillingBlow = true;

					sourceName = CoreManager.Current.CharacterFilter.Name;

					foreach (Regex regex in CombatMessages.TargetKilledByMe)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							targetName = match.Groups["targetname"].Value;

							break;
						}
					}
				}
				else
				{
					foreach (Regex regex in CombatMessages.MeleeMissileReceivedAttacks)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							sourceName = match.Groups["targetname"].Value;
							targetName = CoreManager.Current.CharacterFilter.Name;
							attackType = AttackType.MeleeMissle;
							damageElemenet = GetElementFromText(e.Text);
							int.TryParse(match.Groups["points"].Value, out damageAmount);
							goto Found;
						}
					}

					foreach (Regex regex in CombatMessages.MeleeMissileGivenAttacks)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							sourceName = CoreManager.Current.CharacterFilter.Name;
							targetName = match.Groups["targetname"].Value;
							attackType = AttackType.MeleeMissle;
							damageElemenet = GetElementFromText(e.Text);
							int.TryParse(match.Groups["points"].Value, out damageAmount);
							goto Found;
						}
					}

					foreach (Regex regex in CombatMessages.MagicReceivedAttacks)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							sourceName = match.Groups["targetname"].Value;
							targetName = CoreManager.Current.CharacterFilter.Name;
							attackType = AttackType.Magic;
							damageElemenet = GetElementFromText(e.Text);
							int.TryParse(match.Groups["points"].Value, out damageAmount);
							goto Found;
						}
					}

					foreach (Regex regex in CombatMessages.MagicGivenAttacks)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							sourceName = CoreManager.Current.CharacterFilter.Name;
							targetName = match.Groups["targetname"].Value;
							attackType = AttackType.Magic;
							damageElemenet = GetElementFromText(e.Text);
							int.TryParse(match.Groups["points"].Value, out damageAmount);
							goto Found;
						}
					}

					foreach (Regex regex in CombatMessages.MagicCastAttacks)
					{
						Match match = regex.Match(e.Text);

						if (match.Success)
						{
							sourceName = CoreManager.Current.CharacterFilter.Name;
							targetName = match.Groups["targetname"].Value;
							attackType = AttackType.Magic;
							damageElemenet = DamageElement.None;
							goto Found;
						}
					}

					Found: ;
				}

				if (sourceName == String.Empty && targetName == String.Empty)
					return;

				if (!isKillingBlow && attackType == AttackType.Unknown)
					Debug.WriteToChat("Unable to parse attack type from: " + e.Text);

				if (!isKillingBlow && !isFailedAttack && damageElemenet == DamageElement.Unknown)
					Debug.WriteToChat("Unable to parse damage element from: " + e.Text);

				CombatEventArgs combatEventArgs = new CombatEventArgs(sourceName, targetName, attackType, damageElemenet, isFailedAttack, isCriticalHit, isOverpower, isKillingBlow, damageAmount);

				if (CombatEvent != null)
					CombatEvent(combatEventArgs);
			}
			catch (Exception ex) { Debug.LogException(ex, e.Text); }
		}
		void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
		{
			try
			{
				if (e.Text.StartsWith("You say, ") || e.Text.Contains("says, \""))
					return;

				WorldObject wo = CoreManager.Current.WorldFilter[Id];

				if (wo == null)
					return;

				// The Mana Stone is destroyed.
				// The Mana Stone gives 11,376 points of mana to the following items: Satin Flared Shirt, Steel Chainmail Bracers, Velvet Trousers, Leather Loafers, Copper Chainmail Greaves, Enhanced White Empyrean Ring, Enhanced Red Empyrean Ring, Iron Diforsa Pauldrons, Bronze Chainmail Tassets, Copper Heavy Bracelet, Silver Olthoi Amuli Gauntlets, Ivory Heavy Bracelet, Steel Coronet, Emerald Amulet, Silver Puzzle Box, Sunstone Fire Sceptre
				// Your items are fully charged.
				if (e.Text.Contains("The Mana Stone gives "))
				{
					if (e.Text.Contains(wo.Name))
						CoreManager.Current.Actions.RequestId(Id);
				}

				// This is triggered when an item has 2 minutes left of mana.
				// Your Gold Olthoi Koujia Sleeves is low on Mana.
				// Your Bronze Haebrean Breastplate is out of Mana.
				if (e.Text.Contains("Your ") && (e.Text.Contains(" is low on Mana.") || e.Text.Contains(" is out of Mana.")))
				{
					if (e.Text.Contains(wo.Name))
						CoreManager.Current.Actions.RequestId(Id);
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
 public ParsedChatTextInterceptEventArgs(ChatTextInterceptEventArgs eventArgs, string source, Util.ChatChannels channel, ChatMessageType messageType)
     : this(eventArgs.Text, eventArgs.Target, eventArgs.Color, source, channel, messageType)
 {
 }
Exemple #50
0
        private void Parse_Death(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Color == 0)
                {
                    WorldObject worldObject = CoreManager.Current.WorldFilter[CoreManager.Current.Actions.CurrentSelection];
                    string      tempname;
                    if (worldObject != null)
                    {
                        tempname = worldObject.Name;
                    }
                    else
                    {
                        tempname = "unknown";
                    }

                    if (e.Text.Contains("Your assault sends ") && e.Text.Contains(" to an icy death!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "Your assault sends " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " to an icy death!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains(" suffers a frozen fate!"))
                    {
                        string name = e.Text.Split(new string[] { " suffers a frozen fate!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("Your attack stops ") && e.Text.Contains(" cold!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "Your attack stops " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " cold!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You reduced ") && e.Text.Contains(" to cinders!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You reduced " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " to cinders!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains(" is incinerated by your assault!"))
                    {
                        string name = e.Text.Split(new string[] { " is incinerated by your assault!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("'s seared corpse smolders before you!"))
                    {
                        string name = e.Text.Split(new string[] { "'s seared corpse smolders before you!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You bring ") && e.Text.Contains(" to a fiery end!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You bring " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " to a fiery end!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("Your lightning coruscates over ") && e.Text.Contains("'s mortal remains!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "Your lightning coruscates over " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { "'s mortal remains!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("Electricity tears ") && e.Text.Contains(" apart!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "Electricity tears " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " apart!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You reduce ") && e.Text.Contains(" to a sizzling, oozing mass!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You reduce " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " to a sizzling, oozing mass!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("'s last strength dissolves before you!"))
                    {
                        string name = e.Text.Split(new string[] { "'s last strength dissolves before you!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains(" is liquified by your attack!"))
                    {
                        string name = e.Text.Split(new string[] { " is liquified by your attack!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You knock ") && e.Text.Contains(" into next Morningthaw"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You knock " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " into next Morningthaw" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains(" is utterly destroyed by your attack!"))
                    {
                        string name = e.Text.Split(new string[] { " is utterly destroyed by your attack!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You beat ") && e.Text.Contains(" to a lifeless pulp!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You beat " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " to a lifeless pulp!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You flatten ") && e.Text.Contains("'s body with the force of your assault!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You flatten " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { "'s body with the force of your assault!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("The thunder of crushing ") && e.Text.Contains(" is followed by the deafening silence of death!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "The thunder of crushing " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " is followed by the deafening silence of death!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("'s perforated corpse falls before you!"))
                    {
                        string name = e.Text.Split(new string[] { "'s perforated corpse falls before you!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You killed "))
                    {
                        string temp = e.Text.Split(new string[] { "You killed " }, StringSplitOptions.None)[1];
                        string name = temp.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You run ") && e.Text.Contains("through!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You run " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " through" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains(" is fatally punctured!"))
                    {
                        string name = e.Text.Split(new string[] { " is fatally punctured!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("'s death is preceded by a sharp, stabbing pain!"))
                    {
                        string name = e.Text.Split(new string[] { "'s death is preceded by a sharp, stabbing pain!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You split ") && e.Text.Contains(" apart!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You split " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " apart!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You slay ") && e.Text.Contains(" viciously enough to impart death several times over!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You slay " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " viciously enough to impart death several times over!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("You cleave ") && e.Text.Contains(" in twain!"))
                    {
                        string temp1 = e.Text.Split(new string[] { "You cleave " }, StringSplitOptions.None)[1];
                        string name  = temp1.Split(new string[] { " in twain!" }, StringSplitOptions.None)[0];
                        if (name == tempname)
                        {
                            if (worldObject.ObjectClass == ObjectClass.Player && worldObject.Id != CoreManager.Current.CharacterFilter.Id)
                            {
                                AddPkObject(name, lib.MyName);
                            }
                        }
                    }

                    if (e.Text.Contains("'s electricity tears") && e.Text.Contains(" apart!"))
                    {
                        string temp1  = e.Text.Split(new string[] { "'s electricity tears " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { "'s electricity tears " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " apart!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s lightning coruscates over ") && e.Text.Contains("'s mortal remains"))
                    {
                        string temp1  = e.Text.Split(new string[] { "'s lightning coruscates over " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { "'s lightning coruscates over " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { "'s mortal remains" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" knocks ") && e.Text.Contains(" into next Morningthaw"))
                    {
                        string temp1  = e.Text.Split(new string[] { " knocks " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " knocks " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " into" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" is incinerated by ") && e.Text.Contains("'s assault!"))
                    {
                        string name   = e.Text.Split(new string[] { " is incinerated by " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { " is incinerated by " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "'s assault!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" slays ") && e.Text.Contains(" viciously enough to impart death several times over!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " slays " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " slays " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " viciously enough" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" is utterly destroyed by ") && !e.Text.Contains("your attack!"))
                    {
                        string name   = e.Text.Split(new string[] { " is utterly destroyed by " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { " is utterly destroyed by " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "'s attack!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" reduced ") && e.Text.Contains(" to cinders!") && !e.Text.Contains("You reduced"))
                    {
                        string temp1  = e.Text.Split(new string[] { " reduced " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " reduced " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " to cinders!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" brings ") && e.Text.Contains(" to a fiery end!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " brings " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " brings " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " to a fiery end!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s seared corpse smolders before ") && !e.Text.Contains("'s seared corpse smolders before you!"))
                    {
                        string name   = e.Text.Split(new string[] { "'s seared corpse smolders before " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { "'s seared corpse smolders before " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" runs ") && e.Text.Contains(" through!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " runs " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " runs " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " through!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" is liquified by ") && !e.Text.Contains(" is liquified by your attack!"))
                    {
                        string name   = e.Text.Split(new string[] { " is liquified by " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { " is liquified by " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "'s attack!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" died!"))
                    {
                        string name   = e.Text.Split(new string[] { " died!" }, StringSplitOptions.None)[0];
                        string killer = "Unknown";
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" splits ") && e.Text.Contains(" apart!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " splits " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " splits " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " apart!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s last strength dissolves before ") && !e.Text.Contains("'s last strength dissolves before you!"))
                    {
                        string name   = e.Text.Split(new string[] { "'s last strength dissolves before " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { "'s last strength dissolves before " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" suffers a frozen fate at the hands of "))
                    {
                        string name   = e.Text.Split(new string[] { " suffers a frozen fate at the hands of " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { " suffers a frozen fate at the hands of " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" beats ") && e.Text.Contains(" to a lifeless pulp!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " beats " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " beats " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " to a lifeless pulp" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" reduces ") && e.Text.Contains(" to a sizzling, oozing mass!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " reduces " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " reduces " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " to a sizzling, oozing mass!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" slayed "))
                    {
                        string temp1  = e.Text.Split(new string[] { " slayed " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " slayed " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" is fatally punctured by "))
                    {
                        string name   = e.Text.Split(new string[] { " is fatally punctured by " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { " is fatally punctured by " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" stops ") && e.Text.Contains(" cold!") && !e.Text.Contains("Your attack "))
                    {
                        string temp1  = e.Text.Split(new string[] { " stops " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " stops " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " cold!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s death is preceded by a sharp, stabbing pain courtesy of "))
                    {
                        string name   = e.Text.Split(new string[] { "'s death is preceded by a sharp, stabbing pain courtesy of " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { "'s death is preceded by a sharp, stabbing pain courtesy of " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains(" cleaves ") && e.Text.Contains(" in twain!"))
                    {
                        string temp1  = e.Text.Split(new string[] { " cleaves " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { " cleaves " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " in twain!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s thunder of crushing ") && e.Text.Contains(" is followed by the deafening silence of death!"))
                    {
                        string temp1  = e.Text.Split(new string[] { "'s thunder of crushing " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { "'s thunder of crushing " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " is followed by the deafening silence of death!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s assault sends ") && e.Text.Contains(" to an icy death!"))
                    {
                        string temp1  = e.Text.Split(new string[] { "'s assault sends " }, StringSplitOptions.None)[1];
                        string killer = e.Text.Split(new string[] { "'s assault sends " }, StringSplitOptions.None)[0];
                        string name   = temp1.Split(new string[] { " to an icy death!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }

                    if (e.Text.Contains("'s perforated corpse falls before ") && !e.Text.Contains("'s perforated corpse falls before you!"))
                    {
                        string name   = e.Text.Split(new string[] { "'s perforated corpse falls before " }, StringSplitOptions.None)[0];
                        string temp1  = e.Text.Split(new string[] { "'s perforated corpse falls before " }, StringSplitOptions.None)[1];
                        string killer = temp1.Split(new string[] { "!" }, StringSplitOptions.None)[0];
                        AddPkObject(name, killer);
                    }
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
Exemple #51
0
 private void a(object A_0, ChatTextInterceptEventArgs A_1)
 {
     try
     {
         if (!this.j)
         {
             TimeSpan span = (TimeSpan)(DateTimeOffset.Now - this.g);
             if (span.TotalSeconds > 2.0)
             {
                 return;
             }
         }
         if (!this.j || (PluginCore.cq.ax.get_Actions().get_CurrentSelection() == this.e))
         {
             if ((this.n != null) && (A_1.get_Color() == 7))
             {
                 Match match = this.b.Match(A_1.get_Text());
                 if (!match.Success)
                 {
                     return;
                 }
                 if (match.Groups["spellname"].Value == this.n.Name)
                 {
                     PluginCore.cq.i.a(this.n, this.e);
                 }
             }
             if (A_1.get_Color() == 0)
             {
                 if (A_1.get_Text().Trim().Equals("Your missile attack hit the environment."))
                 {
                     PluginCore.cq.am.b(this.e);
                 }
             }
             else if ((A_1.get_Color() == 0x16) && this.c.IsMatch(A_1.get_Text()))
             {
                 PluginCore.cq.am.a(this.e);
             }
             if (A_1.get_Color() == 0)
             {
                 for (int i = 0; i < PluginCore.cq.f.c.Count; i++)
                 {
                     Match match2 = PluginCore.cq.f.c[i].Match(A_1.get_Text());
                     if (match2.Success)
                     {
                         A_1.set_Eat(true);
                         if (er.j("EnableLooting"))
                         {
                             PluginCore.cq.n.n.a(ActionLockType.Navigation, TimeSpan.FromSeconds(3.0));
                         }
                         l.f();
                         Group group = match2.Groups["targetname"];
                         if ((((((group == null) || !group.Success) || string.Equals(this.f, group.Value, StringComparison.Ordinal)) && (!dh.a(PluginCore.cq.av.d()) || (PluginCore.cq.n.d(PluginCore.cq.av.d()).k <= 1))) && ((!dh.a(PluginCore.cq.av.e()) || (PluginCore.cq.p.d(PluginCore.cq.av.e()).c() != ObjectClass.MeleeWeapon)) || (PluginCore.cq.n.d(PluginCore.cq.av.d()).k <= 1))) && PluginCore.cq.n.f.ContainsKey(this.e))
                         {
                             PluginCore.cq.n.f[this.e].a = true;
                             PluginCore.PC.f(this.e);
                         }
                         return;
                     }
                 }
             }
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }