forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFuncMDefMod.cs
More file actions
36 lines (31 loc) · 1.33 KB
/
Copy pathFuncMDefMod.cs
File metadata and controls
36 lines (31 loc) · 1.33 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
using L2dotNET.DataContracts.Shared.Enums;
using L2dotNET.Models.Player;
using L2dotNET.Models.Player.Basic;
using static L2dotNET.Models.Inventory.Inventory;
namespace L2dotNET.Models.Stats.Funcs
{
public class FuncMDefMod : StatFunction
{
public static FuncMDefMod Instance = new FuncMDefMod();
private FuncMDefMod() : base(CharacterStatId.MagicDefence, 0x20)
{
}
public override void Calculate(StatFunctionEnvironment statFuncEnv)
{
if (statFuncEnv.Character is L2Player player)
{
if (player.Inventory.GetPaperdollItem(PaperdollLfinger) != null)
statFuncEnv.SubValue(5);
if (player.Inventory.GetPaperdollItem(PaperdollRfinger) != null)
statFuncEnv.SubValue(5);
if (player.Inventory.GetPaperdollItem(PaperdollLear) != null)
statFuncEnv.SubValue(9);
if (player.Inventory.GetPaperdollItem(PaperdollRear) != null)
statFuncEnv.SubValue(9);
if (player.Inventory.GetPaperdollItem(PaperdollNeck) != null)
statFuncEnv.SubValue(13);
}
statFuncEnv.MulValue(Formulas.MenBonus[statFuncEnv.Character.CharacterStat.Men] * statFuncEnv.Character.GetLevelMod());
}
}
}