-
Notifications
You must be signed in to change notification settings - Fork 9
/
itemloader.h
187 lines (178 loc) · 4.51 KB
/
itemloader.h
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
////////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
////////////////////////////////////////////////////////////////////////
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
#ifndef __ITEMLOADER__
#define __ITEMLOADER__
#include "fileloader.h"
typedef uint8_t attribute_t;
typedef uint16_t datasize_t;
typedef uint32_t flags_t;
enum itemgroup_t
{
ITEM_GROUP_NONE = 0,
ITEM_GROUP_GROUND,
ITEM_GROUP_CONTAINER,
ITEM_GROUP_WEAPON, //deprecated
ITEM_GROUP_AMMUNITION, //deprecated
ITEM_GROUP_ARMOR, //deprecated
ITEM_GROUP_CHARGES,
ITEM_GROUP_TELEPORT, //deprecated
ITEM_GROUP_MAGICFIELD, //deprecated
ITEM_GROUP_WRITEABLE, //deprecated
ITEM_GROUP_KEY, //deprecated
ITEM_GROUP_SPLASH,
ITEM_GROUP_FLUID,
ITEM_GROUP_DOOR, //deprecated
ITEM_GROUP_DEPRECATED,
ITEM_GROUP_LAST
};
enum clientVersion_t
{
CLIENT_VERSION_750 = 1,
CLIENT_VERSION_755 = 2,
CLIENT_VERSION_760 = 3,
CLIENT_VERSION_770 = 3,
CLIENT_VERSION_780 = 4,
CLIENT_VERSION_790 = 5,
CLIENT_VERSION_792 = 6,
CLIENT_VERSION_800 = 7,
CLIENT_VERSION_810 = 8,
CLIENT_VERSION_811 = 9,
CLIENT_VERSION_820 = 10,
CLIENT_VERSION_830 = 11,
CLIENT_VERSION_840 = 12,
CLIENT_VERSION_841 = 13,
CLIENT_VERSION_842 = 14,
CLIENT_VERSION_850 = 15,
CLIENT_VERSION_854_OLD = 16,
CLIENT_VERSION_854 = 17,
CLIENT_VERSION_855 = 18,
CLIENT_VERSION_860_OLD = 19,
CLIENT_VERSION_860 = 20,
CLIENT_VERSION_861 = 21,
CLIENT_VERSION_862 = 22,
CLIENT_VERSION_870 = 23,
CLIENT_VERSION_871 = 24,
CLIENT_VERSION_872 = 25,
CLIENT_VERSION_873 = 26,
CLIENT_VERSION_900 = 27,
CLIENT_VERSION_910 = 28,
CLIENT_VERSION_920 = 29,
CLIENT_VERSION_940 = 30,
CLIENT_VERSION_944_V1 = 31,
CLIENT_VERSION_944_V2 = 32,
CLIENT_VERSION_944_V3 = 33,
CLIENT_VERSION_944_V4 = 34,
CLIENT_VERSION_946 = 35,
CLIENT_VERSION_950 = 36,
CLIENT_VERSION_952 = 37,
CLIENT_VERSION_953 = 38,
CLIENT_VERSION_954 = 39,
CLIENT_VERSION_960 = 40,
CLIENT_VERSION_961 = 41,
CLIENT_VERSION_963 = 42,
CLIENT_VERSION_970 = 43,
CLIENT_VERSION_980 = 44,
CLIENT_VERSION_981 = 45,
CLIENT_VERSION_982 = 46,
CLIENT_VERSION_983 = 47,
CLIENT_VERSION_985 = 48,
CLIENT_VERSION_986 = 49,
CLIENT_VERSION_1010 = 50
};
enum rootattrib_
{
ROOT_ATTR_VERSION = 0x01
};
enum itemattrib_t
{
ITEM_ATTR_FIRST = 0x10,
ITEM_ATTR_SERVERID = ITEM_ATTR_FIRST,
ITEM_ATTR_CLIENTID,
ITEM_ATTR_NAME,
ITEM_ATTR_DESCR,
ITEM_ATTR_SPEED,
ITEM_ATTR_SLOT,
ITEM_ATTR_MAXITEMS,
ITEM_ATTR_WEIGHT,
ITEM_ATTR_WEAPON,
ITEM_ATTR_AMU,
ITEM_ATTR_ARMOR,
ITEM_ATTR_MAGLEVEL,
ITEM_ATTR_MAGFIELDTYPE,
ITEM_ATTR_WRITEABLE,
ITEM_ATTR_ROTATETO,
ITEM_ATTR_DECAY,
ITEM_ATTR_SPRITEHASH,
ITEM_ATTR_MINIMAPCOLOR,
ITEM_ATTR_07,
ITEM_ATTR_08,
ITEM_ATTR_LIGHT,
ITEM_ATTR_DECAY2,
ITEM_ATTR_WEAPON2,
ITEM_ATTR_AMU2,
ITEM_ATTR_ARMOR2,
ITEM_ATTR_WRITEABLE2,
ITEM_ATTR_LIGHT2,
ITEM_ATTR_TOPORDER,
ITEM_ATTR_WRITEABLE3,
ITEM_ATTR_WAREID,
ITEM_ATTR_LAST
};
enum itemflags_t
{
FLAG_BLOCK_SOLID = 1 << 0,
FLAG_BLOCK_PROJECTILE = 1 << 1,
FLAG_BLOCK_PATHFIND = 1 << 2,
FLAG_HAS_HEIGHT = 1 << 3,
FLAG_USABLE = 1 << 4,
FLAG_PICKUPABLE = 1 << 5,
FLAG_MOVABLE = 1 << 6,
FLAG_STACKABLE = 1 << 7,
FLAG_FLOORCHANGEDOWN = 1 << 8,
FLAG_FLOORCHANGENORTH = 1 << 9,
FLAG_FLOORCHANGEEAST = 1 << 10,
FLAG_FLOORCHANGESOUTH = 1 << 11,
FLAG_FLOORCHANGEWEST = 1 << 12,
FLAG_ALWAYSONTOP = 1 << 13,
FLAG_READABLE = 1 << 14,
FLAG_ROTABLE = 1 << 15,
FLAG_HANGABLE = 1 << 16,
FLAG_VERTICAL = 1 << 17,
FLAG_HORIZONTAL = 1 << 18,
FLAG_CANNOTDECAY = 1 << 19,
FLAG_ALLOWDISTREAD = 1 << 20,
FLAG_UNUSED = 1 << 21,
FLAG_CLIENTCHARGES = 1 << 22, //deprecated
FLAG_LOOKTHROUGH = 1 << 23,
FLAG_ANIMATION = 1 << 24,
FLAG_WALKSTACK = 1 << 25
};
#pragma pack(1)
struct VERSIONINFO
{
uint32_t dwMajorVersion;
uint32_t dwMinorVersion;
uint32_t dwBuildNumber;
uint8_t CSDVersion[128];
};
struct lightBlock2
{
uint16_t lightLevel;
uint16_t lightColor;
};
#pragma pack()
#endif