forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFuncPDefMod.cs
More file actions
34 lines (30 loc) · 1.23 KB
/
Copy pathFuncPDefMod.cs
File metadata and controls
34 lines (30 loc) · 1.23 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
using L2dotNET.DataContracts.Shared.Enums;
using L2dotNET.Models.Player;
using static L2dotNET.Models.Inventory.Inventory;
namespace L2dotNET.Models.Stats.Funcs
{
public class FuncPDefMod : StatFunction
{
public static FuncPDefMod Instance = new FuncPDefMod();
private FuncPDefMod() : base(CharacterStatId.PowerDefence, 0x20)
{
}
public override void Calculate(StatFunctionEnvironment statFuncEnv)
{
if (statFuncEnv.Character is L2Player player)
{
if(player.Inventory.GetPaperdollItem(PaperdollHead) != null)
statFuncEnv.SubValue(12);
if (player.Inventory.GetPaperdollItem(PaperdollChest) != null)
statFuncEnv.SubValue(31);
if (player.Inventory.GetPaperdollItem(PaperdollLegs) != null)
statFuncEnv.SubValue(18);
if (player.Inventory.GetPaperdollItem(PaperdollGloves) != null)
statFuncEnv.SubValue(8);
if (player.Inventory.GetPaperdollItem(PaperdollFeet) != null)
statFuncEnv.SubValue(7);
}
statFuncEnv.MulValue(statFuncEnv.Character.GetLevelMod());
}
}
}