Пример #1
0
        private CombatItem ReadCombatItemRev1(BinaryReader reader)
        {
            // 8 bytes: time
            long time = reader.ReadInt64();

            // 8 bytes: src_agent
            ulong srcAgent = reader.ReadUInt64();

            // 8 bytes: dst_agent
            ulong dstAgent = reader.ReadUInt64();

            // 4 bytes: value
            int value = reader.ReadInt32();

            // 4 bytes: buff_dmg
            int buffDmg = reader.ReadInt32();

            // 4 bytes: overstack_value
            uint overstackValue = reader.ReadUInt32();

            // 4 bytes: skill_id
            uint skillId = reader.ReadUInt32();

            // 2 bytes: src_instid
            ushort srcInstid = reader.ReadUInt16();

            // 2 bytes: dst_instid
            ushort dstInstid = reader.ReadUInt16();

            // 2 bytes: src_master_instid
            ushort srcMasterInstid = reader.ReadUInt16();
            // 2 bytes: dst_master_instid
            ushort dstmasterInstid = reader.ReadUInt16();

            // 1 byte: iff
            ParseEnum.IFF iff = ParseEnum.GetIFF(reader.ReadByte());

            // 1 byte: buff
            byte buff = reader.ReadByte();

            // 1 byte: result
            byte result = reader.ReadByte();

            // 1 byte: is_activation
            ParseEnum.Activation isActivation = ParseEnum.GetActivation(reader.ReadByte());

            // 1 byte: is_buffremove
            ParseEnum.BuffRemove isBuffRemove = ParseEnum.GetBuffRemove(reader.ReadByte());

            // 1 byte: is_ninety
            byte isNinety = reader.ReadByte();

            // 1 byte: is_fifty
            byte isFifty = reader.ReadByte();

            // 1 byte: is_moving
            byte isMoving = reader.ReadByte();

            // 1 byte: is_statechange
            ParseEnum.StateChange isStateChange = ParseEnum.GetStateChange(reader.ReadByte());

            // 1 byte: is_flanking
            byte isFlanking = reader.ReadByte();

            // 1 byte: is_flanking
            byte isShields = reader.ReadByte();
            // 1 byte: is_flanking
            byte isOffcycle = reader.ReadByte();

            // 5 bytes: offcycle (?) + garbage
            ParseHelper.SafeSkip(reader.BaseStream, 4);

            //save
            // Add combat
            return(new CombatItem(time, srcAgent, dstAgent, value, buffDmg, overstackValue, skillId,
                                  srcInstid, dstInstid, srcMasterInstid, dstmasterInstid, iff, buff, result, isActivation, isBuffRemove,
                                  isNinety, isFifty, isMoving, isStateChange, isFlanking, isShields, isOffcycle));
        }
Пример #2
0
 public static bool DstIsAgent(this ParseEnum.StateChange state)
 {
     return(state == ParseEnum.StateChange.None || state == ParseEnum.StateChange.AttackTarget);
 }
Пример #3
0
 public static bool IsSpawn(this ParseEnum.StateChange state)
 {
     return(state == ParseEnum.StateChange.Normal || state == ParseEnum.StateChange.Position || state == ParseEnum.StateChange.Velocity || state == ParseEnum.StateChange.Rotation || state == ParseEnum.StateChange.MaxHealthUpdate || state == ParseEnum.StateChange.Spawn || state == ParseEnum.StateChange.TeamChange);
 }
Пример #4
0
 public static bool IsDespawn(this ParseEnum.StateChange state)
 {
     return(state == ParseEnum.StateChange.Despawn);
 }
Пример #5
0
 public static bool IsUp(this ParseEnum.StateChange state)
 {
     return(state == ParseEnum.StateChange.ChangeUp);
 }
Пример #6
0
 public static bool IsDead(this ParseEnum.StateChange state)
 {
     return(state == ParseEnum.StateChange.ChangeDead);
 }
Пример #7
0
        private static CombatItem ReadCombatItem(BinaryReader reader)
        {
            // 8 bytes: time
            long time = reader.ReadInt64();

            // 8 bytes: src_agent
            ulong src_agent = reader.ReadUInt64();

            // 8 bytes: dst_agent
            ulong dst_agent = reader.ReadUInt64();

            // 4 bytes: value
            int value = reader.ReadInt32();

            // 4 bytes: buff_dmg
            int buff_dmg = reader.ReadInt32();

            // 2 bytes: overstack_value
            ushort overstack_value = reader.ReadUInt16();

            // 2 bytes: skill_id
            ushort skill_id = reader.ReadUInt16();

            // 2 bytes: src_instid
            ushort src_instid = reader.ReadUInt16();

            // 2 bytes: dst_instid
            ushort dst_instid = reader.ReadUInt16();

            // 2 bytes: src_master_instid
            ushort src_master_instid = reader.ReadUInt16();

            // 9 bytes: garbage
            ParseHelper.safeSkip(reader.BaseStream, 9);

            // 1 byte: iff
            ParseEnum.IFF iff = ParseEnum.getIFF(reader.ReadByte());

            // 1 byte: buff
            ushort buff = (ushort)reader.ReadByte();

            // 1 byte: result
            ParseEnum.Result result = ParseEnum.getResult(reader.ReadByte());

            // 1 byte: is_activation
            ParseEnum.Activation is_activation = ParseEnum.getActivation(reader.ReadByte());

            // 1 byte: is_buffremove
            ParseEnum.BuffRemove is_buffremoved = ParseEnum.getBuffRemove(reader.ReadByte());

            // 1 byte: is_ninety
            ushort is_ninety = (ushort)reader.ReadByte();

            // 1 byte: is_fifty
            ushort is_fifty = (ushort)reader.ReadByte();

            // 1 byte: is_moving
            ushort is_moving = (ushort)reader.ReadByte();

            // 1 byte: is_statechange
            ParseEnum.StateChange is_statechange = ParseEnum.getStateChange(reader.ReadByte());

            // 1 byte: is_flanking
            ushort is_flanking = (ushort)reader.ReadByte();

            // 1 byte: is_flanking
            ushort is_shields = (ushort)reader.ReadByte();

            // 2 bytes: garbage
            ParseHelper.safeSkip(reader.BaseStream, 2);

            //save
            // Add combat
            return(new CombatItem(time, src_agent, dst_agent, value, buff_dmg, overstack_value, skill_id,
                                  src_instid, dst_instid, src_master_instid, iff, buff, result, is_activation, is_buffremoved,
                                  is_ninety, is_fifty, is_moving, is_statechange, is_flanking, is_shields));
        }
Пример #8
0
        protected virtual void SetCastLogs(ParsedLog log)
        {
            CastLog curCastLog = null;

            foreach (CombatItem c in log.CombatData.GetCastData(InstID, FirstAware, LastAware))
            {
                ParseEnum.StateChange state = c.IsStateChange;
                if (state == ParseEnum.StateChange.Normal)
                {
                    if (c.IsActivation.StartCasting())
                    {
                        // Missing end activation
                        long time = log.FightData.ToFightSpace(c.Time);
                        if (curCastLog != null)
                        {
                            int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : curCastLog.ExpectedDuration;
                            curCastLog.SetEndStatus(actDur, ParseEnum.Activation.Unknown, time);
                            curCastLog = null;
                        }
                        curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation, Agent, InstID);
                        CastLogs.Add(curCastLog);
                    }
                    else
                    {
                        if (curCastLog != null)
                        {
                            if (curCastLog.SkillId == c.SkillID)
                            {
                                int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : c.Value;
                                curCastLog.SetEndStatus(actDur, c.IsActivation, log.FightData.FightDuration);
                                curCastLog = null;
                            }
                        }
                    }
                }
                else if (state == ParseEnum.StateChange.WeaponSwap)
                {
                    long    time    = log.FightData.ToFightSpace(c.Time);
                    CastLog swapLog = new CastLog(time, SkillItem.WeaponSwapId, (int)c.DstAgent, c.IsActivation, Agent, InstID);
                    if (CastLogs.Count > 0 && (time - CastLogs.Last().Time) < 10 && CastLogs.Last().SkillId == SkillItem.WeaponSwapId)
                    {
                        CastLogs[CastLogs.Count - 1] = swapLog;
                    }
                    else
                    {
                        CastLogs.Add(swapLog);
                    }
                    swapLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration);
                }
            }
            long cloakStart = 0;

            foreach (long time in log.CombatData.GetBuffs(InstID, 40408, FirstAware, LastAware).Select(x => log.FightData.ToFightSpace(x.Time)))
            {
                if (time - cloakStart > 10)
                {
                    CastLog dodgeLog = new CastLog(time, SkillItem.DodgeId, 0, ParseEnum.Activation.Unknown, Agent, InstID);
                    dodgeLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration);
                    CastLogs.Add(dodgeLog);
                }
                cloakStart = time;
            }
            CastLogs.Sort((x, y) => x.Time.CompareTo(y.Time));
        }