forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPcTemplate.cs
More file actions
69 lines (51 loc) · 1.98 KB
/
Copy pathPcTemplate.cs
File metadata and controls
69 lines (51 loc) · 1.98 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System.Collections.Generic;
using System.Linq;
using L2dotNET.Enums;
using L2dotNET.Models.Items;
namespace L2dotNET.Templates
{
public class PcTemplate : CharTemplate
{
public ClassId ClassId { get; }
public int FallingHeight { get; }
public int BaseSwimSpeed { get; }
public double CollisionRadiusFemale { get; }
public double CollisionHeightFemale { get; }
public int SpawnX { get; }
public int SpawnY { get; }
public int SpawnZ { get; }
public int BaseLevel { get; }
public List<int> DefaultInventory { get; }
private double[] HpTable { get; }
private double[] MpTable { get; }
private double[] CpTable { get; }
public PcTemplate(ClassId classId, StatsSet set) : base(set)
{
DefaultInventory = set.GetString("items")?.Split(';').Select(int.Parse).ToList() ?? new List<int>();
ClassId = classId;
BaseSwimSpeed = set.GetInt("swimSpd", 1);
FallingHeight = set.GetInt("falling_height", 333);
CollisionRadiusFemale = set.GetDouble("radiusFemale");
CollisionHeightFemale = set.GetDouble("heightFemale");
SpawnX = set.GetInt("spawnX");
SpawnY = set.GetInt("spawnY");
SpawnZ = set.GetInt("spawnZ");
BaseLevel = set.GetInt("baseLvl");
HpTable = set.GetString("hpTable").Split(';').Select(double.Parse).ToArray();
MpTable = set.GetString("mpTable").Split(';').Select(double.Parse).ToArray();
CpTable = set.GetString("cpTable").Split(';').Select(double.Parse).ToArray();
}
public override double GetBaseMaxHp(int level)
{
return HpTable[level - 1];
}
public override double GetBaseMaxMp(int level)
{
return MpTable[level - 1];
}
public double GetBaseMaxCp(int level)
{
return CpTable[level - 1];
}
}
}