// Constructor public CombatItem(long time, ulong srcAgent, ulong dstAgent, int value, int buffDmg, uint overstackValue, long skillId, ushort srcInstid, ushort dstInstid, ushort srcMasterInstid, ushort dstMasterInstid, ParseEnum.IFF iff, byte isBuff, ParseEnum.Result result, ParseEnum.Activation isActivation, ParseEnum.BuffRemove isBuffRemove, byte isNinety, byte isFifty, byte isMoving, ParseEnum.StateChange isStateChange, byte isFlanking, byte isShields, byte isOffcycle) { Time = time; SrcAgent = srcAgent; DstAgent = dstAgent; Value = value; BuffDmg = buffDmg; OverstackValue = overstackValue; SkillID = skillId; SrcInstid = srcInstid; DstInstid = dstInstid; SrcMasterInstid = srcMasterInstid; DstMasterInstid = dstMasterInstid; IFF = iff; IsBuff = isBuff; Result = result; IsActivation = isActivation; IsBuffRemove = isBuffRemove; IsNinety = isNinety; IsFifty = isFifty; IsMoving = isMoving; IsStateChange = isStateChange; IsFlanking = isFlanking; IsShields = isShields; IsOffcycle = isOffcycle; }
public CombatItem(long time, ulong src_agent, ulong dst_agent, int value, int buff_dmg, ushort overstack_value, int skill_id, ushort src_instid, ushort dst_instid, ushort src_master_instid, ParseEnum.IFF iff, ushort buff, ParseEnum.Result result, ParseEnum.Activation is_activation, ParseEnum.BuffRemove is_buffremove, ushort is_ninety, ushort is_fifty, ushort is_moving, ParseEnum.StateChange is_statechange, ushort is_flanking, ushort is_shields) { this.time = time; this.src_agent = src_agent; this.dst_agent = dst_agent; this.value = value; this.buff_dmg = buff_dmg; this.overstack_value = overstack_value; this.skill_id = skill_id; this.src_instid = src_instid; this.dst_instid = dst_instid; this.src_master_instid = src_master_instid; this.iff = iff; this.is_buff = buff; this.result = result; this.is_activation = is_activation; this.is_buffremove = is_buffremove; this.is_ninety = is_ninety; this.is_fifty = is_fifty; this.is_moving = is_moving; this.is_statechange = is_statechange; this.is_flanking = is_flanking; this.is_shields = is_shields; }
// Constructor public DamageLog(long time, CombatItem c) { this.time = time; this.skill_id = c.getSkillID(); this.buff = c.isBuff(); this.result = c.getResult(); this.is_ninety = c.isNinety(); this.is_moving = c.isMoving(); this.is_flanking = c.isMoving(); this.is_activation = c.isActivation(); this.src_agent = c.getSrcAgent(); this.src_instid = c.getSrcInstid(); this.is_shields = c.isShields(); }
public static bool IsHit(this ParseEnum.Result result) { return(result == ParseEnum.Result.Normal || result == ParseEnum.Result.Crit || result == ParseEnum.Result.Glance || result == ParseEnum.Result.KillingBlow); //Downed and Interrupt omitted for now due to double procing mechanics || result == ParseEnum.Result.Downed || result == ParseEnum.Result.Interrupt; }
public override bool Keep(CombatItem item, ParsedLog log) { ParseEnum.Result val = item.ResultEnum; return(val == _value); }
public CombatItemResultChecker(ParseEnum.Result value) { _value = value; }
private static CombatItem ReadCombatItemRev1(BinaryReader reader) { // 8 bytes: time long time = reader.ReadInt64(); // 8 bytes: src_agent ulong srcAgent = reader.ReadUInt64(); // 8 bytes: dst_agent ulong dstAgent = reader.ReadUInt64(); // 4 bytes: value int value = reader.ReadInt32(); // 4 bytes: buff_dmg int buffDmg = reader.ReadInt32(); // 4 bytes: overstack_value uint overstackValue = reader.ReadUInt32(); // 4 bytes: skill_id uint skillId = reader.ReadUInt32(); // 2 bytes: src_instid ushort srcInstid = reader.ReadUInt16(); // 2 bytes: dst_instid ushort dstInstid = reader.ReadUInt16(); // 2 bytes: src_master_instid ushort srcMasterInstid = reader.ReadUInt16(); // 2 bytes: dst_master_instid ushort dstmasterInstid = reader.ReadUInt16(); // 1 byte: iff ParseEnum.IFF iff = ParseEnum.GetIFF(reader.ReadByte()); // 1 byte: buff byte buff = reader.ReadByte(); // 1 byte: result ParseEnum.Result result = ParseEnum.GetResult(reader.ReadByte()); // 1 byte: is_activation ParseEnum.Activation isActivation = ParseEnum.GetActivation(reader.ReadByte()); // 1 byte: is_buffremove ParseEnum.BuffRemove isBuffRemove = ParseEnum.GetBuffRemove(reader.ReadByte()); // 1 byte: is_ninety byte isNinety = reader.ReadByte(); // 1 byte: is_fifty byte isFifty = reader.ReadByte(); // 1 byte: is_moving byte isMoving = reader.ReadByte(); // 1 byte: is_statechange ParseEnum.StateChange isStateChange = ParseEnum.GetStateChange(reader.ReadByte()); // 1 byte: is_flanking byte isFlanking = reader.ReadByte(); // 1 byte: is_flanking byte isShields = reader.ReadByte(); // 1 byte: is_flanking byte isOffcycle = reader.ReadByte(); // 5 bytes: offcycle (?) + garbage ParseHelper.SafeSkip(reader.BaseStream, 4); //save // Add combat return(new CombatItem(time, srcAgent, dstAgent, value, buffDmg, overstackValue, skillId, srcInstid, dstInstid, srcMasterInstid, dstmasterInstid, iff, buff, result, isActivation, isBuffRemove, isNinety, isFifty, isMoving, isStateChange, isFlanking, isShields, isOffcycle)); }
public static bool IsHit(this ParseEnum.Result result) { return(result == ParseEnum.Result.Normal || result == ParseEnum.Result.Crit || result == ParseEnum.Result.Glance); }
public static void WriteDamageDistTableSkill(StreamWriter sw, SkillItem skill, SkillData skillData, List <DamageLog> damageLogs, int finalTotalDamage, int casts = -1, double timeswasted = -1, double timessaved = 1) { int totaldamage = 0; int mindamage = 0; int avgdamage; int hits = 0; int maxdamage = 0; int crit = 0; int flank = 0; int glance = 0; foreach (DamageLog dl in damageLogs) { int curdmg = dl.Damage; totaldamage += curdmg; if (0 == mindamage || curdmg < mindamage) { mindamage = curdmg; } if (0 == maxdamage || curdmg > maxdamage) { maxdamage = curdmg; } hits++; ParseEnum.Result result = dl.Result; if (result == ParseEnum.Result.Crit) { crit++; } else if (result == ParseEnum.Result.Glance) { glance++; } if (dl.IsFlanking == 1) { flank++; } } avgdamage = (int)(totaldamage / (double)hits); string wasted = timeswasted > 0.0 ? Math.Round(timeswasted, 2) + "s" : ""; string saved = timessaved < 0.0 ? Math.Round(timessaved, 2) + "s" : ""; double hpcast = -1; if (casts > 0) { hpcast = Math.Round(hits / (double)casts, 2); } string skillName = (skill.ID.ToString() == skill.Name) ? skillData.GetName(skill.ID) : skill.Name; if (totaldamage != 0 && skill.ApiSkill != null) { sw.Write("<tr>"); { sw.Write("<td align=\"left\"><img src=\"" + skill.ApiSkill.icon + "\" alt=\"" + skill.Name + "\" title=\"" + skill.ID + "\" height=\"18\" width=\"18\">" + skillName + "</td>"); sw.Write("<td>" + Math.Round(100 * (double)totaldamage / finalTotalDamage, 2) + "%</td>"); sw.Write("<td>" + totaldamage + "</td>"); sw.Write("<td>" + mindamage + "</td>"); sw.Write("<td>" + avgdamage + "</td>"); sw.Write("<td>" + maxdamage + "</td>"); sw.Write("<td>" + (casts != -1 ? casts.ToString() : "") + "</td>"); sw.Write("<td>" + hits + "</td>"); sw.Write("<td>" + (hpcast > 0 ? hpcast.ToString() : "") + "</td>"); sw.Write("<td data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"" + crit + " out of " + hits + " hits\">" + Math.Round(100 * (double)crit / hits, 2) + "%</td>"); sw.Write("<td data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"" + flank + " out of " + hits + " hits\">" + Math.Round(100 * (double)flank / hits, 2) + "%</td>"); sw.Write("<td data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"" + glance + " out of " + hits + " hits\">" + Math.Round(100 * (double)glance / hits, 2) + "%></td>"); sw.Write("<td>" + wasted + "</td>"); sw.Write("<td>" + saved + "</td>"); } sw.Write("</tr>"); } else if (totaldamage != 0) { sw.Write("<tr>"); { sw.Write("<td align=\"left\">" + skillName + "</td>"); sw.Write("<td>" + Math.Round(100 * (double)totaldamage / finalTotalDamage, 2) + "%</td>"); sw.Write("<td>" + totaldamage + "</td>"); sw.Write("<td>" + mindamage + "</td>"); sw.Write("<td>" + avgdamage + "</td>"); sw.Write("<td>" + maxdamage + "</td>"); sw.Write("<td>" + (casts != -1 ? casts.ToString() : "") + "</td>"); sw.Write("<td>" + hits + "</td>"); sw.Write("<td>" + (hpcast > 0 ? hpcast.ToString() : "") + "</td>"); sw.Write("<td data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"" + crit + " out of " + hits + " hits\">" + Math.Round(100 * (double)crit / hits, 2) + "%</td>"); sw.Write("<td data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"" + flank + " out of " + hits + " hits\">" + Math.Round(100 * (double)flank / hits, 2) + "%</td>"); sw.Write("<td data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"" + glance + " out of " + hits + " hits\">" + Math.Round(100 * (double)glance / hits, 2) + "%</td>"); sw.Write("<td>" + wasted + "</td>"); sw.Write("<td>" + saved + "</td>"); } sw.Write("</tr>"); } else if (skill.ApiSkill != null) { sw.Write("<tr>"); { sw.Write("<td align=\"left\"><img src=\"" + skill.ApiSkill.icon + "\" alt=\"" + skill.Name + "\" title=\"" + skill.ID + "\" height=\"18\" width=\"18\">" + skillName + "</td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td>" + (casts != -1 ? casts.ToString() : "") + "</td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td>" + wasted + "</td>"); sw.Write("<td>" + saved + "</td>"); } sw.Write("</tr>"); } else { sw.Write("<tr>"); { sw.Write("<td align=\"left\">" + skillName + "</td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td>" + (casts != -1 ? casts.ToString() : "") + "</td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td></td>"); sw.Write("<td>" + wasted + "</td>"); sw.Write("<td>" + saved + "</td>"); } sw.Write("</tr>"); } }
private static CombatItem ReadCombatItem(BinaryReader reader) { // 8 bytes: time long time = reader.ReadInt64(); // 8 bytes: src_agent ulong src_agent = reader.ReadUInt64(); // 8 bytes: dst_agent ulong dst_agent = reader.ReadUInt64(); // 4 bytes: value int value = reader.ReadInt32(); // 4 bytes: buff_dmg int buff_dmg = reader.ReadInt32(); // 2 bytes: overstack_value ushort overstack_value = reader.ReadUInt16(); // 2 bytes: skill_id ushort skill_id = reader.ReadUInt16(); // 2 bytes: src_instid ushort src_instid = reader.ReadUInt16(); // 2 bytes: dst_instid ushort dst_instid = reader.ReadUInt16(); // 2 bytes: src_master_instid ushort src_master_instid = reader.ReadUInt16(); // 9 bytes: garbage ParseHelper.safeSkip(reader.BaseStream, 9); // 1 byte: iff ParseEnum.IFF iff = ParseEnum.getIFF(reader.ReadByte()); // 1 byte: buff ushort buff = (ushort)reader.ReadByte(); // 1 byte: result ParseEnum.Result result = ParseEnum.getResult(reader.ReadByte()); // 1 byte: is_activation ParseEnum.Activation is_activation = ParseEnum.getActivation(reader.ReadByte()); // 1 byte: is_buffremove ParseEnum.BuffRemove is_buffremoved = ParseEnum.getBuffRemove(reader.ReadByte()); // 1 byte: is_ninety ushort is_ninety = (ushort)reader.ReadByte(); // 1 byte: is_fifty ushort is_fifty = (ushort)reader.ReadByte(); // 1 byte: is_moving ushort is_moving = (ushort)reader.ReadByte(); // 1 byte: is_statechange ParseEnum.StateChange is_statechange = ParseEnum.getStateChange(reader.ReadByte()); // 1 byte: is_flanking ushort is_flanking = (ushort)reader.ReadByte(); // 1 byte: is_flanking ushort is_shields = (ushort)reader.ReadByte(); // 2 bytes: garbage ParseHelper.safeSkip(reader.BaseStream, 2); //save // Add combat return(new CombatItem(time, src_agent, dst_agent, value, buff_dmg, overstack_value, skill_id, src_instid, dst_instid, src_master_instid, iff, buff, result, is_activation, is_buffremoved, is_ninety, is_fifty, is_moving, is_statechange, is_flanking, is_shields)); }