internal override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList) { AgentItem dummyAgent = agentData.AddCustomAgent(fightData.FightStart, fightData.FightEnd, AgentItem.AgentType.NPC, "Enemy Players", "", (int)ArcDPSEnums.TargetID.WorldVersusWorld); ComputeFightTargets(agentData, combatData); var aList = agentData.GetAgentByType(AgentItem.AgentType.EnemyPlayer).ToList(); /*foreach (AgentItem a in aList) * { * TrashMobs.Add(new NPC(a)); * }*/ var enemyPlayerDicts = aList.GroupBy(x => x.Agent).ToDictionary(x => x.Key, x => x.ToList().First()); foreach (CombatItem c in combatData) { if (c.IsStateChange == ArcDPSEnums.StateChange.None && c.IsActivation == ArcDPSEnums.Activation.None && c.IsBuffRemove == ArcDPSEnums.BuffRemove.None && ((c.IsBuff != 0 && c.Value == 0) || (c.IsBuff == 0))) { if (enemyPlayerDicts.TryGetValue(c.SrcAgent, out AgentItem src)) { c.OverrideSrcAgent(dummyAgent.Agent); } if (enemyPlayerDicts.TryGetValue(c.DstAgent, out AgentItem dst)) { c.OverrideDstAgent(dummyAgent.Agent); } } } }
public override void SpecialParse(FightData fightData, AgentData agentData, List <CombatItem> combatData) { AgentItem dummyAgent = agentData.AddCustomAgent(combatData.First().Time, combatData.Last().Time, AgentItem.AgentType.NPC, "WorldVsWorld", "", TriggerID); Targets.Add(new Target(dummyAgent)); Targets[0].Health = 1; }
public override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList) { // make those into npcs List <AgentItem> cas = agentData.GetGadgetsByID((int)ParseEnum.TargetIDS.ConjuredAmalgamate); List <AgentItem> leftArms = agentData.GetGadgetsByID((int)ParseEnum.TargetIDS.CALeftArm); List <AgentItem> rightArms = agentData.GetGadgetsByID((int)ParseEnum.TargetIDS.CARightArm); foreach (AgentItem ca in cas) { ca.OverrideType(AgentItem.AgentType.NPC); } foreach (AgentItem leftArm in leftArms) { leftArm.OverrideType(AgentItem.AgentType.NPC); } foreach (AgentItem rightArm in rightArms) { rightArm.OverrideType(AgentItem.AgentType.NPC); } agentData.Refresh(); ComputeFightTargets(agentData, combatData); AgentItem sword = agentData.AddCustomAgent(fightData.FightStart, fightData.FightEnd, AgentItem.AgentType.Player, "Conjured Sword\0:Conjured Sword\051", "Sword", 0); playerList.Add(new Player(sword, false, true)); foreach (CombatItem c in combatData) { if (c.SkillID == 52370 && c.IsStateChange == ParseEnum.StateChange.None && c.IsBuffRemove == ParseEnum.BuffRemove.None && ((c.IsBuff == 1 && c.BuffDmg >= 0 && c.Value == 0) || (c.IsBuff == 0 && c.Value >= 0)) && c.DstInstid != 0 && c.IFF == ParseEnum.IFF.Foe) { c.OverrideSrcAgent(sword.Agent); } } }
public override void SpecialParse(FightData fightData, AgentData agentData, List <CombatItem> combatData) { AgentItem dummyAgent = agentData.AddCustomAgent(combatData.First().LogTime, combatData.Last().LogTime, AgentItem.AgentType.NPC, "Enemy Players", "", TriggerID); ComputeFightTargets(agentData, combatData); List <AgentItem> aList = agentData.GetAgentByType(AgentItem.AgentType.EnemyPlayer).ToList(); /*foreach (AgentItem a in aList) * { * TrashMobs.Add(new Mob(a)); * }*/ Dictionary <ulong, AgentItem> enemyPlayerDicts = aList.GroupBy(x => x.Agent).ToDictionary(x => x.Key, x => x.ToList().First()); foreach (CombatItem c in combatData) { if (c.IsStateChange == ParseEnum.StateChange.None && c.IsActivation == ParseEnum.Activation.None && c.IsBuffRemove == ParseEnum.BuffRemove.None && ((c.IsBuff != 0 && c.Value == 0) || (c.IsBuff == 0))) { if (enemyPlayerDicts.TryGetValue(c.SrcAgent, out AgentItem src)) { c.OverrideSrcValues(dummyAgent.Agent, dummyAgent.InstID); } if (enemyPlayerDicts.TryGetValue(c.DstAgent, out AgentItem dst)) { c.OverrideDstValues(dummyAgent.Agent, dummyAgent.InstID); } } } }
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, List <AbstractSingleActor> friendlies, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions) { // make those into npcs IReadOnlyList <AgentItem> cas = agentData.GetGadgetsByID((int)ArcDPSEnums.TargetID.ConjuredAmalgamate); IReadOnlyList <AgentItem> leftArms = agentData.GetGadgetsByID((int)ArcDPSEnums.TargetID.CALeftArm); IReadOnlyList <AgentItem> rightArms = agentData.GetGadgetsByID((int)ArcDPSEnums.TargetID.CARightArm); foreach (AgentItem ca in cas) { ca.OverrideType(AgentItem.AgentType.NPC); } foreach (AgentItem leftArm in leftArms) { leftArm.OverrideType(AgentItem.AgentType.NPC); } foreach (AgentItem rightArm in rightArms) { rightArm.OverrideType(AgentItem.AgentType.NPC); } agentData.Refresh(); ComputeFightTargets(agentData, combatData, extensions); AgentItem sword = agentData.AddCustomAgent(0, fightData.FightEnd, AgentItem.AgentType.NPC, "Conjured Sword\0:Conjured Sword\051", ParserHelper.Spec.NPC, (int)ArcDPSEnums.TrashID.ConjuredPlayerSword, true); friendlies.Add(new NPC(sword)); foreach (CombatItem c in combatData) { if (c.IsDamage(extensions) && c.SkillID == 52370) { c.OverrideSrcAgent(sword.Agent); } } }
internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, List <AbstractSingleActor> friendlies, 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.AddCustomAgent(start, end, AgentItem.AgentType.NPC, 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); }
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); }
internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, List <AbstractSingleActor> friendlies, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions) { agentData.AddCustomAgent(0, fightData.FightEnd, AgentItem.AgentType.NPC, "River of Souls", Spec.NPC, (int)ArcDPSEnums.TargetID.DummyTarget, true); ComputeFightTargets(agentData, combatData, extensions); AgentItem desmina = agentData.GetNPCsByID((int)ArcDPSEnums.TargetID.Desmina).FirstOrDefault(); if (desmina != null) { friendlies.Add(new NPC(desmina)); } }
public override void SpecialParse(FightData fightData, AgentData agentData, List <CombatItem> combatData) { AgentItem sword = agentData.AddCustomAgent(combatData.First().Time, combatData.Last().Time, AgentItem.AgentType.Player, "Conjured Sword\0:Conjured Sword\050", "Sword", 0); foreach (CombatItem c in combatData) { if (c.SkillID == 52370 && c.IsStateChange == ParseEnum.StateChange.Normal && c.IsBuffRemove == ParseEnum.BuffRemove.None && ((c.IsBuff == 1 && c.BuffDmg >= 0 && c.Value == 0) || (c.IsBuff == 0 && c.Value >= 0)) && c.DstInstid != 0 && c.IFF == ParseEnum.IFF.Foe) { c.OverrideSrcValues(sword.Agent, sword.InstID, 0); } } }
internal override void EIEvtcParse(ulong gw2Build, FightData fightData, AgentData agentData, List <CombatItem> combatData, List <AbstractSingleActor> friendlies, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions) { AgentItem dummyAgent = agentData.AddCustomAgent(0, fightData.FightEnd, AgentItem.AgentType.NPC, _detailed ? "Dummy WvW Agent" : "Enemy Players", ParserHelper.Spec.NPC, (int)ArcDPSEnums.TargetID.WorldVersusWorld, true); SolveWvWPlayers(agentData, combatData, friendlies, extensions); var friendlyAgents = new HashSet <AgentItem>(friendlies.Select(x => x.AgentItem)); if (!_detailed) { var aList = agentData.GetAgentByType(AgentItem.AgentType.NonSquadPlayer).Where(x => !friendlyAgents.Contains(x)).ToList(); var enemyPlayerDicts = aList.GroupBy(x => x.Agent).ToDictionary(x => x.Key, x => x.ToList()); foreach (CombatItem c in combatData) { if (c.IsDamage(extensions)) { if (enemyPlayerDicts.TryGetValue(c.SrcAgent, out List <AgentItem> srcs)) { foreach (AgentItem src in srcs) { if (c.SrcMatchesAgent(src, extensions)) { c.OverrideSrcAgent(dummyAgent.Agent); break; } } } if (enemyPlayerDicts.TryGetValue(c.DstAgent, out List <AgentItem> dsts)) { foreach (AgentItem dst in dsts) { if (c.DstMatchesAgent(dst, extensions)) { c.OverrideDstAgent(dummyAgent.Agent); break; } } } } } } ComputeFightTargets(agentData, combatData, extensions); }
internal override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList) { agentData.AddCustomAgent(fightData.FightStart, fightData.FightEnd, AgentItem.AgentType.NPC, "River of Souls", "", (int)ArcDPSEnums.TargetID.DummyTarget, true); // The walls and bombers spawn at the start of the encounter, we fix it by overriding their first aware to the first velocity change event var agentsToOverrideFirstAware = new List <AgentItem>(agentData.GetNPCsByID((int)ArcDPSEnums.TrashID.RiverOfSouls)); agentsToOverrideFirstAware.AddRange(agentData.GetNPCsByID((int)ArcDPSEnums.TrashID.HollowedBomber)); bool sortCombatList = false; foreach (AgentItem agentToOverrideFirstAware in agentsToOverrideFirstAware) { CombatItem firstMovement = combatData.FirstOrDefault(x => x.IsStateChange == ArcDPSEnums.StateChange.Velocity && x.SrcAgent == agentToOverrideFirstAware.Agent && x.DstAgent != 0); if (firstMovement != null) { // update start agentToOverrideFirstAware.OverrideAwareTimes(firstMovement.Time - ParserHelper.ServerDelayConstant, agentToOverrideFirstAware.LastAware); foreach (CombatItem c in combatData) { if (c.SrcAgent == agentToOverrideFirstAware.Agent && (c.IsStateChange == ArcDPSEnums.StateChange.Position || c.IsStateChange == ArcDPSEnums.StateChange.Rotation) && c.Time <= agentToOverrideFirstAware.FirstAware) { sortCombatList = true; c.OverrideTime(agentToOverrideFirstAware.FirstAware); } } } } // make sure the list is still sorted by time after overrides if (sortCombatList) { combatData.Sort((x, y) => x.Time.CompareTo(y.Time)); } ComputeFightTargets(agentData, combatData); AgentItem desmina = agentData.GetNPCsByID((int)ArcDPSEnums.TargetID.Desmina).FirstOrDefault(); if (desmina != null) { playerList.Add(new Player(desmina, "Desmina", GetNPCIcon((int)ArcDPSEnums.TargetID.Desmina))); } }
public override void SpecialParse(FightData fightData, AgentData agentData, List <CombatItem> combatData) { Random rnd = new Random(); ulong agent = 1; while (agentData.AgentValues.Contains(agent)) { agent = (ulong)rnd.Next(1, Int32.MaxValue); } ushort id = 1; while (agentData.InstIDValues.Contains(id)) { id = (ushort)rnd.Next(1, ushort.MaxValue); } AgentItem sword = new AgentItem(agent, "Conjured Sword\0:Conjured Sword\050", "Sword", AgentItem.AgentType.Player, 0, 0, 0, 0, 20, 20) { InstID = id, LastAware = combatData.Last().Time, FirstAware = combatData.First().Time, MasterAgent = 0 }; agentData.AddCustomAgent(sword); foreach (CombatItem cl in combatData) { if (cl.SkillID == 52370 && cl.IsStateChange == ParseEnum.StateChange.Normal && cl.IsBuffRemove == ParseEnum.BuffRemove.None && ((cl.IsBuff == 1 && cl.BuffDmg >= 0 && cl.Value == 0) || (cl.IsBuff == 0 && cl.Value >= 0)) && cl.DstInstid != 0 && cl.IFF == ParseEnum.IFF.Foe) { cl.SrcAgent = sword.Agent; cl.SrcInstid = sword.InstID; cl.SrcMasterInstid = 0; } } }
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); } } }
internal override void EIEvtcParse(FightData fightData, AgentData agentData, List <CombatItem> combatData, List <Player> playerList) { AgentItem dummyAgent = agentData.AddCustomAgent(fightData.FightStart, fightData.FightEnd, AgentItem.AgentType.NPC, _detailed ? "Dummy WvW Agent" : "Enemy Players", "", (int)ArcDPSEnums.TargetID.WorldVersusWorld, true); ComputeFightTargets(agentData, combatData); IReadOnlyList <AgentItem> aList = agentData.GetAgentByType(AgentItem.AgentType.EnemyPlayer); if (_detailed) { var set = new HashSet <string>(); foreach (AgentItem a in aList) { var npc = new NPC(a); if (!set.Contains(npc.Character)) { _targets.Add(npc); set.Add(npc.Character); } else { // we merge NPC mainNPC = _targets.FirstOrDefault(x => x.Character == npc.Character); foreach (CombatItem c in combatData) { if (c.IsStateChange.SrcIsAgent() && c.SrcAgent == npc.Agent) { c.OverrideSrcAgent(mainNPC.Agent); } if (c.IsStateChange.DstIsAgent() && c.DstAgent == npc.Agent) { c.OverrideDstAgent(mainNPC.Agent); } } agentData.SwapMasters(npc.AgentItem, mainNPC.AgentItem); mainNPC.AgentItem.OverrideAwareTimes(Math.Min(npc.FirstAware, mainNPC.FirstAware), Math.Max(npc.LastAware, mainNPC.LastAware)); } } } else { var enemyPlayerDicts = aList.GroupBy(x => x.Agent).ToDictionary(x => x.Key, x => x.ToList().First()); foreach (CombatItem c in combatData) { if (c.IsStateChange == ArcDPSEnums.StateChange.None && c.IsActivation == ArcDPSEnums.Activation.None && c.IsBuffRemove == ArcDPSEnums.BuffRemove.None && ((c.IsBuff != 0 && c.Value == 0) || (c.IsBuff == 0))) { if (enemyPlayerDicts.TryGetValue(c.SrcAgent, out AgentItem src)) { c.OverrideSrcAgent(dummyAgent.Agent); } if (enemyPlayerDicts.TryGetValue(c.DstAgent, out AgentItem dst)) { c.OverrideDstAgent(dummyAgent.Agent); } } } } }