Пример #1
0
 public AbstractBuffRemoveEvent(CombatItem evtcItem, AgentData agentData, SkillData skillData, long offset) : base(evtcItem, skillData, offset)
 {
     RemovedDuration = evtcItem.Value;
     By       = agentData.GetAgentByInstID(evtcItem.DstMasterInstid > 0 ? evtcItem.DstMasterInstid : evtcItem.DstInstid, evtcItem.LogTime);
     ByMinion = evtcItem.DstMasterInstid > 0 ? agentData.GetAgentByInstID(evtcItem.DstInstid, evtcItem.LogTime) : null;
     To       = agentData.GetAgentByInstID(evtcItem.SrcInstid, evtcItem.LogTime);
 }
Пример #2
0
 public AbstractCastEvent(CombatItem startEvtcItem, AgentData agentData, SkillData skillData, long offset) : base(startEvtcItem.LogTime, offset)
 {
     Skill            = skillData.Get(startEvtcItem.SkillID);
     Caster           = agentData.GetAgentByInstID(startEvtcItem.SrcInstid, startEvtcItem.LogTime);
     UnderQuickness   = startEvtcItem.IsActivation == ParseEnum.Activation.Quickness;
     ExpectedDuration = startEvtcItem.Value;
     MasterCaster     = startEvtcItem.SrcMasterInstid > 0 ? agentData.GetAgentByInstID(startEvtcItem.SrcMasterInstid, startEvtcItem.LogTime) : null;
 }
Пример #3
0
 public BuffApplyEvent(CombatItem evtcItem, AgentData agentData, SkillData skillData, long offset) : base(evtcItem, skillData, offset)
 {
     Initial         = evtcItem.IsStateChange == ParseEnum.StateChange.BuffInitial;
     AppliedDuration = evtcItem.Value;
     By       = agentData.GetAgentByInstID(evtcItem.SrcMasterInstid > 0 ? evtcItem.SrcMasterInstid : evtcItem.SrcInstid, evtcItem.LogTime);
     ByMinion = evtcItem.SrcMasterInstid > 0 ? agentData.GetAgentByInstID(evtcItem.SrcInstid, evtcItem.LogTime) : null;
     To       = agentData.GetAgentByInstID(evtcItem.DstInstid, evtcItem.LogTime);
 }
        internal override void AdjustCombatEvent(CombatItem combatItem, AgentData agentData)
        {
            if (!IsHealingEvent(combatItem) && !IsBarrierEvent(combatItem))
            {
                return;
            }
            // Prefer instid fetch for healing events
            AgentItem src = agentData.GetAgentByInstID(combatItem.SrcInstid, combatItem.Time);

            combatItem.OverrideSrcAgent(src.Agent);
            AgentItem dst = agentData.GetAgentByInstID(combatItem.DstInstid, combatItem.Time);

            combatItem.OverrideDstAgent(dst.Agent);
        }
Пример #5
0
        public AbstractDamageEvent(CombatItem evtcItem, AgentData agentData, SkillData skillData, long offset) : base(evtcItem.LogTime, offset)
        {
#if DEBUG
            OriginalCombatEvent = evtcItem;
#endif
            From              = agentData.GetAgentByInstID(evtcItem.SrcInstid, evtcItem.LogTime);
            MasterFrom        = evtcItem.SrcMasterInstid > 0 ? agentData.GetAgentByInstID(evtcItem.SrcMasterInstid, evtcItem.LogTime) : null;
            To                = agentData.GetAgentByInstID(evtcItem.DstInstid, evtcItem.LogTime);
            MasterTo          = evtcItem.DstMasterInstid > 0 ? agentData.GetAgentByInstID(evtcItem.DstMasterInstid, evtcItem.LogTime) : null;
            Skill             = skillData.Get(evtcItem.SkillID);
            IsOverNinety      = evtcItem.IsNinety > 0;
            AgainstUnderFifty = evtcItem.IsFifty > 0;
            IsMoving          = evtcItem.IsMoving > 0;
            IsFlanking        = evtcItem.IsFlanking > 0;
            IFF               = evtcItem.IFF;
        }
Пример #6
0
        public AbstractMovementEvent(CombatItem evtcItem, AgentData agentData, long offset) : base(evtcItem.LogTime, offset)
        {
            AgentItem = agentData.GetAgentByInstID(evtcItem.SrcInstid, evtcItem.LogTime);
            _dstAgent = evtcItem.DstAgent;
            _value    = evtcItem.Value;
#if DEBUG
            OriginalCombatEvent = evtcItem;
#endif
        }
        private void FindAgentMaster(long logTime, ushort masterInstid, ulong minionAgent)
        {
            AgentItem master = _agentData.GetAgentByInstID(masterInstid, logTime);

            if (master != ParserHelper._unknownAgent)
            {
                AgentItem minion = _agentData.GetAgent(minionAgent, logTime);
                if (minion != ParserHelper._unknownAgent && minion.Master == null)
                {
                    minion.SetMaster(master);
                }
            }
        }
        private void FindAgentMaster(long logTime, ushort masterInstid, ulong minionAgent)
        {
            AgentItem master = _agentData.GetAgentByInstID(masterInstid, logTime);

            if (master != GeneralHelper.UnknownAgent)
            {
                AgentItem minion = _agentData.GetAgent(minionAgent);
                if (minion != GeneralHelper.UnknownAgent && minion.Master == null)
                {
                    if (minion.FirstAware <= logTime && logTime <= minion.LastAware)
                    {
                        minion.SetMaster(master);
                    }
                }
            }
        }
Пример #9
0
        private long AttackTargetSpecialParse(CombatItem targetable, AgentData agentData, List <CombatItem> combatData, HashSet <ulong> gadgetAgents)
        {
            if (targetable == null)
            {
                return(0);
            }
            long      firstAware  = targetable.LogTime;
            AgentItem targetAgent = agentData.GetAgentByInstID(targetable.SrcInstid, targetable.LogTime);

            if (targetAgent != GeneralHelper.UnknownAgent)
            {
                try
                {
                    string[] names = targetAgent.Name.Split('-');
                    if (ushort.TryParse(names[2], out ushort masterInstid))
                    {
                        CombatItem structDeimosDamageEvent = combatData.FirstOrDefault(x => x.LogTime >= firstAware && x.IFF == ParseEnum.IFF.Foe && x.DstInstid == masterInstid && x.IsStateChange == ParseEnum.StateChange.None && x.IsBuffRemove == ParseEnum.BuffRemove.None &&
                                                                                       ((x.IsBuff == 1 && x.BuffDmg >= 0 && x.Value == 0) ||
                                                                                        (x.IsBuff == 0 && x.Value >= 0)));
                        if (structDeimosDamageEvent != null)
                        {
                            gadgetAgents.Add(structDeimosDamageEvent.DstAgent);
                        }
                        CombatItem armDeimosDamageEvent = combatData.FirstOrDefault(x => x.LogTime >= firstAware && (x.SkillID == 37980 || x.SkillID == 37982 || x.SkillID == 38046) && x.SrcAgent != 0 && x.SrcInstid != 0);
                        if (armDeimosDamageEvent != null)
                        {
                            gadgetAgents.Add(armDeimosDamageEvent.SrcAgent);
                        }
                    }
                    ;
                }
                catch
                {
                    // nothing to do
                }
            }
            return(firstAware);
        }
Пример #10
0
        public override void SpecialParse(FightData fightData, AgentData agentData, List <CombatItem> combatData)
        {
            // Find target
            Target target = Targets.Find(x => x.ID == (ushort)ParseEnum.TargetIDS.Deimos);

            if (target == null)
            {
                throw new InvalidOperationException("Main target of the fight not found");
            }
            if (!target.Character.Contains("Deimos"))
            {
                target.OverrideName("Deimos");
            }
            // enter combat
            CombatItem enterCombat = combatData.FirstOrDefault(x => x.SrcInstid == target.InstID && x.IsStateChange == ParseEnum.StateChange.EnterCombat);

            if (enterCombat != null)
            {
                fightData.FightStart = enterCombat.Time;
            }
            // Remove deimos despawn events as they are useless and mess with combat replay
            combatData.RemoveAll(x => x.IsStateChange == ParseEnum.StateChange.Despawn && x.SrcInstid == target.InstID && x.Time <= target.LastAware && x.Time >= target.FirstAware);
            // Deimos gadgets
            List <AgentItem> deimosGadgets = agentData.GetAgentByType(AgentItem.AgentType.Gadget).Where(x => x.Name.Contains("Deimos") && x.LastAware > target.LastAware).ToList();
            CombatItem       invulApp      = combatData.FirstOrDefault(x => x.DstInstid == target.InstID && x.IsBuff != 0 && x.BuffDmg == 0 && x.Value > 0 && x.SkillID == 762);
            CombatItem       targetable    = combatData.LastOrDefault(x => x.IsStateChange == ParseEnum.StateChange.Targetable && x.Time > combatData.First().Time&& x.DstAgent > 0);

            if (invulApp != null && targetable != null)
            {
                HashSet <ulong> gadgetAgents = new HashSet <ulong>();
                long            firstAware   = targetable.Time;
                AgentItem       targetAgent  = agentData.GetAgentByInstID(targetable.SrcInstid, targetable.Time);
                if (targetAgent != GeneralHelper.UnknownAgent)
                {
                    try
                    {
                        string[] names = targetAgent.Name.Split('-');
                        if (ushort.TryParse(names[2], out ushort masterInstid))
                        {
                            CombatItem structDeimosDamageEvent = combatData.FirstOrDefault(x => x.Time >= firstAware && x.IFF == ParseEnum.IFF.Foe && x.DstInstid == masterInstid && x.IsStateChange == ParseEnum.StateChange.Normal && x.IsBuffRemove == ParseEnum.BuffRemove.None &&
                                                                                           ((x.IsBuff == 1 && x.BuffDmg >= 0 && x.Value == 0) ||
                                                                                            (x.IsBuff == 0 && x.Value >= 0)));
                            if (structDeimosDamageEvent != null)
                            {
                                gadgetAgents.Add(structDeimosDamageEvent.DstAgent);
                            }
                            CombatItem armDeimosDamageEvent = combatData.FirstOrDefault(x => x.Time >= firstAware && (x.SkillID == 37980 || x.SkillID == 37982 || x.SkillID == 38046) && x.SrcAgent != 0 && x.SrcInstid != 0);
                            if (armDeimosDamageEvent != null)
                            {
                                gadgetAgents.Add(armDeimosDamageEvent.SrcAgent);
                            }
                        }
                        ;
                    }
                    catch
                    {
                        // nothing to do
                    }
                }
                invulApp.Value             = (int)(firstAware - invulApp.Time);
                _specialSplit              = (firstAware >= target.LastAware ? firstAware : target.LastAware);
                target.AgentItem.LastAware = combatData.Last().Time;
                SetUniqueID(target, gadgetAgents, agentData, combatData);
            }
            // legacy method
            else if (deimosGadgets.Count > 0)
            {
                long firstAware = deimosGadgets.Max(x => x.FirstAware);
                _specialSplit = (firstAware >= target.LastAware ? firstAware : target.LastAware);
                target.AgentItem.LastAware = deimosGadgets.Max(x => x.LastAware);
                HashSet <ulong> gadgetAgents = new HashSet <ulong>(deimosGadgets.Select(x => x.Agent));
                SetUniqueID(target, gadgetAgents, agentData, combatData);
            }
        }