Ejemplo n.º 1
0
        public static bool ParseNonMeleeType(LogLineEventArgs logInfo)
        {
            Match m = RegexCache.NonMeleeType.Match(logInfo.logLine);

            if (m.Success)
            {
                string actor = m.Groups["actorname"].Success ? TranslateName(m.Groups["actorname"].Value) : "";
                string skill = m.Groups["skillname"].Success ? CleanupSkill(m.Groups["skillname"].Value) : "";

                if (!string.IsNullOrWhiteSpace(actor) && !string.IsNullOrWhiteSpace(skill))
                {
                    if (_LastNonMeleeSkillused.ContainsKey(actor))
                    {
                        _LastNonMeleeSkillused[actor] = skill;
                    }
                    else
                    {
                        _LastNonMeleeSkillused.AddOrUpdate(actor, skill, (key, oldValue) => skill);
                    }
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
 private void source_LinesAdded(object sender, LogLineEventArgs args)
 {
     if (m_firstSeen == null)
     {
         m_firstSeen = args.Line;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// キャストログを格納する
        /// </summary>
        /// <param name="logInfo">ログ情報</param>
        private void StoreCastStartsUsingLog(
            LogLineEventArgs logInfo)
        {
            var match = ConstantKeywords.StartsUsingRegex.Match(logInfo.logLine);

            if (!match.Success)
            {
                return;
            }

            var log = new CombatLog()
            {
                TimeStamp = logInfo.detectedTime,
                Raw       = logInfo.logLine,
                Actor     = match.Groups["actor"].ToString(),
                Activity  = $"starts using {match.Groups["skill"].ToString()}",
                Skill     = match.Groups["skill"].ToString(),
                LogType   = LogTypes.CastStart
            };

            log.Text        = log.Skill;
            log.SyncKeyword = log.RawWithoutTimestamp.Substring(6);

            if (this.ToStoreActor(log.Actor))
            {
                this.StoreLog(log);
            }
        }
Ejemplo n.º 4
0
        public static bool ParseDeath(LogLineEventArgs logInfo)
        {
            Match m = RegexCache.Death.Match(logInfo.logLine);

            if (!m.Success)
            {
                m = RegexCache.Death2.Match(logInfo.logLine);
            }
            if (m.Success)
            {
                string actor     = m.Groups["actorname"].Success ? TranslateName(m.Groups["actorname"].Value) : "";
                string target    = m.Groups["targetname"].Success ? m.Groups["targetname"].Value : "";
                string skillname = "Killing";

                MasterSwing ms = new MasterSwing((int)SwingTypeEnum.Melee, false, Dnum.Death, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, skillname, actor, "", target);

                // only log death if currently in combat.
                if (ActGlobals.oFormActMain.InCombat)
                {
                    if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, actor, target))
                    {
                        ActGlobals.oFormActMain.AddCombatAction(ms);
                    }
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 戦闘(分析)を開始する
        /// </summary>
        /// <param name="logLine">
        /// 対象のログ行</param>
        private void StartCombat(
            LogLineEventArgs logLine = null)
        {
            lock (this.CurrentCombatLogList)
            {
                if (!this.inCombat)
                {
                    if (!this.isImporting)
                    {
                        this.CurrentCombatLogList.Clear();
                        this.ActorHPRate.Clear();
                        this.partyNames = null;
                        this.combatants = null;
                        this.no         = 1;
                    }

                    Logger.Write("Start Combat");

                    // 自分の座標をダンプする
                    LogBuffer.DumpPosition(true);
                }

                this.inCombat = true;
            }

            this.StoreStartCombat(logLine);
        }
Ejemplo n.º 6
0
        private void OnCastEnded(bool _, LogLineEventArgs logInfo)
        {
            if (state != States.In905P)
            {
                return;
            }
            string log = logInfo.logLine;
            Match  m   = OnCast2.Match(log);

            if (m.Success)
            {
                lock (lock1)
                {
                    uint id = Convert.ToUInt32(m.Groups[1].Value, 16);
                    if (map.ContainsKey(id))
                    {
                        int index = map[id];
                        Pod pod   = pods[index];
                        if (pod.isActive)
                        {
                            pod.isActive = false;
                            count--;
                            PlaceKupo.Log("辅助机" + id.ToString("X") + "已施放" + (pod.isLaser ? "激光。" : "重锤。"));
                        }
                    }
                    if (count == 0)
                    {
                        PlaceKupo.WriteWaymark(Preset.Reset);
                        PlaceKupo.Log("场地标点已重置。");
                    }
                }
            }
        }
 private void source_LinesAdded(object sender, LogLineEventArgs args)
 {
     lock (m_sync)
     {
         if (!m_updating)
         {
             m_updating = true;
             m_received = args.Line;
             m_syncContext.Post(o =>
             {
                 if (m_firstSeen == null)
                 {
                     m_firstSeen   = m_received;
                     m_lastHandled = m_firstSeen;
                     LogEntries.Add(new LogEntryViewModel(m_lastHandled, m_zeroTime));
                 }
                 LogLineData next;
                 while (true)
                 {
                     lock (m_sync)
                     {
                         next = m_lastHandled.Next;
                         if (next == null)
                         {
                             m_updating = false;
                             return;
                         }
                     }
                     LogEntries.Add(new LogEntryViewModel(m_lastHandled, m_zeroTime));
                     m_lastHandled = next;
                 }
             }, null);
         }
     }
 }
Ejemplo n.º 8
0
        //void Countdown(bool _, LogLineEventArgs logInfo)
        //{
        //    string log = logInfo.logLine;
        //    if (Regex.IsMatch(log, ".{14} 00:0044:905P:装备重型陆战装置[::]安装通信官21O自我数据! 强行连接自卫系统!"))
        //    {
        //        System.Threading.Thread.Sleep(2000);
        //        PlaceKupo.SendCommand("/e countdown 30");
        //    }
        //}

        private void OnCombatantAdded(bool _, LogLineEventArgs logInfo)
        {
            if (state != States.In905P)
            {
                return;
            }
            string log = logInfo.logLine;
            Match  m   = OnAdded.Match(log);

            if (m.Success)
            {
                Pod pod = new Pod
                {
                    Id = Convert.ToUInt32(m.Groups[1].Value, 16)
                };
                float x = float.Parse(m.Groups[2].Value);
                float y = float.Parse(m.Groups[4].Value);
                float z = float.Parse(m.Groups[3].Value);
                pod.Loc      = new Point(x, y, z);
                pod.isActive = false;
                int index = GetLoc(pod);
                pods[index] = pod;
                map.Add(pod.Id, index);
                PlaceKupo.Log("已添加辅助机: " + pod.Id.ToString("X") + ", 位置: " + pod.Loc.ToString() + ", 编号: " + index);
            }
        }
        private void LogInsertBtn_Click(object sender, EventArgs e)
        {
            LogLineEventArgs args = new LogLineEventArgs(logLineBox.Text, 0, DateTime.Now, string.Empty, true);

            OFormActMain_OnLogLineRead(false, args);
            OFormActMain_BeforeLogLineRead(false, args);
        }
Ejemplo n.º 10
0
        void OFormActMain_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport && !sessionStart)
            {
                return;
            }
            string tlogline = logInfo.logLine;
            Match  match    = Regex.Match(tlogline, "^.{14} 00:.{4}:(?<Player>.*?)获得了“(?<ItemName>.*?)(?”)×(?<ItemNum>.*?)。$");

            if (match.Success)
            {
                for (int itemIndex = 0; itemIndex < ItemList.Items.Count; itemIndex++)
                {
                    if (ItemList.GetItemChecked(itemIndex) && match.Groups[1] == ItemList.Items[itemIndex])
                    {
                        ItemCount.Items[itemIndex] += match.Groups[2].Value;
                    }
                }
            }
            match = Regex.Match(tlogline, "^.{14} 01:Changed Zone to 梦羽宝境.$");
            if (match.Success)
            {
                for (int itemIndex = 0; itemIndex < ItemList.Items.Count; itemIndex++)
                {
                    if (ItemList.GetItemChecked(itemIndex) && match.Groups[1] == ItemList.Items[itemIndex])
                    {
                        ItemCount.Items[itemIndex] += match.Groups[2].Value;
                    }
                }
            }
        }
Ejemplo n.º 11
0
 protected virtual void OnLogLine(LogLineEventArgs e)
 {
     if (LogLine != null)
     {
         LogLine(this, e);
     }
 }
Ejemplo n.º 12
0
        //Function called for each log line
        private void OnLogLineReadHandler(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport)
            {
                return;
            }

            //RegexOptions for a third argument to include things like caseless etc.
            Match match = Regex.Match(logInfo.logLine, "SymsFrigde.eXXMG86jeDLPmjo27rQi");

            if (match.Success)
            {
                DoUpdate();
                return;
            }

            foreach (Trigger t in triggers)
            {
                match = Regex.Match(logInfo.logLine, t.regex);
                if (match.Success)
                {
                    t.reaction(match);
                }
            }
        }
Ejemplo n.º 13
0
        private void OnLogLineRead(
            bool isImport,
            LogLineEventArgs logInfo)
        {
            if (string.IsNullOrEmpty(Config.Instance.OutputDirectory) &&
                !Config.Instance.IsEnabledRecording &&
                !Config.Instance.IsShowTitleCard)
            {
                return;
            }

            var xivlog = new XIVLog(isImport, logInfo);

            if (string.IsNullOrEmpty(xivlog.Log))
            {
                return;
            }

            LogQueue.Enqueue(xivlog);

            if (!isImport)
            {
                this.OpenXIVLogAsync(logInfo.logLine);
                VideoCapture.Instance.DetectCapture(xivlog);
            }
        }
Ejemplo n.º 14
0
        private void OnLogWatcherOnOnNewLine(object sender, LogLineEventArgs args)
        {
            var lines     = args.Lines.Select(x => x.Line).ToList();
            var invokeEnd = false;

            foreach (var line in lines)
            {
                if (_gameState == GameState.InMenu && line.Contains("CREATE_GAME"))
                {
                    _powerLog.Clear();
                    OnGameStart?.Invoke(this, new LogGameStartEventArgs());
                    _gameState = GameState.Playing;
                }
                else if (_gameState == GameState.Playing && line.Contains("tag=STATE value=COMPLETE"))
                {
                    invokeEnd  = true;
                    _gameState = GameState.InMenu;
                }
            }
            _powerLog.AddRange(lines);
            if (invokeEnd)
            {
                OnGameEnd?.Invoke(this, new LogGameEndEventArgs(_powerLog));
            }
        }
Ejemplo n.º 15
0
        private void LogLineReader(bool isImported, LogLineEventArgs e)
        {
            string[] d = e.logLine.Split('|');

            if (d == null || d.Length < 2) // DataErr0r: null or 1-section
            {
                return;
            }

            MessageType type = (MessageType)Convert.ToInt32(d[0]);

            switch (type)
            {
            case MessageType.LogLine:
                if (d.Length < 5)     // Invalid
                {
                    break;
                }
                int logType = Convert.ToInt32(d[2], 16);

                if (logType == 56)     // type:echo
                {
                    sendEchoEvent(isImported, "echo", d[4]);
                }
                break;
            }
        }
        private void LogLineReader(bool isImported, LogLineEventArgs e)
        {
            if (isImported)
            {
                return;
            }
            try
            {
                string[] chunk = e.logLine.Split(new[] { '|' });

                if (chunk.Length < 3) // DataErr0r
                {
                    return;
                }

                if (this.Overlay != null &&
                    this.Overlay.Renderer != null &&
                    this.Overlay.Renderer.Browser != null)
                {
                    JObject message = new JObject();
                    message["opcode"]    = Convert.ToInt32(chunk[0]);
                    message["timestamp"] = chunk[1];
                    message["payload"]   = JArray.FromObject(chunk.Skip(2));
                    this.Overlay.Renderer.ExecuteScript(
                        "document.dispatchEvent(new CustomEvent('onLogLine', { detail: " + message.ToString() + " } ));"
                        );
                }
            }
            catch { }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// セリフを格納する
        /// </summary>
        /// <param name="logInfo">ログ情報</param>
        private void StoreDialog(
            LogLineEventArgs logInfo)
        {
            var match = ConstantKeywords.DialogRegex.Match(logInfo.logLine);

            if (!match.Success)
            {
                return;
            }

            var dialog = match.Groups["dialog"].ToString();

            var isSystem = logInfo.logLine.Contains(":0839");

            var log = new CombatLog()
            {
                TimeStamp = logInfo.detectedTime,
                Raw       = logInfo.logLine,
                Actor     = string.Empty,
                Activity  = isSystem ? "System" : "Dialog",
                LogType   = LogTypes.Dialog
            };

            log.Text        = null;
            log.SyncKeyword = log.RawWithoutTimestamp.Substring(8);

            this.StoreLog(log);
        }
Ejemplo n.º 18
0
        public static void ParseData(bool isImport, LogLineEventArgs e)
        {
            string[] data = e.logLine.Split('|');
            if (data.Length < 2 || data == null)
            {
                return;
            }
            switch ((MessageType)Convert.ToInt32(data[0]))
            {
            case MessageType.ChangePrimaryPlayer:
                if (data.Length < 4)
                {
                    return;
                }

                currentPlayerName = data[3];
                break;

            case MessageType.ChangeZone:
                if (data.Length < 3)
                {
                    return;
                }

                currentZone = Convert.ToInt32(data[2], 16);
                break;
            }
        }
Ejemplo n.º 19
0
        private void OnBeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            try
            {
                if (isImport)
                {
                    return;
                }
#if DEBUG
                Log.Trace(logInfo.logLine);
#endif

                var logLine = logInfo.logLine;
                if (RunState == null)
                {
                    foreach (var potentialRunKey in _runDataLoader.RunData.Keys)
                    {
                        if (TryStartRun(potentialRunKey, logLine))
                        {
                            break;
                        }
                    }
                }
                else
                {
                    TryHitCheckpoint(logLine);
                }
            }
            catch (Exception e)
            {
                Log.Error(e.ToString());
                _actHook.SetPluginStatusError(e.ToString());
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Addedのログを格納する
        /// </summary>
        /// <param name="logInfo">ログ情報</param>
        private void StoreAddedLog(
            LogLineEventArgs logInfo)
        {
            var match = ConstantKeywords.AddedRegex.Match(logInfo.logLine);

            if (!match.Success)
            {
                return;
            }

            var log = new CombatLog()
            {
                TimeStamp = logInfo.detectedTime,
                Raw       = logInfo.logLine,
                Actor     = match.Groups["actor"].ToString(),
                Activity  = $"Added",
                LogType   = LogTypes.Added,
            };

            log.Text        = $"Add {log.Actor}";
            log.SyncKeyword = log.RawWithoutTimestamp.Substring(0, log.RawWithoutTimestamp.IndexOf('.'));

            if (this.ToStoreActor(log.Actor))
            {
                this.StoreLog(log);
            }
        }
Ejemplo n.º 21
0
        public static bool ParseDoTTick(LogLineEventArgs logInfo)
        {
            Match m = RegexCache.DamageDoTTick.Match(logInfo.logLine);

            if (!m.Success)
            {
                return(false);
            }

            string actor = m.Groups["actorname"].Success ? TranslateName(m.Groups["actorname"].Value) :
                           m.Groups["actorname2"].Success ? TranslateName(m.Groups["actorname2"].Value) : "";
            string target    = m.Groups["targetname"].Success ? TranslateName(m.Groups["targetname"].Value) : "";
            string amount    = m.Groups["amount"].Success ? m.Groups["amount"].Value : "";
            string skillname = CleanupSkill(m.Groups["type"].Success ? m.Groups["type"].Value :
                                            m.Groups["type2"].Success ? m.Groups["type2"].Value :
                                            m.Groups["type3"].Success ? m.Groups["type3"].Value :
                                            m.Groups["type4"].Success ? m.Groups["type4"].Value : "");

            if (string.IsNullOrWhiteSpace(actor))
            {
                actor = "unknown";
            }

            MasterSwing ms = new MasterSwing((int)SwingTypeEnum.NonMelee, false, int.Parse(amount), logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, skillname, actor, "", target);

            if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, actor, target))
            {
                ActGlobals.oFormActMain.AddCombatAction(ms);
            }

            return(true);
        }
Ejemplo n.º 22
0
        private void act_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport || timeline == null)
            {
                return;
            }

            string line = logInfo.logLine;

            TimelineAnchor anchor = timeline.FindAnchorMatchingLogline(CurrentTime, logInfo.logLine);

            if (anchor != null)
            {
                if (anchor.Jump == 0)
                {
                    CurrentTime = 0;
                    Paused      = true;
                }
                else
                {
                    CurrentTime = anchor.Jump > 0 ? anchor.Jump : anchor.TimeFromStart;
                    Paused      = false;
                }
            }
        }
        private void OFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            var data = logInfo.logLine.Split('|');

            if (data.Length > 1)
            {
                switch ((MessageType)int.Parse(data[0]))
                {
                case MessageType.ChangePrimaryPlayer:
                    if (data.Length < 4)
                    {
                        return;
                    }
                    CurrentUserName = data[3];
                    break;

                case MessageType.ChangeZone:
                    if (data.Length < 3)
                    {
                        return;
                    }
                    CurrentZoneCode = Convert.ToInt32(data[2], 16);
                    break;
                }
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// OnLogLineRead
        /// </summary>
        /// <param name="isImport">Importか?</param>
        /// <param name="logInfo">ログ情報</param>
        /// <remarks>
        /// FFXIVプラグインが加工した後のログが通知されるイベント</remarks>
        private void OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
#if !DEBUG
            if (isImport)
            {
                return;
            }
#endif
            // 18文字以下のログは読み捨てる
            // なぜならば、タイムスタンプ+ログタイプのみのログだから
            if (logInfo.logLine.Length <= 18)
            {
                return;
            }

            this.logInfoQueue.Enqueue(logInfo);

            // 最初のログならば動作ログに出力する
            if (!this.firstLogArrived)
            {
                Logger.Write("First log has arrived.");
            }

            this.firstLogArrived = true;
        }
Ejemplo n.º 25
0
        /// <summary>
        /// マーカーログを格納する
        /// </summary>
        /// <param name="logInfo">ログ情報</param>
        private void StoreMarkerLog(
            LogLineEventArgs logInfo)
        {
            const string PCIDPlaceholder = "(?<pcid>.{8})";

            var log = default(CombatLog);

            var match = ConstantKeywords.MarkerRegex.Match(logInfo.logLine);

            if (match.Success)
            {
                // ログなしマーカ
                var id            = match.Groups["id"].ToString();
                var target        = match.Groups["target"].ToString();
                var targetJobName = this.ToNameToJob(target);

                log = new CombatLog()
                {
                    TimeStamp = logInfo.detectedTime,
                    Raw       = logInfo.logLine
                                .Replace(id, PCIDPlaceholder)
                                .Replace(target, targetJobName),
                    Activity = $"Marker:{match.Groups["type"].ToString()}",
                    LogType  = LogTypes.Marker
                };
            }
            else
            {
                // マーキング
                match = ConstantKeywords.MarkingRegex.Match(logInfo.logLine);
                if (!match.Success)
                {
                    return;
                }

                var target        = match.Groups["target"].ToString();
                var targetJobName = this.ToNameToJob(target);

                log = new CombatLog()
                {
                    TimeStamp = logInfo.detectedTime,
                    Raw       = logInfo.logLine
                                .Replace(target, targetJobName),
                    Activity = $"Marking",
                    LogType  = LogTypes.Marker
                };
            }

            if (log != null)
            {
                log.Text        = log.Activity;
                log.SyncKeyword = log.RawWithoutTimestamp;

                if (this.ToStoreActor(log.Actor))
                {
                    this.StoreLog(log);
                }
            }
        }
 private void OnLogLineRead(bool isImport, LogLineEventArgs args)
 {
     log_lines_semaphore_.Wait();
     if (!isImport)
     {
         log_lines_.Add(args.logLine);
     }
     log_lines_semaphore_.Release();
 }
Ejemplo n.º 27
0
        public XIVLog(LogLineEventArgs logInfo)
        {
            if (logInfo == null ||
                string.IsNullOrEmpty(logInfo.logLine))
            {
                return;
            }

            this.LogInfo = logInfo;

            // ログの書式の例

            /*
             * [08:20:19.383] 00:0000:clear stacks of Loading....
             */

            var line = this.LogInfo.logLine;

            // 18文字未満のログは書式エラーになるため無視する
            if (line.Length < 18)
            {
                return;
            }

            var timeString = line.Substring(1, 12);

            var      timestampString = DateTime.Now.ToString("yyyy-MM-dd") + " " + timeString;
            DateTime d;

            if (DateTime.TryParse(timestampString, out d))
            {
                this.Timestamp = d;
            }
            else
            {
                // タイムスタンプ書式が不正なものは無視する
                return;
            }

            this.LogType  = line.Substring(15, 2);
            this.Log      = line.Substring(15);
            this.Log      = this.Log.Substring(this.Log.LastIndexOf(":") + 1);
            this.ZoneName = !string.IsNullOrEmpty(logInfo.detectedZone) ?
                            logInfo.detectedZone :
                            "NO DATA";

            if (currentNo >= int.MaxValue)
            {
                currentNo = 0;
            }

            currentNo++;
            this.No = currentNo;

            this.Log = RemoveTooltipSymbols(this.Log);
            //this.Log = new Util().RemoveUnicode(this.Log);
        }
Ejemplo n.º 28
0
 private void OnLogLineRead(bool isImport, LogLineEventArgs args) {
   // isImport happens when somebody is importing old encounters and all the log lines are processed.
   // Don't need to send all of these to the overlay.
   if (isImport)
     return;
   log_lines_semaphore_.Wait();
   log_lines_.Add(args.logLine);
   log_lines_semaphore_.Release();
 }
Ejemplo n.º 29
0
        /// <summary>
        /// ログを一行読取った
        /// </summary>
        /// <param name="isImport">Importか?</param>
        /// <param name="logInfo">ログ情報</param>
        private void oFormActMain_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport)
            {
                return;
            }

            logInfoQueue.Enqueue(logInfo);
        }
Ejemplo n.º 30
0
 /// <summary>
 /// ACT BeforeLogLineRead Event getting Change Primary Player Name
 /// </summary>
 /// <param name="isImport"></param>
 /// <param name="logInfo"></param>
 private void BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
 {
     if (logInfo.logLine.IndexOf("02:Changed") > -1)
     {
         primaryUser            = logInfo.logLine;
         primaryUser            = primaryUser.Replace("02:Changed primary player to ", "").Replace(".", "");
         PluginMain.PrimaryUser = primaryUser = primaryUser.Substring(primaryUser.IndexOf("]") + 2);
     }
 }
Ejemplo n.º 31
0
        private void ParserServiceOnItemAdded(object sender, LogLineEventArgs e)
        {
            if (_settingsService.Settings.EnableCombatClear && e.EventDetail == "ExitCombat")
            {
                Application.Current.Dispatcher.Invoke(() => LogLines.Clear());
                return;
            }

            if (e.Ability.Trim() == string.Empty)
            {
                _loggerService.Log($"{e.Id} was empty.");
            };

            Application.Current.Dispatcher.Invoke(() => AddItem(e));
        }
        private void ProcessCombat(LogLineEventArgs logInfo, CombatEvent ce)
        {
            ce = FixNames(ce);

            switch (ce.type)
            {
                case CombatEvent.Type.Damage:
                    logInfo.detectedType = Color.Red.ToArgb();

                    if (ce.actionResult == CombatEvent.ActionResult.ACTION_RESULT_FALL_DAMAGE)
                    {
                        // Falling damage does not start combat.
                        if (!ActGlobals.oFormActMain.InCombat) return;

                        // TODO:  Need to test falling damage.
                    }

                    if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                    {
                        // TODO get the ability that triggers the reflect if possible..
                        string ability = "";

                        if (reflectionTracker.CheckReflected(ce, out ability))
                        {
                            CombatEvent new_ce = CombatEvent.Builder.Build(ce)
                                .Ability("Reflected: " + ce.ability)
                                .Done();

                            LogCombatEvent(SwingTypeEnum.NonMelee, logInfo, new_ce, "");
                        }
                        else
                        {
                            if ( (damageShielded != null) &&
                                 (damageShielded.targetName == ce.targetName) &&
                                 (damageShielded.sourceName == ce.sourceName) )
                            {
                                int shieled = 0;
                                int damage = 0;

                                if (damageShielded.hitValue < ce.hitValue)
                                {
                                    damage = ce.hitValue - damageShielded.hitValue;
                                    shieled = damageShielded.hitValue;
                                }
                                else
                                {
                                    damage = 0;
                                    shieled = ce.hitValue;
                                }

                                CombatEvent ds_ce = CombatEvent.Builder.Build(damageShielded)
                                    .Source(damageShielded.targetName, damageShielded.targetType)
                                    .HitValue(shieled)
                                    .DamageType("Damage Shield")
                                    .Done();

                                LogCombatEvent(SwingTypeEnum.Healing, logInfo, ds_ce, ce.ability);
                                LogCombatEvent(SwingTypeEnum.NonMelee, logInfo, ce, "Shielded: " + shieled.ToString());
                            }
                            else
                            {
                                LogCombatEvent(SwingTypeEnum.NonMelee, logInfo, ce);
                            }

                            damageShielded = null;
                        }
                    }
                    break;
                case CombatEvent.Type.MissLike:
                    logInfo.detectedType = Color.DarkRed.ToArgb();

                    if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                    {
                        string special = ce.result;
                        LogCombatEvent(SwingTypeEnum.NonMelee, logInfo, ce, special);
                    }
                    break;
                case CombatEvent.Type.Heal:
                    logInfo.detectedType = Color.Green.ToArgb();
                    if (ActGlobals.oFormActMain.InCombat)
                    {
                        if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                        {
                            CombatEvent heal_ce = null;
                            if (ce.actionResult == CombatEvent.ActionResult.ACTION_RESULT_HOT_TICK)
                            {
                                heal_ce = CombatEvent.Builder.Build(ce).DamageType("HoT").Done();
                            }
                            else
                            {
                                CombatEvent.Builder b = CombatEvent.Builder.Build(ce).DamageType("Heal");
                                if (ce.ability == "Mutagen") b = b.Ability("Mutagen Heal");
                                heal_ce = b.Done();
                            }

                            LogCombatEvent(SwingTypeEnum.Healing, logInfo, heal_ce);
                        }
                    }
                    break;
                case CombatEvent.Type.Death:
                    logInfo.detectedType = Color.Fuchsia.ToArgb();

                    // TODO: right names...
                    ActGlobals.oFormSpellTimers.RemoveTimerMods(ce.targetName);
                    ActGlobals.oFormSpellTimers.DispellTimerMods(ce.targetName);

                    if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                    {
                        MasterSwing ms =
                            new MasterSwing((int)SwingTypeEnum.NonMelee, false, "",
                                Dnum.Death, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter,
                                "Killing", ce.sourceName, "Death", ce.targetName);

                        ms.Tags.Add("ActionResult", ce.result);
                        ms.Tags.Add("ActionSlotType", ce.abilitySlotType);
                        ms.Tags.Add("PowerType", ce.powerType);

                        ActGlobals.oFormActMain.AddCombatAction(ms);
                    }
                    break;
                case CombatEvent.Type.Other:
                    logInfo.detectedType = Color.Blue.ToArgb();

                    switch (ce.actionResult)
                    {
                        case CombatEvent.ActionResult.ACTION_RESULT_POWER_ENERGIZE:

                            logInfo.detectedType = Color.Gold.ToArgb();
                            if (ActGlobals.oFormActMain.InCombat)
                            {
                                if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                                {
                                    // TODO: Magicka vs Stamina handling... Special case off ability name?
                                    //       ce.powerType -> Magicka for both magicka and stamina restoring.
                                    if (ce.ability == "Absorb Stamina")
                                    {
                                        // NOTE: Only statmina case handled.
                                        LogCombatEvent(SwingTypeEnum.StaminaHealing, logInfo, ce);
                                    }
                                    else
                                    {
                                        LogCombatEvent(SwingTypeEnum.MagickaHealing, logInfo, ce);
                                    }
                                }
                            }
                            break;

                        case CombatEvent.ActionResult.ACTION_RESULT_REFLECTED:
                            logInfo.detectedType = Color.LightPink.ToArgb();

                            if (!ActGlobals.oFormActMain.InCombat)
                            {
                                if ((ce.sourceType == ce.targetType) && (ce.sourceName == ce.targetName)) break;
                            }

                            if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                            {
                                reflectionTracker.AddReflected(ce);
                            }
                            break;
                        case CombatEvent.ActionResult.ACTION_RESULT_BLOCKED_DAMAGE:
                            logInfo.detectedType = Color.Red.ToArgb();

                            // TODO: possibly make this a CombatEvent.Type.Damage instead of a special case.
                            //       Add a special field to CombatEvent?
                            if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                            {
                                // Block does 50% damage by default.
                                LogCombatEvent(SwingTypeEnum.NonMelee, logInfo, ce, "Blocked");
                            }
                            break;
                        case CombatEvent.ActionResult.ACTION_RESULT_DAMAGE_SHIELDED:
                            logInfo.detectedType = Color.Green.ToArgb();

                            // DamageShielded = The number of damage shield points used by the next Damage line
                            // Damage = The damage hit ( need to subtract shielded damage )

                            if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                            {
                                damageShielded = ce;
                            }
                            break;
                    }

                    // if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, ce.sourceName, ce.targetName))
                    // {
                    //     LogCombatEvent(SwingTypeEnum.NonMelee, logInfo, ce);
                    // }
                    break;
            }
        }
        /// <summary>
        ///  Logline Read
        /// </summary>
        /// <param name="isImport">インポートログか?</param>
        /// <param name="logInfo">発生したログ情報</param>
        private void OnLoglineRead(
            bool isImport,
            LogLineEventArgs logInfo)
        {
            if (isImport)
            {
                return;
            }

            // エノキアンタイマーが有効ならば・・・
            if (Settings.Default.EnabledEnochianTimer &&
                this.EnabledByJobFilter)
            {
                // ログをキューに貯める
                lock (this.logQueue)
                {
                    this.logQueue.Enqueue(logInfo.logLine);
                }
            }
        }
Ejemplo n.º 34
0
        public void act_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (!isImport)
            {
                Match match1 = CDRegex1.Match(logInfo.logLine);
                if (match1.Success && match1.Value != "")
                {
                    ProcessLogLine(match1);
                }
                else
                {
                    Match match2 = CDRegex2.Match(logInfo.logLine);
                    if (match2.Success && match2.Value != "")
                    {
                        ProcessLogLine(match2);
                    }
                }

            }
        }
 // TODO: Determine if we need this event type...  Combat event seems to have enough.
 void ProcessEffect(LogLineEventArgs logInfo, string[] segments)
 {
     // logInfo.detectedType = Color.Blue.ToArgb();
 }
Ejemplo n.º 36
0
 void oFormActMain_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
 {
     if (cbSParseConsider.Checked)
     {
         if (logInfo.logLine.Contains("/whoraid search results"))
             captureWhoraid = true;
         if (logInfo.logLine.EndsWith("players found"))
             captureWhoraid = false;
         if (captureWhoraid && regexWhoraid.IsMatch(logInfo.logLine))
         {
             string outputName = regexWhoraid.Replace(logInfo.logLine, "$1");
             ActGlobals.oFormActMain.SelectiveListAdd(outputName);
         }
         if (regexWhogroup.IsMatch(logInfo.logLine))
         {
             string outputName = regexWhogroup.Replace(logInfo.logLine, "$1");
             ActGlobals.oFormActMain.SelectiveListAdd(outputName);
         }
         if (regexConsider.IsMatch(logInfo.logLine))
         {
             string outputName = regexConsider.Replace(logInfo.logLine, "$1");
             if (outputName.StartsWith("{f}"))
                 outputName = outputName.Substring(3);
             ActGlobals.oFormActMain.SelectiveListAdd(outputName);
             if (!isImport)
                 System.Media.SystemSounds.Beep.Play();
         }
     }
 }
Ejemplo n.º 37
0
        void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            try
            {
                lock (locker)
                {
                    string tempInputStr = previousLine + logInfo.logLine;
                    string oldPreviousLine = previousLine;
                    previousLine = "";

                    string InputStr = removeTimestamp(tempInputStr);
                    int pos = InputStr.IndexOf('[');
                    if (pos > 0)
                    {
                        previousLine = InputStr.Substring(pos);
                        InputStr = InputStr.Substring(0, pos);
                    }

                    string Secret_attacker = string.Empty;
                    string victim = string.Empty;
                    string attacker = string.Empty;
                    string damage = string.Empty;
                    int attackType = (int)SwingTypeEnum.Melee;
                    string effectName = string.Empty;
                    string attackName = string.Empty;
                    string special = SecretLanguage.none;
                    string Aowner = string.Empty;
                    string Vowner = string.Empty;
                    Boolean SelfAttack = false;
                    Int64 Amount = 0;

                    Boolean critical = false;
                    Boolean colorlog = true;
                    string attackSuffix = "";

                    int eventType = -1;

                    MatchCollection matches = null;

                    if (InputStr.IndexOf(SecretLanguage.HitLine1) != -1 || InputStr.IndexOf(SecretLanguage.HitLine2) != -1 || InputStr.IndexOf(SecretLanguage.HateLine) != -1)
                    {
                        foreach (var damageLine in SecretLanguage.damageLines)
                        {
                            matches = damageLine.Matches(InputStr);
                            if (matches != null && matches.Count > 0)
                            {
                                break;
                            }
                        }

                        if (matches != null && matches.Count == 1)
                        {
                            eventType = 3;
                            ++dpsCount;
                        }
                        else
                        {
                            eventType = -1;
                        }
                    }

                    if (InputStr.IndexOf(SecretLanguage.RedirectedLine) != -1)
                    {
                        foreach (var redirectLine in SecretLanguage.redirectLines)
                        {
                            matches = redirectLine.Matches(InputStr);

                            if (matches != null && matches.Count > 0)
                            {
                                break;
                            }
                        }

                        if (matches != null && matches.Count == 1)
                        {
                            attackSuffix = " (redirect)";
                            eventType = 3;
                            ++dpsCount;
                        }
                        else
                        {
                            eventType = -1;
                        }
                    }

                    if (eventType == -1 && (InputStr.IndexOf(SecretLanguage.HealLine1) != -1 || InputStr.IndexOf(SecretLanguage.HealLine2) != -1 || InputStr.IndexOf(SecretLanguage.AbsorbLine) != -1))
                    {
                        foreach (var healLine in SecretLanguage.healLines)
                        {
                            matches = healLine.Matches(InputStr);

                            if (matches != null && matches.Count > 0)
                            {
                                break;
                            }
                        }

                        if (matches != null && matches.Count == 1)
                        {
                            eventType = 5;
                            ++healCount;

                            if (InputStr.IndexOf(SecretLanguage.AbsorbLine) != -1)
                            {
                                attackSuffix = " (absorb)";
                            }
                        }
                        else
                        {
                            eventType = -1;
                        }
                    }

                    if (eventType == -1 && (InputStr.IndexOf(SecretLanguage.EvadeLine1) != -1 || InputStr.IndexOf(SecretLanguage.EvadeLine2) != -1))
                    {
                        foreach (var evadedLine in SecretLanguage.evadedLines)
                        {
                            matches = evadedLine.Matches(InputStr);

                            if (matches != null && matches.Count > 0)
                            {
                                break;
                            }
                        }

                        if (matches != null && matches.Count == 1)
                        {
                            eventType = 10;
                        }
                        else
                        {
                            eventType = -1;
                        }
                    }

                    if (eventType == -1 && InputStr.IndexOf(SecretLanguage.DiedLine) != -1)
                    {
                        foreach (var diedLine in SecretLanguage.diedLines)
                        {
                            matches = diedLine.Matches(InputStr);

                            if (matches != null && matches.Count > 0)
                            {
                                break;
                            }
                        }

                        if (matches != null && matches.Count == 1)
                        {
                            eventType = 12;
                        }
                        else
                        {
                            eventType = -1;
                        }
                    }

                    if (eventType == -1 && (InputStr.IndexOf(SecretLanguage.BuffLine1) != -1 || InputStr.IndexOf(SecretLanguage.BuffLine2) != -1))
                    {
                        foreach (var buffLine in SecretLanguage.buffLines)
                        {
                            matches = buffLine.Matches(InputStr);

                            if (matches != null && matches.Count > 0)
                            {
                                GroupCollection groups = matches[0].Groups;
                                string name = groups["name"].Value.Trim(' ', '"', '\'', '.');
                                if (!buffData.ContainsKey(name))
                                {
                                    buffData.Add(name, new BuffData());
                                }

                                buffData[name].Start(logInfo.detectedTime);
                                break;
                            }
                        }

                        eventType = -1;
                    }

                    if (eventType == -1 && (InputStr.IndexOf(SecretLanguage.BuffStopLine) != -1))
                    {
                        foreach (var buffLine in SecretLanguage.buffStopLines)
                        {
                            matches = buffLine.Matches(InputStr);

                            if (matches != null && matches.Count > 0)
                            {
                                GroupCollection groups = matches[0].Groups;
                                string name = groups["name"].Value.Trim(' ', '"');
                                if (buffData.ContainsKey(name))
                                {
                                    buffData[name].Stop(logInfo.detectedTime);
                                }

                                break;
                            }
                        }

                        eventType = -1;
                    }
                    ProcessLogLineEntry(logInfo, ref victim, ref attacker, ref attackType, ref attackName, ref special, ref SelfAttack, ref Amount, ref critical, colorlog, attackSuffix, eventType, matches);
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message + "\n" + e.StackTrace);
            }
        }
Ejemplo n.º 38
0
 private void AddItem(LogLineEventArgs item)
 {
     if (item.EventDetail != "AbilityActivate" || item.EventType != "Event") return;
     if (LogLines.Count == _settingsService.Settings.Items) LogLines.RemoveAt(LogLines.Count - 1);
     LogLines.Insert(0, item);
 }
Ejemplo n.º 39
0
 private void BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo) {
     if (!isImport)
     {
         lock (_queue)
         {
             _queue.Enqueue(logInfo.logLine);
             _signal.Set();
         }
     }
 }
Ejemplo n.º 40
0
        void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            Action aAction = new Action();
            string logLine = logInfo.logLine;
            string[] tmp = logInfo.logLine.Split(',');

            if (tmp[0].Equals("timestamp"))
                return;
            try
            {
                aAction.timestamp = Convert.ToUInt32(tmp[0]);
                aAction.instanceID = Convert.ToUInt16(tmp[1]);
                aAction.sourceID = Convert.ToUInt32(tmp[2]);
                aAction.sourceName = tmp[3];
                aAction.targetID = Convert.ToUInt32(tmp[4]);
                aAction.targetName = tmp[5];
                aAction.attackID = Convert.ToUInt32(tmp[6]);
                aAction.damage = Convert.ToInt32(tmp[7]);
                aAction.isJA = (Convert.ToInt32(tmp[8]) == 1);
                aAction.isCrit = (Convert.ToInt32(tmp[9]) == 1);
                aAction.isMultiHit = (Convert.ToInt32(tmp[10]) == 1);
                aAction.isMisc = (Convert.ToInt32(tmp[11]) == 1);
                aAction.isMisc2 = (Convert.ToInt32(tmp[12]) == 1);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message + "\n" + logLine);
                return;
            }

            //TODO: deal with when the first thing they do is counter
            if (aAction.targetID == 0 ||
                (aAction.instanceID == 0 && currInstID == 0xFFFF))
                return;

            DateTime time = ActGlobals.oFormActMain.LastKnownTime;
            int gts = ActGlobals.oFormActMain.GlobalTimeSorter;
            if (aAction.instanceID == 0)
                aAction.instanceID = currInstID;
            SwingTypeEnum e;

            string sourceName = aAction.sourceName + "_" + aAction.sourceID.ToString();
            string targetName = aAction.targetName + "_" + aAction.targetID.ToString();

            string actionType = aAction.attackID.ToString();
            string damageType = aAction.attackID.ToString();

            if (aAction.damage < 0 && aAction.isMisc)
                e = SwingTypeEnum.Healing;
            else
                e = SwingTypeEnum.Melee;

            Dnum dmg = new Dnum(aAction.damage) * ((e == SwingTypeEnum.Healing) ? -1 : 1);

            if (skillDict.ContainsKey(aAction.attackID))
            {
                actionType = skillDict[aAction.attackID].Name;
                damageType = skillDict[aAction.attackID].Type;
            }

            MasterSwing ms = new MasterSwing(
                Convert.ToInt32(e),
                aAction.isCrit,
                "",
                dmg,
                time,
                gts,
                actionType,
                sourceName,
                damageType,
                targetName
                );

            if (aAction.instanceID != currInstID)
            {
                currInstID = aAction.instanceID;
                ActGlobals.oFormActMain.ChangeZone(aAction.instanceID.ToString());
            }

            if (ActGlobals.oFormActMain.SetEncounter(time, sourceName, targetName))
                ActGlobals.oFormActMain.AddCombatAction(ms);
        }
Ejemplo n.º 41
0
        private void BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (this.LastCharName == "YOU" && ActGlobals.charName != "YOU") ui.UpdateDefaultCharacter(ActGlobals.charName);

            string str = logInfo.logLine.Substring(0x16, logInfo.logLine.Length - 0x16).Trim();
            string victim = string.Empty;
            string attacker = string.Empty;
            string damage = string.Empty;
            string damageString = string.Empty;
            string skill = string.Empty;
            string special = string.Empty;
            bool critical = false;

            #region misc parse
            // ignore chats (channels i.e. [3.LFG] or whispers [charname:Drakkon] all start with "[")
            if (str.StartsWith("[") || str.StartsWith("You Whisper to ") ||
                str.StartsWith(CheckYou("you") + ": ") || str.StartsWith(CheckYou("you") + " Whispers: "))
            {
                return;
            }

            // zone change
            if (ActGlobals.oFormActMain.ZoneChangeRegex.IsMatch(logInfo.logLine))
            {
                ActGlobals.oFormActMain.ChangeZone(ActGlobals.oFormActMain.ZoneChangeRegex.Replace(logInfo.logLine, "$1"));
                return;
            }

            // act commands
            if (str.StartsWith("/act ") && str.Length > 5)
            {
                string commandText = str.Substring(5);
                ActGlobals.oFormActMain.ActCommands(commandText);
                return;
            }

            // check for critical
            if (str.StartsWith("Critical Hit!"))
            {
                critical = true;
                str = str.Substring(13).TrimStart();
            }
            #endregion

            #region inflict damage parse

            // match "Your attack on xxx was reflected and inflicted xxx damage on you"
            if (rReflectDamageOnYou.IsMatch(str))
            {
                Match match = rReflectDamageOnYou.Match(str);
                victim = CheckYou("you");
                attacker = match.Groups["attacker"].Value;
                damage = match.Groups["damage"].Value;
                if (TagBlockedAttacks)
                {
                    string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime);
                    if (!string.IsNullOrEmpty(blockType))
                        special = blockType + "&";
                }

                special += "reflected";

                // assume: the attack that caused the reflection is recorded on it's own line so we don't have to log an unknown attack
                AddCombatAction(logInfo, attacker, victim, "Damage Shield", critical, special, damage, SwingTypeEnum.NonMelee);
                return;
            }

            // match "xxx inflicted xxx damage on xxx ..."
            var mInflict = rInflictDamage.Match(str);
            if (mInflict.Success)
            {
                if (mInflict.Groups["critical"].Success)
                {
                    critical = true;
                }

                attacker = CheckYou(mInflict.Groups["attacker"].Value); // source
                damage = mInflict.Groups["damage"].Value; // dmg

                string targetClause = mInflict.Groups["targetclause"].Value; // target & extra info

                // submatch "... xxx and dispelled some of its magical buffs by using Ignite Aether I"
                if (rAndDispelled.IsMatch(targetClause))
                {
                    var mIgniteAether = rAndDispelled.Match(targetClause);
                    if (mIgniteAether.Success)
                    {
                        victim = CheckYou(mIgniteAether.Groups["victim"].Value);
                        if (TagBlockedAttacks)
                        {
                            string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime);
                            if (!string.IsNullOrEmpty(blockType))
                                special = blockType;
                        }

                        skill = mIgniteAether.Groups["skill"].Value;
                        AddCombatAction(logInfo, attacker, victim, skill, critical, string.Empty, Dnum.NoDamage, SwingTypeEnum.CureDispel, "dispel");
                        AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.NonMelee);
                        return;
                    }
                }

                // submatch "... xxx by using xxx"
                if (rUsingAttack.IsMatch(targetClause))
                {
                    var mUsingAttack = rUsingAttack.Match(targetClause);

                    // sub-submatch Assassin rune carving
                    var mPatternEngraving = rPatternEngraving.Match(mUsingAttack.Groups["victimclause"].Value);
                    if (mPatternEngraving.Success)
                    {
                        victim = CheckYou(mPatternEngraving.Groups["victim"].Value);
                        ////special = mPatternEngraving.Groups["statuseffect"].Value;
                    }
                    else
                    {
                        victim = CheckYou(mUsingAttack.Groups["victimclause"].Value);
                    }

                    if (TagBlockedAttacks)
                    {
                        string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime);
                        if (!string.IsNullOrEmpty(blockType))
                            special = blockType;
                    }

                    skill = mUsingAttack.Groups["skill"].Value;

                    // check if skill has an extra payload damage that can't be found other than in here
                    if (GuessDotCasters)
                    {
                        if (AionData.Skill.HasAdditionalEffect(skill))
                        {
                            string additionalEffect = skill + " Additional";
                            ContinuousDamageSet.Add(attacker, victim, additionalEffect, logInfo.detectedTime); // record Blood Rune actor for when it deals payload damage later as Blood Rune X Additional Effect (regex will parse out Effect)
                            HealerRecordSet.Add(attacker, victim, additionalEffect, logInfo.detectedTime); // record Blood Rune actor when he heals later as single HoT tick
                        }
                    }

                    var inflictSwingType = SwingTypeEnum.NonMelee;

                    // correct the false damage on you that are actually heals
                    if (victim == CheckYou("you") && AionData.Skill.IsHealThatInflictsDamage(skill))
                    {
                        inflictSwingType = SwingTypeEnum.Healing;
                    }

                    // correct the false self damage message that are actually continuous damage from others to you
                    if (victim == "you" && attacker == CheckYou("you"))
                    {
                        string realAttacker = ContinuousDamageSet.GetActor(victim, skill, logInfo.detectedTime);
                        if (!string.IsNullOrEmpty(realAttacker))
                            attacker = realAttacker;
                    }

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, inflictSwingType);
                    return;
                }

                // submatch "... xxx by reflecting the attack"
                var mReflect = rReflect.Match(targetClause);
                if (mReflect.Success)
                {
                    special = "reflected";
                    victim = CheckYou(mReflect.Groups["victim"].Value);
                    if (TagBlockedAttacks)
                    {
                        string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime);
                        if (!string.IsNullOrEmpty(blockType))
                            special = blockType;
                    }

                    if (ActGlobals.oFormActMain.GlobalTimeSorter == lastActivatedSkillGlobalTime || (logInfo.detectedTime - lastActivedSkillTime).TotalSeconds < 2)
                    {
                        skill = lastActivatedSkill;
                    }
                    else
                    {
                        skill = "Damage Shield";
                    }

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.NonMelee);
                    return;
                }

                // no ability submatch
                victim = CheckYou(targetClause);
                if (TagBlockedAttacks)
                {
                    string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime, false); // block record consume set to false because auto-attacks can be multi-hitting, and multiple attacks can be blocked
                    if (!string.IsNullOrEmpty(blockType))
                    {
                        special = blockType;
                        ////damageString = blockType; // nah, I don't want to cover the numbers with damageString
                    }
                }

                AddCombatAction(logInfo, attacker, victim, "Melee", critical, special, NewDnum(damage, damageString), SwingTypeEnum.Melee);
                return;
            }

            // match "xxx inflicted xxx damage and the rune carve effect on xxx by using xxx ."  (assassin rune abilities)
            var mInflictDamageRuneCarve = rInflictDamageRuneCarve.Match(str);
            if (mInflictDamageRuneCarve.Success)
            {
                attacker = CheckYou(mInflictDamageRuneCarve.Groups["attacker"].Value);
                victim = CheckYou(mInflictDamageRuneCarve.Groups["victim"].Value);
                ////special = "pattern engraving";
                damage = mInflictDamageRuneCarve.Groups["damage"].Value;
                skill = mInflictDamageRuneCarve.Groups["skill"].Value;
                critical = mInflictDamageRuneCarve.Groups["critical"].Success;
                if (TagBlockedAttacks)
                {
                    string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime, false); // block record consume set to false because auto-attacks can be multi-hitting, and multiple attacks can be blocked
                    if (!string.IsNullOrEmpty(blockType))
                        special = blockType;
                }

                AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.NonMelee);
                return;
            }

            #endregion

            #region indicator parsers
            // match "You have used xxx Potion."
            if (str.StartsWith("You have used") && str.EndsWith("Potion."))
            {
                Match match = (new Regex("You have used (?<potion>[a-zA-Z ']*).", RegexOptions.Compiled)).Match(str);
                lastPotion = match.Groups["potion"].Value;
                return;
            }

            // match "xxx has been activated." for use in damage shields like Robe of Cold
            if (rActivated.IsMatch(str))
            {
                if (!GuessDotCasters) return;

                Match match = rActivated.Match(str);
                lastActivatedSkill = match.Groups["skill"].Value;
                lastActivatedSkillGlobalTime = ActGlobals.oFormActMain.GlobalTimeSorter;
                lastActivedSkillTime = logInfo.detectedTime;
                return;
            }

            #region continuous
            if (str.Contains("continuous"))
            {
                Match contDmgMatch = null;

                // match "You inflicted continuous damage on xxx by using xxx."
                if (rContDmg1.IsMatch(str))
                {
                    contDmgMatch = rContDmg1.Match(str);
                    attacker = CheckYou("you");
                    victim = contDmgMatch.Groups["victim"].Value;
                }

                // match "xxx used xxx to inflict continuous damage effect on xxx."
                if (rContDmg2.IsMatch(str))
                {
                    contDmgMatch = rContDmg2.Match(str);
                    attacker = contDmgMatch.Groups["attacker"].Value;
                    victim = contDmgMatch.Groups["victim"].Value;
                }

                // match "You received continuous damage because xxx used xxx."
                if (rContDmg3.IsMatch(str))
                {
                    contDmgMatch = rContDmg3.Match(str);
                    attacker = CheckYou("you");
                    victim = contDmgMatch.Groups["victim"].Value;
                }

                if (contDmgMatch != null)
                {
                    skill = contDmgMatch.Groups["skill"].Value;
                    if (GuessDotCasters)
                        ContinuousDamageSet.Add(attacker, victim, skill, logInfo.detectedTime);
                    return;
                }

                Match contHPMatch = null; // continuous heals like Word of Life or Light of Rejuvenation

                // match "xxx is in the continuous HP recovery state because he/xxx used xxx."
                if (rContHP.IsMatch(str))
                {
                    contHPMatch = rContHP.Match(str);
                    victim = contHPMatch.Groups["victim"].Value;
                    attacker = contHPMatch.Groups["attacker"].Value;
                    if (attacker == "he" || attacker == "she") attacker = victim;
                }

                // match "xxx is continuously restoring your HP by using xxx."
                if (rContHPYou.IsMatch(str))
                {
                    contHPMatch = rContHPYou.Match(str);
                    victim = CheckYou("you");
                    attacker = contHPMatch.Groups["attacker"].Value;
                }

                // match "You are continuously recovering HP because of xxx." (cast HoT on yourself)
                if (rContHPSelf.IsMatch(str))
                {
                    contHPMatch = rContHPSelf.Match(str);
                    victim = CheckYou("you");
                    attacker = victim;
                }

                if (contHPMatch != null)
                {
                    skill = contHPMatch.Groups["skill"].Value;
                    HealerRecordSet.Add(attacker, victim, skill, logInfo.detectedTime);
                    return;
                }
            }
            #endregion

            #region poisoned
            if (str.Contains("poisoned"))
            {
                Match poisonMatch = null;

                // match "xxx became poisoned because xxx used xxx."
                if (rStatusEffect1.IsMatch(str))
                    poisonMatch = rStatusEffect1.Match(str);

                // match "You caused xxx to become poisoned by using xxx."
                if (rStatusEffectByYou1.IsMatch(str))
                    poisonMatch = rStatusEffectByYou1.Match(str);

                // match "xxx poisoned you by using xxx."
                if (rStatusEffectToYou1.IsMatch(str))
                    poisonMatch = rStatusEffectToYou1.Match(str);

                if (poisonMatch != null && poisonMatch.Success)
                {
                    if (GuessDotCasters)
                    {
                        attacker = CheckYou(poisonMatch.Groups["attacker"].Value);
                        victim = CheckYou(poisonMatch.Groups["victim"].Value);
                        skill = poisonMatch.Groups["skill"].Value;
                        ContinuousDamageSet.Add(attacker, victim, skill, logInfo.detectedTime);
                    }

                    return;
                }
            }
            #endregion

            #region bleed
            if (str.Contains("bleed"))
            {
                Match bleedMatch = null;

                // match "xxx is bleeding because xxx used xxx."
                if (rStatusEffect2.IsMatch(str))
                    bleedMatch = rStatusEffect2.Match(str);

                // match "You caused xxx to bleed by using xxx."
                if (rStatusEffectByYou2.IsMatch(str))
                    bleedMatch = rStatusEffectByYou2.Match(str);

                // match "xxx caused you to bleed by using xxx."
                if (rStatusEffectToYou2.IsMatch(str))
                    bleedMatch = rStatusEffectToYou2.Match(str);

                if (bleedMatch != null && bleedMatch.Success)
                {
                    if (GuessDotCasters)
                    {
                        attacker = CheckYou(bleedMatch.Groups["attacker"].Value);
                        victim = CheckYou(bleedMatch.Groups["victim"].Value);
                        skill = bleedMatch.Groups["skill"].Value;
                        ContinuousDamageSet.Add(attacker, victim, skill, logInfo.detectedTime);
                    }

                    return;
                }
            }
            #endregion

            // match "xxx received the xxx effect because xxx used xxx"  occurs when you use Delayed Blast
            if (rReceiveEffect.IsMatch(str))
            {
                Match match = rReceiveEffect.Match(str);
                attacker = CheckYou(match.Groups["attacker"].Value);
                victim = match.Groups["victim"].Value;
                skill = match.Groups["skill"].Value;
                if (GuessDotCasters)
                    ContinuousDamageSet.Add(attacker, victim, skill, logInfo.detectedTime);
                ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, attacker, victim);
                ////AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.Unknown, "effect"), SwingTypeEnum.NonMelee);
                return;
            }

            #region summon
            if (str.Contains("summon"))
            {
                Match summonMatch = null;
                int petDuration = 30;

                if (rSummonServant1.IsMatch(str))
                {
                    summonMatch = rSummonServant1.Match(str); // xxx has summoned pet to attack xxx by using skill
                    victim = summonMatch.Groups["victim"].Value;
                }
                else if (rSummonServant2.IsMatch(str))
                {
                    summonMatch = rSummonServant2.Match(str); // xxx has caused you to summon pet by using skill
                    victim = CheckYou("you");
                }
                else if (rSummonServant3.IsMatch(str))
                {
                    summonMatch = rSummonServant3.Match(str); // You summoned xx by using skill to let it attack xxx
                    victim = summonMatch.Groups["victim"].Value;
                }
                else if (rSummonSpirit.IsMatch(str))
                {
                    if (LinkPets)
                    {
                        summonMatch = rSummonSpirit.Match(str); // xxx summoned pet by using skill
                        victim = null;
                        petDuration = 600;
                    }
                    else
                    {
                        return; // ignore SM's summons
                    }
                }

                if (summonMatch != null && summonMatch.Success)
                {
                    string summoner = CheckYou(summonMatch.Groups["summoner"].Value);
                    string pet = summonMatch.Groups["pet"].Value;
                    skill = summonMatch.Groups["skill"].Value;

                    if (AionData.Pet.PetDurations.ContainsKey(pet))
                        petDuration = AionData.Pet.PetDurations[pet];

                    SummonerRecordSet.Add(summoner, victim, skill, pet, logInfo.detectedTime, petDuration);

                    if (!string.IsNullOrEmpty(victim))
                    {
                        ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, summoner, victim);
                    }

                    return;
                }

                if (this.DebugParse)
                    ui.AddText("NO MATCH on summon: " + str);
            }
            #endregion

            #region spirit
            // match "The spirit used a skill on xtargetx because xsummonerx used xskillx." which indicates later one of the following:
            // "Brutal Mist Mane Pawsoldier is in the spinning state because Fire Spirit used Spirit Threat III Fire."
            // "Joyeuse is in the reflection state because Fire Spirit used Spirit Wall of Protection III Fire."
            // "xElementalx Spirit has cast a reflector on you by using Spirit Wall of Protection III xelementx."
            // "xElementalx Spirit inflicted xxx damage on xtargetx by using xskillx xelementx." i.e. Thunderbolt Claw I -> Water Spirit uses Thunderbolt Claw I Water; (also Spirit Detonation Claw and Spirit Disturbance deal damage)
            // "xElementalx Spirit used xskillx xelementx to inflict the continuous damage effect on xtargetx." i.e. Spirit Erosion I -> Wind Spirit uses Spirit Erosion III Wind.
            // "xElementalx Spirit is in the boost xbuffx state because xElementalx Spirit used xskillx xelementx." i.e. Spirit Wrath Position I -> Fire Spirit is in Physical and Magical attack state using Spirit Wrath Position III Fire
            // NOTE: these skills can be resisted.
            if (rSummonerSkill.IsMatch(str))
            {
                // TODO: use indicator to catch owner of pet.  Store the skill so that the next pet that uses a matching skill will have that pet assigned to the summoner.
                // NOTE: the skill used by the summoner (i.e. Spirit Erosion I) will not exactly match the skill of the spirit (i.e. Spirit Erosion III Wind)
                return;
            }
            #endregion

            #region buffSelf
            // match "xxx was affected by its own xxx."
            if (rProcBuff.IsMatch(str))
            {
                Match match = rProcBuff.Match(str);
                string actor = match.Groups["actor"].Value;
                skill = match.Groups["skill"].Value;
                string playerSkill = AionData.Skill.PlayerSkill(skill);

                if (LinkBOFtoSM && playerSkill == "Blessing of Fire")
                {
                    ContinuousDamageSet.Add(actor, null, skill, logInfo.detectedTime, 10 * 60);
                    return;
                }

                if (LinkDmgProcs)
                {
                    if (playerSkill == "Promise of Wind")
                    {
                        ContinuousDamageSet.Add(actor, null, skill, logInfo.detectedTime, 30 * 60);
                        return;
                    }

                    if (playerSkill == "Apply Poison" || skill == "Apply Deadly Poison")
                    {
                        ContinuousDamageSet.Add(actor, null, skill, logInfo.detectedTime, 2 * 60);
                        return;
                    }
                }

                if (playerSkill == "Promise of Aether")
                {
                    PartyMembers.SetClass(actor, AionData.Player.Classes.Chanter);
                    HealerRecordSet.Add(actor, null, skill, logInfo.detectedTime, 30 * 60);
                    return;
                }

                if (AionData.Skill.IsGainMantra(skill))
                {
                    if (PartyMembers.Find(actor) != null)
                    {
                        PartyMembers.SetClass(actor, AionData.Player.Classes.Chanter);
                        foreach (AionData.Player player in PartyMembers)
                        {
                            HealerRecordSet.Add(actor, player.Name, skill, logInfo.detectedTime, 0); // add every party member as receiving mantra
                        }
                    }
                    else
                    {
                        HealerRecordSet.Add(actor, actor, skill, logInfo.detectedTime, 0); // if not in party, assume chanter is soling
                    }
                }

                // ignore non-damage and non-heal spells
                foreach (string otherSkill in new string[] { "Promise of Earth", "Arrow Flurry", "Blessing of Rock", "Tactical Retreat", "Robe of Cold" })
                {
                    if (playerSkill == otherSkill)
                        return;
                }

                // ignore mob and other unhandled spells
                if (DebugParse)
                {
                    ui.AddText("Unhandled self buff: " + str);
                }

                return;
            }
            #endregion

            #endregion

            #region continuous/extra damage from specific skills
            // match "xxx received xxx damage due to the effect of xxx"
            if (rIndirectDmg2.IsMatch(str))
            {
                Match match = rIndirectDmg2.Match(str);
                victim = CheckYou(match.Groups["victim"].Value);
                damage = match.Groups["damage"].Value;
                skill = match.Groups["skill"].Value;

                if (LinkBOFtoSM || LinkDmgProcs)
                    attacker = ContinuousDamageSet.GetAnyActor(victim, skill, logInfo.detectedTime);
                else
                    attacker = ContinuousDamageSet.GetActor(victim, skill, logInfo.detectedTime);

                if (string.IsNullOrEmpty(attacker))
                {
                    attacker = "Unknown";
                }

                if (TagBlockedAttacks)
                {
                    string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime);
                    if (!string.IsNullOrEmpty(blockType))
                        special = blockType + "&";
                }
                ////special += "DoT";
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.NonMelee);
                return;
            }

            // match "xxx recieved xxx yyy damage after you used xxx"
            if (rIndirectDmg1.IsMatch(str))
            {
                Match match = rIndirectDmg1.Match(str);
                victim = match.Groups["victim"].Value;
                damage = match.Groups["damage"].Value;
                string damageType = match.Groups["damagetype"].Value;
                skill = match.Groups["skill"].Value; // only DoT skills: Poison, Poison Arrow, or Wind Cut Down skills match this... often mob skills
                attacker = ContinuousDamageSet.GetActor(victim, skill, logInfo.detectedTime);
                if (string.IsNullOrEmpty(attacker))
                {
                    /*
                    if (skill.StartsWith("Wind Cut Down"))
                    {
                        attacker = "Unknown (Sorcerer)";
                    }
                    else if (skill.StartsWith("Slash Artery"))
                    {
                        attacker = "Unknown (Templar)";
                    }
                    else if (skill.StartsWith("Apply Poison") || skill.StartsWith("Poison Slash")) // not sure, is Poison Slash an Assassin ability?!?
                    {
                        attacker = "Unknown (Assassin)";
                    }
                    else if (skill.StartsWith("Poison Arrow") || skill.StartsWith("Poisoning Trap"))
                    {
                        attacker = "Unknown (Ranger)";
                    }
                    else
                    {
                        attacker = "Unknown"; // unknown class abilities are: Poison, Poison Slash (assassin?), Bleeding (spiritmaster?)
                    }
                     */
                    attacker = "Unknown";
                }

                if (TagBlockedAttacks)
                {
                    string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime, false); // block record consume set to false because auto-attacks can be multi-hitting, and multiple attacks can be blocked
                    if (!string.IsNullOrEmpty(blockType))
                        special = blockType + "&";
                }

                special += "special";
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.NonMelee, damageType);
                return;
            }
            #endregion

            #region melee attack
            // match "xxx received xxx damage from xxx."  (basic melee attack?)
            if (rReceiveDamage.IsMatch(str))
            {
                Match match = rReceiveDamage.Match(str);
                attacker = match.Groups["attacker"].Value;
                victim = CheckYou(match.Groups["victim"].Value);
                damage = match.Groups["damage"].Value;
                if (TagBlockedAttacks)
                {
                    string blockType = BlockedHistory.IsBlocked(attacker, victim, logInfo.detectedTime, false); // block record consume set to false because auto-attacks can be multi-hitting, and multiple attacks can be blocked
                    if (!string.IsNullOrEmpty(blockType))
                        special = blockType;
                }

                AddCombatAction(logInfo, attacker, victim, "Melee", critical, string.Empty, damage, SwingTypeEnum.Melee);
                return;
            }
            #endregion

            #region hp/mp heals
            if (ActGlobals.oFormActMain.InCombat)
            {
                // match "You restored xx of xxx's HP by using xxx."  the actor in this case is ambigious and not really you.
                if (str.StartsWith("You restored"))
                {
                    Regex rYouRestoreHP = new Regex(@"You restored (?<hp>(\d+" + ngs + @")?\d+) of (?<target>[a-zA-Z ']*)'s HP by using (?<skill>[a-zA-Z \-']*?)( Effect)?\.", RegexOptions.Compiled);
                    Match match = rYouRestoreHP.Match(str);
                    if (!match.Success)
                    {
                        ui.AddText("Exception-Unable to parse[e2]: " + str);
                        return;
                    }

                    victim = match.Groups["target"].Value;
                    damage = match.Groups["hp"].Value;
                    skill = match.Groups["skill"].Value;

                    if (GuessDotCasters)
                    {
                        attacker = HealerRecordSet.GetActor(victim, skill, logInfo.detectedTime); // attempt to get the healer from a past indicator log line; or default to an Unknown (Class) for HoTs
                    }

                    if (string.IsNullOrEmpty(attacker))
                    {
                        if (skill == "Healing")
                        {
                            attacker = victim;
                            skill = "Healing Potion HoT"; // HoTs from healing potions are oddly named Healing
                            if (attacker == CheckYou("you"))
                                skill = lastPotion;
                        }
                        else if (skill == "Recovery Potion")
                        {
                            attacker = victim; // HoTs from potions

                            skill = "Recovery Potion HoT";
                            if (attacker == CheckYou("you"))
                                skill = lastPotion;
                        }
                        else if (AionData.Skill.IsSelfHeal(skill))
                        {
                            attacker = victim; // known HoT skills: Blood Rune Additional Effect (only 1 tick), Stamina Recovery, Absorb Vitality (only 1 tick)
                        }
                        else
                        {
                            attacker = "Unknown";
                            if (DebugParse)
                                ui.AddText("Unknown HoT: " + str);
                        }
                    }

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.Healing);
                    return;
                }

                // match "xx restored xx HP."  caused by initial heal of using a potion
                if (str.EndsWith(" HP.") && str.Contains("restored"))
                {
                    Regex rYouRestoreHP = new Regex(@"(?<actor>[a-zA-Z ']*) restored (?<hp>(\d+" + ngs + @")?\d+) HP\.");
                    Match match = rYouRestoreHP.Match(str);
                    if (!match.Success)
                    {
                        ui.AddText("Exception-Unable to parse[e3]: " + str);
                        return;
                    }

                    attacker = match.Groups["actor"].Value;
                    victim = attacker;
                    damage = match.Groups["hp"].Value;

                    skill = "Healing/Recovery Potion";
                    if (victim == CheckYou("you"))
                        skill = lastPotion;

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.Healing);
                    return;
                }

                // match "xxx recovered xx HP (because xxx used|by using) xxx."
                if (rRecoverHP.IsMatch(str))
                {
                    Match match = rRecoverHP.Match(str);
                    victim = CheckYou(match.Groups["target"].Value);
                    skill = match.Groups["skill"].Value;
                    if (match.Groups["actor"].Success)
                    {
                        attacker = CheckYou(match.Groups["actor"].Value);
                    }
                    else
                    {
                        attacker = victim; // no healer is specified if you healed yourself, unless it was from a HoT (see check below)

                        if (skill == "Recovery Potion")
                        {
                        }
                        else if (skill == "Healing")
                        {
                            skill = "Healing Potion";
                        }
                        else if (GuessDotCasters && skill != "Prayer of Resilience I" /* temp self heal stigma */ && skill != "Improved Stamina I" /* glad self hot */)
                        {
                            string healerHoT = HealerRecordSet.GetActor(victim, skill, logInfo.detectedTime); // check to see if you were recovering because healer placed a HoT on you
                            if (!string.IsNullOrEmpty(healerHoT) && (!healerHoT.StartsWith("Unknown") || AionData.Skill.IsHoT(skill))) attacker = healerHoT; // only assign from HeaderRecordSet if the skill is actually a HoT; otherwise, direct healing spells without a target is actually a self-heal.
                        }
                    }

                    if (AionData.Skill.PlayerSkill(skill) == "Word of Revival")
                    {
                        HealerRecordSet.Add(attacker, victim, skill, logInfo.detectedTime, 40); // Word of Revival doesn't trigger the "is in the continuous recovery state" log line, so we have to catch it here when it does the first heal. (It heals like a potion, first payload, then HoT).
                    }

                    if (AionData.Skill.PlayerSkill(skill) == "Splendor of Rebirth")
                    {
                        HealerRecordSet.Add(attacker, victim, skill, logInfo.detectedTime, 23);
                    }

                    damage = match.Groups["hp"].Value;
                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.Healing);

                    return;
                }

                // match "xxx recovered x MP (due to|by using|after using) xxx."
                if (rRecoverMP.IsMatch(str))
                {
                    Match match = rRecoverMP.Match(str);
                    victim = CheckYou(match.Groups["target"].Value);
                    damage = match.Groups["mp"].Value;
                    skill = match.Groups["skill"].Value;

                    attacker = HealerRecordSet.GetActor(victim, skill, logInfo.detectedTime);

                    if (string.IsNullOrEmpty(attacker))
                    {
                        attacker = victim; // almost any MP recovery spell/potion is self cast (i.e. Promise of Aether)

                        if (skill == "Recovery Potion")
                        {
                            if (attacker == CheckYou("you"))
                                skill = lastPotion;
                        }

                        if (skill == "Mana Treatment")
                        {
                            skill = "Mana Potion";
                            if (attacker == CheckYou("you"))
                                skill = lastPotion; // oddly enough, healing potions are Healing and mana potions are Mana Treatment.  NOTE: Mana Treatment skills have roman numerals after them, potions are just Mana Treatment.
                        }
                    }

                    if (attacker.StartsWith("Unknown"))
                    {
                        if (AionData.Skill.IsGainMantra(skill) && PartyMembers.Contains(victim))
                        {
                            var chanters = PartyMembers.FindByClass(AionData.Player.Classes.Chanter);
                            if (chanters.Count == 1)
                            {
                                attacker = chanters[0].Name;
                            }
                        }

                        if (AionData.Skill.PlayerSkill(skill) == "Magic Recovery")
                        { // NOTE: the only example I have of this spell is "Becca recovered 1,500 MP by using Magic Recovery I." which I assume is self-cast.  I need more examples on this spell: i.e. you cast Magic Recovery on yourself, you cast on another player, another player cast on a different player.
                            ////attacker = victim; // we could guess that most of the time chanter is self-casting this spell
                        }
                    }

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.PowerHealing);
                    return;
                }

                // match "xxx restored x MP." or "You recovered x MP."  caused by initial mana heal of using a potion
                if (str.EndsWith(" MP.") && (str.Contains("restored") || str.Contains("recovered")))
                {
                    Match match = (new Regex(@"^(?<actor>[a-zA-Z ']*) (restored|recovered) (?<mp>.*) MP\.$", RegexOptions.Compiled)).Match(str);
                    if (!match.Success)
                    {
                        ui.AddText("Exception-Unable to parse[e5]: " + str);
                        return;
                    }

                    victim = CheckYou(match.Groups["actor"].Value);
                    attacker = victim; // assume: this log comes from a self action
                    damage = match.Groups["mp"].Value;

                    skill = "Mana/Recovery Potion";
                    if (victim == CheckYou("you"))
                        skill = lastPotion;

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, damage, SwingTypeEnum.PowerHealing);
                    return;
                }
            }
            else if (str.Contains(" HP ") || str.EndsWith(" HP.") || str.Contains(" MP ") || str.EndsWith(" MP."))
            {
                return; // ignore heals/mp out of combat
            }
            #endregion

            #region blocked
            if (str.Contains("blocked"))
            {
                if (!TagBlockedAttacks) return;

                if (str.StartsWith("You have blocked ")) return; // ignore chat logs that indicate adding a player to the block list

                if (str.StartsWith("The attack was blocked by the "))
                {
                    // match "The attack was blocked by the xxx effect cast on xxx."  ( means your next attack has reduced dmg)
                    Regex rBlockYou = new Regex(@"The attack was blocked by the (?<skill>[a-zA-Z \-']*?) effect cast on (?<target>[a-zA-Z ']*)\.", RegexOptions.Compiled);
                    Match match = rBlockYou.Match(str);
                    if (!match.Success)
                    {
                        ui.AddText("Exception-Unable to parse[e4]: " + str);
                        return;
                    }

                    victim = CheckYou(match.Groups["target"].Value);
                    ////theAttackType = match.Groups["skill"].Value;
                    ////AddCombatAction(logInfo, "Unknown", incName, theAttackType, critical, special, Dnum.NoDamage, SwingTypeEnum.Melee); // don't add action; this event occurs even on spells if they have armor up
                    BlockedHistory.Add(CheckYou("you"), victim, logInfo.detectedTime, "blocked");
                    return;
                }
                else
                {
                    // match "xxx blocked xxx's attack with the xxx effect."
                    Regex rBlock = new Regex(@"(?<victim>[a-zA-Z ']*) blocked (?<attacker>[a-zA-Z ']*)'s attack( with the (?<skill>[a-zA-Z \-']*?) effect)?\.", RegexOptions.Compiled);
                    Match match = rBlock.Match(str);
                    if (!match.Success)
                    {
                        ui.AddText("Exception-Unable to parse[e8]: " + str);
                        return;
                    }

                    victim = match.Groups["victim"].Value;
                    attacker = match.Groups["attacker"].Value;
                    ////theAttackType = match.Groups["skill"].Value;
                    BlockedHistory.Add(attacker, victim, logInfo.detectedTime, "blocked");
                    return;
                }
            }
            #endregion

            #region parried
            if ((str.IndexOf("parried") != -1) && (str.IndexOf("'s attack") != -1))
            {
                victim = str.Substring(0, str.IndexOf("parried") - 1);
                victim = this.CheckYou(victim);
                attacker = str.Substring(str.IndexOf("parried") + 8, str.IndexOf("'s attack") - (str.IndexOf("parried") + 8));
                attacker = this.CheckYou(attacker);
                if (TagBlockedAttacks)
                    BlockedHistory.Add(attacker, victim, logInfo.detectedTime, "parried");
                return;
            }
            #endregion

            #region resisted
            else if (str.Contains("resisted"))
            {
                if (rResist.IsMatch(str))
                {
                    Match match = rResist.Match(str);

                    SwingTypeEnum swingType = SwingTypeEnum.NonMelee;
                    victim = CheckYou(match.Groups["victim"].Value);
                    if (match.Groups["attacker"].Success)
                    {
                        attacker = CheckYou(match.Groups["attacker"].Value);
                    }
                    else
                    {
                        attacker = CheckYou("you");
                    }

                    skill = match.Groups["skill"].Value;
                    if (skill == "your attack" || skill == "attack")
                    { // match the generic "attack" word
                        skill = "Melee"; // are these elemental melee attacks being resisted?  I mostly see assassin's attacks being resisted here, but also saw a ranger attack in my personal logs and well as my own sorc attacks.  (speaking of which, I haven't seen in my logs where my sorc's attacks were evaded.)
                        swingType = SwingTypeEnum.Melee;
                    }

                    #region resolve skills with quotes
                    /* Initially, we let the regex let the actor name be greedy with the 's.  i.e. Hirmilden's Tipolid is a possible actor.
                     * However, given the set of skills that contain 's is finite, we double check here if a skill would make more sense.
                     */
                    string blob = attacker + "'s " + skill; // example blob: "Heaven" + "Judgement II" = "Heaven's Judgement II" or "Vyn's Aether" + "Hold" = "Vyn's Aether's Hold I"
                    foreach (string skillThatContainsQuote in AionData.Skill.SkillsThatContainQuote)
                    {
                        string possiblePlayerSkill = skillThatContainsQuote + " I"; // the rank I is just there to end the skill name
                        if (blob.Contains(possiblePlayerSkill))
                        {
                            int indexForSkill = blob.IndexOf(possiblePlayerSkill);
                            string newattacker = blob.Substring(0, indexForSkill).Trim(); // example newattacker: "" or "Vyn's"
                            string newskill = blob.Substring(indexForSkill); // example newskill = "Heaven's Judgement" or "Aether's Hold"

                            if (string.IsNullOrEmpty(newattacker)) // attacker not specified? is this a self cast?
                            {
                                if (attacker == CheckYou("you")) // in the unlikely event that your character's name is Heaven, then we know your name does not appear in your own spell's resist log, so you must be a cleric and you casted Heaven's Judgment
                                {
                                    // leave attacker as "you"
                                    skill = newskill;
                                    break;
                                }
                                else
                                {
                                    // ambiguous case! either there is a templar nearby named Heaven who casted Judgment (unlikely but there is one on Siel), or you're a cleric who casted Heaven's Judgment
                                    // TODO: perhaps knowing more information will help (i.e. surrounding players during encounter, your class versus the class requirement of the spell, etc.)
                                    // just assume it was your spell that got resisted and ignore the other possibility for now
                                    attacker = CheckYou("you");
                                    skill = newskill;
                                    break;
                                }
                            }
                            else
                            {
                                attacker = newattacker.Remove(newattacker.Length - 2); // remove the 's at the end
                                skill = newskill;
                                break;
                            }
                        }
                    }
                    #endregion

                    AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.Miss, "resisted"), swingType);
                    return;
                }
            }
            #endregion

            #region evaded
            else if (str.Contains("evaded"))
            {
                Regex rEvaded = new Regex(@"^(?<victim>[a-zA-Z ']*) evaded (the|(?<attacker>[a-zA-Z ']*?)'s) (attack|(?<skill>[a-zA-Z \-']*?))\.$", RegexOptions.Compiled);
                Match match = rEvaded.Match(str);

                victim = CheckYou(match.Groups["victim"].Value);

                if (match.Groups["attacker"].Success)
                {
                    attacker = CheckYou(match.Groups["attacker"].Value);
                }
                else
                {
                    attacker = "Unknown";
                }

                SwingTypeEnum swingType;
                if (match.Groups["skill"].Success)
                {
                    swingType = SwingTypeEnum.NonMelee;
                    skill = match.Groups["skill"].Value;
                }
                else
                {
                    swingType = SwingTypeEnum.Melee;
                    skill = "Melee";
                }

                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.Miss, "evaded"), swingType);
                return;
            }
            #endregion

            #region removed/dispel
            else if (str.IndexOf("removed its abnormal physical conditions by using") != -1)
            {
                attacker = str.Substring(0, str.IndexOf("removed its abnormal physical conditions by using") - 1);
                attacker = this.CheckYou(attacker);
                victim = attacker;
                skill = str.Substring(str.IndexOf("removed its abnormal physical conditions by using") + 50, (str.Length - (str.IndexOf("removed its abnormal physical conditions by using") + 50)) - 2);
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "cure"), SwingTypeEnum.CureDispel, "cure");
                return;
            }
            else if ((str.IndexOf("removed abnormal physical conditions from") != -1) && (str.IndexOf("by using") != -1))
            {
                attacker = str.Substring(0, str.IndexOf("removed abnormal physical conditions from") - 1);
                attacker = this.CheckYou(attacker);
                victim = str.Substring(str.IndexOf("removed abnormal physical conditions from") + 0x2a, (str.IndexOf("by using") - (str.IndexOf("removed abnormal physical conditions from") + 0x2a)) - 1);
                victim = this.CheckYou(victim);
                skill = str.Substring(str.IndexOf("by using") + 9, (str.Length - (str.IndexOf("by using") + 9)) - 2);
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "cure"), SwingTypeEnum.CureDispel, "cure");
                return;
            }
            else if ((str.IndexOf("dispelled the magical buffs from") != -1) && (str.IndexOf("by using") != -1))
            {
                attacker = str.Substring(0, str.IndexOf("dispelled the magical buffs from") - 1);
                attacker = this.CheckYou(attacker);
                victim = str.Substring(str.IndexOf("dispelled the magical buffs from") + 0x21, (str.IndexOf("by using") - (str.IndexOf("dispelled the magical buffs from") + 0x21)) - 1);
                victim = this.CheckYou(victim);
                skill = str.Substring(str.IndexOf("by using") + 9, (str.Length - (str.IndexOf("by using") + 9)) - 2);
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "dispel"), SwingTypeEnum.CureDispel, "dispel");
                return;
            }
            else if ((str.IndexOf("dispelled the magical debuffs from") != -1) && (str.IndexOf("by using") != -1))
            {
                attacker = str.Substring(0, str.IndexOf("dispelled the magical debuffs from") - 1);
                attacker = this.CheckYou(attacker);
                victim = str.Substring(str.IndexOf("dispelled the magical debuffs from") + 0x21, (str.IndexOf("by using") - (str.IndexOf("dispelled the magical debuffs from") + 0x21)) - 1);
                victim = this.CheckYou(victim);
                skill = str.Substring(str.IndexOf("by using") + 9, (str.Length - (str.IndexOf("by using") + 9)) - 2);
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "cure"), SwingTypeEnum.CureDispel, "dispel");
                return;
            }
            else if (str.IndexOf("dispelled its magic effect by using") != -1) // Blind Leap
            {
                attacker = str.Substring(0, str.IndexOf("dispelled its magic effect by using") - 1);
                attacker = this.CheckYou(attacker);
                victim = attacker;
                skill = str.Substring(str.IndexOf("by using") + 9, (str.Length - (str.IndexOf("by using") + 9)) - 2);
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "cure"), SwingTypeEnum.CureDispel, "dispel");
                return;
            }
            else if (str.Contains("dispelled its magical debuffs by using"))
            {
                attacker = CheckYou(str.Substring(0, str.IndexOf("dispelled its magical debuffs") - 1));
                victim = attacker;
                skill = str.Substring(str.IndexOf("by using") + 9, (str.Length - (str.IndexOf("by using") + 9)) - 2);
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "cure"), SwingTypeEnum.CureDispel, "dispel");
                return;
            }
            else if (str.StartsWith("Your abnormal physical conditions were removed because"))
            {
                Regex rDispelOnYou = new Regex(@"Your abnormal physical conditions were removed because (?<actor>[a-zA-Z ']*) used (?<skill>[a-zA-Z \-']*?) on you", RegexOptions.Compiled);
                Match match = rDispelOnYou.Match(str);
                victim = CheckYou("you");
                attacker = match.Groups["actor"].Value;
                skill = match.Groups["skill"].Value;
                AddCombatAction(logInfo, attacker, victim, skill, critical, special, new Dnum((int)Dnum.NoDamage, "cure"), SwingTypeEnum.CureDispel, "cure");
                return;
            }

            #endregion

            #region state parses
            /*
            // match "xxx is in the xxx state..."
            if (rStateAbility.IsMatch(str))
            {

                Match match = rStateAbility.Match(str);
                string target = CheckYou(match.Groups["target"].Value);
                string actor = CheckYou(match.Groups["actor"].Value);
                if (string.IsNullOrEmpty(actor)) actor = target;
                string skill = match.Groups["skill"].Value;
                return;
            }

            else if (rWeakened.IsMatch(str))
            {
                //Match match = rWeakened.Match(str);
                return;
            }
             */
            #endregion

            #region debug output
            else
            {
                if (DebugParse && !IsIgnore(str))
                    ui.AddText("unparsed: " + str);
            }
            #endregion
        }
Ejemplo n.º 42
0
        private void act_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (!isImport)
            {
                if ((this.HideWhenDissolve && regexDissolve.IsMatch(logInfo.logLine)) ||
                    (this.HideWhenEnded && regexEnded.IsMatch(logInfo.logLine)))
                {
                    // clear
                    for (int i = 0; i < 8; i++)
                    {
                        PartyMemberInfo[i].Job = (int)JOB.Unknown;
                        PartyMemberInfo[i].Name = string.Empty;
                        PartyMemberInfo[i].CurrentTP = 0;
                    }
                    // hide at dissolution.
                    viewer.Hide();
                    return;
                }

                Match match = regexCmd.Match(logInfo.logLine);
                if (match.Success)
                {
                    string command = match.Groups["Command"].ToString().ToLower();
                    if (string.IsNullOrEmpty(command))
                    {
                        switch (match.Groups["Num"].ToString())
                        {
                            case "2":
                            case "3":
                            case "4":
                            case "5":
                            case "6":
                            case "7":
                            case "8":
                                int idx = int.Parse(match.Groups["Num"].Value.ToString()) - 1;
                                PartyMemberInfo[idx].Name = match.Groups["Name"].Value.ToString();
                                break;
                            default:
                                break;
                        }
                    }
                    else
                    {
                        switch (command)
                        {
                            case "adjust":
                                this.PartyListUI = Util.GetPartyListLocation(this.CharFolder);
                                if (this.IsAllianceStyle)
                                    allianceStyle.Adjust();
                                else
                                    normalStyle.Adjust();
                                break;
                            case "clear":
                                for (int i = 0; i < 8; i++)
                                {
                                    PartyMemberInfo[i].Job = (int)JOB.Unknown;
                                    PartyMemberInfo[i].Name = string.Empty;
                                    PartyMemberInfo[i].CurrentTP = 0;
                                }
                                break;
                            case "hide":
                                viewer.Hide();
                                break;
                            case "show":
                                if (this.IsAllianceStyle)
                                    viewer = allianceStyle;
                                else
                                    viewer = normalStyle;

                                if (!viewer.Visible)
                                {
                                    this.PartyListUI = Util.GetPartyListLocation(this.CharFolder);
                                }
                                if (this.IsAllianceStyle)
                                    allianceStyle.Adjust();
                                else
                                    normalStyle.Adjust();
                                viewer.TopMost = true;
                                viewer.Show();
                                break;
                            default:
                                break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 43
0
        void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            // Do we have a valid log file line?
            if (!logInfo.logLine.Contains("::")) return;

            ActGlobals.oFormActMain.GlobalTimeSorter++;

            //pass log line into co event constructor
            COEvent v = new COEvent(logInfo.logLine, checkBox_UseAccountName.Checked);

            //process the event
            if (!v.ignore) { ProcessEvent(v, logInfo); }

        }
Ejemplo n.º 44
0
        private void ProcessEvent(COEvent v, LogLineEventArgs logInfo)
        {
            if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, v.ownerDisplay, v.targetDisplay))
                ActGlobals.oFormActMain.AddCombatAction(v.swingtype, v.critical, v.flags, v.ownerDisplay, v.eventDisplay, v.dnum, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, v.targetDisplay, v.type);

            if (v.kill)
                ActGlobals.oFormActMain.AddCombatAction(v.swingtype, v.critical, "None", v.ownerDisplay, "Killing", Dnum.Death, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, v.targetDisplay, v.type);
        }
Ejemplo n.º 45
0
        private void OnLogLineRead(bool isImport, LogLineEventArgs args)
        {
            if (isImport)
                return;
            Debug.Assert(args.logLine != null);
            // FIXME: Remove this check once the source of the null log lines is found.
            if (args.logLine != null)
            {
                logLines.Enqueue(args.logLine);
            }

            // FIXME: expose this error to the browser.
            if (logLines.Count > MaxLogLinesRetained)
                logLines.Dequeue();
        }
Ejemplo n.º 46
0
        void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            //Init
            string log = logInfo.logLine;
            int chattick = 4;
            int chatspeed = 300;

            //Zone Engine
            if (currentZone != logInfo.detectedZone)
            {
                currentZone = logInfo.detectedZone;

                if (RzPulse == true)
                {
                    CTS.Cancel();
                    RzPulse = false;
                }

                //Raid Effects Mode
                if (chk_raidEffects.Checked && raidZoneList.Contains(currentZone))
                {
                    if (state != 4)
                    {
                        state = 4;
                        skyWatcher.Enabled = false;
                        updateState("breath", btn_raidEffectsA.BackColor, btn_raidEffectsB.BackColor);
                    }
                    else
                    {
                        updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                        state = 1;
                        currentZone = "";
                    }
                }

                //Gold Saucer Vegas Mode
                else if (chk_GoldSaucerVegas.Checked && (currentZone == "The Golden Saucer" || currentZone == "Chocobo Square" || currentZone == "Unknown Zone (184)"))
                {
                    skyWatcher.Enabled = false;
                    updateState("wave", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                    state = 3;
                }

                //Reactive Weather
                else if (chk_reactiveWeather.Checked)
                {
                    state = 6;
                    setWeather(calculateWeather(currentZone));
                    skyWatcher.Enabled = true;
                }

                //Return to Default
                else
                {
                    updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                    state = 1;
                    CTS.Cancel();
                    skyWatcher.Enabled = false;
                }
            }

            //DPS Threshold
            if (chk_DPSLimit.Checked && inCombat == true)
            {
                int currentDPS = Convert.ToInt32(ActiveEnconter.GetCombatant("YOU").EncDPS);
                int limitDPS = Convert.ToInt32(txt_DPSlimit.Value);
                int notifyDPS = Convert.ToInt32(txt_DPSNotify.Value);
                int min = 120;
                int max = 800;

                int tickspeed = ((currentDPS - notifyDPS) * (min - max) / (limitDPS - notifyDPS)) + max;

                if (currentDPS >= limitDPS)
                {
                    if (reachDPS == 1 || reachDPS == 2)
                    {
                        Debug.WriteLine(reachDPS);
                        DPSparse = true;
                        reachDPS = 3;
                        updateState("static", btn_DPSLimitCol.BackColor, btn_defaultCol.BackColor);
                        dpsloop.Stop();
                        dpstickstart = false;
                        dpsloop.Enabled = false;
                    }
                }
                else if ((currentDPS >= notifyDPS && currentDPS < limitDPS) && notifyDPS >= 0)
                {
                    if (dpstickstart == false)
                    {
                        DPSparse = true;
                        reachDPS = 2;
                        if (chk_enableEmnity.Checked)
                        {
                            new Task(() =>
                            {
                                dpstickstart = true;
                                updateState("static", btn_emnityCol.BackColor, btn_defaultCol.BackColor);
                                dpsloop = new System.Timers.Timer();
                                dpsloop.Elapsed += (source, e) => { flashDPSTimer(source, currentDPS); };
                                dpsloop.Interval = tickspeed;
                                dpsloop.Enabled = true;
                            }).Start();
                        }
                        else
                        {
                            new Task(() =>
                            {
                                dpstickstart = true;
                                updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                                dpsloop = new System.Timers.Timer();
                                dpsloop.Elapsed += (source, e) => { flashDPSTimer(source, currentDPS); };
                                dpsloop.Interval = tickspeed;
                                dpsloop.Enabled = true;
                            }).Start();
                        }
                    }
                    else
                    {
                        dpsloop.Interval = tickspeed;
                    }
                }
                else
                {
                    if (reachDPS == 2 || reachDPS == 3)
                    {
                        if (chk_enableEmnity.Checked)
                        {
                            updateState("static", btn_emnityCol.BackColor, btn_defaultCol.BackColor);
                        }
                        else
                        {
                            updateState("static", btn_defaultCol.BackColor, btn_defaultCol.BackColor);
                        }
                        reachDPS = 1;
                        DPSparse = false;
                        dpsloop.Stop();
                        dpstickstart = false;
                        dpsloop.Enabled = false;
                    }
                }
            }

            //Chat Engine
            string receipt = log.Split('.')[1];
            string author = receipt.Split(']')[0];
            string messagetype = log.Substring(20).Split(':')[0];

            if (author == "000")
            {

                //SAY
                if (messagetype == "0a")
                {
                    if (ChromaReady == true && chk_say.Checked)
                    {
                        flashState("say", chattick, chatspeed);
                    }
                }
                //TELL
               else  if (messagetype == "0d")
                {
                    if (ChromaReady == true && chk_tell.Checked)
                    {
                        flashState("tell", chattick, chatspeed);
                    }
                }
                //YELL
                else if (messagetype == "1e")
                {
                    if (ChromaReady == true && chk_yell.Checked)
                    {
                        flashState("yell", chattick, chatspeed);
                    }
                }
                //PARTY
                else if (messagetype == "0e")
                {
                    if (ChromaReady == true && chk_party.Checked)
                    {
                        flashState("party", chattick, chatspeed);
                    }
                }
                //ALLIANCE
                else if (messagetype == "0f")
                {
                    if (ChromaReady == true && chk_alliance.Checked)
                    {
                        flashState("alliance", chattick, chatspeed);
                    }
                }
                //FC
                else if (messagetype == "18")
                {
                    if (ChromaReady == true && chk_fc.Checked)
                    {
                        flashState("fc", chattick, chatspeed);
                    }
                }
                //SHOUT
                else if (messagetype == "0b")
                {
                    if (ChromaReady == true && chk_shout.Checked)
                    {
                        flashState("shout", chattick, chatspeed);
                    }
                }
                //LS1
                else if (messagetype == "10")
                {
                    if (ChromaReady == true && chk_ls1.Checked)
                    {
                        flashState("ls1", chattick, chatspeed);
                    }
                }
                //LS2
                else if (messagetype == "11")
                {
                    if (ChromaReady == true && chk_ls2.Checked)
                    {
                        flashState("ls2", chattick, chatspeed);
                    }
                }
                //LS3
                else if (messagetype == "12")
                {
                    if (ChromaReady == true && chk_ls3.Checked)
                    {
                        flashState("ls3", chattick, chatspeed);
                    }
                }
                //LS4
                else if (messagetype == "13")
                {
                    if (ChromaReady == true && chk_ls4.Checked)
                    {
                        flashState("ls4", chattick, chatspeed);
                    }
                }
                //LS5
                else if (messagetype == "14")
                {
                    if (ChromaReady == true && chk_ls5.Checked)
                    {
                        flashState("ls5", chattick, chatspeed);
                    }
                }
                //LS6
                else if (messagetype == "15")
                {
                    if (ChromaReady == true && chk_ls6.Checked)
                    {
                        flashState("ls6", chattick, chatspeed);
                    }
                }
                //LS7
                else if (messagetype == "16")
                {
                    if (ChromaReady == true && chk_ls7.Checked)
                    {
                        flashState("ls7", chattick, chatspeed);
                    }
                }
                //LS8
                else if (messagetype == "17")
                {
                    if (ChromaReady == true && chk_ls8.Checked)
                    {
                        flashState("ls8", chattick, chatspeed);
                    }
                }
            }

            //Custom Triggers
            string loglineA = log.Substring(23);

            if (customTriggers.Any(str => loglineA.Contains(str)))
            {
                if (ChromaReady == true && chk_enableTriggers.Checked)
                {
                    flashState("trigger", maxtick, tickspeed);
                }

            }
        }
Ejemplo n.º 47
0
        /// <summary>
        /// ログを一行読取った
        /// </summary>
        /// <param name="isImport">Importか?</param>
        /// <param name="logInfo">ログ情報</param>
        private void oFormActMain_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport)
            {
                return;
            }

#if false
            Debug.WriteLine(logInfo.logLine);
#endif

            var logLine = logInfo.logLine.Trim();

            // 最後のログから1min間が空いた?
            if ((DateTime.Now - this.lastLogineTimestamp).TotalMinutes >= 1.0d)
            {
                FF14PluginHelper.RefreshPlayer();
                RefreshPTList();
            }

            // ジョブに変化あり?
            if (logLine.Contains("にチェンジした。") ||
                logLine.Contains("You change to "))
            {
                FF14PluginHelper.RefreshPlayer();
                RefreshPTList();
            }

            // パーティに変化あり?
            if (enabledPartyMemberPlaceHolder)
            {
                if (ptmember == null ||
                    replacementsByJobs == null ||
                    logLine.Contains("パーティを解散しました。") ||
                    logLine.Contains("がパーティに参加しました。") ||
                    logLine.Contains("がパーティから離脱しました。") ||
                    logLine.Contains("をパーティから離脱させました。") ||
                    logLine.Contains("の攻略を開始した。") ||
                    logLine.Contains("の攻略を終了した。") ||
                    (logLine.Contains("You join ") && logLine.Contains("'s party.")) ||
                    logLine.Contains("You left the party.") ||
                    logLine.Contains("You dissolve the party.") ||
                    logLine.Contains("The party has been disbanded.") ||
                    logLine.Contains("joins the party.") ||
                    logLine.Contains("has left the party.") ||
                    logLine.Contains("was removed from the party."))
                {
                    Task.Run(() =>
                    {
                        Thread.Sleep(5 * 1000);
                        RefreshPTList();
                    });
                }
            }

            // ペットIDのCacheを更新する
            var player = FF14PluginHelper.GetPlayer();
            if (player != null)
            {
                var jobName = Job.GetJobName(player.Job);
#if DEBUG
                Debug.WriteLine("JOB NAME!! " + jobName);
#endif
                if (jobName == "巴術士" || jobName == "ARC" ||
                    jobName == "学者" || jobName == "SCH" ||
                    jobName == "召喚士" || jobName == "SMN")
                {
                    if (logLine.Contains(player.Name + "の「サモン") ||
                        logLine.Contains("You cast Summon"))
                    {
                        Task.Run(() =>
                        {
                            Thread.Sleep(5 * 1000);
                            RefreshPetID();
                        });
                    }

                    if (petidZone != ActGlobals.oFormActMain.CurrentZone)
                    {
                        Task.Run(() =>
                        {
                            lock (lockPetidObject)
                            {
                                var count = 0;
                                while (petidZone != ActGlobals.oFormActMain.CurrentZone)
                                {
                                    Thread.Sleep(15 * 1000);
                                    RefreshPetID();
                                    count++;

                                    if (count >= 6)
                                    {
                                        petidZone = ActGlobals.oFormActMain.CurrentZone;
                                        break;
                                    }
                                }
                            }
                        });
                    }
                }
            }

            lock (this.buffer)
            {
                this.buffer.Add(logLine);

                // ログのタイムスタンプを記録する
                this.lastLogineTimestamp = DateTime.Now;
            }
        }
Ejemplo n.º 48
0
        private void ParseLine(bool isImport, LogLineEventArgs log)
        {
            ActGlobals.oFormActMain.GlobalTimeSorter++;
            log.detectedType = Color.Black.ToArgb();
            DateTime time = ActGlobals.oFormActMain.LastKnownTime;
            LogLine line = new LogLine(log.logLine);
            if (log.logLine.Contains("{836045448945490}")) // Exit Combat
            {
                ActGlobals.oFormActMain.EndCombat(!isImport);
                log.detectedType = Color.Purple.ToArgb();
                return;
            }
            if (log.logLine.Contains("{836045448945489}")) // Enter Combat
            {
                ActGlobals.oFormActMain.EndCombat(!isImport);
                ActGlobals.oFormActMain.SetEncounter(time, line.source, line.target);
                log.detectedType = Color.Purple.ToArgb();
                return;
            }

            int type = 0;
            if (log.logLine.Contains("{836045448945501}")) // Damage
            {
                log.detectedType = Color.Red.ToArgb();
                type = DMG;
            }
            else if (log.logLine.Contains("{836045448945488}") || // Taunt
                log.logLine.Contains("{836045448945483}")) // Threat
            {
                log.detectedType = Color.Blue.ToArgb();
                type = THREAT;
            }
            else if (log.logLine.Contains("{836045448945500}")) // Heals
            {
                log.detectedType = Color.Green.ToArgb();
                type = HEALS;
            }
            else if (log.logLine.Contains("{836045448945493}")) // Death
            {
                ActGlobals.oFormActMain.AddCombatAction(DMG, line.crit_value,
                    "None", line.source, "Killing Blow", Dnum.Death, time,
                    ActGlobals.oFormActMain.GlobalTimeSorter, line.target, "Death");

            }

            /*else if (line.event_type.Contains("Restore"))
            {
                log.detectedType = Color.OrangeRed.ToArgb();
                type = 20;
            }
            else if (line.event_type.Contains("Spend"))
            {
                log.detectedType = Color.Cyan.ToArgb();
                type = 21;
            }
            if (line.ability != "")
            {
                last_ability = line.ability;
            }
            if ((type == 20 || type == 21) && ActGlobals.oFormActMain.SetEncounter(time, line.source, line.target))
            {
                ActGlobals.oFormActMain.AddCombatAction(type, line.crit_value, "None", line.source, last_ability, new Dnum(line.value), time, ActGlobals.oFormActMain.GlobalTimeSorter, line.target, "");
            }
            */
            if (!ActGlobals.oFormActMain.InCombat)
            {
                return;
            }
            if (line.threat > 0 && ActGlobals.oFormActMain.SetEncounter(time, line.source, line.target))
            {
                ActGlobals.oFormActMain.AddCombatAction(type, line.crit_value, "None", line.source, line.ability,
                    new Dnum(line.value), time, ActGlobals.oFormActMain.GlobalTimeSorter, line.target, line.value_type);
                ActGlobals.oFormActMain.AddCombatAction(16, line.crit_value, "None", line.source, line.ability,
                    new Dnum(line.threat), time, ActGlobals.oFormActMain.GlobalTimeSorter, line.target, "Increase");
            }
            return;
        }
Ejemplo n.º 49
0
 void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
 {
     for (int i = 0; i < regexArray.Length; i++)
     {
         if (regexArray[i].IsMatch(logInfo.logLine))
         {
             switch (i)
             {
                 case 0:
                 case 1:
                 case 2:
                     logInfo.detectedType = Color.Red.ToArgb();
                     break;
                 case 3:
                 case 4:
                     logInfo.detectedType = Color.Blue.ToArgb();
                     break;
                 case 5:
                 case 6:
                 case 7:
                     logInfo.detectedType = Color.DarkRed.ToArgb();
                     break;
                 case 12:
                     logInfo.detectedType = Color.DarkOrchid.ToArgb();
                     break;
                 case 13:
                 case 14:
                     logInfo.detectedType = Color.DodgerBlue.ToArgb();
                     break;
                 default:
                     logInfo.detectedType = Color.Black.ToArgb();
                     break;
             }
             LogExeJpn(i + 1, logInfo.logLine, isImport);
             break;
         }
     }
 }
        private void AddCombatAction(LogLineEventArgs logInfo, string attacker, string victim, string theAttackType, bool critical, string special, Dnum damage, SwingTypeEnum swingType, string damageType)
        {
            DateTime now = logInfo.detectedTime;
            if (ActGlobals.oFormActMain.SetEncounter(now, attacker, victim))
            {
                // attempt to guess the party member's class
                if (GuessChanter)
                {
                    PartyMembers.SetClass(attacker, theAttackType);
                }

                // redirect attacks from pets/servants as coming from summoner
                if (SummonerRecordSet.IsSummonedPet(attacker))
                {
                    var summonerRecord = SummonerRecordSet.GetSummonerRecord(victim, attacker, now);
                    if (summonerRecord != null)
                    {
                        string pet = attacker;
                        if (AionData.Pet.IsTargettedPet(pet))
                        {
                            attacker = summonerRecord.Actor;
                            theAttackType = summonerRecord.Skill;
                        }
                        else if (LinkPets)
                        {
                            attacker = summonerRecord.Actor;
                            if (summonerRecord.Duration <= 60)
                                theAttackType = summonerRecord.Skill;
                            else
                                theAttackType += "(" + pet + ")";
                        }
                    }
                }
                else if (SummonerRecordSet.IsSummonedPet(victim))
                {
                    if (AionData.Pet.IsPet(victim))
                    {
                        // handle player pets
                        if (AionData.Pet.PetDurations[victim] <= 60) return; // ignore damage done to short-duration temporary pets // TODO: this should be a checkbox as this will decrease the dps of the attacker

                        var summonerRecord = SummonerRecordSet.GetSummonerRecord(null, victim, now);
                        if (LinkPets)
                        {
                            ////return; // TODO: how do we treat damage done to spiritmaster's pets?
                        }
                    }
                    else
                    {
                        // handle monster/unknown pets
                        if (LinkPets)
                        {
                            // TODO: how do we treat damage done to mob's pets?
                        }
                        else
                        {
                            ////victim += " (inc)"; // TODO: this should be a checkbox if we want damage shown to mob pets
                        }
                    }
                }

                int globalTime = ActGlobals.oFormActMain.GlobalTimeSorter++;
                ActGlobals.oFormActMain.AddCombatAction((int)swingType, critical, special, attacker, theAttackType, damage, now, globalTime, victim, damageType);
            }
        }
        void OnBeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            logInfo.detectedType = Color.Gray.ToArgb();
            /*
            // To Short
            if (logInfo.logLine.Length < 35) return;

            // Magic '*' token
            if (logInfo.logLine[30] != '*') return;

            // Break the line down by the separater.
            string meat = logInfo.logLine.Substring(31);
            */

            // ---- BETA
            int i = logInfo.logLine.IndexOf(' ');
            if (i == -1) return;

            // Magic '*' token
            if (logInfo.logLine[i+1] != '*') return;

            // Break the line down by the separater.
            string meat = logInfo.logLine.Substring(i+2);
            // ----- BETA

            string[] segments = meat.Split(':');

            if (segments.Length < 2)
            {
                logInfo.detectedType = Color.DarkGray.ToArgb();
                return;
            }

            ActGlobals.oFormActMain.GlobalTimeSorter++;

            LogEntryTypes code = LogEntryTypes.logEntryType_UNKNOWN;
            if (logEntryTypes.TryGetValue(segments[0], out code))
            {
                switch (code)
                {
                    case LogEntryTypes.logEntryType_PLAYER:
                        ProcessPlayer(isImport, logInfo, segments);
                        break;
                    case LogEntryTypes.logEntryType_COMBAT:
                        CombatEvent ce = CombatEvent.Parse(segments);
                        if (ce != null) ProcessCombat(logInfo, ce);
                        break;
                    case LogEntryTypes.logEntryType_EFFECT:
                        ProcessEffect(logInfo, segments);
                        break;
                }
            }
        }
        // Must match LogLineEventDelegate signature
        void oFormActMain_BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            parsedLineCount++;

            if (logInfo.logLine.Length < 30 || logInfo.logLine[19] != ':' || logInfo.logLine[20] != ':')
            {
                logInfo.detectedType = Color.DarkGray.ToArgb();
                errorLineCount++;
                return;
            }

            if (logInfo.detectedTime != curActionTime)
            {
                // Different times mean new action block, any pending actions won't be related to those of the new block
                curActionTime = logInfo.detectedTime;
            }

            ParsedLine pl = new ParsedLine(logInfo);

            if (pl.error)
            {
                logInfo.detectedType = Color.DarkGray.ToArgb();
                errorLineCount++;
                return;
            }

            // Fix up the ParsedLine to be easy to process.
            ProcessBasic(pl);

            // Detect Player names..
            if ( ! (playersCharacterFound || isImport ) )
            {
                if (pl.ownEntityType == EntityType.Player)
                {
                    if (playerCharacterNames.ContainsKey(pl.ownDsp))
                    {
                        ActGlobals.charName = pl.ownDsp;
                        playersCharacterFound = true;
                    }
                }
            }

            // Do the real stuff..
            ProcessAction(pl);
        }
Ejemplo n.º 53
0
        private void ProcessLogLineEntry(LogLineEventArgs logInfo, ref string victim, ref string attacker, ref int attackType, ref string attackName, ref string special, ref Boolean SelfAttack, ref Int64 Amount, ref Boolean critical, Boolean colorlog, string attackSuffix, int eventType, MatchCollection matches)
        {
            if (eventType != -1) // Filtering
            {

                ActGlobals.oFormActMain.GlobalTimeSorter++;

                GroupCollection groups = matches[0].Groups;
                attacker = groups["actor"].Value.Trim(' ', '"');
                victim = groups["actee"].Value.Trim(' ', '"');
                attackName = removeFont(groups["attackName"].Value);
                if (("".Equals(attacker)) && !(attackName.Contains("\"")) && (SecretLanguage.Language == SecretLanguage.German))
                {
                    attacker = victim;
                }
                attackName = attackName.Trim(' ', '"', '\'') + attackSuffix;
                string damageTypeStr = TrimBrackets(groups["damageType"].Value);
                string damageClassStr = TrimBrackets(groups["damageClass"].Value);
                string blockTypeStr = TrimBrackets(groups["blockType"].Value);
                string amountStr = TrimBrackets(groups["amount"].Value);

                try
                {
                    if (amountStr == "")
                    {
                        Amount = 0;
                    }
                    else
                    {
                        Amount = Int64.Parse(amountStr);
                    }
                }
                catch (Exception)
                {
                    Amount = 0;
                }

                critical = false;
                if (groups["crit"].Length > 0)
                {
                    critical = true;
                }

                attacker = ConvertCharName(attacker);

                if ("Ihres".Equals(victim))
                {
                    victim = attacker;
                }
                else
                {
                    victim = ConvertCharName(victim);
                }

                // Ignore unknown attacks
                if (eventType == 12)
                {
                    if (attacker.Length < 1)
                    {
                        return;
                    }
                }
                else
                {
                    if (attacker.Length < 1 || victim.Length < 1)
                    {
                        return;
                    }
                }

                // Filter the results if enabled
                if (filterNames.Count > 0 && checkBox_Filter.Checked)
                {
                    if (checkBox_filterExclude.Checked)
                    {
                        if (filterNames.Contains(attacker) || filterNames.Contains(victim))
                        {
                            return;
                        }
                    }
                    else
                    {
                        if (!(filterNames.Contains(attacker) || filterNames.Contains(victim)))
                        {
                            return;
                        }
                    }
                }

                string DamageType;
                if (damageClassStr.Length > 0)
                {
                    DamageType = damageClassStr.Trim();
                }
                else
                {
                    DamageType = SecretLanguage.none;
                }

                if (SecretLanguage.Glancing.Equals(damageTypeStr))
                {
                    special = AddSpecial(special, damageTypeStr);
                }

                if (SecretLanguage.Penetrated.Equals(blockTypeStr))
                {
                    special = AddSpecial(special, blockTypeStr);
                }

                if (SecretLanguage.Blocked.Equals(blockTypeStr))
                {
                    special = AddSpecial(special, blockTypeStr);
                }

                // AEGIS
                if (victim.IndexOf(SecretLanguage.AegisShieldLine) != -1)
                {
                    foreach (var aegisShieldLine in SecretLanguage.aegisShieldLines)
                    {
                        matches = aegisShieldLine.Matches(victim);
                        if (matches != null && matches.Count > 0)
                        {
                            GroupCollection aegisGroup = matches[0].Groups;
                            string actee = aegisGroup["actee"].Value.Trim(' ', '"', '\'', '.');
                            string aegis = aegisGroup["aegis"].Value.Trim(' ', '"', '\'', '.');

                            if ((actee.Length > 0) && (aegis.Length > 0))
                            {
                                special = AddSpecial(special, SecretLanguage.Aegis);
                                if (DamageType == SecretLanguage.none)
                                {
                                    DamageType = (Amount > 0) ? aegis : "Aegis Mismatch";
                                }
                                actee = ConvertCharName(actee);
                                victim = (checkBox_ReduceAegis.Checked)? actee : actee + " - " + aegis + " AEGIS";
                                break;
                            }
                        }
                    }
                }

                // Ignore self hits
                if (attacker.Equals(victim))
                {
                    SelfAttack = true;
                }

                #region Main Parsing coding
                // Parsing codes
                //
                switch (eventType)
                {
                    #region Case 3 [Hit]
                    case 3:
                        // Normal attack
                        // <Attacker> , <Vicitim> , <Amount> , <Spell ID> , <Spell Name> )
                        // <attacker>'s <spell name> hits <Victim> for <Amount> damage.
                        if (Amount < 0) Amount = 0;

                        if ((((SelfAttack && ActGlobals.oFormActMain.InCombat) || !SelfAttack) && "" != attacker && "" != victim && ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, attacker, victim)) || (ActGlobals.oFormActMain.InCombat && ("" == attacker || "" == victim))) // Altuslumen 1.3.0.3.2 one line edit
                        {
                            if (SelfAttack)
                            {
                                if (checkBox_SelfDamage.Checked)
                                {
                                    string newAttacker = "";
                                    if (checkBox_SelfPlayerDamage.Checked)
                                    {
                                        newAttacker = attacker;
                                    }
                                    newAttacker += "_self_";
                                    ActGlobals.oFormActMain.AddCombatAction(attackType, critical, special, newAttacker, attackName, Amount, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, victim, DamageType);
                                }
                                else
                                {
                                    ActGlobals.oFormActMain.AddCombatAction(attackType, critical, special, attacker, attackName, new Dnum(0, "0 (" + Amount + ")"), logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, victim, DamageType);
                                }
                                //ActGlobals.oFormActMain.AddDamageToGraph(attacker, 0);
                            }
                            else
                            {
                                ActGlobals.oFormActMain.AddCombatAction(attackType, critical, special, attacker, attackName, Amount, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, victim, DamageType);
                                //ActGlobals.oFormActMain.AddDamageToGraph(attacker, Amount);
                            }

                            if (colorlog) logInfo.detectedType = System.Drawing.Color.Red.ToArgb();
                        }
                        break;
                    #endregion

                    #region Case 5 [Heals]
                    case 5:
                        // Someone is healed
                        // <Attacker> , <Vicitim> , <Amount> , <Spell ID> , <Spell Name> )
                        // <Attacker>'s <Spell Name> heals <Vicitim> for <Amount>.

                        // Check if overheal exists
                        Dnum DamN = new Dnum(Amount);
                        attackType = (int)SwingTypeEnum.Healing;

                        if (ActGlobals.oFormActMain.InCombat)
                        {
                            ActGlobals.oFormActMain.AddCombatAction(attackType, critical, special, attacker, attackName, DamN, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, victim, DamageType);
                            if (colorlog) logInfo.detectedType = System.Drawing.Color.Green.ToArgb();
                        }
                        break;
                    #endregion

                    #region Case 10 [Miss]
                    case 10:
                        // An attack misses
                        // 10 , T=N#R=O#<ID Number of attacker> , T=P#R=O#<ID Number of Victim> , T=X#R=X#<ID Number of attacker's owner if pet> , T=X#R=X#<ID Number of attacker's owner if pet> ,
                        // <Attacker> , <Vicitim> , <Amount> , <Spell ID> , <Spell Name> )
                        // <Attacker>'s <Spell Name> misses <Vicitim>.
                        if (ActGlobals.oFormActMain.SetEncounter(logInfo.detectedTime, attacker, victim))
                        {
                            ActGlobals.oFormActMain.AddCombatAction(attackType, critical, special, attacker, attackName, new Dnum(Dnum.Miss, SecretLanguage.Miss), logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, victim, DamageType); // Altuslumen 1.3.0.3.2
                            if (colorlog) logInfo.detectedType = System.Drawing.Color.Blue.ToArgb();
                        }
                        break;
                    #endregion

                    #region Case 12 [Death]
                    case 12:
                        // Someone died
                        // 12 , T=N#R=O#<ID Number of attacker> , T=P#R=O#<ID Number of Victim> , T=X#R=X#<ID Number of attacker's owner if pet> , T=X#R=X#<ID Number of attacker's owner if pet> ,
                        // <Attacker> , <Vicitim> , <Amount> , <Spell ID> , <Spell Name> )

                        if (ActGlobals.oFormActMain.InCombat)
                        {
                            ActGlobals.oFormActMain.AddCombatAction(attackType, critical, SecretLanguage.none, attacker, SecretLanguage.Killing, Dnum.Death, logInfo.detectedTime, ActGlobals.oFormActMain.GlobalTimeSorter, attacker, DamageType); // Altuslumen 1.3.0.3.2
                            if (colorlog) logInfo.detectedType = System.Drawing.Color.Red.ToArgb();
                            //if (ActGlobals.oFormActMain.CbKillEnd_Checked && ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.GetAllies().Contains(new CombatantData(CodeList[5], null))) ActGlobals.oFormActMain.EndCombat(true);
                        }
                        break;
                    #endregion

                }
                #endregion
            }
        }
 private void AddCombatAction(LogLineEventArgs logInfo, string attacker, string victim, string theAttackType, bool critical, string special, Dnum damage, SwingTypeEnum swingType)
 {
     AddCombatAction(logInfo, attacker, victim, theAttackType, critical, special, damage, swingType, string.Empty);
 }
        void LogCombatEvent(SwingTypeEnum st, LogLineEventArgs logInfo, CombatEvent ce, string special = "")
        {
            MasterSwing ms = new MasterSwing(
                                (int)st,
                                ce.critical,
                                special,
                                new Dnum(ce.hitValue),
                                logInfo.detectedTime,
                                ActGlobals.oFormActMain.GlobalTimeSorter,
                                ce.ability,
                                ce.sourceName,
                                ce.damageType,
                                ce.targetName);

            ms.Tags.Add("ActionResult", ce.result);
            ms.Tags.Add("ActionSlotType", ce.abilitySlotType);
            ms.Tags.Add("PowerType", ce.powerType);

            ActGlobals.oFormActMain.AddCombatAction(ms);
        }
        private void ProcessPlayer(bool isImport, LogLineEventArgs logInfo, string[] segments)
        {
            if (segments.Length < 4) return;

            logInfo.detectedType = Color.Purple.ToArgb();

            if (segments[1].Length > 0) ActGlobals.charName = segments[1];

            if ((segments[2].Length > 0) &&
                (ActGlobals.oFormActMain.CurrentZone != segments[2]))
            {
                if (ActGlobals.oFormActMain.InCombat)
                {
                    ActGlobals.oFormActMain.EndCombat(!isImport);
                }

                if (!isImport)
                {
                    ActGlobals.oFormActMain.ChangeZone(segments[2]);
                }
            }
        }
 private void AddCombatAction(LogLineEventArgs logInfo, string attacker, string victim, string theAttackType, bool critical, string special, string damage, SwingTypeEnum swingType, string damageType)
 {
     Dnum dnumDamage = NewDnum(damage, null);
     AddCombatAction(logInfo, attacker, victim, theAttackType, critical, special, dnumDamage, swingType, damageType);
 }
        public ParsedLine(LogLineEventArgs logInfo)
        {
            //    Time            ::   ownDsp  ,                ownInt                   ,       srcDsp     ,      srcInt          ,   tgtDsp  ,           tgtInt                        ,evtDsp,  evtInt  ,type ,flags,mag,magBase
            // 13:03:22:20:16:32.6::Ameise-22  ,P[100083146@5846877 Ameise@antday]       ,Morsches Skelett-1,C[6261 Skeleton_Basic],Ameise-22  ,P[100083146@5846877 Ameise@antday]       ,Wache ,Pn.Jy04um1,Power,Kill ,-0 ,0
            // 13:07:08:14:57:31.4::Wolf       ,C[42358 Monster_Wolf]                    ,                  ,*                     ,Fiolnir    ,P[201259732@7545190 Fiolnir@lodur42]     ,Bite  ,Pn.Lp6b6g1,Physical,Flank,43.4474,47.6017

            this.logInfo = logInfo;
            this.ts = ++ActGlobals.oFormActMain.GlobalTimeSorter;
            string[] split = logInfo.logLine.Split(NW_Parser.separatorLog, StringSplitOptions.None);
            ownDsp = split[1];
            ownInt = split[2];
            srcDsp = split[3];
            srcInt = split[4];
            tgtDsp = split[5];
            tgtInt = split[6];
            evtDsp = split[7];
            evtInt = split[8];
            type = split[9];
            flags = split[10];
            mag = float.Parse(split[11], NW_Parser.cultureLog);
            magBase = float.Parse(split[12], NW_Parser.cultureLog);
            if (split.Length != 13)
            {
                this.error = true;
            }

            ownEntityType = EntityType.Unknown;
            srcEntityType = EntityType.Unknown;
            tgtEntityType = EntityType.Unknown;

            // Defaults for the clean names.
            encAttackerName = srcDsp;
            encTargetName = tgtDsp;
            unitAttackerName = srcDsp;
            unitTargetName = tgtDsp;

            kill = critical = flank = dodge = immune = false;
            special = "None";
            if (flags.Length > 0)
            {
                int extraFlagCount = 0;
                string[] sflags = flags.Split('|');
                foreach (string sflag in sflags)
                {
                    switch (sflag)
                    {
                        case "Flank":
                            flank = true;
                            break;
                        case "Critical":
                            critical = true;
                            break;
                        case "Dodge":
                            dodge = true;
                            special = (extraFlagCount++ > 0) ? (special + " | " + sflag) : sflag;
                            break;
                        case "Immune":
                            immune = true;
                            special = (extraFlagCount++ > 0) ? (special + " | " + sflag) : sflag;
                            break;
                        case "Kill":
                            kill = true;
                            break;
                        case "ShowPowerDisplayName":
                            showPowerDisplayName = true;
                            break;

                        default:
                            special = (extraFlagCount++ > 0) ? (special + " | " + sflag) : sflag;
                            break;
                    }
                }
            }

            swingType = (int)SwingTypeEnum.NonMelee;

            attackType = evtDsp;
            if (attackType.Trim().Length == 0)
            {
                // Uggly fix for missing attack type
                attackType = NW_Parser.unkAbility;
            }
        }
Ejemplo n.º 59
0
        private void act_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
        {
            if (isImport || timeline == null)
                return;

            string line = logInfo.logLine;

            TimelineAnchor anchor = timeline.FindAnchorMatchingLogline(CurrentTime, logInfo.logLine);
            if (anchor != null)
            {
                CurrentTime = anchor.TimeFromStart;
                Paused = false;
            }
        }
        /// <summary>
        /// Addedのログを格納する
        /// </summary>
        /// <param name="logInfo">ログ情報</param>
        private void StoreAddedLog(
            LogLineEventArgs logInfo)
        {
            var match = AddedRegex.Match(logInfo.logLine);
            if (!match.Success)
            {
                return;
            }

            var log = new CombatLog()
            {
                TimeStamp = logInfo.detectedTime,
                Raw = logInfo.logLine,
                Actor = match.Groups["actor"].ToString(),
                Action = "Added",
                LogType = CombatLogType.Added
            };

            this.StoreLog(log);
        }