• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ITEM_CHECKINDEX函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ITEM_CHECKINDEX函数的典型用法代码示例。如果您正苦于以下问题:C++ ITEM_CHECKINDEX函数的具体用法?C++ ITEM_CHECKINDEX怎么用?C++ ITEM_CHECKINDEX使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ITEM_CHECKINDEX函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: NPC_reCheckItemPilenum

//»¹Ô­ÌúǹÈþ¶Ñµþ
void NPC_reCheckItemPilenum( int meindex, int toindex)
{
	int i, itemindex;
	for( i=0; i<CHAR_MAXITEMHAVE; i++){
		itemindex = CHAR_getItemIndex( toindex , i );
		if( !ITEM_CHECKINDEX( itemindex) ) continue;//ITEM_USEPILENUMS
		if( ITEM_getInt( itemindex, ITEM_ID) != 20284 ) continue;
		if( ITEM_getInt( itemindex, ITEM_CANBEPILE) != 1 ) continue;

		if( ITEM_getInt( itemindex, ITEM_USEPILENUMS) > 1 ){
			int itemID, pilenum=1, newindex;
			itemID = ITEM_getInt( itemindex, ITEM_ID);
			if( !ITEM_CHECKITEMTABLE( itemID) ) continue;
			pilenum = ITEM_getInt( itemindex, ITEM_USEPILENUMS);
			while( pilenum > 1 ){
				int ti = CHAR_findEmptyItemBox( toindex);
				if( ti == -1 ){
					CHAR_sendItemDataOne( toindex, i);
					CHAR_talkToCli( toindex, -1, "µÀ¾ßÀ¸Î»ÒÑÂú¡£", CHAR_COLORYELLOW);
					return;
				}
				newindex = ITEM_makeItemAndRegist( itemID);
				if( !ITEM_CHECKINDEX( newindex) ) break;
				CHAR_setItemIndex( toindex , ti, newindex);
				CHAR_sendItemDataOne( toindex, ti);
				pilenum--;
				ITEM_setInt( itemindex, ITEM_USEPILENUMS, pilenum);
			}
			if( ITEM_getInt( itemindex, ITEM_CANBEPILE) != ITEMTBL_getInt( itemID, ITEM_CANBEPILE) )
				ITEM_setInt( itemindex, ITEM_CANBEPILE, ITEMTBL_getInt( itemID, ITEM_CANBEPILE) );
			CHAR_sendItemDataOne( toindex, i);
		}
	}
	CHAR_talkToCli( toindex, -1, "ÌúǹÈþ´¦ÀíÍê±Ï¡£", CHAR_COLORYELLOW);
}
开发者ID:BlueKarl,项目名称:gmsv,代码行数:36,代码来源:npc_newnpcman.c


示例2: NPC_DepotItem_gettItem

BOOL NPC_DepotItem_gettItem( int meindex, int talkerindex, int num)
{
	int emptyindex;
	int itemindex;

	if( !CHAR_CheckDepotItem( talkerindex) ) return FALSE;

	if( (emptyindex=CHAR_findEmptyItemBox( talkerindex)) == -1 ) return FALSE;
	itemindex = CHAR_getDepotItemIndex( talkerindex, num);
	if( !ITEM_CHECKINDEX( itemindex) )return FALSE;

	CHAR_setDepotItemIndex( talkerindex, num, -1);
	CHAR_setItemIndex( talkerindex, emptyindex, itemindex);
	CHAR_sendItemDataOne( talkerindex, emptyindex);
	
	CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_GOLD);

	LogItem(
		CHAR_getChar( talkerindex, CHAR_NAME ),
		CHAR_getChar( talkerindex, CHAR_CDKEY ),
#ifdef _add_item_log_name
		itemindex,
#else
		ITEM_getInt( itemindex, ITEM_ID),
#endif
		"Depot(取出道具)",
		CHAR_getInt( talkerindex,CHAR_FLOOR),
		CHAR_getInt( talkerindex,CHAR_X ),
 		CHAR_getInt( talkerindex,CHAR_Y ),
		ITEM_getChar( itemindex, ITEM_UNIQUECODE),
		ITEM_getChar( itemindex, ITEM_NAME),
		ITEM_getInt( itemindex, ITEM_ID) );

	{
		int i, cnt=0;
		int work[CHAR_MAXDEPOTITEMHAVE];
		for( i = 0; i < CHAR_MAXDEPOTITEMHAVE; i ++ ) {
			work[i] = -1;
		}
		for( i = 0; i < CHAR_MAXDEPOTITEMHAVE; i ++ ) {
			itemindex = CHAR_getDepotItemIndex( talkerindex, i);
			if( !ITEM_CHECKINDEX( itemindex)) continue;
			work[ cnt++] = itemindex;
		}
		for( i = 0; i < CHAR_MAXDEPOTITEMHAVE; i ++ ) {
			CHAR_setDepotItemIndex( talkerindex, i, work[i]);
		}
	}


	return TRUE;
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:52,代码来源:npc_poolitemshop.c


示例3: NPC_PoolItemShop_DrawItem

static BOOL NPC_PoolItemShop_DrawItem( int meindex, int talkerindex, int num)
{
	int emptyindex;
	int itemindex;
	int i;
	int cnt;
	int work[CHAR_MAXPOOLITEMHAVE];

	emptyindex = CHAR_findEmptyItemBox( talkerindex);
	if( emptyindex == -1 ) return FALSE;
	
	itemindex = CHAR_getPoolItemIndex( talkerindex, num);
	if( !ITEM_CHECKINDEX( itemindex)) {
		fprint( "err\n");
		return FALSE;
	}
	CHAR_setItemIndex( talkerindex, emptyindex, itemindex);
	CHAR_setPoolItemIndex( talkerindex, num, -1);
	CHAR_sendItemDataOne( talkerindex, emptyindex);
	for( i = 0; i < CHAR_MAXPOOLITEMHAVE; i ++ ) {
		work[i] = -1;
	}
	cnt = 0;
	for( i = 0; i < CHAR_MAXPOOLITEMHAVE; i ++ ) {
		itemindex = CHAR_getPoolItemIndex( talkerindex, i);
		if( ITEM_CHECKINDEX( itemindex)) {
			work[ cnt++] = itemindex;
		}
	}
	for( i = 0; i < CHAR_MAXPOOLITEMHAVE; i ++ ) {
		CHAR_setPoolItemIndex( talkerindex, i, work[i]);
	}
	LogItem(
		CHAR_getChar( talkerindex, CHAR_NAME ),
		CHAR_getChar( talkerindex, CHAR_CDKEY ),
#ifdef _add_item_log_name  // WON ADD 在item的log中增加item名稱
		itemindex,
#else
		ITEM_getInt( itemindex, ITEM_ID),
#endif
		"draw(領取道具)",
		CHAR_getInt( talkerindex,CHAR_FLOOR),
		CHAR_getInt( talkerindex,CHAR_X ),
 		CHAR_getInt( talkerindex,CHAR_Y ),
		ITEM_getChar( itemindex, ITEM_UNIQUECODE),
		ITEM_getChar( itemindex, ITEM_NAME),
		ITEM_getInt( itemindex, ITEM_ID)
	);
	return TRUE;
}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:50,代码来源:npc_poolitemshop.c


示例4: NPC_SimpleShopGetEscapedItemString

/*
 * TK¤ÇÁ÷¤ë¤¿¤á¤Î  »ú  ¤ò¤Ä¤¯¤ë¡e
 */
static void NPC_SimpleShopGetEscapedItemString( int shopindex,
                                                int cliindex, char *str )
{
    int i, cost, cl, imageno, itemindex;
    char *itemname;
    char tmp[1024];
    char escapedname[256];
//    char *oli; /* oli means onelineinfo */

    str[0] = '\0';

    /* ¤Þ¤ºÅ¹¤Î  ¤Á  ¤Î¥ê¥¹¥È */
    for( i=CHAR_STARTITEMARRAY;i<CHAR_MAXITEMHAVE;i++ ){
        itemindex=CHAR_getItemIndex( shopindex , i );
        if( ITEM_CHECKINDEX(itemindex) ){
            itemname = ITEM_getChar( itemindex, ITEM_SECRETNAME );
            makeEscapeString( itemname, escapedname, sizeof(escapedname));
            cost = ITEM_getInt( itemindex, ITEM_COST );
            /* ¶â³Û¤ÎÄ´À°¡eMERCHANTLEVEL¤Ë¤è¤Ã¤Æ  ¤ï¤ë¡e */
            cost *= NPC_Util_buyRate(cliindex);
            cl = ITEM_getInt( itemindex, ITEM_LEVEL );
            imageno = ITEM_getInt( itemindex, ITEM_BASEIMAGENUMBER );
            //oli =  ITEM_getMemo( itemindex );
#if 0
            snprintf( tmp, sizeof(tmp), "|%s|%d|%d|%d|%s",
                      escapedname, cost, cl, imageno, oli );
#endif
            snprintf( tmp, sizeof(tmp), "|%s|%d|%d|%d|",
                      escapedname, cost, cl, imageno );
            strcat( str, tmp );
        }
    }

    /* ±­¤Ë¡bµÒ¤Î  ¤Á  ¤Î¥ê¥¹¥È */
    for( i=CHAR_STARTITEMARRAY;i<CHAR_MAXITEMHAVE;i++ ){
        itemindex=CHAR_getItemIndex( cliindex , i );
        if( ITEM_CHECKINDEX(itemindex) ){
            cost = ITEM_getInt( itemindex, ITEM_COST );
            /* ¶â³Û¤ÎÄ´À°¡eMERCHANTLEVEL¤Ë¤è¤Ã¤Æ  ¤ï¤ë¡e */
            cost *=NPC_Util_sellRate(cliindex);
            snprintf( tmp, sizeof(tmp), "|%d", cost );
            strcat( str, tmp );
        }else{
            /* ¥¢¥¤  ¥à¤ò  ¤Ã¤Æ¤Ê¤¤¾ì½ê¤Ë¤Ï0¤ò¤¤¤ì¤ë     */
            strcat( str, "|0" );
        }
    }

}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:52,代码来源:npc_simpleshop.c


示例5: NPC_PAItemShop_reItem

BOOL NPC_PAItemShop_reItem( int itemindex, char *Data)
{
	if( !ITEM_CHECKINDEX( itemindex) )
		return FALSE;

	return TRUE;
}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:7,代码来源:npc_pauctionman.c


示例6: NPC_PAItemShop_BuyDo

BOOL NPC_PAItemShop_BuyDo( int meindex, int toindex, char *npcarg, int select)
{
	int ret=-1, ti;
	int itemindex = NPC_PAItemShop_GetItem( select, &ret);
	int cost;
	char token[256];

	if( !ITEM_CHECKINDEX( itemindex) ){
		return FALSE;
	}

	cost=ITEM_getInt( itemindex, ITEM_COST);
	if( CHAR_DelGold( toindex, cost) == 0 ) return FALSE;

	//匯整資料
	saacproto_ACItemAuction_send( acfd, ITEM_getChar( itemindex, ITEM_NAME), "TEST嘿嘿嘿",
		ITEM_getInt( itemindex, ITEM_ID), ret,AUCTION_DEL);

	ti = CHAR_addItemSpecificItemIndex( toindex, itemindex);
	if( !CHAR_CHECKITEMINDEX( toindex, ti) ){
		ITEM_endExistItemsOne( itemindex);
		print ("\n ret error!!");
		return FALSE;
	}
	CHAR_sendItemDataOne( toindex, ti);
	sprintf( token,"拿到%s",ITEM_getChar( itemindex, ITEM_NAME));
	CHAR_talkToCli( toindex, -1, token, CHAR_COLORYELLOW);

	return TRUE;
}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:30,代码来源:npc_pauctionman.c


示例7: NPC_PAGetMyLimtItem

int NPC_PAGetMyLimtItem(int talker, char *argstr, char* token, int sizes)
{
	char token2[NPC_UTIL_GETARGSTR_LINEMAX];
	int i=1;

	int itemindex;
	int flg=0;
	flg = 0;
	for( i=CHAR_STARTITEMARRAY; i < CHAR_MAXITEMHAVE ; i++ ){

		itemindex = CHAR_getItemIndex( talker , i );
		if( ITEM_CHECKINDEX( itemindex) ){
//==
			char escapedname[256];
			char *eff;
			char name[256];
			int cost = ITEM_getInt( itemindex, ITEM_COST);
			//int rate = 1;
			//cost = (int)(cost * rate);
			strcpy( escapedname, ITEM_getChar( itemindex, ITEM_SECRETNAME));
			makeEscapeString( escapedname, name, sizeof( name));
			eff=ITEM_getChar(itemindex, ITEM_EFFECTSTRING);
			makeEscapeString( eff, escapedname, sizeof(escapedname));
			sprintf(token2,"%s|%d|%d|%d|%s|%d|",
					name, flg, cost, ITEM_getInt( itemindex, ITEM_BASEIMAGENUMBER),
					escapedname, i
			);
//==
			strncat( token, token2, sizeof( token2));
		}
	}
	return 1;
}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:33,代码来源:npc_pauctionman.c


示例8: NPC_Util_moveItemToMap

BOOL NPC_Util_moveItemToMap( int itemindex , int fl , int x , int y,
                             BOOL net )
{
    int oind,cind;

    if( !ITEM_CHECKINDEX( itemindex ) ) return FALSE;

    oind = ITEM_getWorkInt( itemindex , ITEM_WORKOBJINDEX );
    cind = ITEM_getWorkInt( itemindex , ITEM_WORKCHARAINDEX );

    if( oind >= 0 ){
        return MAP_objmove( oind , OBJECT_getFloor(oind),
                     OBJECT_getX(oind),
                     OBJECT_getY(oind),
                     fl,x,y);
    } else if( cind >= 0 ){
        int itemindexinchara = NPC_Util_SearchItemInChar(cind,itemindex);
        if( itemindexinchara == -1 ) return FALSE;

        CHAR_setItemIndex( cind , itemindexinchara , -1 );
        CHAR_complianceParameter(cind);
        if( net ) CHAR_sendItemDataOne( cind, itemindexinchara);
        if( CHAR_DropItemAbsolute( itemindex, fl,x,y,TRUE) < 0 ){
            return FALSE;
        } else {
            return TRUE;
        }
    }
    return FALSE;
}
开发者ID:darciusal,项目名称:stoneagecode,代码行数:30,代码来源:npcutil.c


示例9: NPC_Util_FrontItem

int NPC_Util_FrontItem( int meindex )
{
    int front_x, front_y,objindex,itemindex;
    OBJECT obj;

    CHAR_getCoordinationDir( CHAR_getInt(meindex,CHAR_DIR)
                             , CHAR_getInt(meindex,CHAR_X)
                             , CHAR_getInt(meindex,CHAR_Y)
                             ,1, &front_x, &front_y );
    for( obj=MAP_getTopObj(CHAR_getInt(meindex,CHAR_FLOOR),
                           front_x,front_y );obj;
        obj=NEXT_OBJECT(obj) ){
        objindex = GET_OBJINDEX(obj);
        if( OBJECT_getType(objindex) == OBJTYPE_ITEM ){
            itemindex = OBJECT_getIndex(objindex);
            if(ITEM_CHECKINDEX(itemindex) ){
                return itemindex;
            }else{
                return -1;
            }
        }
    }

    return -1;

}
开发者ID:darciusal,项目名称:stoneagecode,代码行数:26,代码来源:npcutil.c


示例10: NPC_PoolItemShop_MakeItemString_Draw

static void NPC_PoolItemShop_MakeItemString_Draw( int meindex, int talkerindex, 
								char *retstring,int retstringlen)
{
	int		i;
	int		itemindex;
	int		pos = 0;
	char	buff[1024];
		
	retstring[0] = '\0';
	for( i = 0; i < CHAR_MAXPOOLITEMHAVE; i ++ ) {
		itemindex = CHAR_getPoolItemIndex( talkerindex, i);
		if( ITEM_CHECKINDEX( itemindex)) {
			int poolflg = FALSE;
			snprintf( buff, sizeof( buff),
						"%s|%d|%d|%d|%d|%s|",
						ITEM_getChar( itemindex, ITEM_SECRETNAME),
						poolflg,
						ITEM_getInt( itemindex, ITEM_LEVEL),
						ITEM_getInt( itemindex, ITEM_COST),
						ITEM_getInt( itemindex, ITEM_BASEIMAGENUMBER),
						ITEM_getChar( itemindex, ITEM_EFFECTSTRING)
						);
			if( pos +strlen( buff)>= retstringlen) {
				fprint( "buffer over err\n");
				break;
			}
			strcpy( &retstring[pos], buff);
			pos += strlen( buff);
		}
	}
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:31,代码来源:npc_poolitemshop.c


示例11: NPC_PoolItemShop_MakeItemString_Pool

static void NPC_PoolItemShop_MakeItemString_Pool( int meindex, int talkerindex, 
								char *retstring,int retstringlen)
{
	int		i;
	int		itemindex;
	int		pos = 0;
	char	buff[1024];
		
	retstring[0] = '\0';
	for( i = CHAR_STARTITEMARRAY; i < CHAR_MAXITEMHAVE; i ++ ) {
		itemindex = CHAR_getItemIndex( talkerindex, i);
		if( ITEM_CHECKINDEX( itemindex)) {
			int poolflg = FALSE;
			if( ITEM_getInt( itemindex, ITEM_DROPATLOGOUT) || 
				ITEM_getInt( itemindex, ITEM_VANISHATDROP) ||
				!ITEM_getInt( itemindex, ITEM_CANPETMAIL)){
				poolflg = TRUE;
			}
			snprintf( buff, sizeof( buff), 
						"%s|%d|%d|%d|%s|%d|",
						ITEM_getChar( itemindex, ITEM_SECRETNAME),
						poolflg,CHAR_getWorkInt( meindex, NPC_WORK_COST),
						ITEM_getInt( itemindex, ITEM_BASEIMAGENUMBER),
						ITEM_getChar( itemindex, ITEM_EFFECTSTRING),
						i + 1 );
			if( pos +strlen( buff)>= retstringlen) {
				fprint( "buffer over err\n");
				break;
			}
			strcpy( &retstring[pos], buff);
			pos += strlen( buff);
		}
	}
}
开发者ID:ECNU-ZR,项目名称:physwf-c-lab,代码行数:34,代码来源:npc_poolitemshop.c


示例12: BATTLE_ItemUseDelete

int BATTLE_ItemUseDelete(
	int charaindex,
	int haveitemindex
)
{
	int itemindex;

    itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
	if( ITEM_CHECKINDEX( itemindex ) == FALSE ) return 0;
	{
		LogItem(
			CHAR_getChar( charaindex, CHAR_NAME ),
			CHAR_getChar( charaindex, CHAR_CDKEY ),
#ifdef _add_item_log_name  // WON ADD ��item��log������item����
			itemindex,
#else
       		ITEM_getInt( itemindex, ITEM_ID ),
#endif
			"BattleUse(ս����ʹ�õ��ĵ���)",
	       	CHAR_getInt( charaindex,CHAR_FLOOR),
			CHAR_getInt( charaindex,CHAR_X ),
        	CHAR_getInt( charaindex,CHAR_Y ),
			ITEM_getChar( itemindex, ITEM_UNIQUECODE),
					ITEM_getChar( itemindex, ITEM_NAME),
					ITEM_getInt( itemindex, ITEM_ID)
		);
	}
	CHAR_DelItemMess( charaindex, haveitemindex, 0);

	return 0;
}
开发者ID:BlueKarl,项目名称:gmsv,代码行数:31,代码来源:battle_item.c


示例13: ITEM_useAttReverse_Battle

//--------------------------------------------------------------
//  ����  ��ʧ��  ةë��������������
//--------------------------------------------------------------
// ��    ������
void ITEM_useAttReverse_Battle(
	int charaindex, 	// �������м��̼������͵�
	int toNo, 			// ����ľ���м�  į
	int haveitemindex 	// �����м�ʧ��  ة��    į
)
{
	int itemindex, battleindex, attackNo;


	// ʧ��  ة��ؤ�¾�������
    itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
    if(!ITEM_CHECKINDEX(itemindex)) return;

	//------- �������   -----------
	battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );

	attackNo = BATTLE_Index2No( battleindex, charaindex );

	// �幻
	BATTLE_MultiAttReverse( battleindex, attackNo, toNo,
		SPR_item3, SPR_kyu );

	// ��    ��ʧ��  ة����������������ɧ��
	BATTLE_ItemUseDelete( charaindex, haveitemindex );


}
开发者ID:BlueKarl,项目名称:gmsv,代码行数:31,代码来源:battle_item.c


示例14: ITEM_useFieldChange_Battle

//--------------------------------------------------------------
//  ¥Õ¥£¡¼¥ë¥É°À­  ¹¹¥¢¥¤  ¥à¤ò»È¤Ã¤¿¾ì¹ç¤Î½è  
//--------------------------------------------------------------
// Àï    ¤Î¾ì¹ç
void ITEM_useFieldChange_Battle(
	int charaindex, 	// »È¤Ã¤¿¿Í¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹
	int toNo, 			// »È¤ï¤ì¤ë¿Í¤Î  ¹æ
	int haveitemindex 	// »È¤¦¿Í¤Î¥¢¥¤  ¥à¤Î    ¹æ
)
{
	int itemindex;
	char *pArg;

	// ¥¢¥¤  ¥à¤¬¤¢¤ë¤«¤É¤¦¤«
    itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
    if(!ITEM_CHECKINDEX(itemindex)) return;

	//------- ¤³¤³¤«¤é½è   -----------
	// ¥Ñ¥é¥á¡¼¥¿¤ò¼è  
	pArg = ITEM_getChar(itemindex, ITEM_ARGUMENT );

	// ¥Ñ¥é¥á¡¼¥¿  ¤¤¤Î¤Ç¼º  
	if( pArg == NULL )return ;

	BATTLE_FieldAttChange( charaindex, pArg );

	// Àï    ¤Ë¥¢¥¤  ¥à¤¬¾Ã¤¨¤¿¾ì¹ç¤Î¶¦ÄÌ½è  
	BATTLE_ItemUseDelete( charaindex, haveitemindex );

}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:30,代码来源:battle_item.c


示例15: BATTLE_ItemUseDelete

int BATTLE_ItemUseDelete(
	int charaindex,
	int haveitemindex
)
{
	int itemindex;

    itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
	if( ITEM_CHECKINDEX( itemindex ) == FALSE ) return 0;
	{
		LogItem(
			CHAR_getChar( charaindex, CHAR_NAME ),
			CHAR_getChar( charaindex, CHAR_CDKEY ),
#ifdef _add_item_log_name  // WON ADD ¦bitemªºlog¤¤¼W¥[item¦WºÙ
			itemindex,
#else
       		ITEM_getInt( itemindex, ITEM_ID ),
#endif
			"BattleUse(¾Ô°«¤¤¨Ï¥Î±¼ªº¹D¨ã)",
	       	CHAR_getInt( charaindex,CHAR_FLOOR),
			CHAR_getInt( charaindex,CHAR_X ),
        	CHAR_getInt( charaindex,CHAR_Y ),
			ITEM_getChar( itemindex, ITEM_UNIQUECODE),
					ITEM_getChar( itemindex, ITEM_NAME),
					ITEM_getInt( itemindex, ITEM_ID)
		);
	}
	CHAR_DelItemMess( charaindex, haveitemindex, 0);

	return 0;
}
开发者ID:ChowZenki,项目名称:SMO-Sa-Source,代码行数:31,代码来源:battle_item.c


示例16: NPC_SimpleShopProcessBuyMsg

static BOOL NPC_SimpleShopProcessBuyMsg(char *msg, int shopindex,
                                        int playerindex )
{
    int shopwindowindex, itemtableindex,itemind;
    int price, tmpgold;
    char buf[64];

    if(!CHAR_CHECKINDEX(shopindex)||!CHAR_CHECKINDEX(playerindex))
        return -1;

    if( !getStringFromIndexWithDelim( msg,"|",4,buf,sizeof(buf) )){
        return -1;
    }
    shopwindowindex = atoi(buf);
    itemtableindex=NPC_ShopWindowIndexToItemTableIndex( shopindex, shopwindowindex );
    itemind = CHAR_getItemIndex(shopindex,itemtableindex );
    if( ! ITEM_CHECKINDEX(itemind) ) return -1;
    price = ITEM_getInt( itemind, ITEM_COST )
        * NPC_Util_buyRate(playerindex);

    tmpgold = CHAR_getInt(playerindex,CHAR_GOLD);
    if( tmpgold < price ){
        return -2;
    }

    if( ! NPC_Util_moveItemToChar(playerindex,itemind,TRUE ) ){
        return -3;
    }
	CHAR_AddGold( playerindex, price );

    CHAR_sendStatusString( playerindex , "P");
    return 1;
}
开发者ID:darciusal,项目名称:stoneagecode,代码行数:33,代码来源:npc_simpleshop.c


示例17: ITEM_useFieldChange_Battle

//--------------------------------------------------------------
//  ��ū����������  ��ʧ��  ةë��������������
//--------------------------------------------------------------
// ��    ������
void ITEM_useFieldChange_Battle(
	int charaindex, 	// �������м��̼������͵�
	int toNo, 			// ����ľ���м�  į
	int haveitemindex 	// �����м�ʧ��  ة��    į
)
{
	int itemindex;
	char *pArg;

	// ʧ��  ة��ؤ�¾�������
    itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
    if(!ITEM_CHECKINDEX(itemindex)) return;

	//------- �������   -----------
	// �ɷ¶�����ë��
	pArg = ITEM_getChar(itemindex, ITEM_ARGUMENT );

	// �ɷ¶�����  �м�ƥ��
	if( pArg == NULL )return ;

	BATTLE_FieldAttChange( charaindex, pArg );

	// ��    ��ʧ��  ة����������������ɧ��
	BATTLE_ItemUseDelete( charaindex, haveitemindex );

}
开发者ID:BlueKarl,项目名称:gmsv,代码行数:30,代码来源:battle_item.c


示例18: NPC_QuizItemFullCheck

BOOL NPC_QuizItemFullCheck(int meindex,int talker)
{
    int i;
    int itemindex;
    char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
    char buf2[32];


    for( i = CHAR_STARTITEMARRAY ; i < CHAR_MAXITEMHAVE ; i++ ) {
        itemindex = CHAR_getItemIndex( talker , i );
        if( !ITEM_CHECKINDEX( itemindex) ) {
            return TRUE;
        }
    }

    if(NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr)) == NULL)
    {
        print("GetArgstrErr:Quiz %s",CHAR_getChar( meindex, CHAR_NAME));
    }

    if(NPC_Util_GetStrFromStrWithDelim( argstr,"EntryItem",	buf2, sizeof( buf2)) != NULL)
    {
        if(NPC_EntryItemCheck( talker, buf2) == FALSE) {
            NPC_Quiz_selectWindow( meindex, talker, 3);
            return  FALSE;

        } else {
            return TRUE;
        }
    }


    return FALSE;

}
开发者ID:darciusal,项目名称:stoneagecode,代码行数:35,代码来源:npc_quiz.c


示例19: NPC_BusCheckDeniedItem

/**************************************
 * ϶�ý�ľ��ʧ��  ةë  �Ȼ����¾�������������
 *   �Ȼ������շֻ�
 **************************************/
static BOOL NPC_BusCheckDeniedItem( int meindex, int charaindex, char *argstr)
{
	char	buf[1024];
	BOOL	found = TRUE;

	if( NPC_Util_GetStrFromStrWithDelim( argstr, "denieditem", buf, sizeof( buf))
		!= NULL ) 
	{
		int	i;
		int ret;
		for( i = 1; ; i ++) {
			int itemid;
			char buf2[64];
			int j;
			ret = getStringFromIndexWithDelim( buf, ",", i, buf2, sizeof(buf2));
			if( ret == FALSE ) break;
			itemid = atoi( buf2);
			for( j = 0; j < CHAR_MAXITEMHAVE; j ++) {
				int itemindex = CHAR_getItemIndex( charaindex, j);
				if( ITEM_CHECKINDEX( itemindex)) {
					if( ITEM_getInt( itemindex, ITEM_ID) == itemid) {
						found = FALSE;
						break;
					}
				}
			}
		}
	}
	return found;
}
开发者ID:ChowZenki,项目名称:Long-Sa-Source,代码行数:34,代码来源:npc_bus.c


示例20: NPC_Util_RemoveItemByID

/*
 * キャラクターがもっているアイテムを1個抹消する。そのアイテムは
 * アイテムIDで指定する。アイテム表を前から検索していって、
 * 最初にヒットしたやつを削除する。
 * 
 * int charindex : キャラクタのindex
 * int itemid : アイテムのID . itemset.txt に記述されている。
 * BOOL net:    ネットワークをするかどうか。TRUEだとする。
 *
 * アイテムをもっていて削除できたら TRUE , 削除できなかったらFALSE
 */
BOOL NPC_Util_RemoveItemByID( int charindex, int itemid, BOOL net )
{
    int i;

    for(i=0;i<CHAR_MAXITEMHAVE;i++){
        int ii = CHAR_getItemIndex( charindex , i);
        if( ITEM_CHECKINDEX(ii)
            && ITEM_getInt( ii, ITEM_ID ) == itemid){
            /* キャラクタがもっているアイテムを*/
            CHAR_setItemIndex( charindex , i , -1 );
            /*
             * そのアイテムを世界から消去する。
             * つまりアイテム表から抹消する
             */
            ITEM_endExistItemsOne( ii );
            /*  両手持ち武器    */
            if( ii == CHAR_ARM1 && CHAR_getItemIndex(charindex,CHAR_ARM2)
                == -2 )
                CHAR_setItemIndex(charindex,CHAR_ARM2,-1);

            if(net)CHAR_sendStatusString( charindex, "I");
            return TRUE;
        }
    }
    return FALSE;
}
开发者ID:kengonakajima,项目名称:snippets,代码行数:37,代码来源:npcutil.c



注:本文中的ITEM_CHECKINDEX函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ITEM_GiveAmmo函数代码示例发布时间:2022-05-30
下一篇:
C++ ITEMGET函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap