forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharInfo.cs
More file actions
150 lines (120 loc) · 5.56 KB
/
Copy pathCharInfo.cs
File metadata and controls
150 lines (120 loc) · 5.56 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
using L2dotNET.Models.Inventory;
using L2dotNET.Models.Player;
namespace L2dotNET.Network.serverpackets
{
class CharInfo : GameserverPacket
{
private readonly L2Player _player;
public CharInfo(L2Player player)
{
_player = player;
}
//TODO: Simplify method body
public override void Write()
{
WriteByte(0x03);
WriteInt(_player.X);
WriteInt(_player.Y);
WriteInt(_player.Z);
WriteInt(_player.Heading);
WriteInt(_player.ObjId);
WriteString(_player.Name);
WriteInt((int)_player.BaseClass.ClassId.ClassRace);
WriteInt((int)_player.Sex);
WriteInt((int)_player.ActiveClass.ClassId.Id);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollHair]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollHead]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollRhand]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollLhand]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollGloves]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollChest]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollLegs]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollFeet]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollBack]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollRhand]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollHairall]?.Template.ItemId ?? 0);
WriteInt(_player.Inventory.Paperdoll[Inventory.PaperdollFace]?.Template.ItemId ?? 0);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteInt(0x00); //player.Inventory.getPaperdollAugmentId(InvPC.EQUIPITEM_RHand));
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteInt(0x00); //player.Inventory.getPaperdollAugmentId(InvPC.EQUIPITEM_LHand));
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteShort(0x00);
WriteInt(_player.PvPStatus);
WriteInt(_player.Karma);
WriteInt(_player.CharacterStat.PAttackSpeed); //atckspeed
WriteInt(_player.CharacterStat.MAttackSpeed); //mattackspeed
WriteInt(_player.PvPStatus);
WriteInt(_player.Karma);
WriteInt(_player.CharacterStat.BaseRunSpeed);
WriteInt(_player.CharacterStat.BaseWalkSpeed);
WriteInt(50); // swimspeed
WriteInt(50); // swimspeed
WriteInt(_player.CharacterStat.BaseRunSpeed);
WriteInt(_player.CharacterStat.BaseWalkSpeed);
WriteInt(_player.CharacterStat.BaseRunSpeed);
WriteInt(_player.CharacterStat.BaseWalkSpeed);
WriteDouble(1);
WriteDouble(1);
WriteDouble(_player.Radius);
WriteDouble(_player.Height);
WriteInt((int)_player.HairStyleId);
WriteInt((int)_player.HairColor);
WriteInt((int)_player.Face);
WriteString(_player.Title);
WriteInt(0);//_player.ClanId
WriteInt(0);//_player.ClanCrestId
WriteInt(0);//_player.AllianceId
WriteInt(0);//_player.AllianceCrestId
WriteInt(0);
WriteByte(_player.IsSitting() ? 0 : 1); // standing = 1 sitting = 0
WriteByte(_player.IsRunning);
WriteByte(_player.isInCombat() ? 1 : 0);
WriteByte(_player.IsAlikeDead() ? 1 : 0); //if (_activeChar.isInOlympiadMode()) 0 TODO
WriteByte(_player.Visible ? 0 : 1);
WriteByte(_player.MountType);
WriteByte(_player.GetPrivateStoreType());
WriteShort(0);//_player.Cubics.Count
//_player.Cubics.ForEach(cub => WriteShort(cub.Template.Id));
WriteByte(0x00); //1-_activeChar.isInPartyMatchRoom()
WriteInt(_player.AbnormalBitMask);
WriteByte(0); //_activeChar.isFlyingMounted() ? 2 : 0);
WriteShort(_player.RecHave);
WriteInt((int)_player.ActiveClass.ClassId.Id);
WriteInt(_player.MaxCp); //max cp here
WriteInt((int)_player.CurCp);
WriteByte(_player.GetEnchantValue());
WriteByte(_player.TeamId);
WriteInt(0);//_player.GetClanCrestLargeId()
WriteByte(_player.Noblesse);
byte hero = _player.Heroic;
WriteByte(hero);
WriteByte(_player.IsFishing() ? 0x01 : 0x00); //Fishing Mode
WriteInt(_player.GetFishx()); //fishing x
WriteInt(_player.GetFishy()); //fishing y
WriteInt(_player.GetFishz()); //fishing z
WriteInt(_player.GetNameColor());
WriteInt(0x00);
WriteInt(0);//_player.ClanRank()
WriteInt(_player.ClanType);
WriteInt(_player.GetTitleColor());
WriteInt(0x00); //titlecolor
}
}
}