forked from jo3bingham/TibiaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreatureOutfit.cs
More file actions
42 lines (37 loc) · 1.22 KB
/
CreatureOutfit.cs
File metadata and controls
42 lines (37 loc) · 1.22 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
using OXGaming.TibiaAPI.Appearances;
using OXGaming.TibiaAPI.Constants;
namespace OXGaming.TibiaAPI.Network.ServerPackets
{
public class CreatureOutfit : ServerPacket
{
public AppearanceInstance Mount { get; set; }
public AppearanceInstance Outfit { get; set; }
public uint CreatureId { get; set; }
public CreatureOutfit(Client client)
{
Client = client;
PacketType = ServerPacketType.CreatureOutfit;
}
public override void ParseFromNetworkMessage(NetworkMessage message)
{
CreatureId = message.ReadUInt32();
Outfit = message.ReadCreatureOutfit();
Mount = message.ReadMountOutfit();
}
public override void AppendToNetworkMessage(NetworkMessage message)
{
message.Write((byte)ServerPacketType.CreatureOutfit);
message.Write(CreatureId);
if (Outfit is OutfitInstance)
{
message.Write((OutfitInstance)Outfit);
}
else
{
message.Write((ushort)0);
message.Write((ushort)Outfit.Id);
}
message.Write((ushort)Mount.Id);
}
}
}