Skip to content

Commit

Permalink
remove damage share, hp sync
Browse files Browse the repository at this point in the history
  • Loading branch information
shalzuth committed Jul 26, 2022
1 parent cd4ed40 commit 261dc41
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
29 changes: 28 additions & 1 deletion LostArkLogger/Data/DamageModifierFlags.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
namespace LostArkLogger
{
[Flags] public enum DamageModifierFlags // 0b**FBKD*C with F: front attack, B: Back attack, K: bleed crit (dots ?), D: bleed not crit (dots ?), C: crit
[Flags] public enum DamageModifierFlags // to remove
{
None = 0,
SkillCrit = 1,
Expand All @@ -13,4 +13,31 @@ namespace LostArkLogger
UnkModifier2 = 0x40,
UnkModifier3 = 0x80
}
[Flags] public enum HitFlag : int
{
HIT_FLAG_NORMAL = 0,
HIT_FLAG_CRITICAL = 1,
HIT_FLAG_MISS = 2,
HIT_FLAG_INVINCIBLE = 3,
HIT_FLAG_DOT = 4,
HIT_FLAG_IMMUNE = 5,
HIT_FLAG_IMMUNE_SILENCED = 6,
HIT_FLAG_FONT_SILENCED = 7,
HIT_FLAG_DOT_CRITICAL = 8,
HIT_FLAG_DODGE = 9,
HIT_FLAG_REFLECT = 10,
HIT_FLAG_DAMAGE_SHARE = 11,
HIT_FLAG_DODGE_HIT = 12,
HIT_FLAG_MAX = 13,
HIT_OPTION_BACK_ATTACK = 1 << (0 + 4),
HIT_OPTION_FRONTAL_ATTACK = 1 << (1 + 4),
HIT_OPTION_FLANK_ATTACK = 1 << (2 + 4),
}
public enum HitOption : int
{
HIT_OPTION_BACK_ATTACK = 0,
HIT_OPTION_FRONTAL_ATTACK = 1,
HIT_OPTION_FLANK_ATTACK = 2,
HIT_OPTION_MAX = 3,
}
}
12 changes: 7 additions & 5 deletions LostArkLogger/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public void InstallListener()

void ProcessDamageEvent(Entity sourceEntity, UInt32 skillId, UInt32 skillEffectId, SkillDamageEvent dmgEvent)
{
if (((HitFlag)dmgEvent.Modifier & (HitFlag.HIT_FLAG_DAMAGE_SHARE)) > 0)
return;
var skillName = Skill.GetSkillName(skillId, skillEffectId);
var targetEntity = currentEncounter.Entities.GetOrAdd(dmgEvent.TargetId);
var destinationName = targetEntity != null ? targetEntity.VisibleName : dmgEvent.TargetId.ToString("X");
Expand All @@ -135,11 +137,11 @@ void ProcessDamageEvent(Entity sourceEntity, UInt32 skillId, UInt32 skillEffectI
SkillName = skillName,
Damage = (ulong)dmgEvent.Damage,
Crit =
((DamageModifierFlags)dmgEvent.Modifier &
(DamageModifierFlags.DotCrit |
DamageModifierFlags.SkillCrit)) > 0,
BackAttack = ((DamageModifierFlags)dmgEvent.Modifier & (DamageModifierFlags.BackAttack)) > 0,
FrontAttack = ((DamageModifierFlags)dmgEvent.Modifier & (DamageModifierFlags.FrontAttack)) > 0
((HitFlag)dmgEvent.Modifier &
(HitFlag.HIT_FLAG_CRITICAL |
HitFlag.HIT_FLAG_DOT_CRITICAL)) > 0,
BackAttack = ((HitFlag)dmgEvent.Modifier & (HitFlag.HIT_OPTION_BACK_ATTACK)) > 0,
FrontAttack = ((HitFlag)dmgEvent.Modifier & (HitFlag.HIT_OPTION_FRONTAL_ATTACK)) > 0
};
onCombatEvent?.Invoke(log);
currentEncounter.RaidInfos.Add(log);
Expand Down

0 comments on commit 261dc41

Please sign in to comment.