forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArmor.cs
More file actions
52 lines (47 loc) · 1.69 KB
/
Copy pathArmor.cs
File metadata and controls
52 lines (47 loc) · 1.69 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
using System.Linq;
using L2dotNET.DataContracts.Shared.Enums;
using L2dotNET.Enums;
using L2dotNET.Templates;
using L2dotNET.Utility;
namespace L2dotNET.Models.Items
{
public class Armor : ItemTemplate
{
public ArmorTypeId ArmorType { get; set; }
public bool AvoidModify { get; set; }
public int Pdef { get; set; }
public int Mdef { get; set; }
public int MpBonus { get; set; }
public int ItemSkillId { get; set; }
public byte ItemSkillLvl { get; set; }
public Armor()
{
//TODO: check this
if (BodyPart == BodyPartType.SlotNeck
|| BodyPart == BodyPartType.SlotFace
|| BodyPart == BodyPartType.SlotHair
|| BodyPart == BodyPartType.SlotHairall
|| (BodyPart & BodyPartType.SlotREar) != 0
|| (BodyPart & BodyPartType.SlotLFinger) != 0
|| (BodyPart & BodyPartType.SlotBack) != 0)
{
Type1 = (int) ItemType1.WeaponRingEarringNecklace;
Type2 = (int) ItemType2.Accessory;
}
else
{
if (ArmorType == Enums.ArmorType.None.Id && BodyPart == BodyPartType.SlotLHand) // retail define shield as NONE
{
ArmorType = Enums.ArmorType.Shield.Id;
}
Type1 = (int) ItemType1.ShieldArmor;
Type2 = (int) ItemType2.ShieldArmor;
}
}
public override int GetItemMask()
{
ArmorType orDefault = Enums.ArmorType.Values.FirstOrDefault(x => x.Id == ArmorType);
return orDefault?.GetMask() ?? 0;
}
}
}