forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHit.cs
More file actions
52 lines (45 loc) · 1.37 KB
/
Copy pathHit.cs
File metadata and controls
52 lines (45 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
namespace L2dotNET.Network.serverpackets
{
public class Hit
{
private const int HITFLAG_USESS = 0x10;
private const int HITFLAG_CRITICAL = 0x20;
private const int HITFLAG_SHIELD = 0x40;
private const int HITFLAG_MISS = 0x80;
public int TargetId { get; }
public int Damage { get; }
public int Flags { get; }
public bool IsMiss { get; }
public bool IsCritical { get; }
public bool IsSoulshotUsed { get; }
public int SoulshotGrade { get; }
public int Shield { get; }
public Hit(int targetId, int damage, bool isMiss, bool isCritical, int shield, bool isSoulshotUsed, int soulshotGrade)
{
TargetId = targetId;
Damage = damage;
IsMiss = isMiss;
IsCritical = isCritical;
Shield = shield;
IsSoulshotUsed = isSoulshotUsed;
SoulshotGrade = soulshotGrade;
if (isMiss)
{
Flags = HITFLAG_MISS;
return;
}
if (isSoulshotUsed)
{
Flags |= HITFLAG_USESS | soulshotGrade;
}
if (isCritical)
{
Flags |= HITFLAG_CRITICAL;
}
if (shield > 0)
{
Flags |= HITFLAG_SHIELD;
}
}
}
}