#define ROOM_MODE_SET_TEXTURES 240

// Teams...
#define TEAM_NEUTRAL   0 // Default team
#define TEAM_MONSTER   1 // Monsters
#define TEAM_GOOD      2 // Players and their helpers
#define TEAM_EVIL      3 // PK'ers and their helpers

// General defines...
#define MAX_CHARACTER 128
#define MAX_PARTICLE 4096
#define MAX_MAP_ROOM 4000
#define MAX_FOOD     36000
#define MAX_MONEY    1000
#define MAX_KEYS     25
#define RED_HEART    0
#define HEALER_HEART 1


// Game areas...
#define AREA_SUMMON  0
#define AREA_CELLAR  1
#define AREA_SEWERS  2
#define AREA_CAVES   3
#define AREA_UPPER   4
#define AREA_LOWER   5
#define AREA_MINES   6
#define AREA_ABYSS_1 7
#define AREA_ABYSS_2 8
#define AREA_ABYSS_3 9
#define AREA_ABYSS_4 10


// For ButtonPress()...
#define BUTTON_LEFT     0
#define BUTTON_RIGHT    1
#define BUTTON_SPECIAL1 2
#define BUTTON_SPECIAL2 3
#define BUTTON_PRESS          0
#define BUTTON_UNPRESS        1
#define BUTTON_PRESS_AND_HOLD 2
#define BUTTON_HANDLED        3
#define AXIS_UP     8
#define AXIS_DOWN   4
#define AXIS_LEFT   2
#define AXIS_RIGHT  1

// For water...
#define WATER_TYPE_WATER 0
#define WATER_TYPE_LAVA  1
#define WATER_TYPE_SAND  2

// For AcquireTarget()
#define ACQUIRE_SEE_NEUTRAL   1
#define ACQUIRE_SEE_FRIENDLY  2
#define ACQUIRE_SEE_ENEMY     4
#define ACQUIRE_SEE_INVISIBLE 8
#define ACQUIRE_SEE_BEHIND    16
#define ACQUIRE_OPEN_MOUNT_ONLY 32
#define ACQUIRE_STANDING_ONLY 64
#define ACQUIRE_IGNORE_COLLISION 128


// Delay for hitting a sign or somethin...
#define WALL_COLLISION_DELAY 60

// Fade types...
#define FADE_TYPE_NONE      0
#define FADE_TYPE_CIRCLE    1
#define FADE_TYPE_WARNING   2
#define FADE_TYPE_FULL      3
#define FADE_TYPE_CAMERA    255


// Player classes...
#define CLASS_NONE           255
#define CLASS_SOLDIER        0
#define CLASS_WIZARD         1
#define CLASS_HEALER         2
#define CLASS_GNOME          3
#define CLASS_ELF            4
#define CLASS_MYSTIC         5
#define CLASS_DWARF          6
#define CLASS_HUBBIN         7



// Standard weapon attack types...
#define WEAPON_ATTACK_BASH        1
#define WEAPON_ATTACK_THRUST      2
#define WEAPON_ATTACK_SLASH       4


// Standard weapon reload times
#define WEAPON_RELOAD_SHORT       50
#define WEAPON_RELOAD_MEDIUM      65
#define WEAPON_RELOAD_LONG        80


// Standard weapon ranges
#define WEAPON_RANGE_EXTRA_SHORT  80
#define WEAPON_RANGE_SHORT        87
#define WEAPON_RANGE_MEDIUM       95
#define WEAPON_RANGE_LONG         102
#define WEAPON_RANGE_EXTRA_LONG   115


// Standard weapon radii
#define WEAPON_RADIUS_SMALL       1.5
#define WEAPON_RADIUS_MEDIUM      2.25
#define WEAPON_RADIUS_LARGE       2.75


// Control input stuff...
#define PLAYER_DEVICE_NONE 0
#define PLAYER_DEVICE_KEYBOARD 1
#define PLAYER_DEVICE_JOYSTICK_1 2
#define PLAYER_DEVICE_JOYSTICK_2 3
#define PLAYER_DEVICE_JOYSTICK_3 4
#define PLAYER_DEVICE_JOYSTICK_4 5
#define PLAYER_DEVICE_TYPE -1
#define PLAYER_DEVICE_BUTTON_LEFT 0
#define PLAYER_DEVICE_BUTTON_RIGHT 1
#define PLAYER_DEVICE_BUTTON_SPECIAL1 2
#define PLAYER_DEVICE_BUTTON_SPECIAL2 3
#define PLAYER_DEVICE_BUTTON_ITEMS 4
#define PLAYER_DEVICE_BUTTON_MOVE_UP 5
#define PLAYER_DEVICE_BUTTON_MOVE_DOWN 6
#define PLAYER_DEVICE_BUTTON_MOVE_LEFT 7
#define PLAYER_DEVICE_BUTTON_MOVE_RIGHT 8
#define PLAYER_DEVICE_BUTTON_ITEMS_DOWN 9

// Event callback codes...
#define EVENT_HIT_WALL         1
#define EVENT_HIT_WATER        2
#define EVENT_HIT_CHARACTER    3
#define EVENT_HIT_FLOOR        4
#define EVENT_TIMER            5
#define EVENT_FELL_IN_PIT      6
#define EVENT_DAMAGED          7
#define EVENT_LEVEL_UP         8
#define EVENT_SECONDARY_TIMER  9
#define EVENT_THIRDIARY_TIMER  10
#define EVENT_MOUNTED          11
#define EVENT_DISMOUNTED       12
#define EVENT_BLOCKED          13
#define EVENT_DEFLECTED        14
#define EVENT_PETRIFIED        15
#define EVENT_UNPETRIFIED      16
#define EVENT_JUMPED_ON        17
#define EVENT_DROWN            18
#define EVENT_RIPPLE           19
#define EVENT_SPAWNED_IN_WATER 20
#define EVENT_HIT_WAYPOINT     21
#define EVENT_HUNGER_DAMAGED   22
#define EVENT_NETWORK_UPDATE   23


// Damage types...
#define DAMAGE_EDGE      0
#define DAMAGE_BASH      1
#define DAMAGE_ACID      2
#define DAMAGE_FIRE      3
#define DAMAGE_ICE       4
#define DAMAGE_VOLT      5
#define DAMAGE_WOUND     6


// Experience types...
#define EXPERIENCE_GIVE                0
#define EXPERIENCE_GET_NEEDED          1
#define EXPERIENCE_VIRTUE_COMPASSION   2
#define EXPERIENCE_VIRTUE_DILLIGENCE   3
#define EXPERIENCE_VIRTUE_HONOR        4
#define EXPERIENCE_VIRTUE_FAITH        5
#define EXPERIENCE_VIRTUE_COURAGE      6


// Action names...
#define ACTION_BONING            0
#define ACTION_STAND             1
#define ACTION_WALK              2
#define ACTION_STUN_BEGIN        3
#define ACTION_STUN              4
#define ACTION_STUN_END          5
#define ACTION_KNOCK_OUT_BEGIN   6
#define ACTION_KNOCK_OUT         7
#define ACTION_KNOCK_OUT_STUN    8
#define ACTION_KNOCK_OUT_END     9
#define ACTION_BASH_LEFT         10
#define ACTION_BASH_RIGHT        11
#define ACTION_THRUST_LEFT       12
#define ACTION_THRUST_RIGHT      13
#define ACTION_SLASH_LEFT        14
#define ACTION_SLASH_RIGHT       15
#define ACTION_ATTACK_FAIL       16
#define ACTION_BLOCK_BEGIN       17
#define ACTION_BLOCK             18
#define ACTION_BLOCK_END         19
#define ACTION_JUMP_BEGIN        20
#define ACTION_JUMP              21
#define ACTION_JUMP_END          22
#define ACTION_RIDE              23
#define ACTION_SWIM              24
#define ACTION_SWIM_FORWARD      25
#define ACTION_MAGIC             26
#define ACTION_BOW_LEFT          27
#define ACTION_BOW_LEFT_ARC      28
#define ACTION_GONNE_RIGHT       29
#define ACTION_GONNE_NO_AMMO     30
#define ACTION_EXTRA             31
#define ACTION_SPECIAL_0         32 // Blow kiss
#define ACTION_SPECIAL_1         33 // Pray
#define ACTION_SPECIAL_2         34 // Throw (Gronnade)
#define ACTION_SPECIAL_3         35 // Monster's "I don't know what I'm doing" animation (Look left and right)
#define ACTION_SPECIAL_4         36 // Exclaim (also used as animation for Talk action...  No frames is okay...)
#define ACTION_SPECIAL_5         37
#define ACTION_SPECIAL_6         38
#define ACTION_SPECIAL_7         39
#define ACTION_SPECIAL_8         40
#define ACTION_SPECIAL_9         41
#define ACTION_SPECIAL_10        42 // Tinker start
#define ACTION_SPECIAL_11        43 // Tinker
#define ACTION_SPECIAL_12        44 // Tinker end
#define ACTION_DOUBLE_BEGIN      45
#define ACTION_DOUBLE            46
#define ACTION_DOUBLE_END        47



// For SystemGet and SystemSet
#define SYS_INVALID                 0
#define SYS_PLAYERDEVICE            1
#define SYS_NUMJOYSTICK             2
#define SYS_WINDOWSCALE             3
#define SYS_KEYPRESSED              4
#define SYS_KEYDOWN                 5
#define SYS_TOPWINDOW               6
#define SYS_SFXVOLUME               7
#define SYS_MUSICVOLUME             8
#define SYS_MESSAGE                 9
#define SYS_USERLANGUAGE            10
#define SYS_LANGUAGEFILE            11
#define SYS_QUITGAME                12
#define SYS_FILENAME                13
#define SYS_FILESIZE                14
#define SYS_FILEFTPFLAG             15
#define SYS_FILECOUNT               16
#define SYS_FILEFREE                17
#define SYS_DEVTOOL                 18
#define SYS_CURSORDRAW              19
#define SYS_CURSORPOS               20
#define SYS_CURSORBUTTONDOWN        21
#define SYS_MODELVIEW               22
#define SYS_MODELMOVE               23
#define SYS_MODELPLOP               24
#define SYS_MODELSELECT             25
#define SYS_MODELDELETE             26
#define SYS_MODELPLOPTRIANGLE       27
#define SYS_MODELDELETETRIANGLE     28
#define SYS_MODELREGENERATE         29
#define SYS_MODELPLOPJOINT          30
#define SYS_MODELPLOPBONE           31
#define SYS_MODELDELETEBONE         32
#define SYS_MODELDELETEJOINT        33
#define SYS_MODELJOINTSIZE          34
#define SYS_MODELBONEID             35
#define SYS_MODELCRUNCH             36
#define SYS_MODELROTATEBONES        37
#define SYS_MODELUNROTATEBONES      38
#define SYS_MODELHIDE               39
#define SYS_MODELTRIANGLELINES      40
#define SYS_MODELCOPYPASTE          41
#define SYS_MODELWELDVERTICES       42
#define SYS_MODELWELDTEXVERTICES    43
#define SYS_MODELFLIP               44
#define SYS_MODELSCALE              45
#define SYS_MODELTEXSCALE           46
#define SYS_MODELANCHOR             47
#define SYS_MODELTEXFLAGSALPHA      48
#define SYS_MODELMAXFRAME           49
#define SYS_MODELADDFRAME           50
#define SYS_MODELFRAMEFLAGS         51
#define SYS_MODELFRAMEACTIONNAME    52
#define SYS_MODELACTIONSTART        53
#define SYS_MODELADDBASEMODEL       54
#define SYS_MODELFRAMEBASEMODEL     55
#define SYS_MODELFRAMEOFFSETX       56
#define SYS_MODELFRAMEOFFSETY       57
#define SYS_MODELEXTERNALFILENAME   58
#define SYS_MODELSHADOWTEXTURE      59
#define SYS_MODELSHADOWALPHA        60
#define SYS_MODELINTERPOLATE        61
#define SYS_MODELCENTER             62
#define SYS_MODELNUMTRIANGLE        63
#define SYS_MODELNUMCARTOONLINE     64
#define SYS_MODELSARELINKABLE       65
#define SYS_MODELDETEXTURE          66
#define SYS_MODELPLOPATSTRING       67
#define SYS_MODELMARKFRAME          68
#define SYS_MODELCOPYFRAME          69
#define SYS_MODELAUTOSHADOW         70
#define SYS_LASTKEYPRESSED          71
#define SYS_WATERLAYERSACTIVE       72
#define SYS_CARTOONMODE             73
#define SYS_CURSORLASTPOS           74
#define SYS_CURSORINOBJECT          75
#define SYS_NUMKANJI                76
#define SYS_NUMKANJITRIANGLE        77
#define SYS_KANJICOPY               78
#define SYS_KANJIPASTE              79
#define SYS_KANJIDELETE             80
#define SYS_CURSORSCREENPOS         81
#define SYS_DAMAGEAMOUNT            82
#define SYS_COLLISIONCHAR           83
#define SYS_MAINVIDEOFRAME          84
#define SYS_MAINGAMEFRAME           85
#define SYS_MAINFRAMESKIP           86
#define SYS_FINDDATASIZE            87
#define SYS_BLOCKKEYBOARD           88
#define SYS_BILLBOARDACTIVE         89
#define SYS_ARCTANANGLE             90
#define SYS_MAINSERVERLOCATED       91
#define SYS_SHARDLIST               92
#define SYS_SHARDLISTPING           93
#define SYS_SHARDLISTPLAYERS        94
#define SYS_VERSIONERROR            95
#define SYS_JOINGAME                96
#define SYS_STARTGAME               97
#define SYS_LEAVEGAME               98
#define SYS_NETWORKON               99
#define SYS_MAINGAMEACTIVE          100
#define SYS_NETWORKGAMEACTIVE       101
#define SYS_TRYINGTOJOINGAME        102
#define SYS_JOINPROGRESS            103
#define SYS_GAMESEED                104
#define SYS_LOCALPASSWORDCODE       105
#define SYS_NUMNETWORKPLAYER        106
#define SYS_NETWORKFINISHED         107
#define SYS_SERVERSTATISTICS        108
#define SYS_LOCALPLAYER             109
#define SYS_SCREENSHAKE             110
#define SYS_INCLUDEPASSWORD         111
#define SYS_FPS                     112
#define SYS_RANDOMSEED              113
#define SYS_MIPMAPACTIVE            114
#define SYS_WATERTEXTURE            115
#define SYS_PLAYERCONTROLHANDLED    116
#define SYS_GLOBALSPAWN             117
#define SYS_GLOBALATTACKSPIN        118
#define SYS_GLOBALATTACKER          119
#define SYS_DEBUGACTIVE             120
#define SYS_CURRENTITEM             121
#define SYS_DAMAGECOLOR             122
#define SYS_ITEMREGISTRYCLEAR       123
#define SYS_ITEMREGISTRYSCRIPT      124
#define SYS_ITEMREGISTRYICON        125
#define SYS_ITEMREGISTRYOVERLAY     126
#define SYS_ITEMREGISTRYPRICE       127
#define SYS_ITEMREGISTRYFLAGS       128
#define SYS_ITEMREGISTRYNAME        129
#define SYS_ITEMREGISTRYSTR         130
#define SYS_ITEMREGISTRYDEX         131
#define SYS_ITEMREGISTRYINT         132
#define SYS_ITEMREGISTRYMANA        133
#define SYS_ITEMREGISTRYAMMO        134
#define SYS_WEAPONGRIP              135
#define SYS_WEAPONMODELSETUP        136
#define SYS_WEAPONEVENT             137
#define SYS_WEAPONFRAMEEVENT        138
#define SYS_WEAPONUNPRESSED         139
#define SYS_CHARFASTFUNCTION        140
#define SYS_FASTANDUGLY             141
#define SYS_DEFENSERATING           142
#define SYS_CLEARDEFENSERATING      143
#define SYS_ITEMDEFENSERATING       144
#define SYS_CURSORBUTTONPRESSED     145
#define SYS_CAMERAANGLE             146
#define SYS_STARTFADE               147
#define SYS_MEMBUFFER               148
#define SYS_ROOMUNCOMPRESS          149
#define SYS_ROOMPLOPATSTRING        150
#define SYS_ROOMSELECT              151
#define SYS_ROOMPLOPVERTEX          152
#define SYS_ROOMDELETEVERTEX        153
#define SYS_ROOMWELDVERTICES        154
#define SYS_ROOMCLEAREXTERIORWALL   155
#define SYS_ROOMPLOPEXTERIORWALL    156
#define SYS_ROOMEXTERIORWALLFLAGS   157
#define SYS_ROOMPLOPWAYPOINT        158
#define SYS_ROOMDELETEWAYPOINT      159
#define SYS_ROOMLINKWAYPOINT        160
#define SYS_ROOMUNLINKWAYPOINT      161
#define SYS_ROOMDELETEBRIDGE        162
#define SYS_ROOMPLOPTRIANGLE        163
#define SYS_ROOMPLOPFAN             164
#define SYS_ROOMDELETETRIANGLE      165
#define SYS_ROOMGROUP               166
#define SYS_ROOMOBJECT              167
#define SYS_ROOMAUTOTEXTURE         168
#define SYS_ROOMAUTOTRIM            169
#define SYS_ROOMTEXTUREFLAGS        170
#define SYS_ROOMHARDPLOPPER         171
#define SYS_ROOMCOPYPASTE           172
#define SYS_MOUSETEXT               173
#define SYS_MOUSELASTOBJECT         174
#define SYS_MOUSELASTITEM           175
#define SYS_MOUSELASTSCRIPT         176
#define SYS_BUMPABORT               177
#define SYS_MODELAUTOVERTEX         178
#define SYS_ITEMINDEX               179
#define SYS_WEAPONREFRESHXYZ        180
#define SYS_WEAPONREFRESHFLASH      181
#define SYS_WEAPONREFRESHBONENAME   182
#define SYS_FASTFUNCTION            183
#define SYS_KEEPITEM                184
#define SYS_MAKEINPUTACTIVE         185
#define SYS_FREEPARTICLE            186
#define SYS_GNOMIFYVECTOR           187
#define SYS_GNOMIFYJOINT            188
#define SYS_JOINTFROMVERTEX         189
#define SYS_ROOMWATERLEVEL          190
#define SYS_ROOMWATERTYPE           191
#define SYS_MAPSIDENORMAL           192
#define SYS_MESSAGESIZE             193
#define SYS_LASTINPUTCURSORPOS      194
#define SYS_MESSAGERESET            195
#define SYS_FASTFUNCTIONFOUND       196
#define SYS_INPUTACTIVE             197
#define SYS_LOCALPLAYERINPUT        198
#define SYS_ROOMMONSTERTYPE         199
#define SYS_SANDTEXTURE             200
#define SYS_PAYINGCUSTOMER          201
#define SYS_FILESETFLAG             202
#define SYS_ENCHANTCURSOR           203
#define SYS_CHARACTERSCRIPTFILE     204
#define SYS_PARTICLESCRIPTFILE      205
#define SYS_FLIPPAN                 206
#define SYS_MAPCLEAR                207
#define SYS_MAPROOM                 208
#define SYS_MAPAUTOMAPPRIME         209
#define SYS_MAPAUTOMAPDRAW          210
#define SYS_MAPOBJECTRECORD         211
#define SYS_MAPOBJECTDEFEATED       212
#define SYS_MAPDOOROPEN             213
#define SYS_CAMERARESET             214
#define SYS_LOCALPLAYERZ            215
#define SYS_RESPAWNCHARACTER        216
#define SYS_RESERVECHARACTER        217
#define SYS_SWAPCHARACTERS          218
#define SYS_LUCK                    219
#define SYS_ROOMTEXTURE             220
#define SYS_DAMAGECHARACTER         221
#define SYS_NETWORKSCRIPT           222
#define SYS_ROOMMETALBOXITEM        223
#define SYS_CAMERAZOOM              224
#define SYS_CAMERASPIN              225
#define SYS_ROOMRESTOCK             226
#define SYS_MODELCHECKHACK          255



// For SYS_NETWORKSCRIPT
#define NETWORK_SCRIPT_NEWLY_SPAWNED    0
#define NETWORK_SCRIPT_EXTRA_DATA       1
#define NETWORK_SCRIPT_REMOTE_INDEX     2
#define NETWORK_SCRIPT_NETLIST_INDEX    3
#define NETWORK_SCRIPT_X                4
#define NETWORK_SCRIPT_Y                5
#define NETWORK_SCRIPT_Z                6
#define NETWORK_SCRIPT_FACING           7
#define NETWORK_SCRIPT_ACTION           8
#define NETWORK_SCRIPT_TEAM             9
#define NETWORK_SCRIPT_POISON           10
#define NETWORK_SCRIPT_PETRIFY          11
#define NETWORK_SCRIPT_ALPHA            12
#define NETWORK_SCRIPT_DEFLECT          13
#define NETWORK_SCRIPT_HASTE            14
#define NETWORK_SCRIPT_OTHER_ENCHANT    15
#define NETWORK_SCRIPT_EQLEFT           16
#define NETWORK_SCRIPT_EQRIGHT          17
#define NETWORK_SCRIPT_EQCOL01          18
#define NETWORK_SCRIPT_EQCOL23          19
#define NETWORK_SCRIPT_EQSPEC1          20
#define NETWORK_SCRIPT_EQSPEC2          21
#define NETWORK_SCRIPT_EQHELM           22
#define NETWORK_SCRIPT_EQBODY           23
#define NETWORK_SCRIPT_EQLEGS           24
#define NETWORK_SCRIPT_CLASS            25
#define NETWORK_SCRIPT_MOUNT_INDEX      26



// Map room flags...
#define MAP_ROOM_FLAG_FOUND       128
#define MAP_ROOM_FLAG_DUAL_LEVEL  64
#define MAP_ROOM_FLAG_TOWN        32
#define MAP_ROOM_FLAG_BOSS        16
#define MAP_ROOM_FLAG_VIRTUE      8
#define MAP_ROOM_FLAG_OUTSIDE     4


// For SYS_MAPROOM...
#define MAP_ROOM_SRF                  0
#define MAP_ROOM_X                    1
#define MAP_ROOM_Y                    2
#define MAP_ROOM_DOOR_X               3
#define MAP_ROOM_DOOR_Y               4
#define MAP_ROOM_DOOR_Z               5
#define MAP_ROOM_ROTATION             6
#define MAP_ROOM_SEED                 7
#define MAP_ROOM_TWSET                8
#define MAP_ROOM_LEVEL                9
#define MAP_ROOM_FLAGS               10
#define MAP_ROOM_DIFFICULTY          11
#define MAP_ROOM_AREA                12
#define MAP_ROOM_DEFEATED_CHARACTER  13
#define MAP_ROOM_NEXT_ROOM           14
#define MAP_ROOM_FROM_ROOM           15
#define MAP_ROOM_MULTI_CONNECT       16
#define MAP_ROOM_NUMBER              17
#define MAP_ROOM_CURRENT             18
#define MAP_ROOM_DOOR_PUSHBACK       19
#define MAP_ROOM_DOOR_SPIN           20
#define MAP_ROOM_LAST_TOWN           21
#define MAP_ROOM_REMOVE             128
#define MAP_ROOM_UPDATE_FLAGS       254
#define MAP_ROOM_ADD                255



// For CharFastFunction...
#define FAST_FUNCTION_SPAWN        0
#define FAST_FUNCTION_REFRESH      2
#define FAST_FUNCTION_EVENT        4
#define FAST_FUNCTION_AISCRIPT     6
#define FAST_FUNCTION_BUTTONEVENT  8
#define FAST_FUNCTION_GETNAME      10
#define FAST_FUNCTION_UNPRESSED    12
#define FAST_FUNCTION_FRAMEEVENT   14
#define FAST_FUNCTION_MODELSETUP   16
#define FAST_FUNCTION_DEFENSERATING 18
#define FAST_FUNCTION_SETUP        20
#define FAST_FUNCTION_DIRECTUSAGE  22
#define FAST_FUNCTION_ENCHANTUSAGE 24


#define AUTOAIM_X                0
#define AUTOAIM_Y                1
#define AUTOAIM_Z                2
#define AUTOAIM_TARGET           3
#define AUTOAIM_CRUNCH           4
#define AUTOAIM_CRUNCH_BALLISTIC 5


#define GLOBAL_SPAWN_OWNER      0
#define GLOBAL_SPAWN_TARGET     1
#define GLOBAL_SPAWN_TEAM       2
#define GLOBAL_SPAWN_SUBTYPE    3
#define GLOBAL_SPAWN_CLASS      4


// For the modeler
#define VIEW_TOP_XY    0
#define VIEW_SIDE_YZ   1
#define VIEW_FRONT_XZ  2
#define VIEW_3D_XYZ    3
#define MOVE_MODE_MOVE      0
#define MOVE_MODE_SCALE     1
#define MOVE_MODE_ROTATE    2
#define MODEL_COPY 0
#define MODEL_PASTE 1


// Looped/Distance sound effect channels (reserved)
#define INSECT_BUZZING  63


// Supported languages
#define ENGLISH                     0
#define FRENCH                      1
#define SPANISH                     2
#define ITALIAN                     3
#define GERMAN                      4


// For WindowMegaImage
#define ALPHA_NONE 0
#define ALPHA_TRANS 256
#define ALPHA_LIGHT 512


// For Window3D
#define WIN_CAMERA                  0
#define WIN_TARGET                  1
#define WIN_LIGHT                   2
#define WIN_ORTHO                   3
#define WIN_FRUSTUM                 4
#define WIN_SCALE                   5
#define WIN_3D_AXIS                 0
#define WIN_3D_SHADOW               16
#define WIN_3D_VERTEX               32
#define WIN_3D_BONE                 48
#define WIN_3D_MODEL                64
#define WIN_3D_BONE_UPDATE          80
#define WIN_3D_TEXVERTEX            96
#define WIN_3D_SKIN_FROM_CAMERA     112
#define WIN_3D_MODEL_EDIT           128


// For Window3DRoom
#define ROOM_MODE_MINIMAP       0
#define ROOM_MODE_GRID          16
#define ROOM_MODE_VERTEX        32
#define ROOM_MODE_TRIANGLE      48
#define ROOM_MODE_EXTERIOR_WALL 64
#define ROOM_MODE_WAYPOINT      80
#define ROOM_MODE_BRIDGE        96
#define ROOM_MODE_OBJECT_GROUP  112


// For FileOpen
#define FILE_NORMAL                 0
#define FILE_EXPORT                 1
#define FILE_IMPORT                 2
#define FILE_DELETE                 3
#define FILE_MAKENEW                4
#define FILE_SIZE                   5


// For GoPoof
#define POOF_SELF                   0
#define POOF_TARGET                 1
#define POOF_ALL_OTHER_WINDOWS      2
#define WARN_ALL_OTHER_WINDOWS      3
#define POOF_STUCK_PARTICLES        4
#define POOF_TARGET_STUCK_PARTICLES 5
#define POOF_ALL_PARTICLES          6
#define POOF_ALL_CHARACTERS         7


// For UpdateFiles
#define UPDATE_END                  1
#define UPDATE_RECOMPILE            2
#define UPDATE_SDFSAVE              3
#define UPDATE_SDFREORGANIZE        4
#define UPDATE_RELOADALLTEXTURES    5

// For PlayMusic
#define MUSIC_STOP 0
#define MUSIC_ONCE 1
#define MUSIC_PLAY 2


// Object types...
#define CHARACTER 0
#define PARTICLE 1
#define WINDOW 2


#define NO_TARGET  1024


// Color types...
#define WHITE              16777215
#define RED                16744576
#define DARK_RED           16711680
#define GREEN              8454016
#define DARK_GREEN         65280
#define BLUE               8421631
#define DARK_BLUE          255
#define FLESH              15716000
#define CYAN               65535
#define MAGENTA            16711935
#define BLACK              0
#define YELLOW             16776960
#define GREY               8421504


// Window borders...
//   4bit Sides (top,right,bottom,left)
//   4bit corners (tl,tr,br,bl)
//   4bit background (0000 or 1111)
//   4bit fancy corners (tl,tr,br,bl)
#define BORDER_FULL        65535
#define BORDER_BOX         65520
#define BORDER_TITLE       56572
#define BORDER_LOW_TITLE   29683
#define BORDER_NONE        0


// For modeler/border tools
#define BORDER_SIMPLE       0
#define BORDER_DRAG         1
#define BORDER_SELECT       2
#define BORDER_POINT_PICK   3
#define BORDER_CROSS_HAIRS  4
#define BORDER_MOVE         5


// Global Defines...
#define TRUE               1
#define FALSE              0
#define NULL               0
#define NAME_STRING        String(14)
#define DEBUG_STRING       String(15)
#define KANJI_IMAGE        1


// Simple directions...
#define DIRECTION_FRONT  0
#define DIRECTION_LEFT   1
#define DIRECTION_RIGHT  2
#define DIRECTION_BACK   3


// Particle flags...
#define PART_CHAR_COLLISION_ON 1
#define PART_WALL_COLLISION_ON 2
#define PART_IGNORE_INTIMER 4
#define PART_FIT_LENGTH_ON 8
#define PART_SPIN_ON       16
#define PART_FLAT_ON       32
#define PART_STUCK_ON      64
#define PART_GRAVITY_ON    128
#define PART_LIGHT_ON      256
#define PART_NUMBER_ON     512
#define PART_IN_WATER      1024
#define PART_AFTER_WATER   2048
#define PART_SLOW_ON       4096
#define PART_FAST_ON       8192
#define PART_HIT_OWNER_ON  16384
#define PART_ATTACK_SPIN_ON 32768




// Special flags for PATTACK/PBEAM
#define SPECIAL_FLAG_CHOP_THROUGH   128
#define SPECIAL_FLAG_POISON         64
#define SPECIAL_FLAG_PETRIFY        32
#define SPECIAL_FLAG_DRAIN          16
#define SPECIAL_FLAG_KNOCK_DOWN     8
#define SPECIAL_FLAG_BACKSTAB       4
#define SPECIAL_FLAG_ROCK_CRUSHER   2    // More damage to petrified targets...
#define SPECIAL_FLAG_INVERT_DEFWOUN 1    // Undead are only characters that should have defwoun...


// Script flags...  (for character scripts...  Because I ran out of character flags...)
#define SCRIPT_BUMP_DAMAGE     1
#define SCRIPT_NO_KNOCK_OUT    2
#define SCRIPT_NO_PETRIFY      4
#define SCRIPT_NO_POISON       8
#define SCRIPT_BOSS_DEFEAT     16
#define SCRIPT_ALLOW_HELM      32
#define SCRIPT_ALLOW_BODY      64
#define SCRIPT_ALLOW_LEGS      128


// Virtue flags...  (for characters...  Because I ran out of character flags...)
#define VIRTUE_FLAG_HITS         1  // Prayer whammy
#define VIRTUE_FLAG_EATS_TRIPE   2  // Character can be healed/charmed with tripe 
#define VIRTUE_FLAG_AFTER_WATER  4  // Character should always be drawn after water (used to solve some rendering issues)
#define VIRTUE_FLAG_NO_DROWN     8  // Character doesn't take drown damage...
#define VIRTUE_FLAG_STILL_HIDE  16  // Character is hidden when action == ACTION_STAND (enemies have trouble acquiring character as a target) (for mimic...)
#define VIRTUE_FLAG_RUN_ME_OVER 32  // Can be run over by tankes (without being knocked down first)
#define VIRTUE_FLAG_BUMP_IMMUNE 64  // Immune to damage from bumps (unless bumper is also immune)
#define VIRTUE_FLAG_IMMUNE     128  // Immune to damage from own shots...


// More flags...  (for characters....  Because I ran out of character flags...)
#define MORE_FLAG_FAST_TURN   1   // Makes character not slow down when turning...
#define MORE_FLAG_PETRIFY_ON  2   // Don't mess with this in script...  Used internally to give petrify events...
#define MORE_FLAG_HIT_HEAD    4   // Hitting in head does double damage...
#define MORE_FLAG_PUSHABLE    8   // Character is pushable...
#define MORE_FLAG_PLATFALL    16  // Character falls through platforms
#define MORE_FLAG_NOSHADOW    64  // Character's volumetric shadow is never drawn (if pretty shadows are turned on)
#define MORE_FLAG_DOOR        128 // Weird collision thing...


// Other flags...  (for characters...  Ran out...)
#define OTHER_FLAG_ENCHANT_CENTER     1 // Character is using an ENCHANT.SRC spell and targeting circle has already been center'd...
#define OTHER_FLAG_NO_MORPH           2 // Character can't be Morph'd (for bosses & chests & stuff)
#define OTHER_FLAG_NO_HEARTS          4 // Character can't grab Hearts (for tankes & stuff)
#define OTHER_FLAG_EASY_ENTANGLE      8 // Character can be Entangle'd easily
#define OTHER_FLAG_NO_WALL_COLLIDE   16 // Character doesn't bump into walls...
#define OTHER_FLAG_ENCHANT_MOVED     32 // Character has moved the enchantment target cursor thing off of his own character (so we don't accidentally DChant ourselves)
// 64 is unused
// 128 is unused


// Enchant flags...  (for characters...  Guess why...)
#define ENCHANT_FLAG_SUMMON_1         1 // Character is minor summon'd (taps 2 mana) (character is instantly destroy'd if disenchanted)
#define ENCHANT_FLAG_SUMMON_2         2 // Character is major summon'd (taps 4 mana) (character is instantly destroy'd if disenchanted)
#define ENCHANT_FLAG_SUMMON_3         3 // Character is summon'd (either minor or major...  these are flags remember...)
#define ENCHANT_FLAG_LEVITATE         4 // Jump action allows levitation if held down (should fall if disenchanted)
#define ENCHANT_FLAG_INVISIBLE        8 // Character is invisible (turns visible again if disenchanted)
#define ENCHANT_FLAG_MORPH           16 // Character is morph'd into an alternate form (revert to normal form if disenchanted)
#define ENCHANT_FLAG_DEFLECT         32 // Arrows and other particles deflect off character (glowie sphere goes away if disenchanted) (glow particle shatters if it absorbs too many particles too quickly - should flash with each one it deflects)
#define ENCHANT_FLAG_HASTE           64 // Character moves as if they had double Dex (goes away if disenchanted)
#define ENCHANT_FLAG_MIRROR_DEFLECT 128 // Character is using a mirror shield to deflect stuff...


// Stuff for SYS_ENCHANT_CURSOR...
#define ENCHANT_CURSOR_ACTIVE       0
#define ENCHANT_CURSOR_TARGET       1
#define ENCHANT_CURSOR_TARGET_ITEM  2



// Character flags...
#define CHAR_FALL_ON         1
#define CHAR_FUZZY_ON        2
#define CHAR_ON_GROUND       4
#define CHAR_GRAVITY_ON      8
#define CHAR_IN_WATER        16
#define CHAR_NO_COLLISION    32
#define CHAR_FINISH_ACTION   64
#define CHAR_NO_STUCK_PARTS  128
#define CHAR_ON_PLATFORM     256    // Used internally...
#define CHAR_CAN_BE_MOUNTED  512
#define CHAR_CAN_RIDE_MOUNT  1024
#define CHAR_LITTLE_BOX      2048
#define CHAR_FULL_NETWORK    4096
#define CHAR_PLATFORM_ON     8192
#define CHAR_HOVER_ON        16384
#define CHAR_NO_BACKSTAB     32768


// Property data...  Note that many things overlap data areas...
#proper x          F    0   // char, part, win
#proper y          F    4   // char, part, win
#proper z          F    8   // char, part, win

#proper gotox      F   12   // char
#proper gotoy      F   16   // char
#proper hoverz     F   20   // char (only used if CHAR_HOVER_ON)
#proper b0timer    B   36   // char (Button becomes unpressed when down to 0)
#proper b1timer    B   37   // char (Button becomes unpressed when down to 0)
#proper b2timer    B   38   // char (Button becomes unpressed when down to 0)
#proper b3timer    B   39   // char (Button becomes unpressed when down to 0)
#proper pstimer    W   40   // char (Poison timer)
#proper pttimer    W   42   // char (Petrify timer)
#proper floorz     F   44   // char (floor level below character)
#proper flatten    B   48   // char (Character flatness...  255 is normal...)
// Byte at 49 is used internally for character drown timer
#proper lastway    B   50   // char (Last waypoint the character was at...  For findpath)
#proper nextway    B   51   // char (Next waypoint the character is going to...  For findpath)
#proper action     B   65   // char (current action)
#proper daction    B   66   // char (default action when current action ends)
#proper morphoc    W   68   // char (index of morph's old character - so we can respawn it on disenchant)
#proper exp        W   70   // char (experience)
#proper cbtimer    B   72   // char (Combo timer...  Reset to 0 every time hit...  Decrements combo count after it counts up to a certain number...)
#proper level      B   73   // char (character's experience level)
#proper statpts    B   74   // char (Points to spend upgrading character)
#proper combo      B   75   // char (How many times in a row character has been hit...  Decrements every now and then)
#proper hitsmax    B   80   // char (The character's stats)
#proper hitstap    B   81   // char
#proper hits       B   82   // char
#proper manamax    B   83   // char
#proper manatap    B   84   // char
#proper mana       B   85   // char
#proper str        B   86   // char
#proper dex        B   87   // char
#proper int        B   88   // char
#proper vircomp    B   89   // char (The character's virtue ratings)
#proper virdill    B   90   // char
#proper virhono    B   91   // char
#proper virfait    B   92   // char
#proper vircour    B   93   // char
// Byte at 94 is unused
// Byte at 95 is unused
#proper oflags     B   96   // char (Other flags)
#proper defedge    B   97   // char (The character's defense ratings)
#proper defbash    B   98   // char
#proper defacid    B   99   // char
#proper deffire    B   100  // char
#proper defice     B   101  // char
#proper defvolt    B   102  // char
#proper defwoun    B   103  // char (Only undead characters should have defwoun...)
#proper mflags     B   104  // char (More flags)
#proper vflags     B   105  // char (Virtue flags)
#proper rider      W   106  // char (Index of the character who's riding current character... >= MAX_CHARACTER for none...)
#proper sidex      F   108  // char (The character's rotation matrix)
#proper sidey      F   112  // char
#proper sidez      F   116  // char
#proper frontx     F   120  // char
#proper fronty     F   124  // char
#proper frontz     F   128  // char
#proper upx        F   132  // char
#proper upy        F   136  // char
#proper upz        F   140  // char
#proper name       S   144  // char
#proper boxsize    F   160  // char
#proper mount      W   164  // char (Index of the character who current character is riding... 65535 for none...)
#proper nctimer    W   166  // char (No Collision Timer...  Character doesn't collide with other chars or particles)
#proper dmtimer    W   168  // char (Damage timer...  Makes color change)
#proper intimer    W   170  // char (Invincibility timer...  Character doesn't collide with particles)
#proper vrtimer    W   172  // char (Virtue timer)
#proper theight    B   174  // char (Temporary height...  Saves actual height when knocked out)
#proper height     B   175  // char
#proper aitimer    W   176  // char (AI timer)
#proper frame      W   178  // char
#proper food       W   180  // char
#proper eframe     W   182  // char (Eye frame)
#proper mframe     W   184  // char (Mouth frame)
#proper eaction    B   186  // char (Eye action)
#proper maction    B   187  // char (Mouth action)
#proper money      W   188  // char (Amount of money character is carrying)
#proper keys       B   190  // char (Number of keys character is carrying)
#proper cdtimer    B   191  // char (Collision delay timer) (character only gets hit wall events if this is 0...)
#proper aistate    B   192  // char (generic AI variable)
#proper aimode     B   193  // char (generic AI variable)
#proper rltimer    W   194  // char (Reload left timer) (can't use left button when > 0) (also for special 1)
#proper rrtimer    W   196  // char (Reload right timer) (can't use right button when > 0) (also for special 2)
#proper bflags     B   198  // char (Button state flags, Low 4 bits for pressed, High 4 bits for unpressed)
#proper baxis      B   199  // char (Button axis flags, Low 4 bits, AXIS_UP etc..., High 4 bits for button down flags...)
#proper setimer    W   200  // char (Secondary event timer)
#proper tetimer    W   202  // char (Third-iary event timer)
#proper class      B   204  // char (Character class) (sent if CHAR_FULL_NETWORK)
#proper sflags     B   205  // char (Script flags)
#proper bright     B   206  // char (Character brightness...  255 is normal...)
#proper charge     B   207  // char (For chargeable weapons & stuff...)
#proper lasthit    W   208  // char (Index of the character who hit our character with poison, or who killed 'em...  Used to figger who gets the experience...)
#proper expgive    W   210  // char (Experience points that this character gives when killed)
#proper flyfric    F   212  // char (Flying friction...  Defaults to 0.95 on spawn)
#proper eflags     B   216  // char (Enchantment flags...)
#proper manacst    B   217  // char (Number of stat points required for mana - usually 5)

#proper lastx      F   12   // part
#proper lasty      F   16   // part
#proper lastz      F   20   // part
#proper vx         F   24   // part, char
#proper vy         F   28   // part, char
#proper vz         F   32   // part, char
#proper length     F   36   // part
#proper width      F   40   // part
#proper image      I   44   // part (doesn't draw if NULL)
#proper red        B   48   // part (for tinting particle to a desired color...  defaults to white...)
#proper green      B   49   // part
#proper blue       B   50   // part
#proper number     B   51   // part (for PART_NUMBER_ON)
#proper timer      W   52   // part, char  (Refresh timer)
#proper evtimer    W   54   // part, char  (Event timer)
#proper spin       W   56   // part, char
#proper vspin      W   58   // part, char
#proper flags      W   60   // part, char
#proper target     W   62   // part, char  (Stores index...  No target.x stuff...)
#proper bone       B   64   // part, char  (Part uses for stuck parts...)
#proper trail      B   65   // part (0 means lastxyz is actual last position, 1-255 means lastxyz is sluggified)
#proper dtype      B   66   // part (Damage type in low 4 bits, Top 4 bits have special flags...)
#proper event      B   67   // part, char
#proper image2     I   68   // part (overwrites misc0-3)
#proper misc0      B   68   // part (misc0-5 are used for stuck bones when active...)
#proper misc1      B   69   // part (otherwise, they can be used for whatever...)
#proper misc2      B   70   // part
#proper misc3      B   71   // part
#proper misc4      B   72   // part
#proper misc5      B   73   // part
#proper misc6      B   74   // part (use for anything)
#proper misc7      B   75   // part (use for anything)
#proper owner      W   76   // part, char
#proper team       B   78   // part, char
#proper alpha      B   79   // part, char
#proper colsize    F   80   // part (used for bumping the floor...  Diameter of sphere for particle...  Doesn't work as well as it should...)
// 84 is used internally as the particle's spawn'd in water detection thinger...
// 85 is unused
#proper stuckto    W   86   // part (used when particle is stuck to a character...)

#proper int0001    I   12   // win
#proper stat00w    W   12   // win
#proper stat00h    B   12   // win
#proper stat00l    B   13   // win
#proper stat01w    W   14   // win
#proper stat01h    B   14   // win
#proper stat01l    B   15   // win
#proper int0203    I   16   // win
#proper stat02w    W   16   // win
#proper stat02h    B   16   // win
#proper stat02l    B   17   // win
#proper stat03w    W   18   // win
#proper stat03h    B   18   // win
#proper stat03l    B   19   // win
#proper int0405    I   20   // win
#proper stat04w    W   20   // win
#proper stat04h    B   20   // win
#proper stat04l    B   21   // win
#proper stat05w    W   22   // win
#proper stat05h    B   22   // win
#proper stat05l    B   23   // win
#proper int0607    I   24   // win
#proper stat06w    W   24   // win
#proper stat06h    B   24   // win
#proper stat06l    B   25   // win
#proper stat07w    W   26   // win
#proper stat07h    B   26   // win
#proper stat07l    B   27   // win
#proper int0809    I   28   // win
#proper stat08w    W   28   // win
#proper stat08h    B   28   // win
#proper stat08l    B   29   // win
#proper stat09w    W   30   // win
#proper stat09h    B   30   // win
#proper stat09l    B   31   // win
#proper int1011    I   32   // win
#proper stat10w    W   32   // win
#proper stat10h    B   32   // win
#proper stat10l    B   33   // win
#proper stat11w    W   34   // win
#proper stat11h    B   34   // win
#proper stat11l    B   35   // win
#proper int1213    I   36   // win
#proper stat12w    W   36   // win
#proper stat12h    B   36   // win
#proper stat12l    B   37   // win
#proper stat13w    W   38   // win
#proper stat13h    B   38   // win
#proper stat13l    B   39   // win
#proper int1415    I   40   // win
#proper stat14w    W   40   // win
#proper stat14h    B   40   // win
#proper stat14l    B   41   // win
#proper stat15w    W   42   // win
#proper stat15h    B   42   // win
#proper stat15l    B   43   // win
#proper int1617    I   44   // win
#proper stat16w    W   44   // win
#proper stat16h    B   44   // win
#proper stat16l    B   45   // win
#proper stat17w    W   46   // win
#proper stat17h    B   46   // win
#proper stat17l    B   47   // win
#proper int1819    I   48   // win
#proper stat18w    W   48   // win
#proper stat18h    B   48   // win
#proper stat18l    B   49   // win
#proper stat19w    W   50   // win
#proper stat19h    B   50   // win
#proper stat19l    B   51   // win
#proper int2021    I   52   // win
#proper stat20w    W   52   // win
#proper stat20h    B   52   // win
#proper stat20l    B   53   // win
#proper stat21w    W   54   // win
#proper stat21h    B   54   // win
#proper stat21l    B   55   // win
#proper int2223    I   56   // win
#proper int2425    I   60   // win
#proper int2627    I   64   // win
#proper int2829    I   68   // win
// Byte at 72 is unused
// Byte at 73 is unused
// Byte at 74 is unused
// Byte at 75 is unused
#proper bigtext    T   76   // win
#proper string0    S   76   // win
#proper string1    S   92   // win
#proper string2    S  108   // win
#proper string3    S  124   // win
#proper string4    S  156   // win
#proper string5    S  172   // win
#proper string6    S  188   // win
#proper string7    S  204   // win
#proper binding    W  220   // win
#proper slotype    B  222   // win
#proper xtra00w    W  224   // win
#proper xtra01w    W  226   // win
#proper xtra02w    W  228   // win
#proper xtra03w    W  230   // win


// Inventory Stuff (character only)
#proper item00     B  224
#proper item01     B  225
#proper item02     B  226
#proper item03     B  227
#proper item04     B  228
#proper item05     B  229
#proper item06     B  230
#proper item07     B  231
#proper item08     B  232
#proper item09     B  233
#proper item10     B  234
#proper item11     B  235
#proper item12     B  236
#proper item13     B  237
#proper item14     B  238
#proper item15     B  239


// Equipment Stuff (character & window)
#proper eqcol01    B  240  // Color slider 0 is high 4 bits, Color slider 1 is low 4 bits (actual meaning interpreted by script) (always sent over network)
#proper eqcol23    B  241  // Color slider 2 is high 4 bits, Color slider 3 is low 4 bits (actual meaning interpreted by script) (sent if CHAR_FULL_NETWORK)
#proper eqleft     B  242  // Left weapon (always sent over network)
#proper eqright    B  243  // Right weapon (always sent over network)
#proper eqspec1    B  244  // Special 1 (sent if CHAR_FULL_NETWORK)
#proper eqspec2    B  245  // Special 2 (sent if CHAR_FULL_NETWORK)
#proper eqhelm     B  246  // Armor slot 0 (sent if CHAR_FULL_NETWORK)
#proper eqbody     B  247  // Armor slot 1 (sent if CHAR_FULL_NETWORK)
#proper eqlegs     B  248  // Armor slot 2 (sent if CHAR_FULL_NETWORK)
// Byte at 249 is used for room object number - for remembering which have been defeated...  Used in CRANDOM by number...  Used in PTRAP by number...
// Byte at 250 is used as the remote index number (the character number as it is on the remote's computer that is running this character)
// Byte at 251 is used for the network script index (see NETLIST.DAT)
// Bytes at 252,253,254,255 are used as the remote IP Address (0.0.0.0 means hosted locally)


// Rendering attributes
#define MODEL_BASE_FILE    256
#define MODEL_BASE_TEX0    260
#define MODEL_BASE_TEX1    264
#define MODEL_BASE_TEX2    268
#define MODEL_BASE_TEX3    272
#define MODEL_BASE_COLOR   276
#define MODEL_LEGS_FILE    280
#define MODEL_LEGS_TEX0    284
#define MODEL_LEGS_TEX1    288
#define MODEL_LEGS_TEX2    292
#define MODEL_LEGS_TEX3    296
#define MODEL_LEGS_COLOR   300
#define MODEL_CHEST_FILE   304
#define MODEL_CHEST_TEX0   308
#define MODEL_CHEST_TEX1   312
#define MODEL_CHEST_TEX2   316
#define MODEL_CHEST_TEX3   320
#define MODEL_CHEST_COLOR  324
#define MODEL_ARMS_FILE    328
#define MODEL_ARMS_TEX0    332
#define MODEL_ARMS_TEX1    336
#define MODEL_ARMS_TEX2    340
#define MODEL_ARMS_TEX3    344
#define MODEL_ARMS_COLOR   348
#define MODEL_PADS_FILE    352
#define MODEL_PADS_TEX0    356
#define MODEL_PADS_TEX1    360
#define MODEL_PADS_TEX2    364
#define MODEL_PADS_TEX3    368
#define MODEL_PADS_COLOR   372
#define MODEL_FEET_FILE    376
#define MODEL_FEET_TEX0    380
#define MODEL_FEET_TEX1    384
#define MODEL_FEET_TEX2    388
#define MODEL_FEET_TEX3    392
#define MODEL_FEET_COLOR   396
#define MODEL_HEAD_FILE    400
#define MODEL_HEAD_TEX0    404
#define MODEL_HEAD_TEX1    408
#define MODEL_HEAD_TEX2    412
#define MODEL_HEAD_TEX3    416
#define MODEL_HEAD_COLOR   420
#define MODEL_HAIR_FILE    424
#define MODEL_HAIR_TEX0    428
#define MODEL_HAIR_TEX1    432
#define MODEL_HAIR_TEX2    436
#define MODEL_HAIR_TEX3    440
#define MODEL_HAIR_COLOR   444
#define MODEL_EYES_FILE    448
#define MODEL_EYES_TEX0    452
#define MODEL_EYES_TEX1    456
#define MODEL_EYES_TEX2    460
#define MODEL_EYES_TEX3    464
#define MODEL_EYES_COLOR   468
#define MODEL_MOUTH_FILE   472
#define MODEL_MOUTH_TEX0   476
#define MODEL_MOUTH_TEX1   480
#define MODEL_MOUTH_TEX2   484
#define MODEL_MOUTH_TEX3   488
#define MODEL_MOUTH_COLOR  492
#define MODEL_RIDER_FILE   496
#define MODEL_RIDER_TEX0   500
#define MODEL_RIDER_TEX1   504
#define MODEL_RIDER_TEX2   508
#define MODEL_RIDER_TEX3   512
#define MODEL_RIDER_COLOR  516
#define MODEL_LEFT_FILE    520
#define MODEL_LEFT_TEX0    524
#define MODEL_LEFT_TEX1    528
#define MODEL_LEFT_TEX2    532
#define MODEL_LEFT_TEX3    536
#define MODEL_LEFT_COLOR   540
#define MODEL_RIGHT_FILE   544
#define MODEL_RIGHT_TEX0   548
#define MODEL_RIGHT_TEX1   552
#define MODEL_RIGHT_TEX2   556
#define MODEL_RIGHT_TEX3   560
#define MODEL_RIGHT_COLOR  564
#define MODEL_LEFT2_FILE   568
#define MODEL_LEFT2_TEX0   572
#define MODEL_LEFT2_TEX1   576
#define MODEL_LEFT2_TEX2   580
#define MODEL_LEFT2_TEX3   584
#define MODEL_LEFT2_COLOR  588
#define MODEL_RIGHT2_FILE  592
#define MODEL_RIGHT2_TEX0  596
#define MODEL_RIGHT2_TEX1  600
#define MODEL_RIGHT2_TEX2  604
#define MODEL_RIGHT2_TEX3  608
#define MODEL_RIGHT2_COLOR 612


// Item flags...
#define ITEM_FLAG_WEAPON     1
#define ITEM_FLAG_LEFT       2
#define ITEM_FLAG_SPECIAL    4
#define ITEM_FLAG_HELM       8
#define ITEM_FLAG_BODY       16
#define ITEM_FLAG_LEGS       32
#define ITEM_FLAG_ITEM       64
#define ITEM_FLAG_RIGHT      128


// General items (0-63)...
#define ITEM_NONE             0
#define ITEM_JUMP             1
#define ITEM_TALK             2
#define ITEM_PRAY             3
#define ITEM_KISS             4
// 5 is unused
#define ITEM_HIDE             6
#define ITEM_TINKER           7
#define ITEM_GONNE            8
#define ITEM_GRONNADE         9
#define ITEM_QUIVER_10       10
#define ITEM_QUIVER_9        11
#define ITEM_QUIVER_8        12
#define ITEM_QUIVER_7        13
#define ITEM_QUIVER_6        14
#define ITEM_QUIVER_5        15
#define ITEM_QUIVER_4        16
#define ITEM_QUIVER_3        17
#define ITEM_QUIVER_2        18
#define ITEM_QUIVER_1        19
#define ITEM_AMMO_10         20
#define ITEM_AMMO_9          21
#define ITEM_AMMO_8          22
#define ITEM_AMMO_7          23
#define ITEM_AMMO_6          24
#define ITEM_AMMO_5          25
#define ITEM_AMMO_4          26
#define ITEM_AMMO_3          27
#define ITEM_AMMO_2          28
#define ITEM_AMMO_1          29
#define ITEM_LETTER          30
#define ITEM_HORN            31
#define ITEM_DOLL            32
#define ITEM_FLAMER          33
#define ITEM_HEAL            34
#define ITEM_MANA            35
#define ITEM_SUPER_HEAL      36
#define ITEM_SUPER_MANA      37
#define ITEM_EXPLOSIVES      38
#define ITEM_FISHING_POLE    39
#define ITEM_BOOK_5          40 // Adventurer's Handbook & Virtue
#define ITEM_BOOK_4          41 // Magic Spells
#define ITEM_BOOK_3          42 // Beastiary
#define ITEM_BOOK_2          43 // Weapons & Armor
#define ITEM_BOOK_1          44 // Rogue
#define ITEM_RING            45
#define ITEM_GOLD_BAR        46
#define ITEM_ONE_UP          47


// Armor items (48-123) (4 variants each)...
#define ITEM_SHIELD          48
#define ITEM_MIRROR_SHIELD   52
#define ITEM_BOW             56
#define ITEM_LONG_BOW        60
#define ITEM_HELM_1          64
#define ITEM_HELM_2          68
#define ITEM_HELM_3          72
#define ITEM_HELM_4          76
#define ITEM_HELM_5          80
#define ITEM_BODY_1          84
#define ITEM_BODY_2          88
#define ITEM_BODY_3          92
#define ITEM_BODY_4          96
#define ITEM_BODY_5         100
#define ITEM_LEGS_1         104
#define ITEM_LEGS_2         108
#define ITEM_LEGS_3         112
#define ITEM_LEGS_4         116
#define ITEM_LEGS_5         120

#define ARMOR_VARIANT_NONE    0
#define ARMOR_VARIANT_MAGIC   1
#define ARMOR_VARIANT_FIRE    2
#define ARMOR_VARIANT_ICE     3


// Food items (124 - 135)
#define ITEM_FISH           124
#define ITEM_MEAT           125
#define ITEM_MEAT_ROTTEN    126
#define ITEM_PORC           127
#define ITEM_PORC_ROTTEN    128
#define ITEM_FOOD           129
#define ITEM_COOKIE         130
#define ITEM_TRIPE          131
// 132 is Unused
// 133 is Unused
// 134 is Unused
// 135 is Unused


// Weapon items (136-231) (8 variants each)...
#define ITEM_DAGGER         136
#define ITEM_SHORT_SWORD    144
#define ITEM_SWORD          152
#define ITEM_GREAT_SWORD    160
#define ITEM_OBSIDIAN_BLADE 168
#define ITEM_DRAGON_SWORD   176
#define ITEM_HAMMER         184
#define ITEM_PICK_AXE       192
#define ITEM_HATCHET        200
#define ITEM_MACE           208
#define ITEM_BROAD_AXE      216
#define ITEM_WAR_HAMMER     224


#define WEAPON_VARIANT_NONE    0
#define WEAPON_VARIANT_MAGIC   1
#define WEAPON_VARIANT_FIRE    2
#define WEAPON_VARIANT_ICE     3
#define WEAPON_VARIANT_VOLT    4
#define WEAPON_VARIANT_POISON  5
#define WEAPON_VARIANT_HOLY    6
#define WEAPON_VARIANT_UNHOLY  7


// Spell items (232-255)
// Level 1 (10 Int)
#define ITEM_SPELL_MISSILE          232
#define ITEM_SPELL_POISON_CLOUD     233
#define ITEM_SPELL_ANIMATE_DEAD     234
#define ITEM_SPELL_ENTANGLE         235
#define ITEM_SPELL_DISENCHANT       236
#define ITEM_SPELL_KNOCK            237

// Level 2 (20 Int)
#define ITEM_SPELL_FLAME_WALL       238
#define ITEM_SPELL_LIGHTNING_BOLT   239
#define ITEM_SPELL_TELEPORT         240
#define ITEM_SPELL_ENCHANT          241
#define ITEM_SPELL_MAPPING          242
#define ITEM_SPELL_LUCK             243

// Level 3 (30 Int)
#define ITEM_SPELL_FIREBALL         244
#define ITEM_SPELL_ICEBALL          245
#define ITEM_SPELL_LEVITATE         246
#define ITEM_SPELL_PETRIFY          247
#define ITEM_SPELL_PORTAL           248
#define ITEM_SPELL_DEFLECT          249

// Level 4 (40 Int)
#define ITEM_SPELL_FIRESTORM        250
#define ITEM_SPELL_HASTE            251
#define ITEM_SPELL_INVISIBILITY     252
#define ITEM_SPELL_MORPH            253
#define ITEM_SPELL_FLAME_BRAND      254
#define ITEM_SPELL_ICE_BRAND        255




// Goody types...
#define ITEM_GOODIES_HEARTS   1
#define ITEM_GOODIES_KEYS     2
#define ITEM_GOODIES_COINS    4
#define ITEM_GOODIES_BADDIES  8
#define ITEM_GOODIES_ALL      255

