Game Structs

////////////////////////////////////////////////////////////////////
// D2 Game Map Position
////////////////////////////////////////////////////////////////////
typedef struct tagMapPos
{
	WORD x;				// x
	WORD y;				// y
} MAPPOS, *LPMAPPOS;
typedef const tagMapPos* LPCMAPPOS;


////////////////////////////////////////////////////////////////////
// Stuff for Screen Text Drawing
// Added v2.00 by Abin
////////////////////////////////////////////////////////////////////

// Drawing Capacities
#define D2DRAW_MAX_TEXT		255 // Maximum text length that can be drawn in one element
#define D2DRAW_MAX_DATA		64  // Maximum elements can be drawn on the screen at a time

// Drawing Element Data Definition
typedef struct tagD2DrawData
{
	char szText[D2DRAW_MAX_TEXT + 1]; 		  // Text to be drawn
	BOOL bRightAlign;				  // Right alignment
	long x;						  // Screen coordinates x
	long y;						  // Screen coordinates y
	int nFont;					  // Text font(0-13)
} D2DRAWDATA, *LPD2DRAWDATA;
typedef const tagD2DrawData* LPCD2DRAWDATA;


#define	ITEM_CODE_LEN					3
#define	ITEM_DESC_LEN					128
#define ITEM_MAX_MOD	25
typedef struct tagItemMod
{
	DWORD dwModID;			// mod id
	BYTE iCount;			// number of values
	DWORD aValues[4];		// mod values
} ITEMMOD, *LPITEMMOD;
typedef const tagItemMod* LPCITEMMOD;

// The ITEM struct
typedef struct tagItem
{
	DWORD dwItemID;						// item ID
	BYTE iMessageID;					// 0x9c/0x9d
	BYTE iAction;						// action
	BYTE iType;						// type: weapon, armor, etc
	BYTE iIsSocketFull;					// is sockets full?
	BYTE iSocketNumber;					// number of total sockets on this item
	BYTE iSwtichIn;						// switched in?
	BYTE iSwitchOut;					// switched out?
	BYTE iBroken;						// item is broken
	BYTE iIdentified;					// identified?
	BYTE iEthereal;						// ethereal?
	BYTE iLevel;						// item level
	BYTE iLocation;						// ground, belt, inventory etc
	BYTE iPersonalized;					// personalized
	BYTE iRuneword;						// is runeword item
	BYTE iGamble;						// gamble
	BYTE iStorageID;					// storage id
	BYTE iQuality;						// unique, rare, set, superior, etc
	WORD wPositionX;					// location x
	WORD wPositionY;					// location y
	DWORD dwGoldAmount;					// Gold amount, "gld" only
	char szItemCode[ITEM_CODE_LEN + 1];			// item code, 3 letters
	WORD wDefense;						// defense
	WORD wDurability;					// durability
	WORD wMaxDurability;					// maximum durability
	BYTE iModCount;						// number of total mods
	BYTE iAtBeltRow;					// belt row index(0-4)
	BYTE iAtBeltColumn;					// belt column index(0-4)
	ITEMMOD aMods[ITEM_MAX_MOD];				// mods
} ITEM, *LPITEM;
typedef const tagItem* LPCITEM;


//////////////////////////////////////////////////////////////////////
// Item Enumeration Callback Function def
//////////////////////////////////////////////////////////////////////
typedef BOOL (CALLBACK *fnEnumItemProc)(LPCITEM lpItem, LPARAM lParam); 



typedef struct tagGameUnit
{
	DWORD dwUnitID;					// Unit ID
	DWORD dwUnitType;				// Unit type(player, monster, object, etc)
} GAMEUNIT, *LPGAMEUNIT;
typedef const tagGameUnit* LPCGAMEUNIT;

// Unit enumeration callback definition
typedef BOOL (CALLBACK *fnEnumUnitProc)(LPCGAMEUNIT lpUnit, LPARAM lParam);
//////////////////////////////////////////////////////////////////////
// PresetUnit(Caves, Stairs, Dens, Towers, Entrances, Izual, Hephasto, Countess Chest, etc...)
//////////////////////////////////////////////////////////////////////
typedef struct tagPresetUnit
{
	DWORD dwID;		// Preset unit ID (txt no). 
	DWORD dwType;		// Preset unit type, monster, object, room tile, etc
	WORD x;			// Map position x
	WORD y;			// Map position y
} PRESETUNIT, *LPPRESETUNIT;
typedef const tagPresetUnit* LPCPRESETUNIT;

// PresetUnit enumeration callback definition
typedef BOOL (CALLBACK *fnEnumPresetUnitProc)(LPCPRESETUNIT lpPresetUnit, LPARAM lParam);


/////////////////////////////////////////////////////////////////////
// Path (path from one position to an other)
/////////////////////////////////////////////////////////////////////
typedef struct tagPath
{
	MAPPOS posStart;				// Start position
	MAPPOS posEnd;				// Destination position
	MAPPOS aPathNodes[255];			// Path nodes between posStart and posEnd
	BYTE iNodeCount;				// Number of path nodes (0-255)
} PATH, *LPPATH;
typedef const tagPath* LPCPATH;



//////////////////////////////////////////////////////////////////////
// Boss Monster Enchants
//////////////////////////////////////////////////////////////////////
typedef struct tagBossEchants
{
	BOOL bFireEnchanted;				// Fire Enchanted
	BOOL bLightningEnchanted;			// Lightning Enchanted
	BOOL bColdEnchanted;				// Cold Enchanted
	BOOL bExtraStrong;				// Extra Strong
	BOOL bExtraFast;				// Extra Fast
	BOOL bMagicResistant;				// Magic Resistant
	BOOL bStoneSkin;				// Stone Skin
	BOOL bCursed;					// Cursed
	BOOL bManaBurn;					// Mana Burn
	BOOL bMultiShot;				// Multishot
	BOOL bSpectralHit;				// Spectral Hit
	BOOL bTeleport;					// Teleport
	BOOL bAuraEnchanted;				// Aura Enchanted
} BOSSENCHANTS, *LPBOSSENCHANTS;
typedef const tagBossEchants* LPCBOSSENCHANTS;