chuyiwen_gmsv/include/item.h

491 lines
14 KiB
C
Raw Normal View History

2016-12-24 08:45:52 +08:00
#ifndef __ITEM_H__
#define __ITEM_H__
//#include "char.h"
#define NULLITEM "0"
typedef enum
{
ITEM_FIST =0,
ITEM_AXE,
ITEM_CLUB,
ITEM_SPEAR,
ITEM_BOW,
ITEM_SHIELD,
ITEM_HELM,
ITEM_ARMOUR,
ITEM_BRACELET =8,
ITEM_MUSIC,
ITEM_NECKLACE,
ITEM_RING,
ITEM_BELT,
ITEM_EARRING,
ITEM_NOSERING,
ITEM_AMULET,
/* ****** */
ITEM_OTHER =16,
2017-01-13 23:37:03 +08:00
ITEM_BOOMERANG, // 回旋标
ITEM_BOUNDTHROW, // 投掷斧头
ITEM_BREAKTHROW, // 投掷石
2016-12-24 08:45:52 +08:00
ITEM_DISH =20,
#ifdef _ITEM_INSLAY
ITEM_METAL,
ITEM_JEWEL,
#endif
#ifdef _ITEM_CHECKWARES
2017-01-13 23:37:03 +08:00
ITEM_WARES, //货物
2016-12-24 08:45:52 +08:00
#endif
#ifdef _ITEM_EQUITSPACE
2017-01-13 23:37:03 +08:00
ITEM_WBELT, //腰带
ITEM_WSHIELD, //盾
ITEM_WSHOES, //鞋子
2016-12-24 08:45:52 +08:00
#endif
#ifdef _EQUIT_NEWGLOVE
2017-01-13 23:37:03 +08:00
ITEM_WGLOVE, //手套
2016-12-24 08:45:52 +08:00
#endif
#ifdef _ALCHEMIST
ITEM_ALCHEMIST =30,
#endif
#ifdef _PET_ITEM
ITEM_PET_HEAD,
ITEM_PET_TOOTH,
ITEM_PET_CLAW,
ITEM_PET_BREAST,
ITEM_PET_BACK,
ITEM_PET_WING,
ITEM_PET_FEET,
#endif
#ifdef _ANGEL_SUMMON
//ITEM_ANGELTOKEN,
//ITEM_HEROTOKEN,
#endif
ITEM_CATEGORYNUM,
}ITEM_CATEGORY;
typedef enum
{
ITEM_FIELD_ALL,
ITEM_FIELD_BATTLE,
ITEM_FIELD_MAP,
}ITEM_FIELDTYPE;
typedef enum
{
ITEM_TARGET_MYSELF,
ITEM_TARGET_OTHER,
ITEM_TARGET_ALLMYSIDE,
ITEM_TARGET_ALLOTHERSIDE,
ITEM_TARGET_ALL,
}ITEM_TARGETTYPE;
typedef enum
{
ITEM_ID,
ITEM_BASEIMAGENUMBER,
ITEM_COST,
ITEM_TYPE,
ITEM_ABLEUSEFIELD,
ITEM_TARGET,
ITEM_LEVEL, /* LEVEL */
#ifdef _ITEM_MAXUSERNUM
2017-01-13 23:37:03 +08:00
ITEM_DAMAGEBREAK, //物品使用次数
2016-12-24 08:45:52 +08:00
#endif
#ifdef _ITEMSET4_TXT
2017-01-13 23:37:03 +08:00
ITEM_USEPILENUMS, //物品堆叠次数
ITEM_CANBEPILE, //是否可堆叠
2016-12-24 08:45:52 +08:00
ITEM_NEEDSTR,
ITEM_NEEDDEX,
ITEM_NEEDTRANS,
ITEM_NEEDPROFESSION,
#endif
#ifdef _TAKE_ITEMDAMAGE
ITEM_DAMAGECRUSHE,
ITEM_MAXDAMAGECRUSHE,
#endif
#ifdef _ADD_DEAMGEDEFC
ITEM_OTHERDAMAGE,
ITEM_OTHERDEFC,
#endif
#ifdef _SUIT_ITEM
ITEM_SUITCODE,
#endif
2017-01-13 23:37:03 +08:00
ITEM_ATTACKNUM_MIN, /* 斓 猾荚醒 */
ITEM_ATTACKNUM_MAX, /* 嫖 猾荚醒 */
ITEM_MODIFYATTACK, /* 猾 祭汹 */
ITEM_MODIFYDEFENCE, /* 豢 祭汹 */
ITEM_MODIFYQUICK, /* QUICK 祭汹 */
2016-12-24 08:45:52 +08:00
2017-01-13 23:37:03 +08:00
ITEM_MODIFYHP, /* HP 祭汹 */
ITEM_MODIFYMP, /* MP 祭汹 */
ITEM_MODIFYLUCK, /* LUCK 祭汹 */
ITEM_MODIFYCHARM, /* CHARM 祭汹 */
ITEM_MODIFYAVOID, /* 荚 膜恳 */
ITEM_MODIFYATTRIB, /* 箪岭膜恳 */
ITEM_MODIFYATTRIBVALUE, /* 箪岭膜恳袄 */
ITEM_MAGICID, /* 热诸 寞 */
ITEM_MAGICPROB, /* 热诸 */
ITEM_MAGICUSEMP, /* 壅 MP */
2016-12-24 08:45:52 +08:00
#ifdef _ITEMSET5_TXT
ITEM_MODIFYARRANGE,
ITEM_MODIFYSEQUENCE,
ITEM_ATTACHPILE,
2017-01-13 23:37:03 +08:00
ITEM_HITRIGHT, //额外命中
2016-12-24 08:45:52 +08:00
#endif
#ifdef _ITEMSET6_TXT
ITEM_NEGLECTGUARD,
// ITEM_BEMERGE,
#endif
#ifdef _PETITEM__AMOI_E
ITEM_PETFIX0,
ITEM_PETFIX1,
ITEM_PETFIX2,
ITEM_PETFIX3,
ITEM_PETFIX4,
ITEM_PETFIX5,
ITEM_PETFIX6,
ITEM_PETFIX7,
#endif
2017-01-13 23:37:03 +08:00
/* 旦 □正旦膜恳袄[*/
ITEM_POISON, /* 汹仁凶太卞母丢□斥 */
ITEM_PARALYSIS, /* 仄太木1 及垫 互匹五卅中[ */
ITEM_SLEEP, /* 戽曰[垫 匹五卅中 */
ITEM_STONE, /* 檗[垫 匹五卅中 */
ITEM_DRUNK, /* 办丹[ 互票互月 */
ITEM_CONFUSION, /* 渔刭[ 猾 毛赀月 */
ITEM_CRITICAL, /* 弁伉 奴市伙 膜恳 */
ITEM_USEACTION, /* 银匀凶凛及失弁扑亦件 */
ITEM_DROPATLOGOUT, /* 夫弘失它玄允月凛卞 允井升丹井 */
ITEM_VANISHATDROP, /* 仄凶凛卞壅尹月井升丹井 */
ITEM_ISOVERED, /* 晓卞昙匀井日日木月井升丹井[*/
ITEM_CANPETMAIL, /* 矢永玄丢□伙匹霜木月井 */
ITEM_CANMERGEFROM, /* 宁岳葭卞卅木月井 */
ITEM_CANMERGETO, /* 宁岳燮卞卅木月井 */
ITEM_INGVALUE0, /* 岳坌(5蜊坌) */
2016-12-24 08:45:52 +08:00
ITEM_INGVALUE1,
ITEM_INGVALUE2,
ITEM_INGVALUE3,
ITEM_INGVALUE4,
#ifdef _PETITEM__AMOI_E
ITEM_TYPEOFITEM,
#endif
2017-01-13 23:37:03 +08:00
ITEM_PUTTIME, /* 失奶 丞互 井木凶凛棉 */
ITEM_LEAKLEVEL, /* 怍互升木分仃壬木凶井 */
ITEM_MERGEFLG, /* 宁岳今木凶失奶 丞井升丹井 */
ITEM_CRUSHLEVEL, /* 莽木蘸宁中 0 2 ㄟ反莽木化卅中 2反蝈莽 */
ITEM_VAR1, /* 迕综仅 */
ITEM_VAR2, /* 迕综仅 */
ITEM_VAR3, /* 迕综仅 */
ITEM_VAR4, /* 迕综仅 */
2016-12-24 08:45:52 +08:00
ITEM_TIME,
#ifdef _ITEM_COLOER
ITEM_COLOER,
#endif
ITEM_DATAINTNUM,
}ITEM_DATAINT;
typedef enum
{
2017-01-13 23:37:03 +08:00
ITEM_NAME, /* 蟆 癫及 蟆 */
ITEM_SECRETNAME, /* 蟆 凳今木月第 岭 曰 */
ITEM_EFFECTSTRING, /* 躲绊 侬 */
ITEM_ARGUMENT, /* 失奶 丞及娄醒 */
2016-12-24 08:45:52 +08:00
#ifdef _ITEM_INSLAY
ITEM_TYPECODE,
ITEM_INLAYCODE,
#endif
2017-01-13 23:37:03 +08:00
ITEM_CDKEY, /* 失奶 丞及 蟆毛 赓卞 凳仄凶谛及 */
2016-12-24 08:45:52 +08:00
#ifdef _ITEM_FORUSERNAMES
ITEM_FORUSERNAME,
ITEM_FORUSERCDKEY,
#endif
// CoolFish: 2001/10/11
#ifdef _UNIQUE_P_I
2017-01-13 23:37:03 +08:00
ITEM_UNIQUECODE, /* 物品编码 */
2016-12-24 08:45:52 +08:00
#endif
2017-01-13 23:37:03 +08:00
ITEM_INGNAME0, /* 岳坌及 蟆(5蜊坌) */
2016-12-24 08:45:52 +08:00
ITEM_INGNAME1,
ITEM_INGNAME2,
ITEM_INGNAME3,
ITEM_INGNAME4,
2017-01-13 23:37:03 +08:00
ITEM_INITFUNC, /* 娄醒
2016-12-24 08:45:52 +08:00
* ITEM_Item*
2017-01-13 23:37:03 +08:00
* BOOL
* CHAR_INITFUNC
* */
2016-12-24 08:45:52 +08:00
ITEM_FIRSTFUNCTION = ITEM_INITFUNC,
2017-01-13 23:37:03 +08:00
ITEM_PREOVERFUNC, /* CHAR_PREOVERFUNC 毛辅寰 */
ITEM_POSTOVERFUNC, /* CHAR_POSTOVERFUNC 毛辅寰*/
ITEM_WATCHFUNC, /* CHAR_WATCHFUNC 毛辅寰 */
ITEM_USEFUNC, /* 娄醒反}
* int charaindex 仿
* int charitemindex
*
*
2016-12-24 08:45:52 +08:00
*/
2017-01-13 23:37:03 +08:00
ITEM_ATTACHFUNC, /* 娄醒反}
* int charaindex 仿
* int itemindex
* 仿
*
*
2016-12-24 08:45:52 +08:00
*/
2017-01-13 23:37:03 +08:00
ITEM_DETACHFUNC, /* 娄醒反}
* int charaindex 仿
* int itemindex
* 仿
*
*
2016-12-24 08:45:52 +08:00
*/
2017-01-13 23:37:03 +08:00
ITEM_DROPFUNC, /* 午仄凶午五
*
* int charaindex 仿
* int itemindex
2016-12-24 08:45:52 +08:00
*/
2017-01-13 23:37:03 +08:00
ITEM_PICKUPFUNC, /* 失奶 丞毛胶匀凶凛
*
* int charaindex 仿index
* int itemindex
2016-12-24 08:45:52 +08:00
*/
#ifdef _Item_ReLifeAct
ITEM_DIERELIFEFUNC, /*ANDY_ADD
2017-01-13 23:37:03 +08:00
2016-12-24 08:45:52 +08:00
*/
#endif
#ifdef _PETITEM__AMOI_E
ITEM_PETEQUITALLOW,
ITEM_PETEQUITFORBIT,
#endif
#ifdef _PICKUP_ITEM_OTHER
ITEM_FROMCDKEY,
#endif
ITEM_LASTFUNCTION,
ITEM_DATACHARNUM = ITEM_LASTFUNCTION,
#ifdef _ANGEL_SUMMON
ITEM_ANGELMISSION = ITEM_INGNAME0,
ITEM_ANGELINFO = ITEM_INGNAME1,
ITEM_HEROINFO = ITEM_INGNAME2,
#endif
}ITEM_DATACHAR;
typedef enum
{
ITEM_WORKOBJINDEX,
ITEM_WORKCHARAINDEX,
#ifdef _ITEM_ORNAMENTS
ITEM_CANPICKUP,
#endif
#ifdef _ITEM_TIME_LIMIT
ITEM_WORKTIMELIMIT,
#endif
ITEM_WORKDATAINTNUM,
}ITEM_WORKDATAINT;
//typedef struct tagItem
//{
// int data[ITEM_DATAINTNUM];
// STRING64 string[ITEM_DATACHARNUM];
// int workint[ITEM_WORKDATAINTNUM];
//
// void* functable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
//}ITEM_Item;
typedef struct tagItem
{
int data[ITEM_DATAINTNUM];
STRING64 string[ITEM_DATACHARNUM];
int workint[ITEM_WORKDATAINTNUM];
void* functable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
#ifdef _ALLBLUES_LUA_1_2
lua_State *lua[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
char *luafunctable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
#endif
#ifdef _JZ_NEWSCRIPT_LUA
STRING32 lua_charfunctable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
void* sur_functable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
STRING32 sur_charfunctable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
#endif
}ITEM_Item;
typedef struct tagITEM_table
{
int use;
ITEM_Item itm;
int randomdata[ITEM_DATAINTNUM];
}ITEM_table;
typedef struct tagITEM_exists
{
BOOL use;
ITEM_Item itm;
}ITEM_exists;
#ifdef _PETITEM__AMOI_E
2017-01-13 23:37:03 +08:00
#define ITEM_NOT_LIMIT 0x00000000 //无限制
#define ITEM_NOT_DROP 0x00000010 //不可扔
#define ITEM_NOT_STREETVANDOR 0x00000100 //不可摆店
#define ITEM_NOT_TRADE 0x00001000 //不可交易
#define ITEM_NOT_MAIL 0x00010000 //不可邮寄
2016-12-24 08:45:52 +08:00
#endif
#define ITEM_CHECKINDEX(index) \
_ITEM_CHECKINDEX( __FILE__, __LINE__, index)
INLINE BOOL _ITEM_CHECKINDEX( char *file, int line, int index);
BOOL ITEM_initExistItemsArray( int num );
BOOL ITEM_endExistItemsArray( void );
#define ITEM_initExistItemsOne( itm) \
_ITEM_initExistItemsOne( __FILE__, __LINE__, itm)
int _ITEM_initExistItemsOne( char *file, int line, ITEM_Item* itm );
#define ITEM_endExistItemsOne( index ) \
_ITEM_endExistItemsOne( index, __FILE__, __LINE__)
void _ITEM_endExistItemsOne( int index , char *file, int line);
#define ITEM_getInt( Index, element) _ITEM_getInt( __FILE__, __LINE__, Index, element )
INLINE int _ITEM_getInt( char *file, int line, int index ,ITEM_DATAINT element);
#define ITEM_setInt( Index, element, data) _ITEM_setInt( __FILE__, __LINE__, Index, element, data)
INLINE int _ITEM_setInt( char *file, int line, int index ,ITEM_DATAINT element, int data);
INLINE char* ITEM_getChar( int index ,ITEM_DATACHAR element );
INLINE BOOL ITEM_setChar( int index ,ITEM_DATACHAR element , char* new);
INLINE int ITEM_getWorkInt( int index ,ITEM_WORKDATAINT element);
INLINE int ITEM_setWorkInt( int index ,ITEM_WORKDATAINT element, int data);
INLINE int ITEM_getITEM_itemnum( void );
INLINE int ITEM_getITEM_UseItemnum( void );
INLINE BOOL ITEM_getITEM_use( int index );
void ITEM_constructFunctable( int itemindex );
void* ITEM_getFunctionPointer( int itemindex, int functype );
#ifdef _ALLBLUES_LUA_1_2
typedef struct tagITEM_LuaFunc
{
lua_State *lua;
char luafuncname[128];
char luafunctable[128];
struct tagITEM_LuaFunc *next;
}ITEM_LuaFunc;
INLINE BOOL ITEM_setLUAFunction( int itemindex, int functype, const char *luafuncname);
INLINE lua_State *ITEM_getLUAFunction( int itemindex, int functype);
BOOL ITEM_addLUAListFunction( lua_State *L, const char *luafuncname, const char *luafunctable );
#endif
INLINE ITEM_Item *ITEM_getItemPointer( int index );
int ITEM_getItemMaxIdNum( void);
char* ITEM_makeStringFromItemData( ITEM_Item* one, int mode );
char* ITEM_makeStringFromItemIndex( int index, int mode );
BOOL ITEM_makeExistItemsFromStringToArg( char* src , ITEM_Item* item, int mode );
void ITEM_getDefaultItemSetting( ITEM_Item* itm);
INLINE BOOL ITEM_CHECKITEMTABLE( int number );
BOOL ITEM_readItemConfFile( char* filename );
CHAR_EquipPlace ITEM_getEquipPlace( int charaindex, int itmid );
char* ITEM_makeItemStatusString( int haveitemindex, int itemindex );
char* ITEM_makeItemFalseString( void );
char* ITEM_makeItemFalseStringWithNum( int haveitemindex );
BOOL ITEM_makeItem( ITEM_Item* itm, int number );
int ITEM_makeItemAndRegist( int number );
void ITEM_equipEffect( int index );
void Other_DefcharWorkInt( int index);
char* ITEM_getAppropriateName(int itemindex);
char* ITEM_getEffectString( int itemindex );
int ITEM_getcostFromITEMtabl( int itemid );
#define ITEM_getNameFromNumber( id) _ITEM_getNameFromNumber( __FILE__, __LINE__, id)
INLINE char* _ITEM_getNameFromNumber( char *file, int line, int itemid );
int ITEM_getlevelFromITEMtabl( int itemid );
int ITEM_getgraNoFromITEMtabl( int itemid );
char *ITEM_getItemInfoFromNumber( int itemid );
int ITEM_getdropatlogoutFromITEMtabl( int itemid );
int ITEM_getvanishatdropFromITEMtabl( int itemid );
int ITEM_getcanpetmailFromITEMtabl( int itemid );
int ITEM_getmergeItemFromFromITEMtabl( int itemid );
#ifdef _ITEM_CHECKWARES
BOOL CHAR_CheckInItemForWares( int charaindex, int flg);
#endif
BOOL ITEM_canuseMagic( int itemindex);
// Nuke +1 08/23 : For checking the validity of item target
int ITEM_isTargetValid( int charaindex, int itemindex, int toindex);
int ITEMTBL_getInt( int ItemID, ITEM_DATAINT datatype);
char *ITEMTBL_getChar( int ItemID, ITEM_DATACHAR datatype);
int ITEM_getItemDamageCrusheED( int itemindex);
2017-01-13 23:37:03 +08:00
void ITEM_RsetEquit( int charaindex);//自动卸除装备位置错误之物品
2016-12-24 08:45:52 +08:00
void ITEM_reChangeItemToPile( int itemindex);
void ITEM_reChangeItemName( int itemindex);
#ifdef _SIMPLIFY_ITEMSTRING
void ITEM_getDefaultItemData( int itemID, ITEM_Item* itm);
#endif
#ifdef _PET_ITEM
char* ITEM_petmakeItemStatusString( int petindex, int itemid );
#endif
#endif