protected override void SetCastLogs(ParsedLog log) { CastLog curCastLog = null; long minTime = Math.Max(log.FightData.FightStart, AgentItem.FirstAware); long maxTime = Math.Min(log.FightData.FightEnd, AgentItem.LastAware); foreach (CombatItem c in log.GetCastData(AgentItem.InstID)) { if (!(c.Time >= minTime)) { continue; } ParseEnum.StateChange state = c.IsStateChange; if (state == ParseEnum.StateChange.Normal) { if (c.IsActivation.IsCasting() && c.Time <= maxTime) { long time = log.FightData.ToFightSpace(c.Time); curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation); CastLogs.Add(curCastLog); } else { if (curCastLog != null) { if (curCastLog.SkillId == c.SkillID) { curCastLog.SetEndStatus(c.Value, c.IsActivation, log.FightData.FightDuration); curCastLog = null; } } } } } }
// Main method public ushort TryFindSrc(AbstractActor a, long time, long extension, ParsedLog log) { int sbCheck = CheckSoulbeast(a, extension, log); if (sbCheck != -1) { return((ushort)sbCheck); } HashSet <long> idsToCheck = new HashSet <long>(); if (DurationToIDs.TryGetValue(extension, out idsToCheck)) { List <CastLog> cls = GetExtensionSkills(log, time, idsToCheck); if (cls.Count == 1) { CastLog item = cls.First(); // Imbued Melodies check int tempestCheck = CheckTempest(item, time, extension, log); if (tempestCheck != -1) { return((ushort)tempestCheck); } return(item.SrcInstId); } } return(0); }
// Main method public ushort TryFindSrc(AbstractActor a, long time, long extension, ParsedLog log, long boonid) { if (!_boonIds.Contains(boonid)) { return(a.InstID); } int essenceOfSpeedCheck = CouldBeEssenceOfSpeed(a, extension, log); if (essenceOfSpeedCheck != -1) { // unknown or self return((ushort)essenceOfSpeedCheck); } HashSet <long> idsToCheck = new HashSet <long>(); if (DurationToIDs.TryGetValue(extension, out idsToCheck)) { List <CastLog> cls = GetExtensionSkills(log, time, idsToCheck); if (cls.Count == 1) { CastLog item = cls.First(); // Imbued Melodies check if (CouldBeImbuedMelodies(item, time, extension, log)) { return(0); } return(item.SrcInstId); } } return(0); }
public void AddCustomCastLog(CastLog cl, ParsedLog log) { if (CastLogs.Count == 0) { GetCastLogs(log, 0, log.FightData.FightEnd); } CastLogs.Add(cl); }
private ushort TryFindSrc(List <CastLog> castsToCheck, long time, long extension, ParsedLog log) { HashSet <long> idsToCheck = new HashSet <long>(); switch (extension) { // SoI case 5000: idsToCheck.Add(10236); break; // Treated True Nature case 3000: idsToCheck.Add(51696); break; // Sand Squall, True Nature, Soulbeast trait case 2000: if (Prof == "Soulbeast") { if (log.PlayerListBySpec.ContainsKey("Herald") || log.PlayerListBySpec.ContainsKey("Tempest")) { return(0); } // if not herald or tempest in squad then can only be the trait return(InstID); } idsToCheck.Add(51696); idsToCheck.Add(29453); break; } List <CastLog> cls = castsToCheck.Where(x => idsToCheck.Contains(x.SkillId) && x.Time <= time && time <= x.Time + x.ActualDuration + 10 && x.EndActivation.NoInterruptEndCasting()).ToList(); if (cls.Count == 1) { CastLog item = cls.First(); if (extension == 2000 && log.PlayerListBySpec.TryGetValue("Tempest", out List <Player> tempests)) { List <CombatItem> magAuraApplications = log.GetBoonData(5684).Where(x => x.IsBuffRemove == ParseEnum.BuffRemove.None && x.IsOffcycle == 0).ToList(); foreach (Player tempest in tempests) { if (magAuraApplications.FirstOrDefault(x => x.SrcInstid == tempest.InstID && Math.Abs(x.Time - time) < 50) != null) { return(0); } } } return(item.SrcInstId); } return(0); }
protected override void setCastLogs(ParsedLog log) { long time_start = log.getBossData().getFirstAware(); CastLog curCastLog = null; foreach (CombatItem c in log.getCastData()) { if (!(c.getTime() > log.getBossData().getFirstAware() && c.getTime() < log.getBossData().getLastAware())) { continue; } ParseEnum.StateChange state = c.isStateChange(); if (state == ParseEnum.StateChange.Normal) { if (agent.getInstid() == c.getSrcInstid())//selecting player as caster { if (c.isActivation().IsCasting()) { long time = c.getTime() - time_start; curCastLog = new CastLog(time, c.getSkillID(), c.getValue(), c.isActivation()); cast_logs.Add(curCastLog); } else { if (curCastLog != null) { if (curCastLog.getID() == c.getSkillID()) { curCastLog.setEndStatus(c.getValue(), c.isActivation()); curCastLog = null; } } } } } else if (state == ParseEnum.StateChange.WeaponSwap) { //Weapon swap if (agent.getInstid() == c.getSrcInstid()) //selecting player as caster { if ((int)c.getDstAgent() == 4 || (int)c.getDstAgent() == 5) { long time = c.getTime() - time_start; CastLog swapLog = new CastLog(time, -2, (int)c.getDstAgent(), c.isActivation()); cast_logs.Add(swapLog); } } } } }
private void setCastLogs(BossData bossData, List <CombatItem> combatList, AgentData agentData) { int time_start = bossData.getFirstAware(); CastLog curCastLog = null; foreach (CombatItem c in combatList) { LuckParser.Models.ParseEnums.StateChange state = c.isStateChange(); if (state.getID() == 0) { if (instid == c.getSrcInstid())//selecting player as caster { if (c.isActivation().getID() > 0) { if (c.isActivation().getID() < 3) { int time = c.getTime() - time_start; curCastLog = new CastLog(time, c.getSkillID(), c.getValue(), c.isActivation()); } else { if (curCastLog != null) { if (curCastLog.getID() == c.getSkillID()) { curCastLog = new CastLog(curCastLog.getTime(), curCastLog.getID(), curCastLog.getExpDur(), curCastLog.startActivation(), c.getValue(), c.isActivation()); cast_logs.Add(curCastLog); curCastLog = null; } } } } } } else if (state.getID() == 11) //Weapon swap { if (instid == c.getSrcInstid()) //selecting player as caster { if ((int)c.getDstAgent() == 4 || (int)c.getDstAgent() == 5) { int time = c.getTime() - time_start; curCastLog = new CastLog(time, -2, (int)c.getDstAgent(), c.isActivation()); cast_logs.Add(curCastLog); curCastLog = null; } } } } }
private int CheckTempest(CastLog item, long time, long extension, ParsedLog log) { if (extension == ImbuedMelodies && log.PlayerListBySpec.TryGetValue("Tempest", out List <Player> tempests)) { HashSet <ushort> magAuraApplications = new HashSet <ushort>(log.CombatData.GetBoonData(5684).Where(x => x.IsBuffRemove == ParseEnum.BuffRemove.None && Math.Abs(x.Time - log.FightData.ToLogSpace(time)) < 50 && x.SrcInstid != item.SrcInstId).Select(x => x.SrcInstid)); foreach (Player tempest in tempests) { if (magAuraApplications.Contains(tempest.InstID)) { return(0); } } } return(-1); }
protected override void SetCastLogs(ParsedLog log) { long agentStart = Math.Max(FirstAware, log.FightData.FightStart); long agentEnd = Math.Min(LastAware, log.FightData.FightEnd); long timeStart = log.FightData.FightStart; CastLog curCastLog = null; foreach (CombatItem c in log.GetCastData(AgentItem.InstID)) { if (!(c.Time > agentStart)) { continue; } ParseEnum.StateChange state = c.IsStateChange; if (state == ParseEnum.StateChange.Normal) { if (c.IsActivation.IsCasting() && c.Time < agentEnd) { long time = c.Time - timeStart; curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation); CastLogs.Add(curCastLog); } else { if (curCastLog != null) { if (curCastLog.SkillId == c.SkillID) { curCastLog.SetEndStatus(c.Value, c.IsActivation); curCastLog = null; } } } } else if (state == ParseEnum.StateChange.WeaponSwap && c.Time < agentEnd) { long time = c.Time - timeStart; CastLog swapLog = new CastLog(time, SkillItem.WeaponSwapId, (int)c.DstAgent, c.IsActivation); CastLogs.Add(swapLog); } } }
protected override void setCastLogs(ParsedLog log) { long time_start = log.getBossData().getFirstAware(); CastLog curCastLog = null; long min_time = Math.Max(time_start, agent.getFirstAware()); long max_time = Math.Min(log.getBossData().getLastAware(), agent.getLastAware()); foreach (CombatItem c in log.getCastData()) { if (!(c.getTime() > min_time && c.getTime() < max_time)) { continue; } ParseEnum.StateChange state = c.isStateChange(); if (state == ParseEnum.StateChange.Normal) { if (agent.getInstid() == c.getSrcInstid())//selecting player as caster { if (c.isActivation().IsCasting()) { long time = c.getTime() - time_start; curCastLog = new CastLog(time, c.getSkillID(), c.getValue(), c.isActivation()); } else { if (curCastLog != null) { if (curCastLog.getID() == c.getSkillID()) { curCastLog = new CastLog(curCastLog.getTime(), curCastLog.getID(), curCastLog.getExpDur(), curCastLog.startActivation(), c.getValue(), c.isActivation()); cast_logs.Add(curCastLog); curCastLog = null; } } } } } } }
protected virtual void SetCastLogs(ParsedLog log) { CastLog curCastLog = null; foreach (CombatItem c in log.GetCastData(InstID, FirstAware, LastAware)) { ParseEnum.StateChange state = c.IsStateChange; if (state == ParseEnum.StateChange.Normal) { if (c.IsActivation.StartCasting()) { // Missing end activation long time = log.FightData.ToFightSpace(c.Time); if (curCastLog != null) { int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : curCastLog.ExpectedDuration; curCastLog.SetEndStatus(actDur, ParseEnum.Activation.Unknown, time); curCastLog = null; } curCastLog = new CastLog(time, c.SkillID, c.Value, c.IsActivation, Agent, InstID); CastLogs.Add(curCastLog); } else { if (curCastLog != null) { if (curCastLog.SkillId == c.SkillID) { int actDur = curCastLog.SkillId == SkillItem.DodgeId ? 750 : c.Value; curCastLog.SetEndStatus(actDur, c.IsActivation, log.FightData.FightDuration); curCastLog = null; } } } } else if (state == ParseEnum.StateChange.WeaponSwap) { long time = log.FightData.ToFightSpace(c.Time); CastLog swapLog = new CastLog(time, SkillItem.WeaponSwapId, (int)c.DstAgent, c.IsActivation, Agent, InstID); if (CastLogs.Count > 0 && (time - CastLogs.Last().Time) < 10 && CastLogs.Last().SkillId == SkillItem.WeaponSwapId) { CastLogs[CastLogs.Count - 1] = swapLog; } else { CastLogs.Add(swapLog); } swapLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration); } } long cloakStart = 0; foreach (long time in log.CombatData.GetBuffs(InstID, 40408, FirstAware, LastAware).Select(x => log.FightData.ToFightSpace(x.Time))) { if (time - cloakStart > 10) { CastLog dodgeLog = new CastLog(time, SkillItem.DodgeId, 0, ParseEnum.Activation.Unknown, Agent, InstID); dodgeLog.SetEndStatus(50, ParseEnum.Activation.Unknown, log.FightData.FightDuration); CastLogs.Add(dodgeLog); } cloakStart = time; } CastLogs.Sort((x, y) => x.Time.CompareTo(y.Time)); }
// Private Methods private void setPhases(ParsedLog log) { long fight_dur = log.getBossData().getAwareDuration(); phases.Add(new PhaseData(0, fight_dur)); phases[0].setName("Full Fight"); long start = 0; long end = 0; getCastLogs(log, 0, fight_dur); switch (log.getBossData().getID()) { case 0x3C4E: // Invul check List <CombatItem> invulsVG = log.getBoonData().Where(x => x.getSkillID() == 757 && getInstid() == x.getDstInstid()).ToList(); for (int i = 0; i < invulsVG.Count; i++) { CombatItem c = invulsVG[i]; if (c.isBuffremove() == ParseEnum.BuffRemove.None) { end = c.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); if (i == invulsVG.Count - 1) { cast_logs.Add(new CastLog(end, -5, (int)(fight_dur - end), ParseEnum.Activation.None, (int)(fight_dur - end), ParseEnum.Activation.None)); } } else { start = c.getTime() - log.getBossData().getFirstAware(); cast_logs.Add(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None)); } } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; case 0x3C45: // Ghostly protection check List <CastLog> clsG = cast_logs.Where(x => x.getID() == 31759).ToList(); foreach (CastLog cl in clsG) { end = cl.getTime(); phases.Add(new PhaseData(start, end)); start = end + cl.getActDur(); } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; case 0x3C0F: // Invul check List <CombatItem> invulsSab = log.getBoonData().Where(x => x.getSkillID() == 757 && getInstid() == x.getDstInstid()).ToList(); for (int i = 0; i < invulsSab.Count; i++) { CombatItem c = invulsSab[i]; if (c.isBuffremove() == ParseEnum.BuffRemove.None) { end = c.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); if (i == invulsSab.Count - 1) { cast_logs.Add(new CastLog(end, -5, (int)(fight_dur - end), ParseEnum.Activation.None, (int)(fight_dur - end), ParseEnum.Activation.None)); } } else { start = c.getTime() - log.getBossData().getFirstAware(); cast_logs.Add(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None)); } } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; case 0x3EF3: // Special buff cast check CombatItem heat_wave = log.getCombatList().Find(x => x.getSkillID() == 34526); List <long> phase_starts = new List <long>(); if (heat_wave != null) { phase_starts.Add(heat_wave.getTime() - log.getBossData().getFirstAware()); CombatItem down_pour = log.getCombatList().Find(x => x.getSkillID() == 34554); if (down_pour != null) { phase_starts.Add(down_pour.getTime() - log.getBossData().getFirstAware()); CastLog abo = cast_logs.Find(x => x.getID() == 34427); if (abo != null) { phase_starts.Add(abo.getTime()); } } } foreach (long t in phase_starts) { end = t; phases.Add(new PhaseData(start, end)); // make sure stuff from the precedent phase mix witch each other start = t + 1; } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } string[] namesMat = new string[] { "Fire Phase", "Ice Phase", "Storm Phase", "Abomination Phase" }; for (int i = 1; i < phases.Count; i++) { phases[i].setName(namesMat[i - 1]); } break; case 0x3F6B: // Main phases List <CastLog> clsKC = cast_logs.Where(x => x.getID() == 35048).ToList(); foreach (CastLog cl in clsKC) { end = cl.getTime(); phases.Add(new PhaseData(start, end)); start = end + cl.getActDur(); } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); start = fight_dur; } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } // add burn phases int offset = phases.Count; List <CombatItem> orbItems = log.getBoonData().Where(x => x.getDstInstid() == agent.getInstid() && x.getSkillID() == 35096).ToList(); // Get number of orbs and filter the list List <CombatItem> orbItemsFiltered = new List <CombatItem>(); Dictionary <long, int> orbs = new Dictionary <long, int>(); foreach (CombatItem c in orbItems) { long time = c.getTime() - log.getBossData().getFirstAware(); if (!orbs.ContainsKey(time)) { orbs[time] = 0; } if (c.isBuffremove() == ParseEnum.BuffRemove.None) { orbs[time] = orbs[time] + 1; } if (orbItemsFiltered.Count > 0) { CombatItem last = orbItemsFiltered.Last(); if (last.getTime() != c.getTime()) { orbItemsFiltered.Add(c); } } else { orbItemsFiltered.Add(c); } } foreach (CombatItem c in orbItemsFiltered) { if (c.isBuffremove() == ParseEnum.BuffRemove.None) { start = c.getTime() - log.getBossData().getFirstAware(); } else { end = c.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); } } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); start = fight_dur; } for (int i = offset; i < phases.Count; i++) { phases[i].setName("Burn " + (i - offset + 1) + " (" + orbs[phases[i].getStart()] + " orbs)"); } phases.Sort((x, y) => (x.getStart() < y.getStart()) ? -1 : 1); break; case 0x3F76: // split happened if (phaseData.Count == 2) { end = phaseData[0] - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); start = phaseData[1] - log.getBossData().getFirstAware(); cast_logs.Add(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None)); } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; case 0x4324: // Determined check List <CombatItem> invulsSam = log.getBoonData().Where(x => x.getSkillID() == 762 && getInstid() == x.getDstInstid()).ToList(); // Samarog receives determined twice and its removed twice, filter it List <CombatItem> invulsSamFiltered = new List <CombatItem>(); foreach (CombatItem c in invulsSam) { if (invulsSamFiltered.Count > 0) { CombatItem last = invulsSamFiltered.Last(); if (last.getTime() != c.getTime()) { invulsSamFiltered.Add(c); } } else { invulsSamFiltered.Add(c); } } for (int i = 0; i < invulsSamFiltered.Count; i++) { CombatItem c = invulsSamFiltered[i]; if (c.isBuffremove() == ParseEnum.BuffRemove.None) { end = c.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); if (i == invulsSamFiltered.Count - 1) { cast_logs.Add(new CastLog(end, -5, (int)(fight_dur - end), ParseEnum.Activation.None, (int)(fight_dur - end), ParseEnum.Activation.None)); } } else { start = c.getTime() - log.getBossData().getFirstAware(); cast_logs.Add(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None)); } } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; case 0x4302: // Determined + additional data on inst change CombatItem invulDei = log.getBoonData().Find(x => x.getSkillID() == 762 && x.isBuffremove() == ParseEnum.BuffRemove.None && x.getDstInstid() == getInstid()); if (invulDei != null) { end = invulDei.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); start = (phaseData.Count == 1 ? phaseData[0] - log.getBossData().getFirstAware() : fight_dur); cast_logs.Add(new CastLog(end, -6, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None)); } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; case 0x4BFA: CombatItem invulDhuum = log.getBoonData().Find(x => x.getSkillID() == 762 && x.isBuffremove() != ParseEnum.BuffRemove.None && x.getSrcInstid() == getInstid()); if (invulDhuum != null) { end = invulDhuum.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); start = end + 1; CastLog shield = cast_logs.Find(x => x.getID() == 47396); if (shield != null) { end = shield.getTime(); phases.Add(new PhaseData(start, end)); start = shield.getTime() + shield.getActDur(); if (start < fight_dur - 5000) { phases.Add(new PhaseData(start, fight_dur)); } } } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } string[] namesDh = new string[] { "Roleplay", "Main Fight", "Ritual" }; for (int i = 1; i < phases.Count; i++) { phases[i].setName(namesDh[i - 1]); } break; case 0x427D: case 0x4284: case 0x4234: case 0x44E0: case 0x461D: case 0x455F: List <CombatItem> invulsBoss = log.getBoonData().Where(x => x.getSkillID() == 762 && agent.getInstid() == x.getDstInstid()).ToList(); List <CombatItem> invulsBossFiltered = new List <CombatItem>(); foreach (CombatItem c in invulsBoss) { if (invulsBossFiltered.Count > 0) { CombatItem last = invulsBossFiltered.Last(); if (last.getTime() != c.getTime()) { invulsBossFiltered.Add(c); } } else { invulsBossFiltered.Add(c); } } for (int i = 0; i < invulsBossFiltered.Count; i++) { CombatItem c = invulsBossFiltered[i]; if (c.isBuffremove() == ParseEnum.BuffRemove.None) { end = c.getTime() - log.getBossData().getFirstAware(); phases.Add(new PhaseData(start, end)); if (i == invulsBossFiltered.Count - 1) { cast_logs.Add(new CastLog(end, -5, (int)(fight_dur - end), ParseEnum.Activation.None, (int)(fight_dur - end), ParseEnum.Activation.None)); } } else { start = c.getTime() - log.getBossData().getFirstAware(); cast_logs.Add(new CastLog(end, -5, (int)(start - end), ParseEnum.Activation.None, (int)(start - end), ParseEnum.Activation.None)); } } if (fight_dur - start > 5000 && start >= phases.Last().getEnd()) { phases.Add(new PhaseData(start, fight_dur)); } for (int i = 1; i < phases.Count; i++) { phases[i].setName("Phase " + i); } break; default: break;; } }