Ejemplo n.º 1
0
        internal override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList)
        {
            var  attackTargets = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.AttackTarget).ToList();
            long first         = fightData.FightStart;
            long final         = fightData.FightEnd;

            foreach (CombatItem at in attackTargets)
            {
                AgentItem  hand        = agentData.GetAgent(at.DstAgent);
                AgentItem  atAgent     = agentData.GetAgent(at.SrcAgent);
                var        attackables = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.Targetable && x.SrcAgent == atAgent.Agent && x.Time <= atAgent.LastAware && x.Time >= atAgent.FirstAware).ToList();
                var        attackOn    = attackables.Where(x => x.DstAgent == 1 && x.Time >= first + 2000).Select(x => x.Time).ToList();
                var        attackOff   = attackables.Where(x => x.DstAgent == 0 && x.Time >= first + 2000).Select(x => x.Time).ToList();
                var        posFacingHP = combatData.Where(x => x.SrcAgent == hand.Agent && x.Time >= hand.FirstAware && hand.LastAware >= x.Time && (x.IsStateChange == ArcDPSEnums.StateChange.Position || x.IsStateChange == ArcDPSEnums.StateChange.Rotation || x.IsStateChange == ArcDPSEnums.StateChange.MaxHealthUpdate)).ToList();
                CombatItem pos         = posFacingHP.FirstOrDefault(x => x.IsStateChange == ArcDPSEnums.StateChange.Position);
                int        id          = (int)ArcDPSEnums.TrashID.HandOfErosion;
                if (pos != null)
                {
                    (float x, float y, _) = AbstractMovementEvent.UnpackMovementData(pos.DstAgent, 0);
                    if ((Math.Abs(x - 15570.5) < 10 && Math.Abs(y + 693.117) < 10) ||
                        (Math.Abs(x - 14277.2) < 10 && Math.Abs(y + 2202.52) < 10))
                    {
                        id = (int)ArcDPSEnums.TrashID.HandOfEruption;
                    }
                }
                for (int i = 0; i < attackOn.Count; i++)
                {
                    long start = attackOn[i];
                    long end   = final;
                    if (i <= attackOff.Count - 1)
                    {
                        end = attackOff[i];
                    }
                    AgentItem extra = agentData.AddCustomAgent(start, end, AgentItem.AgentType.NPC, hand.Name, hand.Prof, id, hand.Toughness, hand.Healing, hand.Condition, hand.Concentration, hand.HitboxWidth, hand.HitboxHeight);
                    foreach (CombatItem c in combatData)
                    {
                        if (c.Time >= extra.FirstAware && c.Time <= extra.LastAware)
                        {
                            if (c.IsStateChange.SrcIsAgent() && c.SrcAgent == hand.Agent)
                            {
                                c.OverrideSrcAgent(extra.Agent);
                            }
                            if (c.IsStateChange.DstIsAgent() && c.DstAgent == hand.Agent)
                            {
                                c.OverrideDstAgent(extra.Agent);
                            }
                        }
                    }
                    foreach (CombatItem c in posFacingHP)
                    {
                        var cExtra = new CombatItem(c);
                        cExtra.OverrideTime(extra.FirstAware);
                        cExtra.OverrideSrcAgent(extra.Agent);
                        combatData.Add(cExtra);
                    }
                }
            }
            combatData.Sort((x, y) => x.Time.CompareTo(y.Time));
            ComputeFightTargets(agentData, combatData);
        }
        internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions)
        {
            var  attackTargets = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.AttackTarget).ToList();
            long first         = 0;
            long final         = fightData.FightEnd;

            foreach (CombatItem at in attackTargets)
            {
                AgentItem  hand        = agentData.GetAgent(at.DstAgent, at.Time);
                AgentItem  atAgent     = agentData.GetAgent(at.SrcAgent, at.Time);
                var        attackables = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.Targetable && x.SrcMatchesAgent(atAgent)).ToList();
                var        attackOn    = attackables.Where(x => x.DstAgent == 1 && x.Time >= first + 2000).Select(x => x.Time).ToList();
                var        attackOff   = attackables.Where(x => x.DstAgent == 0 && x.Time >= first + 2000).Select(x => x.Time).ToList();
                var        posFacingHP = combatData.Where(x => x.SrcMatchesAgent(hand) && (x.IsStateChange == ArcDPSEnums.StateChange.Position || x.IsStateChange == ArcDPSEnums.StateChange.Rotation || x.IsStateChange == ArcDPSEnums.StateChange.MaxHealthUpdate)).ToList();
                CombatItem pos         = posFacingHP.FirstOrDefault(x => x.IsStateChange == ArcDPSEnums.StateChange.Position);
                int        id          = (int)ArcDPSEnums.TrashID.HandOfErosion;
                if (pos != null)
                {
                    (float x, float y, _) = AbstractMovementEvent.UnpackMovementData(pos.DstAgent, 0);
                    if ((Math.Abs(x - 15570.5) < 10 && Math.Abs(y + 693.117) < 10) ||
                        (Math.Abs(x - 14277.2) < 10 && Math.Abs(y + 2202.52) < 10))
                    {
                        id = (int)ArcDPSEnums.TrashID.HandOfEruption;
                    }
                }
                for (int i = 0; i < attackOn.Count; i++)
                {
                    long start = attackOn[i];
                    long end   = final;
                    if (i <= attackOff.Count - 1)
                    {
                        end = attackOff[i];
                    }
                    AgentItem extra = agentData.AddCustomNPCAgent(start, end, hand.Name, hand.Spec, id, false, hand.Toughness, hand.Healing, hand.Condition, hand.Concentration, hand.HitboxWidth, hand.HitboxHeight);
                    foreach (CombatItem c in combatData)
                    {
                        if (extra.InAwareTimes(c.Time))
                        {
                            if (c.SrcMatchesAgent(hand, extensions))
                            {
                                c.OverrideSrcAgent(extra.Agent);
                            }
                            if (c.DstMatchesAgent(hand, extensions))
                            {
                                c.OverrideDstAgent(extra.Agent);
                            }
                        }
                    }
                    foreach (CombatItem c in posFacingHP)
                    {
                        var cExtra = new CombatItem(c);
                        cExtra.OverrideTime(extra.FirstAware);
                        cExtra.OverrideSrcAgent(extra.Agent);
                        combatData.Add(cExtra);
                    }
                }
            }
            ComputeFightTargets(agentData, combatData, extensions);
        }
Ejemplo n.º 3
0
        public override void SpecialParse(FightData fightData, AgentData agentData, List <CombatItem> combatData)
        {
            List <CombatItem> attackTargets = combatData.Where(x => x.IsStateChange == ParseEnum.StateChange.AttackTarget).ToList();
            long first = combatData.Count > 0 ? combatData.First().LogTime : 0;
            long final = combatData.Count > 0 ? combatData.Last().LogTime : 0;

            foreach (CombatItem at in attackTargets)
            {
                AgentItem         hand        = agentData.GetAgent(at.DstAgent, at.LogTime);
                AgentItem         atAgent     = agentData.GetAgent(at.SrcAgent, at.LogTime);
                List <CombatItem> attackables = combatData.Where(x => x.IsStateChange == ParseEnum.StateChange.Targetable && x.SrcAgent == atAgent.Agent && x.LogTime <= atAgent.LastAwareLogTime && x.LogTime >= atAgent.FirstAwareLogTime).ToList();
                List <long>       attackOn    = attackables.Where(x => x.DstAgent == 1 && x.LogTime >= first + 2000).Select(x => x.LogTime).ToList();
                List <long>       attackOff   = attackables.Where(x => x.DstAgent == 0 && x.LogTime >= first + 2000).Select(x => x.LogTime).ToList();
                List <CombatItem> posFacingHP = combatData.Where(x => x.SrcAgent == hand.Agent && x.LogTime >= hand.FirstAwareLogTime && hand.LastAwareLogTime >= x.LogTime && (x.IsStateChange == ParseEnum.StateChange.Position || x.IsStateChange == ParseEnum.StateChange.Rotation || x.IsStateChange == ParseEnum.StateChange.MaxHealthUpdate)).ToList();
                CombatItem        pos         = posFacingHP.FirstOrDefault(x => x.IsStateChange == ParseEnum.StateChange.Position);
                ushort            id          = (ushort)HandOfErosion;
                if (pos != null)
                {
                    byte[] xy = BitConverter.GetBytes(pos.DstAgent);
                    float  x  = BitConverter.ToSingle(xy, 0);
                    float  y  = BitConverter.ToSingle(xy, 4);
                    if ((Math.Abs(x - 15570.5) < 10 && Math.Abs(y + 693.117) < 10) ||
                        (Math.Abs(x - 14277.2) < 10 && Math.Abs(y + 2202.52) < 10))
                    {
                        id = (ushort)HandOfEruption;
                    }
                }
                for (int i = 0; i < attackOn.Count; i++)
                {
                    long start = attackOn[i];
                    long end   = final;
                    if (i <= attackOff.Count - 1)
                    {
                        end = attackOff[i];
                    }
                    AgentItem extra = agentData.AddCustomAgent(start, end, AgentItem.AgentType.Gadget, hand.Name, hand.Prof, id, hand.Toughness, hand.Healing, hand.Condition, hand.Concentration, hand.HitboxWidth, hand.HitboxHeight);
                    foreach (CombatItem c in combatData.Where(x => x.SrcAgent == hand.Agent && x.LogTime >= extra.FirstAwareLogTime && x.LogTime <= extra.LastAwareLogTime))
                    {
                        c.OverrideSrcValues(extra.Agent, extra.InstID);
                    }
                    foreach (CombatItem c in combatData.Where(x => x.DstAgent == hand.Agent && x.LogTime >= extra.FirstAwareLogTime && x.LogTime <= extra.LastAwareLogTime))
                    {
                        c.OverrideDstValues(extra.Agent, extra.InstID);
                    }
                    foreach (CombatItem c in posFacingHP)
                    {
                        CombatItem cExtra = new CombatItem(c);
                        cExtra.OverrideTime(extra.FirstAwareLogTime);
                        cExtra.OverrideSrcValues(extra.Agent, extra.InstID);
                        combatData.Add(cExtra);
                    }
                }
            }
            combatData.Sort((x, y) => x.LogTime.CompareTo(y.LogTime));
            ComputeFightTargets(agentData, combatData);
        }
Ejemplo n.º 4
0
 internal AbstractDamageEvent(CombatItem evtcItem, AgentData agentData, SkillData skillData) : base(evtcItem.Time)
 {
     From              = agentData.GetAgent(evtcItem.SrcAgent);
     To                = agentData.GetAgent(evtcItem.DstAgent);
     Skill             = skillData.Get(evtcItem.SkillID);
     IsOverNinety      = evtcItem.IsNinety > 0;
     AgainstUnderFifty = evtcItem.IsFifty > 0;
     IsMoving          = evtcItem.IsMoving > 0;
     IsFlanking        = evtcItem.IsFlanking > 0;
     IFF               = evtcItem.IFF;
 }
Ejemplo n.º 5
0
        public AbstractStatusEvent(CombatItem evtcItem, AgentData agentData, long offset) : base(evtcItem.LogTime, offset)
        {
            Src = agentData.GetAgent(evtcItem.SrcAgent, evtcItem.LogTime);
#if DEBUG
            OriginalCombatEvent = evtcItem;
#endif
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Parses all the data again and link related stuff to each other
        /// </summary>
        private void FillMissingData()
        {
            CompleteAgents();
            _fightData = new FightData(_id, _agentData);
            _fightData.Logic.ComputeFightTargets(_agentData, _fightData, _combatItems);
            if (_combatItems.Count > 0)
            {
                _fightData.FightStart = _combatItems.Min(x => x.Time);
                _fightData.FightEnd   = _combatItems.Max(x => x.Time);
            }
            else
            {
                throw new InvalidDataException("No combat events found");
            }
            // Dealing with special cases
            _fightData.Logic.SpecialParse(_fightData, _agentData, _combatItems);
            // Grab values threw combat data
            foreach (CombatItem c in _combatItems)
            {
                switch (c.IsStateChange)
                {
                case ParseEnum.StateChange.PointOfView:
                    if (_logData.PoV == "N/A")    //Point of View
                    {
                        ulong povAgent = c.SrcAgent;
                        _logData.SetPOV(_agentData.GetAgent(povAgent, c.Time).Name);
                    }
                    break;

                case ParseEnum.StateChange.GWBuild:
                    _logData.GW2Version = c.SrcAgent;
                    break;

                case ParseEnum.StateChange.LogStart:
                    _logData.SetLogStart(c.Value);
                    break;

                case ParseEnum.StateChange.LogEnd:
                    _logData.SetLogEnd(c.Value);
                    break;

                case ParseEnum.StateChange.MaxHealthUpdate:
                    _fightData.Logic.SetMaxHealth(c.SrcInstid, c.Time, (int)c.DstAgent);
                    break;

                case ParseEnum.StateChange.HealthUpdate:
                    //set health update
                    _fightData.Logic.AddHealthUpdate(c.SrcInstid, c.Time, c.Time, (int)c.DstAgent);
                    break;
                }
            }

            //players
            CompletePlayers();
            _playerList = _playerList.OrderBy(a => a.Group).ToList();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Parses all the data again and link related stuff to each other
        /// </summary>
        private void FillMissingData()
        {
            CompleteAgents();
            _fightData.Logic.ComputeFightTargets(_agentData, _fightData, _combatItems);
            _target = _fightData.Logic.Targets.Find(x => x.ID == _fightData.ID);
            if (_target == null)
            {
                _target = new Target(new AgentItem(0, "UNKNOWN"));
            }
            if (_combatItems.Count > 0)
            {
                _fightData.FightStart = _combatItems.First().Time;
                _fightData.FightEnd   = _combatItems.Last().Time;
            }
            // Dealing with special cases
            _fightData.Logic.SpecialParse(_fightData, _agentData, _combatItems);
            // Grab values threw combat data
            foreach (CombatItem c in _combatItems)
            {
                switch (c.IsStateChange)
                {
                case ParseEnum.StateChange.PointOfView:
                    if (_logData.PoV == "N/A")    //Point of View
                    {
                        ulong povAgent = c.SrcAgent;
                        _logData.SetPOV(_agentData.GetAgent(povAgent).Name);
                    }
                    break;

                case ParseEnum.StateChange.LogStart:
                    _logData.SetLogStart(c.Value);
                    break;

                case ParseEnum.StateChange.LogEnd:
                    _logData.SetLogEnd(c.Value);
                    break;

                case ParseEnum.StateChange.MaxHealthUpdate:
                    _fightData.Logic.SetMaxHealth(c.SrcInstid, c.Time, (int)c.DstAgent);
                    break;

                case ParseEnum.StateChange.HealthUpdate:
                    //set health update
                    _fightData.Logic.AddHealthUpdate(c.SrcInstid, c.Time, (int)(_fightData.ToFightSpace(c.Time)), (int)c.DstAgent);
                    break;
                }
            }

            //players
            if (_playerList.Count == 0)
            {
                CompletePlayers();
            }
            _playerList = _playerList.OrderBy(a => a.Group).ToList();
        }
 public GuildEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem)
 {
     Src  = agentData.GetAgent(evtcItem.SrcAgent);
     Guid = new byte[16];
     byte[] first8 = BitConverter.GetBytes(evtcItem.DstAgent);
     byte[] mid4   = BitConverter.GetBytes(evtcItem.Value);
     byte[] last4  = BitConverter.GetBytes(evtcItem.BuffDmg);
     Guid = new byte[first8.Length + mid4.Length + last4.Length];
     first8.CopyTo(Guid, 0);
     mid4.CopyTo(Guid, first8.Length);
     last4.CopyTo(Guid, first8.Length + mid4.Length);
 }
        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);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        private long AttackTargetSpecialParse(CombatItem targetable, AgentData agentData, List <CombatItem> combatData, HashSet <ulong> gadgetAgents)
        {
            if (targetable == null)
            {
                return(0);
            }
            long      firstAware  = targetable.Time;
            AgentItem targetAgent = agentData.GetAgent(targetable.SrcAgent);

            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.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.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
                }
            }
            return(firstAware);
        }
 internal PointOfViewEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem)
 {
     PoV = agentData.GetAgent(evtcItem.SrcAgent, evtcItem.Time);
 }
Ejemplo n.º 13
0
 public AttackTargetEvent(CombatItem evtcItem, AgentData agentData, long offset) : base(evtcItem, agentData, offset)
 {
     AttackTarget = agentData.GetAgent(evtcItem.SrcAgent, evtcItem.LogTime);
     Src          = agentData.GetAgent(evtcItem.DstAgent, evtcItem.LogTime);
 }
Ejemplo n.º 14
0
 public TagEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem)
 {
     TagID = evtcItem.Value;
     Src   = agentData.GetAgent(evtcItem.SrcAgent);
     Src.SetCommanderTag(this);
 }
Ejemplo n.º 15
0
 public AbstractMovementEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem.Time)
 {
     AgentItem = agentData.GetAgent(evtcItem.SrcAgent);
     _dstAgent = evtcItem.DstAgent;
     _value    = evtcItem.Value;
 }
Ejemplo n.º 16
0
 internal AbstractCastEvent(CombatItem baseItem, AgentData agentData, SkillData skillData) : base(baseItem.Time)
 {
     Skill  = skillData.Get(baseItem.SkillID);
     Caster = agentData.GetAgent(baseItem.SrcAgent, baseItem.Time);
 }
 internal AbstractBuffRemoveEvent(CombatItem evtcItem, AgentData agentData, SkillData skillData) : base(evtcItem, skillData)
 {
     RemovedDuration = evtcItem.Value;
     InternalBy      = agentData.GetAgent(evtcItem.DstAgent);
     To = agentData.GetAgent(evtcItem.SrcAgent);
 }
 public AttackTargetEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem, agentData)
 {
     AttackTarget = Src;
     Src          = agentData.GetAgent(evtcItem.DstAgent);
 }
Ejemplo n.º 19
0
 public AbstractCastEvent(CombatItem startItem, AgentData agentData, SkillData skillData) : base(startItem.Time)
 {
     Skill  = skillData.Get(startItem.SkillID);
     Caster = agentData.GetAgent(startItem.SrcAgent);
 }
 internal AttackTargetEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem, agentData)
 {
     AttackTarget = Src;
     Src          = agentData.GetAgent(evtcItem.DstAgent, evtcItem.Time);
 }
Ejemplo n.º 21
0
        internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, List <AbstractSingleActor> friendlies, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions)
        {
            // find target
            AgentItem firstXera = agentData.GetNPCsByID((int)ArcDPSEnums.TargetID.Xera).FirstOrDefault();

            if (firstXera == null)
            {
                throw new MissingKeyActorsException("Xera not found");
            }
            _xeraFirstPhaseEndTime = firstXera.LastAware;
            //
            var maxHPUpdates = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.MaxHealthUpdate && x.DstAgent > 0).ToList();
            //
            var bloodstoneFragments = maxHPUpdates.Where(x => x.DstAgent == 104580).Select(x => agentData.GetAgent(x.SrcAgent, x.Time)).Where(x => x.Type == AgentItem.AgentType.Gadget).ToList();

            foreach (AgentItem gadget in bloodstoneFragments)
            {
                gadget.OverrideType(AgentItem.AgentType.NPC);
                gadget.OverrideID(ArcDPSEnums.TrashID.BloodstoneFragment);
            }
            //
            var bloodstoneShards = maxHPUpdates.Where(x => x.DstAgent == 343620).Select(x => agentData.GetAgent(x.SrcAgent, x.Time)).Where(x => x.Type == AgentItem.AgentType.Gadget).ToList();

            foreach (AgentItem gadget in bloodstoneShards)
            {
                gadget.OverrideType(AgentItem.AgentType.NPC);
                gadget.OverrideID(ArcDPSEnums.TrashID.BloodstoneShard);
            }
            //
            var chargedBloodStones = maxHPUpdates.Where(x => x.DstAgent == 74700).Select(x => agentData.GetAgent(x.SrcAgent, x.Time)).Where(x => x.Type == AgentItem.AgentType.Gadget && x.LastAware > firstXera.LastAware).ToList();

            foreach (AgentItem gadget in chargedBloodStones)
            {
                gadget.OverrideType(AgentItem.AgentType.NPC);
                gadget.OverrideID(ArcDPSEnums.TrashID.ChargedBloodstone);
            }
            if (bloodstoneFragments.Any() || bloodstoneShards.Any() || chargedBloodStones.Any())
            {
                agentData.Refresh();
            }
            // find split
            AgentItem secondXera = agentData.GetNPCsByID(16286).FirstOrDefault();

            if (secondXera != null)
            {
                CombatItem move = combatData.FirstOrDefault(x => x.IsStateChange == ArcDPSEnums.StateChange.Position && x.SrcMatchesAgent(secondXera) && x.Time >= secondXera.FirstAware + 500);
                if (move != null)
                {
                    _xeraSecondPhaseStartTime = move.Time;
                }
                else
                {
                    _xeraSecondPhaseStartTime = secondXera.FirstAware;
                }
                firstXera.OverrideAwareTimes(firstXera.FirstAware, secondXera.LastAware);
                agentData.SwapMasters(secondXera, firstXera);
                // update combat data
                foreach (CombatItem c in combatData)
                {
                    if (c.SrcMatchesAgent(secondXera, extensions))
                    {
                        c.OverrideSrcAgent(firstXera.Agent);
                    }
                    if (c.DstMatchesAgent(secondXera, extensions))
                    {
                        c.OverrideDstAgent(firstXera.Agent);
                    }
                }
            }
            ComputeFightTargets(agentData, combatData, extensions);

            if (_xeraSecondPhaseStartTime > 0)
            {
                AbstractSingleActor mainTarget = GetMainTarget();
                if (mainTarget == null)
                {
                    throw new MissingKeyActorsException("Xera not found");
                }
                mainTarget.SetManualHealth(24085950);
            }
        }
Ejemplo n.º 22
0
        internal override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList)
        {
            // find target
            AgentItem firstXera = agentData.GetNPCsByID((int)ArcDPSEnums.TargetID.Xera).FirstOrDefault();

            if (firstXera == null)
            {
                throw new MissingKeyActorsException("Xera not found");
            }

            var maxHPUpdates        = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.MaxHealthUpdate && x.DstAgent > 0).ToList();
            var bloodstoneFragments = maxHPUpdates.Where(x => x.DstAgent == 104580).Select(x => agentData.GetAgent(x.SrcAgent)).Where(x => x.Type == AgentItem.AgentType.Gadget).ToList();

            foreach (AgentItem gadget in bloodstoneFragments)
            {
                gadget.OverrideType(AgentItem.AgentType.NPC);
                gadget.OverrideID(ArcDPSEnums.TrashID.BloodstoneFragment);
            }
            var bloodstoneShards = maxHPUpdates.Where(x => x.DstAgent == 343620).Select(x => agentData.GetAgent(x.SrcAgent)).Where(x => x.Type == AgentItem.AgentType.Gadget).ToList();

            foreach (AgentItem gadget in bloodstoneShards)
            {
                gadget.OverrideType(AgentItem.AgentType.NPC);
                gadget.OverrideID(ArcDPSEnums.TrashID.BloodstoneShard);
            }
            var chargedBloodStones = maxHPUpdates.Where(x => x.DstAgent == 74700).Select(x => agentData.GetAgent(x.SrcAgent)).Where(x => x.Type == AgentItem.AgentType.Gadget && x.LastAware > firstXera.LastAware).ToList();

            foreach (AgentItem gadget in chargedBloodStones)
            {
                gadget.OverrideType(AgentItem.AgentType.NPC);
                gadget.OverrideID(ArcDPSEnums.TrashID.ChargedBloodstone);
                // they are actually present from start to finish
                gadget.OverrideAwareTimes(firstXera.LastAware + 15000, gadget.LastAware);
            }
            if (bloodstoneFragments.Any() || bloodstoneShards.Any() || chargedBloodStones.Any())
            {
                agentData.Refresh();
            }
            // find split
            AgentItem secondXera = agentData.GetNPCsByID(16286).FirstOrDefault();

            if (secondXera != null)
            {
                CombatItem move = combatData.FirstOrDefault(x => x.IsStateChange == ArcDPSEnums.StateChange.Position && x.SrcAgent == secondXera.Agent && x.Time >= secondXera.FirstAware + 500);
                if (move != null)
                {
                    _xeraSecondPhaseStartTime = move.Time;
                }
                else
                {
                    _xeraSecondPhaseStartTime = secondXera.FirstAware;
                }
                firstXera.OverrideAwareTimes(firstXera.FirstAware, secondXera.LastAware);
                agentData.SwapMasters(secondXera, firstXera);
                // update combat data
                foreach (CombatItem c in combatData)
                {
                    if (c.SrcAgent == secondXera.Agent && c.IsStateChange.SrcIsAgent())
                    {
                        c.OverrideSrcAgent(firstXera.Agent);
                    }
                    if (c.DstAgent == secondXera.Agent && c.IsStateChange.DstIsAgent())
                    {
                        c.OverrideDstAgent(firstXera.Agent);
                    }
                }
            }
            ComputeFightTargets(agentData, combatData);
        }
Ejemplo n.º 23
0
 public PointOfViewEvent(CombatItem evtcItem, AgentData agentData, long offset) : base(evtcItem, offset)
 {
     PoV = agentData.GetAgent(evtcItem.SrcAgent, evtcItem.LogTime);
 }
        internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions)
        {
            //
            var attackTargetEvents = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.AttackTarget).ToList();
            var idsToUse           = new List <ArcDPSEnums.TargetID> {
                ArcDPSEnums.TargetID.TheDragonVoidJormag,
                ArcDPSEnums.TargetID.TheDragonVoidPrimordus,
                ArcDPSEnums.TargetID.TheDragonVoidKralkatorrik,
                ArcDPSEnums.TargetID.TheDragonVoidMordremoth,
                ArcDPSEnums.TargetID.TheDragonVoidZhaitan,
                ArcDPSEnums.TargetID.TheDragonVoidSooWon,
            };
            int index = 0;

            foreach (CombatItem at in attackTargetEvents)
            {
                AgentItem dragonVoid = agentData.GetAgent(at.DstAgent, at.Time);
                AgentItem atAgent    = agentData.GetAgent(at.SrcAgent, at.Time);
                // We take attack events, filter out the first one, present at spawn, that is always a non targetable event
                var targetables = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.Targetable && x.SrcMatchesAgent(atAgent) && x.Time > 2000).ToList();
                // There are only two relevant attack targets, one represents the first five and the last one Soo Won
                if (!targetables.Any())
                {
                    continue;
                }
                var targetOns  = targetables.Where(x => x.DstAgent == 1).ToList();
                var targetOffs = targetables.Where(x => x.DstAgent == 0).ToList();
                // Events to be copied
                var posFacingHPEventsToCopy = combatData.Where(x => x.SrcMatchesAgent(dragonVoid) && (x.IsStateChange == ArcDPSEnums.StateChange.MaxHealthUpdate)).ToList();
                posFacingHPEventsToCopy.AddRange(combatData.Where(x => x.SrcMatchesAgent(atAgent) && (x.IsStateChange == ArcDPSEnums.StateChange.Position || x.IsStateChange == ArcDPSEnums.StateChange.Rotation)));
                var attackTargetEventsToCopy = combatData.Where(x => x.SrcMatchesAgent(atAgent) && (x.IsStateChange == ArcDPSEnums.StateChange.AttackTarget)).ToList();
                //
                foreach (CombatItem targetOn in targetOns)
                {
                    // If Soo Won has been already created, we break
                    if (index >= idsToUse.Count)
                    {
                        break;
                    }
                    int        id        = (int)idsToUse[index++];
                    long       start     = targetOn.Time;
                    long       end       = fightData.FightEnd;
                    CombatItem targetOff = targetOffs.FirstOrDefault(x => x.Time > start);
                    // Don't split Soo won into two
                    if (targetOff != null && id != (int)ArcDPSEnums.TargetID.TheDragonVoidSooWon)
                    {
                        end = targetOff.Time;
                    }
                    AgentItem extra        = agentData.AddCustomNPCAgent(start, end, dragonVoid.Name, dragonVoid.Spec, id, false, dragonVoid.Toughness, dragonVoid.Healing, dragonVoid.Condition, dragonVoid.Concentration, atAgent.HitboxWidth, atAgent.HitboxHeight);
                    ulong     lastHPUpdate = ulong.MaxValue;
                    foreach (CombatItem c in combatData)
                    {
                        if (extra.InAwareTimes(c.Time))
                        {
                            if (c.SrcMatchesAgent(dragonVoid, extensions))
                            {
                                // Avoid making the gadget go back to 100% hp on "death"
                                if (c.IsStateChange == ArcDPSEnums.StateChange.HealthUpdate)
                                {
                                    // Discard hp update that goes up close to death time
                                    if (c.DstAgent >= lastHPUpdate && c.Time > extra.LastAware - 2000)
                                    {
                                        continue;
                                    }
                                    // Remember last hp
                                    lastHPUpdate = c.DstAgent;
                                }
                                c.OverrideSrcAgent(extra.Agent);
                            }
                            // Redirect effects from attack target to main body
                            if (c.IsStateChange == ArcDPSEnums.StateChange.Effect && c.SrcMatchesAgent(atAgent, extensions))
                            {
                                c.OverrideSrcAgent(extra.Agent);
                            }
                            if (c.DstMatchesAgent(dragonVoid, extensions))
                            {
                                c.OverrideDstAgent(extra.Agent);
                            }
                        }
                    }
                    var attackTargetCopy = new CombatItem(at);
                    attackTargetCopy.OverrideTime(extra.FirstAware);
                    attackTargetCopy.OverrideDstAgent(extra.Agent);
                    combatData.Add(attackTargetCopy);
                    foreach (CombatItem c in posFacingHPEventsToCopy)
                    {
                        var cExtra = new CombatItem(c);
                        cExtra.OverrideTime(extra.FirstAware);
                        cExtra.OverrideSrcAgent(extra.Agent);
                        combatData.Add(cExtra);
                    }
                    foreach (CombatItem c in attackTargetEventsToCopy)
                    {
                        var cExtra = new CombatItem(c);
                        cExtra.OverrideTime(extra.FirstAware);
                        cExtra.OverrideDstAgent(extra.Agent);
                        //combatData.Add(cExtra);
                    }
                }
            }
            //
            IReadOnlyList <AgentItem> voidAmalgamates = agentData.GetNPCsByID((int)ArcDPSEnums.TrashID.VoidAmalgamate);
            bool needRefresh = false;

            foreach (AgentItem voidAmal in voidAmalgamates)
            {
                if (combatData.Where(x => x.SkillID == VoidShell && x.IsBuffApply() && x.SrcMatchesAgent(voidAmal)).Any())
                {
                    voidAmal.OverrideID(ArcDPSEnums.TrashID.PushableVoidAmalgamate);
                    needRefresh = true;
                }
            }
            AgentItem dragonBodyVoidAmalgamate = voidAmalgamates.MaxBy(x => x.LastAware - x.FirstAware);

            if (dragonBodyVoidAmalgamate != null)
            {
                dragonBodyVoidAmalgamate.OverrideID(ArcDPSEnums.TrashID.DragonBodyVoidAmalgamate);
                needRefresh = true;
            }
            if (needRefresh)
            {
                agentData.Refresh();
            }
            if (index == 0)
            {
                // Add dummy target as there are no dragon voids
                agentData.AddCustomNPCAgent(0, fightData.FightEnd, "Dummy Harvest Temple", Spec.NPC, (int)ArcDPSEnums.TargetID.DummyTarget, true);
                Targetless = true;
            }
            //
            ComputeFightTargets(agentData, combatData, extensions);
            //
            int  purificationID = 0;
            bool needRedirect   = false;

            (HashSet <ulong> jormagDamagingAgents, NPC jormag)       = (new HashSet <ulong>(), null);
            (HashSet <ulong> primordusDamagingAgents, NPC primordus) = (new HashSet <ulong>(), null);
            (HashSet <ulong> kralkDamagingAgents, NPC kralk)         = (new HashSet <ulong>(), null);
            (HashSet <ulong> mordDamagingAgents, NPC mord)           = (new HashSet <ulong>(), null);
            (HashSet <ulong> zhaitanDamagingAgents, NPC zhaitan)     = (new HashSet <ulong>(), null);
            (HashSet <ulong> soowonDamagingAgents, NPC soowon)       = (new HashSet <ulong>(), null);
            foreach (NPC target in Targets)
            {
                switch (target.ID)
                {
                case (int)ArcDPSEnums.TargetID.TheDragonVoidJormag:
                    target.OverrideName("The JormagVoid");
                    jormag       = target;
                    needRedirect = true;
                    var jormagAttacks = new HashSet <long>()
                    {
                        BreathOfJormag1,
                        BreathOfJormag2,
                        BreathOfJormag3,
                    };
                    jormagDamagingAgents = new HashSet <ulong>(combatData.Where(x => x.IsDamage() && jormagAttacks.Contains(x.SkillID)).Select(x => x.SrcAgent));
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidKralkatorrik:
                    target.OverrideName("The KralkatorrikVoid");
                    kralk        = target;
                    needRedirect = true;
                    var kralkAttacks = new HashSet <long>()
                    {
                        BrandingBeam,
                        CrystalBarrage,
                        VoidPoolKralkatorrik
                    };
                    kralkDamagingAgents = new HashSet <ulong>(combatData.Where(x => x.IsDamage() && kralkAttacks.Contains(x.SkillID)).Select(x => x.SrcAgent));
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidMordremoth:
                    target.OverrideName("The MordremothVoid");
                    mord         = target;
                    needRedirect = true;
                    var mordAttacks = new HashSet <long>()
                    {
                        Shockwave,
                        PoisonRoar,
                    };
                    mordDamagingAgents = new HashSet <ulong>(combatData.Where(x => x.IsDamage() && mordAttacks.Contains(x.SkillID)).Select(x => x.SrcAgent));
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidPrimordus:
                    target.OverrideName("The PrimordusVoid");
                    primordus    = target;
                    needRedirect = true;
                    var primordusAttacks = new HashSet <long>()
                    {
                        LavaSlam,
                        JawsOfDestruction,
                    };
                    primordusDamagingAgents = new HashSet <ulong>(combatData.Where(x => x.IsDamage() && primordusAttacks.Contains(x.SkillID)).Select(x => x.SrcAgent));
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidSooWon:
                    target.OverrideName("The SooWonVoid");
                    soowon       = target;
                    needRedirect = true;
                    var soowonAttacks = new HashSet <long>()
                    {
                        TsunamiSlam1,
                        TsunamiSlam2,
                        ClawSlap,
                        MagicHail,
                        VoidPurge,
                        VoidPoolSooWon,
                        TormentOfTheVoid
                    };
                    soowonDamagingAgents = new HashSet <ulong>(combatData.Where(x => x.IsDamage() && soowonAttacks.Contains(x.SkillID)).Select(x => x.SrcAgent));
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidZhaitan:
                    target.OverrideName("The ZhaitanVoid");
                    zhaitan      = target;
                    needRedirect = true;
                    var zhaiAttacks = new HashSet <long>()
                    {
                        ScreamOfZhaitan,
                        SlamZhaitan,
                        PutridDeluge
                    };
                    zhaitanDamagingAgents = new HashSet <ulong>(combatData.Where(x => x.IsDamage() && zhaiAttacks.Contains(x.SkillID)).Select(x => x.SrcAgent));
                    break;

                case (int)ArcDPSEnums.TrashID.PushableVoidAmalgamate:
                case (int)ArcDPSEnums.TrashID.KillableVoidAmalgamate:
                    target.OverrideName("Heart " + (++purificationID));
                    break;
                }
            }
            if (needRedirect)
            {
                foreach (CombatItem cbt in combatData)
                {
                    if (cbt.IsDamage())
                    {
                        // sanity check
                        if (agentData.GetAgent(cbt.SrcAgent, cbt.Time).GetFinalMaster().IsPlayer)
                        {
                            continue;
                        }
                        if (jormagDamagingAgents.Any(x => cbt.SrcAgent == x && jormag.FirstAware <= cbt.Time && cbt.Time <= jormag.LastAware))
                        {
                            cbt.OverrideSrcAgent(jormag.AgentItem.Agent);
                        }
                        else if (primordusDamagingAgents.Any(x => cbt.SrcAgent == x && primordus.FirstAware <= cbt.Time && cbt.Time <= primordus.LastAware))
                        {
                            cbt.OverrideSrcAgent(primordus.AgentItem.Agent);
                        }
                        else if (kralkDamagingAgents.Any(x => cbt.SrcAgent == x && kralk.FirstAware <= cbt.Time && cbt.Time <= kralk.LastAware))
                        {
                            cbt.OverrideSrcAgent(kralk.AgentItem.Agent);
                        }
                        else if (mordDamagingAgents.Any(x => cbt.SrcAgent == x && mord.FirstAware <= cbt.Time && cbt.Time <= mord.LastAware))
                        {
                            cbt.OverrideSrcAgent(mord.AgentItem.Agent);
                        }
                        else if (zhaitanDamagingAgents.Any(x => cbt.SrcAgent == x && zhaitan.FirstAware <= cbt.Time && cbt.Time <= zhaitan.LastAware))
                        {
                            cbt.OverrideSrcAgent(zhaitan.AgentItem.Agent);
                        }
                        else if (soowonDamagingAgents.Any(x => cbt.SrcAgent == x && soowon.FirstAware <= cbt.Time && cbt.Time <= soowon.LastAware))
                        {
                            cbt.OverrideSrcAgent(soowon.AgentItem.Agent);
                        }
                    }
                }
            }
        }
Ejemplo n.º 25
0
        internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions)
        {
            var attackTargetEvents = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.AttackTarget).ToList();
            var idsToUse           = new List <ArcDPSEnums.TargetID> {
                ArcDPSEnums.TargetID.TheDragonVoidJormag,
                ArcDPSEnums.TargetID.TheDragonVoidPrimordious,
                ArcDPSEnums.TargetID.TheDragonVoidKralkatorrik,
                ArcDPSEnums.TargetID.TheDragonVoidMordremoth,
                ArcDPSEnums.TargetID.TheDragonVoidZhaitan,
                ArcDPSEnums.TargetID.TheDragonVoidSooWon,
            };
            int index = 0;

            foreach (CombatItem at in attackTargetEvents)
            {
                AgentItem dragonVoid = agentData.GetAgent(at.DstAgent, at.Time);
                AgentItem atAgent    = agentData.GetAgent(at.SrcAgent, at.Time);
                // We take attack events, filter out the first one, present at spawn, that is always a non targetable event
                var targetables = combatData.Where(x => x.IsStateChange == ArcDPSEnums.StateChange.Targetable && x.SrcMatchesAgent(atAgent) && x.Time > 2000).ToList();
                // There are only two relevant attack targets, one represents the first five and the last one Soo Won
                if (!targetables.Any())
                {
                    continue;
                }
                var targetOns  = targetables.Where(x => x.DstAgent == 1).ToList();
                var targetOffs = targetables.Where(x => x.DstAgent == 0).ToList();
                // Events to be copied
                var posFacingHP = combatData.Where(x => x.SrcMatchesAgent(dragonVoid) && (x.IsStateChange == ArcDPSEnums.StateChange.Position || x.IsStateChange == ArcDPSEnums.StateChange.Rotation || x.IsStateChange == ArcDPSEnums.StateChange.MaxHealthUpdate)).ToList();
                //
                foreach (CombatItem targetOn in targetOns)
                {
                    // If Soo Won has been already created, we break
                    if (index >= idsToUse.Count)
                    {
                        break;
                    }
                    int        id        = (int)idsToUse[index++];
                    long       start     = targetOn.Time;
                    long       end       = fightData.FightEnd;
                    CombatItem targetOff = targetOffs.FirstOrDefault(x => x.Time > start);
                    // Don't split Soo won into two
                    if (targetOff != null && id != (int)ArcDPSEnums.TargetID.TheDragonVoidSooWon)
                    {
                        end = targetOff.Time;
                    }
                    AgentItem extra = agentData.AddCustomNPCAgent(start, end, dragonVoid.Name, dragonVoid.Spec, id, false, dragonVoid.Toughness, dragonVoid.Healing, dragonVoid.Condition, dragonVoid.Concentration, dragonVoid.HitboxWidth, dragonVoid.HitboxHeight);
                    foreach (CombatItem c in combatData)
                    {
                        if (extra.InAwareTimes(c.Time))
                        {
                            if (c.SrcMatchesAgent(dragonVoid, extensions))
                            {
                                // Avoid making the gadget go back to 100% hp on "death"
                                if (c.IsStateChange == ArcDPSEnums.StateChange.HealthUpdate && c.DstAgent == 10000 && c.Time > extra.LastAware - 2000)
                                {
                                    continue;
                                }
                                c.OverrideSrcAgent(extra.Agent);
                            }
                            if (c.DstMatchesAgent(dragonVoid, extensions))
                            {
                                c.OverrideDstAgent(extra.Agent);
                            }
                        }
                    }
                    var attackTargetCopy = new CombatItem(at);
                    attackTargetCopy.OverrideTime(extra.FirstAware);
                    attackTargetCopy.OverrideDstAgent(extra.Agent);
                    combatData.Add(attackTargetCopy);
                    foreach (CombatItem c in posFacingHP)
                    {
                        var cExtra = new CombatItem(c);
                        cExtra.OverrideTime(extra.FirstAware);
                        cExtra.OverrideSrcAgent(extra.Agent);
                        combatData.Add(cExtra);
                    }
                }
            }
            if (index == 0)
            {
                // Add dummy target as there are no dragon voids
                agentData.AddCustomNPCAgent(0, fightData.FightEnd, "Dummy Harvest Temple", Spec.NPC, (int)ArcDPSEnums.TargetID.DummyTarget, true);
                Targetless = true;
            }
            ComputeFightTargets(agentData, combatData, extensions);
            foreach (NPC target in Targets)
            {
                switch (target.ID)
                {
                case (int)ArcDPSEnums.TargetID.TheDragonVoidJormag:
                    target.OverrideName("The JormagVoid");
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidKralkatorrik:
                    target.OverrideName("The KralkatorrikVoid");
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidMordremoth:
                    target.OverrideName("The MordremothVoid");
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidPrimordious:
                    target.OverrideName("The PrimordiusVoid");
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidSooWon:
                    target.OverrideName("The SooWonVoid");
                    break;

                case (int)ArcDPSEnums.TargetID.TheDragonVoidZhaitan:
                    target.OverrideName("The ZhaitanVoid");
                    break;
                }
            }
        }
Ejemplo n.º 26
0
 protected AbstractBuffStackEvent(CombatItem evtcItem, AgentData agentData, SkillData skillData) : base(evtcItem, skillData)
 {
     To = agentData.GetAgent(evtcItem.SrcAgent);
 }
 internal override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList)
 {
     // has breakbar state into
     if (combatData.Any(x => x.IsStateChange == ArcDPSEnums.StateChange.BreakbarState))
     {
         long sacrificeID        = 34442;
         var  sacrificeList      = combatData.Where(x => x.SkillID == sacrificeID && ((x.IsBuffRemove == ArcDPSEnums.BuffRemove.All && x.IsBuff != 0) || (x.IsBuff != 0 && x.BuffDmg == 0 && x.Value > 0 && x.IsStateChange == ArcDPSEnums.StateChange.None && x.IsActivation == ArcDPSEnums.Activation.None && x.IsBuffRemove == ArcDPSEnums.BuffRemove.None))).ToList();
         var  sacrificeStartList = sacrificeList.Where(x => x.IsBuffRemove == ArcDPSEnums.BuffRemove.None).ToList();
         var  sacrificeEndList   = sacrificeList.Where(x => x.IsBuffRemove == ArcDPSEnums.BuffRemove.All).ToList();
         var  copies             = new List <CombatItem>();
         for (int i = 0; i < sacrificeStartList.Count; i++)
         {
             //
             long sacrificeStartTime = sacrificeStartList[i].Time;
             long sacrificeEndTime   = i < sacrificeEndList.Count ? sacrificeEndList[i].Time : fightData.FightEnd;
             //
             Player sacrifice = playerList.FirstOrDefault(x => x.AgentItem == agentData.GetAgent(sacrificeStartList[i].DstAgent));
             if (sacrifice == null)
             {
                 continue;
             }
             AgentItem sacrificeCrystal = agentData.AddCustomAgent(sacrificeStartTime, sacrificeEndTime + 100, AgentItem.AgentType.NPC, "Sacrificed " + (i + 1) + " " + sacrifice.Character, sacrifice.Prof, (int)ArcDPSEnums.TrashID.MatthiasSacrificeCrystal, false);
             foreach (CombatItem cbt in combatData)
             {
                 if (!sacrificeCrystal.InAwareTimes(cbt.Time))
                 {
                     continue;
                 }
                 bool skip = !((cbt.IsStateChange.DstIsAgent() && cbt.DstAgent == sacrifice.Agent) || (cbt.IsStateChange.SrcIsAgent() && cbt.SrcAgent == sacrifice.Agent));
                 if (skip)
                 {
                     continue;
                 }
                 bool isDamageEvent = cbt.IsStateChange == ArcDPSEnums.StateChange.None && cbt.IsActivation == ArcDPSEnums.Activation.None && cbt.IsBuffRemove == ArcDPSEnums.BuffRemove.None && ((cbt.IsBuff != 0 && cbt.Value == 0) || (cbt.IsBuff == 0));
                 // redirect damage events
                 if (isDamageEvent)
                 {
                     // only redirect incoming damage
                     if (cbt.DstAgent == sacrifice.Agent)
                     {
                         cbt.OverrideDstAgent(sacrificeCrystal.Agent);
                     }
                 }
                 // copy the rest
                 else
                 {
                     var copy = new CombatItem(cbt);
                     if (cbt.IsStateChange.DstIsAgent() && cbt.DstAgent == sacrifice.Agent)
                     {
                         cbt.OverrideDstAgent(sacrificeCrystal.Agent);
                     }
                     if (cbt.IsStateChange.SrcIsAgent() && cbt.SrcAgent == sacrifice.Agent)
                     {
                         cbt.OverrideSrcAgent(sacrificeCrystal.Agent);
                     }
                     copies.Add(copy);
                 }
             }
         }
         if (copies.Any())
         {
             combatData.AddRange(copies);
             combatData.Sort((x, y) => x.Time.CompareTo(y.Time));
         }
     }
     ComputeFightTargets(agentData, combatData);
     foreach (NPC target in Targets)
     {
         if (target.ID == (int)ArcDPSEnums.TrashID.MatthiasSacrificeCrystal)
         {
             target.SetManualHealth(100000);
         }
     }
 }
 internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, List <AbstractSingleActor> friendlies, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions)
 {
     // has breakbar state into
     if (combatData.Any(x => x.IsStateChange == ArcDPSEnums.StateChange.BreakbarState))
     {
         long sacrificeID        = 34442;
         var  sacrificeList      = combatData.Where(x => x.SkillID == sacrificeID && !x.IsExtension && (x.IsBuffRemove == ArcDPSEnums.BuffRemove.All || x.IsBuffApply())).ToList();
         var  sacrificeStartList = sacrificeList.Where(x => x.IsBuffRemove == ArcDPSEnums.BuffRemove.None).ToList();
         var  sacrificeEndList   = sacrificeList.Where(x => x.IsBuffRemove == ArcDPSEnums.BuffRemove.All).ToList();
         var  copies             = new List <CombatItem>();
         for (int i = 0; i < sacrificeStartList.Count; i++)
         {
             //
             long sacrificeStartTime = sacrificeStartList[i].Time;
             long sacrificeEndTime   = i < sacrificeEndList.Count ? sacrificeEndList[i].Time : fightData.FightEnd;
             //
             Player sacrifice = friendlies.OfType <Player>().FirstOrDefault(x => x.AgentItem == agentData.GetAgent(sacrificeStartList[i].DstAgent, sacrificeStartList[i].Time));
             if (sacrifice == null)
             {
                 continue;
             }
             AgentItem sacrificeCrystal = agentData.AddCustomAgent(sacrificeStartTime, sacrificeEndTime + 100, AgentItem.AgentType.NPC, "Sacrificed " + (i + 1) + " " + sacrifice.Character, sacrifice.Spec, (int)ArcDPSEnums.TrashID.MatthiasSacrificeCrystal, false);
             foreach (CombatItem cbt in combatData)
             {
                 if (!sacrificeCrystal.InAwareTimes(cbt.Time))
                 {
                     continue;
                 }
                 bool skip = !(cbt.DstMatchesAgent(sacrifice.AgentItem, extensions) || cbt.SrcMatchesAgent(sacrifice.AgentItem, extensions));
                 if (skip)
                 {
                     continue;
                 }
                 // redirect damage events
                 if (cbt.IsDamage(extensions))
                 {
                     // only redirect incoming damage
                     if (cbt.DstMatchesAgent(sacrifice.AgentItem, extensions))
                     {
                         cbt.OverrideDstAgent(sacrificeCrystal.Agent);
                     }
                 }
                 // copy the rest
                 else
                 {
                     var copy = new CombatItem(cbt);
                     if (copy.DstMatchesAgent(sacrifice.AgentItem, extensions))
                     {
                         copy.OverrideDstAgent(sacrificeCrystal.Agent);
                     }
                     if (copy.SrcMatchesAgent(sacrifice.AgentItem, extensions))
                     {
                         copy.OverrideSrcAgent(sacrificeCrystal.Agent);
                     }
                     copies.Add(copy);
                 }
             }
         }
         if (copies.Any())
         {
             combatData.AddRange(copies);
         }
     }
     ComputeFightTargets(agentData, combatData, extensions);
     foreach (AbstractSingleActor target in Targets)
     {
         if (target.ID == (int)ArcDPSEnums.TrashID.MatthiasSacrificeCrystal)
         {
             target.SetManualHealth(100000);
         }
     }
 }
Ejemplo n.º 29
0
 internal AbstractStatusEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem.Time)
 {
     Src = agentData.GetAgent(evtcItem.SrcAgent);
 }
Ejemplo n.º 30
0
 public PointOfViewEvent(CombatItem evtcItem, AgentData agentData) : base(evtcItem)
 {
     PoV = agentData.GetAgent(evtcItem.SrcAgent);
 }