public static void Log(Logger logger, string type, Event e, Expressions exp = null)
 {
     var cleaned = String.Format("{0}:{1}", e.ChatLogEntry.Code, e.ChatLogEntry.Line);
     if (exp != null)
     {
         cleaned = String.Format("{0}:{1}", e.Code, exp.Cleaned);
     }
     var data = String.Format("Unknown {0} Line -> [Type:{1}][Subject:{2}][Direction:{3}] {4}", type, e.Type, e.Subject, e.Direction, cleaned);
     Logging.Log(logger, data);
 }
 private static void ProcessDetrimental(Event e, Expressions exp)
 {
     var line = new Line(e.ChatLogEntry)
     {
         EventDirection = e.Direction,
         EventSubject = e.Subject,
         EventType = e.Type
     };
     var detrimental = Regex.Match("ph", @"^\.$");
     if (detrimental.Success)
     {
         return;
     }
     ParsingLogHelper.Log(Logger, "Detrimental", e, exp);
 }
        /// <summary>
        /// </summary>
        /// <param name="e"> </param>
        protected override void HandleEvent(Event e)
        {
            Expressions = new Expressions(e);

            if (String.IsNullOrWhiteSpace(e.ChatLogEntry.Line))
            {
                return;
            }
            switch (e.Type)
            {
                case EventType.Defeats:
                    ProcessDefeated(e);
                    break;
                case EventType.Loot:
                    ProcessLoot(e);
                    break;
                default:
                    //ProcessParty(e);
                    break;
            }
        }
 /// <summary>
 /// </summary>
 /// <param name="source"> </param>
 /// <param name="e"> </param>
 private void FilterUnknownEvent(object source, Event e)
 {
     LastEventReceived = e.Timestamp;
     HandleUnknownEvent(e);
 }
 /// <summary>
 /// </summary>
 /// <param name="source"> </param>
 /// <param name="e"> </param>
 private void FilterEvent(object source, Event e)
 {
     if (!e.MatchesFilter(Filter, e))
     {
         return;
     }
     LastEventReceived = e.Timestamp;
     HandleEvent(e);
 }
        public static void Process(Event e)
        {
            if (!ParseControl.Instance.FirstActionFound)
            {
                switch (Settings.Default.StoreHistoryEvent)
                {
                    case "Any":
                        ParseControl.Instance.Reset();
                        break;
                    case "Damage Only":
                        if (e.Type == EventType.Damage)
                        {
                            ParseControl.Instance.Reset();
                        }
                        break;
                }
            }

            _lastEventYou = _lastEventYou ?? new Event();
            _lastEventPet = _lastEventPet ?? new Event();
            _lastEventParty = _lastEventParty ?? new Event();
            _lastEventPetParty = _lastEventPetParty ?? new Event();
            _lastEventAlliance = _lastEventAlliance ?? new Event();
            _lastEventPetAlliance = _lastEventPetAlliance ?? new Event();

            _type = FilterType.Unknown;

            var expressions = new Expressions(e);

            switch (Settings.Default.StoreHistoryEvent)
            {
                case "Any":
                    ParseControl.Instance.Timeline.StoreHistoryTimer.Stop();
                    break;
                case "Damage Only":
                    if (e.Type == EventType.Damage)
                    {
                        ParseControl.Instance.Timeline.StoreHistoryTimer.Stop();
                    }
                    break;
            }

            switch (e.Type)
            {
                case EventType.Damage:
                case EventType.Cure:
                    ParseControl.Instance.Timeline.FightingRightNow = true;
                    ParseControl.Instance.Timeline.FightingTimer.Stop();
                    break;
            }

            switch (e.Type)
            {
                case EventType.Damage:
                    ProcessDamage(e, expressions);
                    break;
                case EventType.Failed:
                    ProcessFailed(e, expressions);
                    break;
                case EventType.Actions:
                    ProcessActions(e, expressions);
                    break;
                case EventType.Items:
                    ProcessItems(e, expressions);
                    break;
                case EventType.Cure:
                    ProcessCure(e, expressions);
                    break;
                case EventType.Beneficial:
                    ProcessBeneficial(e, expressions);
                    break;
                case EventType.Detrimental:
                    ProcessDetrimental(e, expressions);
                    break;
            }

            switch (_type)
            {
                case FilterType.You:
                    _lastEventYou = e;
                    break;
                case FilterType.Pet:
                    _lastEventPet = e;
                    break;
                case FilterType.Party:
                    _lastEventParty = e;
                    break;
                case FilterType.PetParty:
                    _lastEventPetParty = e;
                    break;
                case FilterType.Alliance:
                    _lastEventAlliance = e;
                    break;
                case FilterType.PetAlliance:
                    _lastEventPetAlliance = e;
                    break;
            }

            switch (Settings.Default.StoreHistoryEvent)
            {
                case "Any":
                    ParseControl.Instance.Timeline.StoreHistoryTimer.Start();
                    break;
                case "Damage Only":
                    if (e.Type == EventType.Damage)
                    {
                        ParseControl.Instance.Timeline.StoreHistoryTimer.Start();
                    }
                    break;
            }

            switch (e.Type)
            {
                case EventType.Damage:
                case EventType.Cure:
                    ParseControl.Instance.Timeline.FightingTimer.Start();
                    break;
            }
        }
 private static void ProcessCure(Event e, Expressions exp)
 {
     var line = new Line(e.ChatLogEntry)
     {
         EventDirection = e.Direction,
         EventSubject = e.Subject,
         EventType = e.Type
     };
     LineHelper.SetTimelineTypes(ref line);
     if (LineHelper.IsIgnored(line))
     {
         return;
     }
     var cure = Regex.Match("ph", @"^\.$");
     switch (e.Subject)
     {
         case EventSubject.You:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     line.Target = You;
                     break;
             }
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = You;
                 UpdateHealing(cure, line, exp, FilterType.You);
             }
             break;
         case EventSubject.Pet:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNamePet;
                 UpdateHealing(cure, line, exp, FilterType.Pet);
             }
             break;
         case EventSubject.Party:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNamePartyHealingFrom;
                 UpdateHealing(cure, line, exp, FilterType.Party);
             }
             break;
         case EventSubject.PetParty:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNamePetPartyHealingFrom;
                 UpdateHealing(cure, line, exp, FilterType.PetParty);
             }
             break;
         case EventSubject.Alliance:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNameAllianceHealingFrom;
                 UpdateHealing(cure, line, exp, FilterType.Alliance);
             }
             break;
         case EventSubject.PetAlliance:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNamePetAllianceHealingFrom;
                 UpdateHealing(cure, line, exp, FilterType.PetAlliance);
             }
             break;
         case EventSubject.Other:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNameOtherHealingFrom;
                 UpdateHealing(cure, line, exp, FilterType.Other);
             }
             break;
         case EventSubject.PetOther:
             cure = exp.pCure;
             if (cure.Success)
             {
                 line.Source = _lastNamePetOtherHealingFrom;
                 UpdateHealing(cure, line, exp, FilterType.PetOther);
             }
             break;
     }
     if (cure.Success)
     {
         return;
     }
     ParsingLogHelper.Log(Logger, "Cure", e, exp);
 }
 /// <summary>
 /// </summary>
 /// <param name="thing"> </param>
 /// <param name="e"></param>
 private void AttachDropToPartyMonster(string thing, Event e)
 {
     var monsterName = ParseControl.Timeline.FightingRightNow ? ParseControl.Timeline.LastEngaged : "";
     if (ParseControl.Instance.Timeline.FightingRightNow)
     {
         Fight fight;
         if (ParseControl.Timeline.Fights.TryGet(ParseControl.Timeline.LastEngaged, out fight))
         {
             monsterName = fight.MonsterName;
             if (monsterName.Replace(" ", "") != "")
             {
                 var monsterGroup = ParseControl.Timeline.GetSetMonster(monsterName);
                 monsterGroup.SetDrop(thing);
             }
         }
     }
     else
     {
         ParsingLogHelper.Log(Logger, "Loot.NoKillInLastThreeSeconds", e);
     }
 }
 /// <summary>
 /// </summary>
 /// <param name="filter"> </param>
 /// <returns> </returns>
 public bool MatchesFilter(UInt64 filter, Event e)
 {
     return (((UInt64) Subject & filter) != 0 && ((UInt64) Type & filter) != 0 && ((UInt64) Direction & filter) != 0);
 }
 public static void Error(Logger logger, string type, Event e, Exception ex)
 {
     var data = String.Format("{0} Error: [{1}] Line -> {2} StackTrace: \n{3}", type, ex.Message, e.ChatLogEntry.Line, ex.StackTrace);
     Logging.Log(logger, data, ex);
 }
 private static void ProcessBeneficial(Event e, Expressions exp)
 {
     var line = new Line(e.ChatLogEntry)
     {
         EventDirection = e.Direction,
         EventSubject = e.Subject,
         EventType = e.Type
     };
     LineHelper.SetTimelineTypes(ref line);
     if (LineHelper.IsIgnored(line))
     {
         return;
     }
     var beneficial = Regex.Match("ph", @"^\.$");
     switch (e.Subject)
     {
         case EventSubject.You:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     line.Target = You;
                     break;
             }
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = You;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.You);
             }
             break;
         case EventSubject.Pet:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNamePet;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.Pet);
             }
             break;
         case EventSubject.Party:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNamePartyFrom;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.Party);
             }
             break;
         case EventSubject.PetParty:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNamePetPartyFrom;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.PetParty);
             }
             break;
         case EventSubject.Alliance:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNameAllianceFrom;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.Alliance);
             }
             break;
         case EventSubject.PetAlliance:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNamePetAllianceFrom;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.PetAlliance);
             }
             break;
         case EventSubject.Other:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNameOtherFrom;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.Other);
             }
             break;
         case EventSubject.PetOther:
             beneficial = exp.pBeneficialGain;
             if (beneficial.Success)
             {
                 line.Source = _lastNamePetOtherFrom;
                 UpdateBeneficialGain(beneficial, line, exp, FilterType.PetOther);
             }
             break;
     }
     if (beneficial.Success)
     {
         return;
     }
     ParsingLogHelper.Log(Logger, "Beneficial", e, exp);
 }
 private static void ProcessFailed(Event e, Expressions exp)
 {
     var line = new Line(e.ChatLogEntry)
     {
         EventDirection = e.Direction,
         EventSubject = e.Subject,
         EventType = e.Type
     };
     LineHelper.SetTimelineTypes(ref line);
     if (LineHelper.IsIgnored(line))
     {
         return;
     }
     var failed = Regex.Match("ph", @"^\.$");
     switch (e.Subject)
     {
         case EventSubject.You:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = You;
                             UpdateFailed(failed, line, exp, FilterType.You);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 line.Source = You;
                                 UpdateFailed(failed, line, exp, FilterType.You);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Pet:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNamePet;
                             UpdateFailed(failed, line, exp, FilterType.Pet);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.Pet);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Party:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNamePartyFrom;
                             UpdateFailed(failed, line, exp, FilterType.Party);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.Party);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.PetParty:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNamePetPartyFrom;
                             UpdateFailed(failed, line, exp, FilterType.PetParty);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.PetParty);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Alliance:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameAllianceFrom;
                             UpdateFailed(failed, line, exp, FilterType.Alliance);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.Alliance);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.PetAlliance:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNamePetAllianceFrom;
                             UpdateFailed(failed, line, exp, FilterType.PetAlliance);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.PetAlliance);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Other:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameOtherFrom;
                             UpdateFailed(failed, line, exp, FilterType.Other);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.Other);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.PetOther:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     failed = exp.pFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNamePetOtherFrom;
                             UpdateFailed(failed, line, exp, FilterType.PetOther);
                             break;
                         case false:
                             failed = exp.pFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailed(failed, line, exp, FilterType.PetOther);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Engaged:
         case EventSubject.UnEngaged:
             switch (e.Direction)
             {
                 case EventDirection.You:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = You;
                             UpdateFailedMonster(failed, line, exp, FilterType.You);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 line.Target = You;
                                 UpdateFailedMonster(failed, line, exp, FilterType.You);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Pet:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePet;
                             UpdateFailedMonster(failed, line, exp, FilterType.Pet);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.Pet);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Party:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePartyTo;
                             UpdateFailedMonster(failed, line, exp, FilterType.Party);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.Party);
                             }
                             break;
                     }
                     break;
                 case EventDirection.PetParty:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePetPartyTo;
                             UpdateFailedMonster(failed, line, exp, FilterType.PetParty);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.PetParty);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Alliance:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNameAllianceTo;
                             UpdateFailedMonster(failed, line, exp, FilterType.Alliance);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.Alliance);
                             }
                             break;
                     }
                     break;
                 case EventDirection.PetAlliance:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePetAllianceTo;
                             UpdateFailedMonster(failed, line, exp, FilterType.PetAlliance);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.PetAlliance);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Other:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNameOtherTo;
                             UpdateFailedMonster(failed, line, exp, FilterType.Other);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.Other);
                             }
                             break;
                     }
                     break;
                 case EventDirection.PetOther:
                     failed = exp.mFailed;
                     switch (failed.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePetOtherTo;
                             UpdateFailedMonster(failed, line, exp, FilterType.PetOther);
                             break;
                         case false:
                             failed = exp.mFailedAuto;
                             if (failed.Success)
                             {
                                 UpdateFailedMonster(failed, line, exp, FilterType.PetOther);
                             }
                             break;
                     }
                     break;
             }
             break;
     }
     if (failed.Success)
     {
         return;
     }
     ParsingLogHelper.Log(Logger, "Failed", e, exp);
 }
 /// <summary>
 /// </summary>
 private void ProcessDefeated(Event e)
 {
     Match matches;
     var you = Constants.CharacterName;
     switch (Constants.GameLanguage)
     {
         case "French":
             matches = PlayerRegEx.DefeatsFr.Match(e.ChatLogEntry.Line);
             break;
         case "Japanese":
             matches = PlayerRegEx.DefeatsJa.Match(e.ChatLogEntry.Line);
             break;
         case "German":
             matches = PlayerRegEx.DefeatsDe.Match(e.ChatLogEntry.Line);
             break;
         case "Chinese":
             matches = PlayerRegEx.DefeatsZh.Match(e.ChatLogEntry.Line);
             break;
         default:
             matches = PlayerRegEx.DefeatsEn.Match(e.ChatLogEntry.Line);
             break;
     }
     if (!matches.Success)
     {
         ParseControl.Timeline.PublishTimelineEvent(TimelineEventType.PartyMonsterKilled, "");
         ParsingLogHelper.Log(Logger, "Defeat", e);
         return;
     }
     var target = matches.Groups["target"];
     var source = matches.Groups["source"];
     if (!target.Success)
     {
         return;
     }
     if (ParseControl.Timeline.Party.HasGroup(target.Value) || Regex.IsMatch(target.Value, Expressions.You) || target.Value == you)
     {
         return;
     }
     var targetName = StringHelper.TitleCase(target.Value);
     var sourceName = StringHelper.TitleCase(source.Success ? source.Value : "Unknown");
     AddKillToPartyMonster(targetName, sourceName);
 }
 protected override void HandleUnknownEvent(Event e)
 {
     ParsingLogHelper.Log(Logger, "UnknownEvent", e);
 }
 /// <summary>
 /// </summary>
 /// <param name="e"> </param>
 protected virtual void HandleEvent(Event e)
 {
 }
 public Expressions(Event e)
 {
     Event = e;
     Cleaned = e.ChatLogEntry == null ? "" : e.ChatLogEntry.Line;
     Initialize();
 }
 /// <summary>
 /// </summary>
 /// <param name="e"> </param>
 protected virtual void HandleUnknownEvent(Event e)
 {
 }
 private static void ProcessDamage(Event e, Expressions exp)
 {
     var line = new Line(e.ChatLogEntry)
     {
         EventDirection = e.Direction,
         EventSubject = e.Subject,
         EventType = e.Type
     };
     LineHelper.SetTimelineTypes(ref line);
     if (LineHelper.IsIgnored(line))
     {
         return;
     }
     var damage = Regex.Match("ph", @"^\.$");
     switch (e.Subject)
     {
         case EventSubject.You:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = You;
                             UpdateDamage(damage, line, exp, FilterType.You);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionYouIsAttack = true;
                                 line.Source = You;
                                 UpdateDamage(damage, line, exp, FilterType.You);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Pet:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNamePet;
                             UpdateDamage(damage, line, exp, FilterType.Pet);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.Pet);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Party:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNamePartyFrom;
                             UpdateDamage(damage, line, exp, FilterType.Party);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPartyIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.Party);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.PetParty:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNamePetPartyFrom;
                             UpdateDamage(damage, line, exp, FilterType.PetParty);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetPartyIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.PetParty);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Alliance:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameAllianceFrom;
                             UpdateDamage(damage, line, exp, FilterType.Alliance);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionAllianceIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.Alliance);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.PetAlliance:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNamePetAllianceFrom;
                             UpdateDamage(damage, line, exp, FilterType.PetAlliance);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetAllianceIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.PetAlliance);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Other:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameOtherFrom;
                             UpdateDamage(damage, line, exp, FilterType.Other);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionOtherIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.Other);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.PetOther:
             switch (e.Direction)
             {
                 case EventDirection.Engaged:
                 case EventDirection.UnEngaged:
                     damage = exp.pDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNamePetOtherFrom;
                             UpdateDamage(damage, line, exp, FilterType.PetOther);
                             break;
                         case false:
                             damage = exp.pDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetOtherIsAttack = true;
                                 UpdateDamage(damage, line, exp, FilterType.PetOther);
                             }
                             break;
                     }
                     break;
             }
             break;
         case EventSubject.Engaged:
         case EventSubject.UnEngaged:
             switch (e.Direction)
             {
                 case EventDirection.You:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = You;
                             UpdateDamageMonster(damage, line, exp, FilterType.You);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionYouIsAttack = true;
                                 line.Target = You;
                                 UpdateDamageMonster(damage, line, exp, FilterType.You);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Pet:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePet;
                             UpdateDamageMonster(damage, line, exp, FilterType.Pet);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.Pet);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Party:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePartyTo;
                             UpdateDamageMonster(damage, line, exp, FilterType.Party);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPartyIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.Party);
                             }
                             break;
                     }
                     break;
                 case EventDirection.PetParty:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePetPartyTo;
                             UpdateDamageMonster(damage, line, exp, FilterType.PetParty);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetPartyIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.PetParty);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Alliance:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNameAllianceTo;
                             UpdateDamageMonster(damage, line, exp, FilterType.Alliance);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionAllianceIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.Alliance);
                             }
                             break;
                     }
                     break;
                 case EventDirection.PetAlliance:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePetAllianceTo;
                             UpdateDamageMonster(damage, line, exp, FilterType.PetAlliance);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetAllianceIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.PetAlliance);
                             }
                             break;
                     }
                     break;
                 case EventDirection.Other:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNameOtherTo;
                             UpdateDamageMonster(damage, line, exp, FilterType.Other);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionOtherIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.Other);
                             }
                             break;
                     }
                     break;
                 case EventDirection.PetOther:
                     damage = exp.mDamage;
                     switch (damage.Success)
                     {
                         case true:
                             line.Source = _lastNameMonster;
                             line.Target = _lastNamePetOtherTo;
                             UpdateDamageMonster(damage, line, exp, FilterType.PetOther);
                             break;
                         case false:
                             damage = exp.mDamageAuto;
                             if (damage.Success)
                             {
                                 _lastActionPetOtherIsAttack = true;
                                 UpdateDamageMonster(damage, line, exp, FilterType.PetOther);
                             }
                             break;
                     }
                     break;
             }
             break;
     }
     if (damage.Success)
     {
         return;
     }
     ParsingLogHelper.Log(Logger, "Damage", e, exp);
 }
 private static void ProcessItems(Event e, Expressions exp)
 {
     var line = new Line(e.ChatLogEntry)
     {
         EventDirection = e.Direction,
         EventSubject = e.Subject,
         EventType = e.Type
     };
     LineHelper.SetTimelineTypes(ref line);
     if (LineHelper.IsIgnored(line))
     {
         return;
     }
     var items = Regex.Match("ph", @"^\.$");
     switch (e.Subject)
     {
         case EventSubject.You:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = You;
                         _lastActionYou = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                         UpdateItems(items, line, exp, FilterType.You);
                     }
                     break;
             }
             break;
         case EventSubject.Pet:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNamePet = line.Source;
                         _lastActionPet = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                     }
                     break;
             }
             break;
         case EventSubject.Party:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNamePartyFrom = line.Source;
                         _lastActionPartyFrom = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                         UpdateItems(items, line, exp, FilterType.Party);
                     }
                     break;
             }
             break;
         case EventSubject.PetParty:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNamePetPartyFrom = line.Source;
                         _lastActionPet = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                     }
                     break;
             }
             break;
         case EventSubject.Alliance:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNameAllianceFrom = line.Source;
                         _lastActionAllianceFrom = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                         UpdateItems(items, line, exp, FilterType.Alliance);
                     }
                     break;
             }
             break;
         case EventSubject.PetAlliance:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNamePetAllianceFrom = line.Source;
                         _lastActionPet = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                     }
                     break;
             }
             break;
         case EventSubject.Other:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNameOtherFrom = line.Source;
                         _lastActionOtherFrom = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                         UpdateItems(items, line, exp, FilterType.Other);
                     }
                     break;
             }
             break;
         case EventSubject.PetOther:
             switch (e.Direction)
             {
                 case EventDirection.Self:
                     items = exp.pItems;
                     if (items.Success)
                     {
                         line.Source = Convert.ToString(items.Groups["source"].Value);
                         _lastNamePetOtherFrom = line.Source;
                         _lastActionPet = StringHelper.TitleCase(Convert.ToString(items.Groups["item"].Value));
                     }
                     break;
             }
             break;
         case EventSubject.Engaged:
         case EventSubject.UnEngaged:
             break;
     }
     if (items.Success)
     {
         return;
     }
     ParsingLogHelper.Log(Logger, "Item", e, exp);
 }
 /// <summary>
 /// </summary>
 private void ProcessLoot(Event e)
 {
     Match matches;
     switch (Constants.GameLanguage)
     {
         case "French":
             matches = PlayerRegEx.ObtainsFr.Match(e.ChatLogEntry.Line);
             break;
         case "Japanese":
             matches = PlayerRegEx.ObtainsJa.Match(e.ChatLogEntry.Line);
             break;
         case "German":
             matches = PlayerRegEx.ObtainsDe.Match(e.ChatLogEntry.Line);
             break;
         case "Chinese":
             matches = PlayerRegEx.ObtainsZh.Match(e.ChatLogEntry.Line);
             break;
         default:
             matches = PlayerRegEx.ObtainsEn.Match(e.ChatLogEntry.Line);
             break;
     }
     if (!matches.Success)
     {
         ParsingLogHelper.Log(Logger, "Loot", e);
         return;
     }
     var thing = StringHelper.TitleCase(matches.Groups["item"].Value);
     AttachDropToPartyMonster(thing, e);
 }