viewing paste Unknown #495 | C

Posted on the
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
#pragma once
 
#ifndef _ITEMDB_H_
#define _ITEMDB_H_
 
 
// ItemTypes 
enum ITEM_TYPE {
  ITEM_TYPE_NORMAL = 0,         //Card, special, heal, event
  ITEM_TYPE_ARROW,              //Arrow, ammo, Throwweapon
  ITEM_TYPE_EQUIP,              //Armor, weapon, twohandweapon, gun
  ITEM_TYPE_PET,                //-> used for eggs to store informations in serial/card slots.;
  ITEM_TYPE_QUEST,              //guest
  ITEM_TYPE_UNKNOWN,
};
 
// Item States (required to decide wich equipitem structure!)
enum ITEM_STATE{
  ITEMSTATE_UNKNOWN = 0x00,
  ITEMSTATE_IDENTIFIED,
  ITEMSTATE_UNKNOWN_SERIAL = 0x40,
  ITEMSTATE_IDENTIFIED_SERIAL,
};
 
 
struct itemDB_Entry_S{
    unsigned int ID;
    //char Name[25];
    enum ITEM_TYPE type;
};
typedef struct itemDB_Entry_S itemDB_Entry;
 
// 00 00 
// 
 
#pragma pack(1)
//Normal Item
struct Item_Normal_S{
                UINT16 ItemID;
                UINT8  IsIdentified;
                UINT16 count;
                UINT16 slot[4];
};
typedef struct Item_Normal_S IData_Normal;
 
//Arrow Item
struct Item_Arrow_S{
                UINT16 ItemID;
                UINT8  IsIdentified;
                UINT16 count;
                UINT16 WearState;
};
typedef struct Item_Arrow_S IData_Arrow;
 
// EQUIP Item
// EGG (PET)
// It depends on the ItemState,...
struct Item_Equip_Base_S{
                UINT16 ItemID;
                UINT8  ItemState;       //0x00, 0x01 [Not Identified, Identified - without Serial], 0x40, 0x41 [Not Identified, Identified - with Serial]
};
typedef struct Item_Equip_Base_S IData_Equip_Base;
 
struct Item_Equip_Main_S{
                UINT16 ItemID;
                UINT8  ItemState;
                UINT16 WearState;
                UINT8  IsDamaged;
                UINT8  RefiningLevel;
                UINT16 slot[4];
};
typedef struct Item_Equip_Main_S IData_Equip_Main;
 
struct Item_Equip_MainSerial_S{
                UINT16 ItemID;
                UINT8  ItemState;
                UINT16 WearState;
                UINT8  IsDamaged;
                UINT8  RefiningLevel;
                UINT16 slot[4];
                UINT32 serial[2];
};
typedef struct Item_Equip_MainSerial_S IData_Equip_MainSerial;
 
struct Item_Quest_S{
                UINT16 ItemID;
                UINT16 count;
};
typedef struct Item_Quest_S IData_Quest;
 
#pragma pack()
 
 
enum ITEM_TYPE ItemID2Type(unsigned int ID);
 
 
void itemDB_init();
void itemDB_final();
 
 
#endif
Viewed 666 times, submitted by Guest.