forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeapon.cs
More file actions
54 lines (49 loc) · 1.91 KB
/
Copy pathWeapon.cs
File metadata and controls
54 lines (49 loc) · 1.91 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
53
54
using System.Linq;
using L2dotNET.Enums;
using L2dotNET.Templates;
using L2dotNET.Utility;
namespace L2dotNET.Models.Items
{
public class Weapon : ItemTemplate
{
public WeaponTypeId Type { get; set; }
public int SoulshotCount { get; set; }
public int SpiritshotCount { get; set; }
public int PDam { get; set; }
public int RndDam { get; set; }
public int Critical { get; set; }
public double HitModifier { get; set; }
public int AvoidModifier { get; set; }
public int ShieldDef { get; set; }
public double ShieldDefRate { get; set; }
public int AtkSpeed { get; set; }
public int AtkReuse { get; set; }
public int MpConsume { get; set; }
public int MDam { get; set; }
public Weapon(StatsSet set) : base(set)
{
Type = Utilz.GetEnumFromString(set.GetString("weaponType", "none"), WeaponTypeId.None);
SoulshotCount = set.GetInt("soulshots");
SpiritshotCount = set.GetInt("spiritshots");
PDam = set.GetInt("p_dam");
RndDam = set.GetInt("rnd_dam");
Critical = set.GetInt("critical");
HitModifier = set.GetDouble("hit_modify");
AvoidModifier = set.GetInt("avoid_modify");
ShieldDef = set.GetInt("shield_def");
ShieldDefRate = set.GetDouble("shield_def_rate");
AtkSpeed = set.GetInt("atk_speed");
AtkReuse = set.GetInt("atk_reuse", Type == WeaponTypeId.Bow ? 1500 : 0);
MpConsume = set.GetInt("mp_consume");
MDam = set.GetInt("m_dam");
}
public override int GetItemMask()
{
WeaponType orDefault = WeaponType.Values.FirstOrDefault(x => x.Id == Type);
if (orDefault == null)
return 0;
int firstOrDefault = orDefault.GetMask();
return firstOrDefault;
}
}
}