Ejemplo n.º 1
0
void NPC_BlackMarketWindowTalked( int index, int talker, int seqno, int select, char *data)
{
	int  i;
	char sBuf[1024]="", sBuf1[256]="";
    
    if(!CHAR_CHECKINDEX( talker)) return;	
    if(getfdFromCharaIndex( talker)==-1) return;
	if(CHAR_getInt( talker, CHAR_WHICHTYPE)!=CHAR_TYPEPLAYER) return;    
    if(NPC_Util_isFaceToFace( talker, index, 1)!=TRUE) return;
        
    if( seqno == CHAR_WINDOWTYPE_BLACKMARKET){
		for(i=0; i<12; i++){
		    CONNECT_set_BMList( getfdFromCharaIndex( talker), i, BMSellList[i]);		    
		    sprintf( sBuf1, "%d|%d|%s\n", BMSellList[i], BMItem[BMSellList[i]].iGraphicsNum, BMItem[BMSellList[i]].iName); 
		    strcat( sBuf, sBuf1);
		}

	    lssproto_WN_send( getfdFromCharaIndex( talker), 
		                  WINDOW_MESSAGETYPE_BLACKMARKET, 
		                  WINDOW_BUTTONTYPE_NONE,
				    	  CHAR_WINDOWTYPE_BLACKMARKET,
				          CHAR_getWorkInt( index, CHAR_WORKOBJINDEX),
					      sBuf );
	}
}
Ejemplo n.º 2
0
void NPC_NewNpcManWindowTalked( int meindex, int talkerindex, int seqno, int select, char *data)
{
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
			return;
	}

	if( select == WINDOW_BUTTONTYPE_CANCEL || select == WINDOW_BUTTONTYPE_NO){
		CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
		CHAR_setWorkInt( talkerindex, CHAR_WORKNPCMETAMO, -1);
		return;
	}
	switch( seqno)	{
	case NPC_TRANSERMAN_START:
		break;
	case NPC_PROGRAMEGINEER_SELECT1:
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_SELECT1, atoi( data));
		break;
	case NPC_PROGRAMEGINEER_SELECT2:
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_SELECT2, atoi( data));
		break;
	case NPC_PROGRAMEGINEER_SELECT3:
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_SELECT3, atoi( data));
		break;
	case NPC_PROGRAMEGINEER_SELECTLOSTPET:
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_SELECTLOSTPET, atoi( data));
		break;
	case NPC_PROGRAMEGINEER_DEFIND:
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_DEFIND, atoi( data));
		break;
	case NPC_PROGRAMEGINEER_END:
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_END, atoi( data));
		break;
	}
}
Ejemplo n.º 3
0
/*********************************
*   ¤·¤«¤±¤é¤ì¤¿»þ¤Î½è  
*********************************/
void NPC_LuckyManTalked( int meindex , int talkerindex , char *szMes ,int color )
{

	char argstr1[NPC_UTIL_GETARGSTR_BUFSIZE];
	char *argstr;
	char buf[256];
	char token[512];
	int cost;



	/*--  ¤ÎÁ°¤Ë¤¤¤ë¤«¤É¤¦¤«¡ª--*/
	if(NPC_Util_isFaceToFace( meindex ,talkerindex ,2) == FALSE) {
		/* £±¥°¥ê¥Ã¥É°Ê  ¤Î¤ß */
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE) return;
	}
	
	/*--ÀßÄê¥Õ¥¡¥¤¥ë¤ò  ¤ß  ¤ß--*/
	if((argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1)))== NULL) {
		print("NPC_ExChange.c TypeCheck: GetArgStrErr\n");
		print("NPCName=%s\n", CHAR_getChar( meindex, CHAR_NAME));
		return;
	}


	NPC_Util_GetStrFromStrWithDelim( argstr,"Stone", buf, sizeof( buf));
	cost = NPC_GetMoney( meindex, talkerindex, buf);

	NPC_Util_GetStrFromStrWithDelim( argstr,"main_msg", buf, sizeof( buf));
	sprintf( token, buf, cost);
	
	NPC_LuckyMan_selectWindow( meindex, talkerindex, 2, token);

}
Ejemplo n.º 4
0
/*********************************
*   Øƾ®ØêÈÕľÐ×Áݼ°ÖÊ  
*********************************/
void NPC_LuckyManTalked( int meindex , int talkerindex , char *szMes ,int color )
{

	char argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
	char buf[256];
	char token[512];
	int cost;



	/*--  ¼°ó¡±åÖÐÔ¾®Éýµ¤¾®£¢--*/
	if(NPC_Util_isFaceToFace( meindex ,talkerindex ,2) == FALSE) {
		/* ¨àºëØøÓÀÓñ¶¯  ¼°ÐÄ */
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE) return;
	}
	
	/*--ɬÀð×ÑëÄÌ»ïë  ÐÄ  ÐÄ--*/
	if(NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr)) == NULL) {
		print("NPC_ExChange.c TypeCheck: GetArgStrErr\n");
		print("NPCName=%s\n", CHAR_getChar( meindex, CHAR_NAME));
		return;
	}


	NPC_Util_GetStrFromStrWithDelim( argstr,"Stone", buf, sizeof( buf));
	cost = NPC_GetMoney( meindex, talkerindex, buf);

	NPC_Util_GetStrFromStrWithDelim( argstr,"main_msg", buf, sizeof( buf));
	sprintf( token, buf, cost);
	
	NPC_LuckyMan_selectWindow( meindex, talkerindex, 2, token);

}
Ejemplo n.º 5
0
void NPC_AlldomanTalked( int meindex , int talker , char *msg ,int color )
{
     if( NPC_Util_CharDistance( talker, meindex ) > 1) return;
     if( NPC_Util_isFaceToFace( talker, meindex , 1 ) == FALSE ) return;
	 showpage = 1 ; 
	 NPC_Alldoman_selectWindow(meindex, talker , 4 ,"");
}
Ejemplo n.º 6
0
//对话时的处理
void NPC_VeryWelfareTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    if( NPC_Util_isFaceToFace( talkerindex, meindex , 1 ) == FALSE )
        return;
    //开始的选择画面
	NPC_VeryWelfare_selectWindow( meindex, talkerindex, 0, -1);
}
Ejemplo n.º 7
0
void NPC_SimpleShopTalked( int meindex, int talker, char *msg, int color )
{
#define SHOPRANGE 3
    char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE], token[NPC_UTIL_GETARGSTR_LINEMAX];
    if( CHAR_getInt( talker,CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ){
        return;
    }
    if( NPC_Util_charIsInFrontOfChar( talker, meindex, SHOPRANGE )
        && ! CHAR_getFlg( talker,CHAR_ISDIE )  ){
        NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg));
        getStringFromIndexWithDelim( npcarg,"|", OPENSHOPTOKEN,token, sizeof(token));
        if( NPC_SimpleShopOpenShopOrNot( msg, token )
           && NPC_Util_isFaceToFace( meindex, talker, SHOPRANGE ) ){
            CHAR_setWorkInt( meindex, CHAR_WORKSHOPCLIENTINDEX, talker );
            NPC_SimpleShopOpenShopWindow( meindex, talker, npcarg );
        }else{
            int tokennum;
            int i;
            char tmp[NPC_UTIL_GETARGSTR_LINEMAX];
            getStringFromIndexWithDelim( npcarg,"|", MSGTOKEN,token, sizeof(token));
            tokennum = 1;
            for( i=0;token[i]!='\0';i++ ){
                if( token[i] == ',' ) tokennum++;
            }
            getStringFromIndexWithDelim( token,",", rand()%tokennum+1,tmp, sizeof(tmp));
            CHAR_talkToCli( talker, meindex, tmp, CHAR_COLORWHITE );
        }
    }
}
Ejemplo n.º 8
0
static void NPC_TranserMan_selectWindow( int meindex, int toindex, int num,int select)
{
	char npcarg1[NPC_UTIL_GETARGSTR_BUFSIZE];
	char *npcarg;
	char token[256];

	int buttontype = 0, windowtype = 0, windowno = 0;
	int fd = getfdFromCharaIndex( toindex);

	windowtype = WINDOW_MESSAGETYPE_MESSAGE;

	if(NPC_Util_isFaceToFace( meindex ,toindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( toindex, meindex, 1) == FALSE)
			return;
	}

	//memset( npcarg, 0, sizeof( npcarg));
	if((npcarg = NPC_Util_GetArgStr( meindex, npcarg1, sizeof(npcarg1)))==NULL){
		print("TRANSER_MAN: GetArgStrErr!!");
		return;
	}
	memset( token, 0, sizeof( token));

	switch( num)	{
	case WINDOW_START:
		if( NPC_Util_GetStrFromStrWithDelim( npcarg, "START_MSG", token, sizeof( token) ) == NULL) {
			print("TranserMan Get START_MSG ERROR !");
			return;
		}
		CHAR_setWorkInt( toindex, CHAR_WORKSHOPRELEVANT, WINDOW_START);
		buttontype = WINDOW_BUTTONTYPE_YESNO;
		windowno = NPC_TRANSERMAN_SELECT;
		break;
	case WINDOW_SELECT:
		if( TranserMan_GetMenuStr( meindex, toindex, npcarg, token) == FALSE )	{
			print( "TranserMan GetMenu ERROR !!");
			return;
		}
		windowtype = WINDOW_MESSAGETYPE_SELECT;
		buttontype = WINDOW_BUTTONTYPE_CANCEL;
		windowno = NPC_TRANSERMAN_WARP;
		break;
	case WINDOW_WARP:
		if( ActionNpc_CheckMenuFree( meindex, toindex, npcarg, select) == FALSE ){
			memset( token, 0, sizeof( token));
			if( NPC_Util_GetStrFromStrWithDelim( npcarg, "FAIL_MSG", token, sizeof( token) ) != NULL) {
				CHAR_talkToCli( toindex, meindex, token, CHAR_COLORYELLOW);
			}
		}
		return;

	case WINDOW_END:
		break;
	}

	lssproto_WN_send( fd, windowtype, buttontype, windowno,
		CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX), token);
}
void NPC_PetRaceMasterTalked( int meindex , int talkerindex , char *szMes , int color )
{
	// ©|¶··s¼W»¡©ú¥H¤ÎÃdª«ª¬ªp
	if (CHAR_getInt(talkerindex, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER)
		return;
	if (NPC_Util_isFaceToFace(talkerindex, meindex, 2) == FALSE)
		if (NPC_Util_CharDistance(talkerindex, meindex) > 1)
			return;
	NPC_PetRaceMaster_selectWindow(meindex, talkerindex, 0, -1);
}
Ejemplo n.º 10
0
void NPC_PetSkillShopTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
    	return;
    }
	if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE){
		if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
	}
	NPC_PetSkillShop_selectWindow( meindex, talkerindex,0,-1);
}
Ejemplo n.º 11
0
void NPC_TimeManTalked( int meindex , int talkerindex , char *msg ,int color )
{
	char	argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
	char token[512];
	char buf[512];
	int tokennum=0;
	int i;


	/*--目の前にいるかどうか?--*/
	if(NPC_Util_isFaceToFace( meindex ,talkerindex ,2)==FALSE){
		/* 1グリッド以内のみ */
		if( NPC_Util_CharDistance( talkerindex ,meindex ) > 1) return;
	}

	if(CHAR_getInt(meindex,CHAR_BASEIMAGENUMBER)==9999){
		/*--消えているモード--*/
		return;
	}

	if(NPC_Util_GetArgStr( meindex, argstr, sizeof(argstr))==NULL){
		print("GetArgStrErr");	
		return;
	}
	

	if( CHAR_getInt(talkerindex,CHAR_WHICHTYPE) != CHAR_TYPEPLAYER )return;
	
	if( NPC_Util_charIsInFrontOfChar( talkerindex, meindex, 3 ) ==FALSE) return;




	if(CHAR_getWorkInt(meindex,E_INT_MODE)==0){
		/*--メッセージを返す */
		NPC_Util_GetStrFromStrWithDelim(argstr,"main_msg",buf,sizeof( buf) );
 	
 	}else{
 		/*グラフィックNOを変えただけなので、違うメッセージを返す */
		NPC_Util_GetStrFromStrWithDelim(argstr,"change_msg",buf,sizeof( buf) );
 	}

   	tokennum = 1;
   	/* コンマで区切られたトークンが何こあるか数える */
	 for( i=0;buf[i]!='\0';i++ ){
          if( buf[i] == ',' ) tokennum++;
     }
 
    /* ランダムでどれを喋るか決めて、そのトークンを取りだす */
    getStringFromIndexWithDelim( buf,",", rand()%tokennum+1,token, sizeof(token));
	/*--しゃべる--*/
	CHAR_talkToCli( talkerindex, meindex, token, CHAR_COLORWHITE );


}
Ejemplo n.º 12
0
void NPC_PauctionManTalked( int meindex, int talkerindex, char *msg, int color )
{
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    		return;
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
			return;
	}   
	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
	NPC_Pauctionman_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
Ejemplo n.º 13
0
void NPC_FreePetSkillShopTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
    	return;
    }
	if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE){
		if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
	}
	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 1 );

	NPC_FreePetSkillShop_selectWindow( meindex, talkerindex, START_WINDOW,-1);
}
Ejemplo n.º 14
0
void NPC_PoolItemShopTalked( int meindex , int talkerindex , 
							char *szMes ,int color )
{
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
		return;
	}
	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
	if( !NPC_Util_isFaceToFace( meindex, talkerindex, 2)) {
		if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
	}
	NPC_PoolItemShop_printWindow_Start( meindex, talkerindex);
}
Ejemplo n.º 15
0
/*********************************
* watch質  
*********************************/
void NPC_ActionWatch( int meobjindex, int objindex, CHAR_ACTION act,
                    int x,int y,int dir, int* opt,int optlen )
{
	int		meindex;
	int		index;
	char	argstr1[NPC_UTIL_GETARGSTR_BUFSIZE];
	char *argstr;
	char	buf[64];
	int		i;
    struct  {
    	CHAR_ACTION		act;
    	char			*string;
    }searchtbl[] = {
	    { CHAR_ACTATTACK,	"attack"},
	    { CHAR_ACTDAMAGE,	"damage"},
		{ CHAR_ACTDOWN,		"down"},
		{ CHAR_ACTSIT,		"sit"},
		{ CHAR_ACTHAND,		"hand"},
		{ CHAR_ACTPLEASURE,	"pleasure"},
		{ CHAR_ACTANGRY,	"angry"},
		{ CHAR_ACTSAD,		"sad"},
		{ CHAR_ACTGUARD,	"guard"},
		{ CHAR_ACTNOD,		"nod"},
		{ CHAR_ACTTHROW,	"throw"},
    };
	
	if( OBJECT_getType( objindex) != OBJTYPE_CHARA) return;
	index = OBJECT_getIndex( objindex);
	/* 皿伊奶乩□卞及心  殺允月 */
	if( CHAR_getInt( index, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER) return;
    
    meindex = OBJECT_getIndex( meobjindex);
    
    /* 輊五寧勻化ㄠ弘伉永玉匹卅中午  殺仄卅中 */
    if( NPC_Util_isFaceToFace( meindex, index, 1 ) != TRUE ) return;
	
	argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1));
	
	for( i = 0; i < arraysizeof( searchtbl); i ++ ) {
		if( searchtbl[i].act == act) {
			if( NPC_Util_GetStrFromStrWithDelim( argstr, 
												searchtbl[i].string,
												buf, sizeof( buf))
		    	!= NULL )
			{
		    	CHAR_talkToCli( index, meindex ,buf , 
		    					CHAR_getWorkInt( meindex, CHAR_WORK_MSGCOLOR ));
				break;
			}
		}
	}
}
Ejemplo n.º 16
0
void NPC_TimeManTalked( int meindex , int talkerindex , char *msg ,int color )
{
	char	argstr[NPC_UTIL_GETARGSTR_BUFSIZE];
	char token[512];
	char buf[512];
	int tokennum=0;
	int i;


	if(NPC_Util_isFaceToFace( meindex ,talkerindex ,2)==FALSE){
		if( NPC_Util_CharDistance( talkerindex ,meindex ) > 1) return;
	}

	if(CHAR_getInt(meindex,CHAR_BASEIMAGENUMBER)==9999){
		/*--壅尹化中月乒□玉--*/
		return;
	}

	if(NPC_Util_GetArgStr( meindex, argstr, sizeof(argstr))==NULL){
		print("GetArgStrErr");	
		return;
	}
	

	if( CHAR_getInt(talkerindex,CHAR_WHICHTYPE) != CHAR_TYPEPLAYER )return;
	
	if( NPC_Util_charIsInFrontOfChar( talkerindex, meindex, 3 ) ==FALSE) return;




	if(CHAR_getWorkInt(meindex,E_INT_MODE)==0){
		/*--丢永本□斥毛忒允 */
		NPC_Util_GetStrFromStrWithDelim(argstr,"main_msg",buf,sizeof( buf) );
 	
 	}else{
		NPC_Util_GetStrFromStrWithDelim(argstr,"change_msg",buf,sizeof( buf) );
 	}

   	tokennum = 1;
   	/* 戊件穴匹嗉濠日木凶玄□弁件互窒仇丐月井醒尹月 */
	 for( i=0;buf[i]!='\0';i++ ){
          if( buf[i] == ',' ) tokennum++;
     }
 
    getStringFromIndexWithDelim( buf,",", rand()%tokennum+1,token, sizeof(token));
	/*--仄扎屯月--*/
	CHAR_talkToCli( talkerindex, meindex, token, CHAR_COLORWHITE );


}
Ejemplo n.º 17
0
/*********************************
*   仄井仃日木凶凛及质  
*********************************/
void NPC_CharmTalked( int meindex , int talkerindex , char *szMes ,int color )
{

    /* 皿伊奶乩□卞覆仄化分仃  杀允月 */
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    {
    	return;
    }
	
	/*--  及蟆卞中月井升丹井"--*/
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		/* ㄠ弘伉永玉动  及心 */
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE) return;
	}

	NPC_Charm_selectWindow( meindex, talkerindex, 0);
}
Ejemplo n.º 18
0
void NPC_PetFusionManTalked( int meindex, int talkerindex, char *msg, int color )
{
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    		return;
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
			return;
	}
#ifdef _ITEM_CHECKWARES
	if( CHAR_CheckInItemForWares( talkerindex, 0) == FALSE ){
		CHAR_talkToCli( talkerindex, meindex, "無法服務攜帶貨物的人!", CHAR_COLORYELLOW);
		return;
	}
#endif

	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, WINDOW_START);
	NPC_PetFusion_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
Ejemplo n.º 19
0
void NPC_BlackMarketTalked( int meindex, int talker, char *msg, int color)
{		
	char sBuf[512]="", tBuf[512]="";
	if(!CHAR_CHECKINDEX( talker)) return;	
    if(getfdFromCharaIndex( talker)==-1) return;
	if(CHAR_getInt( talker, CHAR_WHICHTYPE)!=CHAR_TYPEPLAYER) return;    
    if(NPC_Util_isFaceToFace( talker, meindex, 1)!=TRUE) return;
		
	sprintf( tBuf, "嘿嘿....\n在我这边有各式各样的武器、防具及道具,你想要跟我交换吗?换好了可就不能反悔喔~");

	lssproto_WN_send(getfdFromCharaIndex( talker), 
	                 WINDOW_MESSAGETYPE_MESSAGE,
        	         WINDOW_BUTTONTYPE_OK,
                     CHAR_WINDOWTYPE_BLACKMARKET,
 		             CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX),
		             makeEscapeString( tBuf, sBuf, sizeof(sBuf)));   	
	return;
}
Ejemplo n.º 20
0
void NPC_MakePairManTalked( int meindex, int talkerindex, char *msg, int color )
{
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    		return;
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
			return;
	}
#ifdef _ITEM_CHECKWARES
	if( CHAR_CheckInItemForWares( talkerindex, 0) == FALSE ){
		CHAR_talkToCli( talkerindex, meindex, "无法服务携带货物的人!", CHAR_COLORYELLOW);
		return;
	}
#endif
	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
	CHAR_setWorkInt( talkerindex, CHAR_MYPAIRCODE, NPC_getPairCode( talkerindex));
	NPC_MakePair_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
Ejemplo n.º 21
0
/*********************************
*   仄井仃日木凶凛及质
*********************************/
void NPC_FMPKManTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    /* 皿伊奶乩□卞覆仄化分仃  杀允月 */
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
        return;
    }

    /*--  及蟆卞中月井升丹井"--*/
    if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE) {
        /* ㄠ弘伉永玉动  及心 */
        if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
    }

    /*--伐□弁及赓渝祭--*/
    CHAR_setWorkInt(talkerindex, CHAR_WORKSHOPRELEVANT, 0);

    /*-反元户及蓟      --*/
    NPC_FMPKMan_selectWindow( meindex, talkerindex, 0, -1);
}
Ejemplo n.º 22
0
/*********************************
*   Ў∆ЊЃЎк»’ƒЊ–„ЅЁЉ∞÷   
*********************************/
void NPC_CheckManTalked( int meindex , int talkerindex , char *szMes ,int color )
{

    /* √у“ЅƒћЎј°х±еЄ≤Ў∆їѓЈ÷Ўк  …±‘ ‘¬ */
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    {
    	return;
    }

	/*--  Љ∞у°±е÷–‘¬ЊЃ…эµ§ЊЃ£¢--*/
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		/* ®аЇлЎш”ј”с∂ѓ  Љ∞–ƒ */
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE) return;
	}

	//  вўЉ∞ЋьƒћЉю”сЋь±е
	NPC_CheckMan_selectWindow( meindex, talkerindex, 0);

}
Ejemplo n.º 23
0
/*********************************
*   Øƾ®ØêÈÕľÐ×Áݼ°ÖÊ  
*********************************/
void NPC_FMPKManTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    /* ÃóÒÁÄÌØÀ¡õ±å¸²ØÆ»¯·ÖØê  É±ÔÊÔ */
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
    	return;
    }
	
	/*--  ¼°ó¡±åÖÐÔ¾®Éýµ¤¾®£¢--*/
	if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE){
		/* ¨àºëØøÓÀÓñ¶¯  ¼°ÐÄ */
		if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
	}

	/*--·¥¡õÛͼ°âÙÓå¼À--*/
	CHAR_setWorkInt(talkerindex, CHAR_WORKSHOPRELEVANT, 0);

	/*-·´Ôª»§¼°¼»      --*/
	NPC_FMPKMan_selectWindow( meindex, talkerindex, 0, -1);
}
Ejemplo n.º 24
0
/*********************************
* Ïä·¤«¤±¤é¤ì¤¿»þ¤Î½èÍý
*********************************/
void NPC_FMPKManTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    /* ¥×¥ì¥¤¥ä¡¼¤ËÂФ·¤Æ¤À¤±È¿±þ¤¹¤ë */
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
    	return;
    }
	
	/*--ÌܤÎÁ°¤Ë¤¤¤ë¤«¤É¤¦¤«¡©--*/
	if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE){
		/* £±¥°¥ê¥Ã¥É°ÊÆâ¤Î¤ß */
		if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
	}

	/*--¥ï¡¼¥¯¤Î½é´ü²½--*/
	CHAR_setWorkInt(talkerindex, CHAR_WORKSHOPRELEVANT, 0);

	/*-¤Ï¤¸¤á¤ÎÁªÂò²èÌÌ--*/
	NPC_FMPKMan_selectWindow( meindex, talkerindex, 0, -1);
}
Ejemplo n.º 25
0
/*********************************
*   �ƾ�����ľ���ݼ���
*********************************/
void NPC_FMPKManTalked( int meindex , int talkerindex , char *szMes ,int color )
{
    /* �����������帲�ƻ�����  ɱ���� */
    if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
        return;
    }

    /*--  �������¾���������--*/
    if(NPC_Util_isFaceToFace(talkerindex,meindex,2 )==FALSE) {
        /* ���������  ���� */
        if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
    }

    /*--�����ͼ������--*/
    CHAR_setWorkInt(talkerindex, CHAR_WORKSHOPRELEVANT, 0);

    /*-��Ԫ������      --*/
    NPC_FMPKMan_selectWindow( meindex, talkerindex, 0, -1);
}
Ejemplo n.º 26
0
void NPC_NewNpcManTalked( int meindex , int talkerindex , char *msg , int color )
{
	char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE];
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    		return;
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
			return;
	}
	if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
		print("TRANSER_MAN: GetArgStrErr!!");
		return;
	}
	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
	if( CHAR_getInt( talkerindex, CHAR_BASEBASEIMAGENUMBER) != 101578 ){
		NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_SELECT1, 0);
		return;
	}
	NPC_NewNpcMan_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
Ejemplo n.º 27
0
//CHAR_setWorkInt(talkerindex,CHAR_WORKSHOPRELEVANT,1);
void NPC_TranserManTalked( int meindex, int talkerindex, char *msg, int color )
{
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )
    		return;
	if(NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
			return;
	}
#ifdef _ITEM_CHECKWARES
	if( CHAR_CheckInItemForWares( talkerindex, 0) == FALSE ){
		CHAR_talkToCli( talkerindex, meindex, "根據傳送師工會規定,不能服務攜帶貨物的人!", CHAR_COLORYELLOW);
		return;
	}
#endif
// Syu ADD 天才傳送師判斷組隊狀態
	if( CHAR_getWorkInt ( talkerindex , CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE)
	{
		CHAR_talkToCli( talkerindex, meindex, "根據傳送師工會規定,不能幫組隊中的人傳送!",CHAR_COLORYELLOW);
		return;
	}

	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
	NPC_TranserMan_selectWindow( meindex, talkerindex, WINDOW_START, 0);
}
Ejemplo n.º 28
0
void NPC_WarpManTalked( int meindex , int talkerindex , char *szMes ,int color )
{
	char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE - 1024 * 20];
	char token[256];
	int RunType=-1;
	
	CHAR_setWorkInt( talkerindex, CHAR_WORKWARPCHECK, FALSE );
	if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
		return;
	}
	if(NPC_Util_isFaceToFace( meindex ,talkerindex ,2)==FALSE){
		if(NPC_Util_isFaceToChara(talkerindex,meindex,1 )==FALSE) return;
	}
	if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
		print("GetArgStrErr");
		return ;
	}

#ifdef _NEW_WARPMAN
	if( strstr( npcarg,"NEWWARPMAN") )      {
#ifdef _TREASURE_BOX
		if( CHAR_getWorkInt( meindex, NPC_TIME_EVENTMODE) == NPC_EVENTMODE_OPEN )
			return;
#endif
		NPC_NewWarpMan_selectWindow( meindex ,talkerindex, 0, -1, szMes);
		return;
	}else	{
		if(NPC_PARTY_CHAECK( meindex, talkerindex) == FALSE)	{//有组队
			NPC_ERR_DiSP( meindex, talkerindex, 1);
			return;
		}
		
		
		RunType = CheckWarpMsg( meindex, talkerindex, npcarg , szMes);
		if( RunType !=0 )	{
			if( RunType == 1 )	{
				if( NPC_Util_GetStrFromStrWithDelim( npcarg, "nomal_msg", token, sizeof(token)) != NULL)	{
					CHAR_talkToCli( talkerindex, meindex,token,CHAR_COLORWHITE);
				}
			}
			return;
		}
	}
#else
	
	
	if(NPC_PARTY_CHAECK( meindex, talkerindex) == FALSE)	{//有组队
		NPC_ERR_DiSP( meindex, talkerindex, 1);
		return;
	}
	RunType = CheckWarpMsg( meindex, talkerindex, npcarg , szMes);
	if( RunType !=0 )	{
		if( RunType == 1 )	{
			if( NPC_Util_GetStrFromStrWithDelim( npcarg, "nomal_msg", token, sizeof(token)) != NULL)	{
				CHAR_talkToCli( talkerindex, meindex,token,CHAR_COLORWHITE);
			}
		}
		return;
	}
#endif
	
	CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 0);
	CHAR_setWorkInt( talkerindex , CHAR_WORKSHOPRELEVANTTRD , 0 );
	if(strstr(npcarg,"DR")!=NULL)	{
		CHAR_setWorkInt( talkerindex , CHAR_WORKSHOPRELEVANTSEC , -1 );
		if(NPC_GetDuelPointCheck(meindex,talkerindex)==FALSE)	return;
	}else{
		NPC_WarpMan_selectWindow( meindex, talkerindex,0,-1);
	}
}
Ejemplo n.º 29
0
static void NPC_VipShop_selectWindow( int meindex, int toindex, int num,int select)
{
	char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE];
	char token[256];
	char buf1[256];
	char buf2[256];
	char buf3[256];
	int buttontype = 0, windowtype = 0, windowno = 0;
	int fd = getfdFromCharaIndex( toindex);
	static int select1;
	windowtype = WINDOW_MESSAGETYPE_MESSAGE;

	if(NPC_Util_isFaceToFace( meindex ,toindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( toindex, meindex, 1) == FALSE)
			return;
	}

	memset( npcarg, 0, sizeof( npcarg));
	if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
		print("VipShop_MAN: GetArgStrErr!!");
		return;
	}
	memset( token, 0, sizeof( token));

	switch( num)	{
	case WINDOW_START:
		if( NPC_Util_GetStrFromStrWithDelim( npcarg, "START_MSG", token, sizeof( token) ) == NULL) {
			print("VipShop Get START_MSG ERROR !");
			return;
		}
		CHAR_setWorkInt( toindex, CHAR_WORKSHOPRELEVANT, WINDOW_START);
		buttontype = WINDOW_BUTTONTYPE_YESNO;
		windowno = NPC_TRANSERMAN_SELECT;
		break;
	case WINDOW_SELECT:
		CHAR_setWorkInt( toindex, CHAR_WORKLISTPAGE, 0);
		page=VipShop_ShowMenulist(npcarg);
		if( VipShop_GetMenuStr( meindex, toindex, npcarg, token,CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)) == FALSE )	{
			print( "VipShop GetMenu ERROR !!");
			return;
		}
		windowtype = WINDOW_MESSAGETYPE_SELECT;
		if(page>1)
			buttontype = WINDOW_BUTTONTYPE_CANCEL|WINDOW_BUTTONTYPE_NEXT;
		else
			buttontype = WINDOW_BUTTONTYPE_CANCEL;
		windowno = NPC_TRANSERMAN_WARP;
		break;
	case WINDOW_NEXT:
		if(CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)<=page)
			CHAR_setWorkInt( toindex, CHAR_WORKLISTPAGE, CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)+1);
		if( VipShop_GetMenuStr( meindex, toindex, npcarg, token,CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)) == FALSE )	{
			print( "VipShop GetMenu ERROR !!");
			return;
		}
		windowtype = WINDOW_MESSAGETYPE_SELECT;
		if(CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)+1==page)
			buttontype = WINDOW_BUTTONTYPE_CANCEL|WINDOW_BUTTONTYPE_PREV;
		else
			buttontype = WINDOW_BUTTONTYPE_CANCEL|WINDOW_BUTTONTYPE_PREV|WINDOW_BUTTONTYPE_NEXT;
		windowno = NPC_TRANSERMAN_WARP;
		break;
	case WINDOW_PREV:
		if(CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)>0)
			CHAR_setWorkInt( toindex, CHAR_WORKLISTPAGE, CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)-1);
		if( VipShop_GetMenuStr( meindex, toindex, npcarg, token,CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)) == FALSE )	{
			print( "VipShop GetMenu ERROR !!");
			return;
		}
		windowtype = WINDOW_MESSAGETYPE_SELECT;
		if(CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)==0)
			buttontype = WINDOW_BUTTONTYPE_CANCEL|WINDOW_BUTTONTYPE_NEXT;
		else
			buttontype = WINDOW_BUTTONTYPE_PREV|WINDOW_BUTTONTYPE_CANCEL|WINDOW_BUTTONTYPE_NEXT;
		windowno = NPC_TRANSERMAN_WARP;
		break;
	case WINDOW_WARP:
		select1=CHAR_getWorkInt( toindex, CHAR_WORKLISTPAGE)*7+select;
		CHAR_setWorkInt( toindex, CHAR_WORKLISTSELECT , select1);
		if( NPC_Util_GetStrFromStrWithDelim( npcarg, "END_MSG", buf1, sizeof( buf1) ) == NULL) {
			print("VipShop Get START_MSG ERROR !");
			return;
		}
		if(getStringFromIndexWithDelim( npcarg,"}",select1, buf2, sizeof( buf2)) != FALSE)
			NPC_Util_GetStrFromStrWithDelim( buf2, "MenuStr", buf3, sizeof( buf3));
		sprintf( token, "\n%s\n\n        %s\n",buf1, buf3);
		
		windowtype = WINDOW_MESSAGETYPE_MESSAGE;
		buttontype = WINDOW_BUTTONTYPE_YESNO;
		windowno = NPC_TRANSERMAN_END;
		break;
	case WINDOW_END:
		ActionNpc_CheckMenuFree( meindex, toindex, npcarg, CHAR_getWorkInt( toindex, CHAR_WORKLISTSELECT ));
		return;
		break;
	}

	lssproto_WN_send( fd, windowtype, buttontype, windowno,
		CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX), token);
}
Ejemplo n.º 30
0
static void NPC_NewNpcMan_selectWindow( int meindex, int toindex, int num, int flg)
{
	char npcarg[NPC_UTIL_GETARGSTR_BUFSIZE];
	char token[256];

	int buttontype = 0, windowtype = 0, windowno = 0;
	int fd = getfdFromCharaIndex( toindex);

	windowtype = WINDOW_MESSAGETYPE_MESSAGE;

	if(NPC_Util_isFaceToFace( meindex ,toindex , 2) == FALSE) {
		if(NPC_Util_isFaceToChara( toindex, meindex, 1) == FALSE)
			return;
	}

	memset( npcarg, 0, sizeof( npcarg));
	if(NPC_Util_GetArgStr( meindex, npcarg, sizeof(npcarg))==NULL){
		return;
	}

	memset( token, 0, sizeof( token));
	switch( num)	{
	case WINDOW_START:
		if( NPC_Util_GetStrFromStrWithDelim( npcarg, "START_MSG", token, sizeof( token) ) == NULL) {
			return;
		}
		buttontype = WINDOW_BUTTONTYPE_YESNO;
		windowno = NPC_PROGRAMEGINEER_DEFIND;
		break;
	case WINDOW_SELECT1:
		sprintf(token,"              ÇëÑ¡Ôñ"
			      "\n             ¡¶ÐÞÕý³èÎïÒì³£¡·"
				  "\n             ¡¶ÐÞÕý³èÎïͼºÅ¡·"
			      "\n              ¡¶¸ü»»ÁéÁ¦îø¡·"
#ifdef _PET_LOSTPET
				  "\n             ¡¶Áì»ØÒÅʧ³èÎï¡·"
#endif
//				  "\n            ¡¶»¹Ô­ÌúǹÈþ¶Ñµþ¡·"

				  );
		windowtype = WINDOW_MESSAGETYPE_SELECT;
		buttontype = WINDOW_BUTTONTYPE_CANCEL;
		windowno = NPC_PROGRAMEGINEER_SELECT2;
		break;
	case WINDOW_SELECT2:
		switch( flg){
		case 1://ÐÞÕý³èÎïÒì³£
			NPC_reCheckMyPetUnusual( meindex, toindex);
			CHAR_talkToCli( toindex, -1, "ÉíÉϳèÎï¼ì²éÍê±Ï!", CHAR_COLORYELLOW);
			return;
			break;
		case 2://ÐÞÕý³èÎïͼºÅ
			CHECK_PETBBI( toindex);
			return;
			break;
		case 3://¸ü»»ÁéÁ¦îø
			if( CHECK_ITEMEQUIT( toindex) == TRUE ){
				CHAR_talkToCli( toindex, -1, "¼ì²éÍê±Ï!", CHAR_COLORYELLOW);
			}
			return;
			break;

		case 4:
#ifdef _PET_LOSTPET
			if( NPC_reFindMyLostPet( meindex, toindex, token) == FALSE ){
				CHAR_talkToCli( toindex, -1, "²éÎÞ×ÊÁÏ£¡", CHAR_COLORYELLOW);
				return;
			}
			windowtype = WINDOW_MESSAGETYPE_SELECT;
			buttontype = WINDOW_BUTTONTYPE_CANCEL;
			windowno = NPC_PROGRAMEGINEER_SELECTLOSTPET;
#endif
			break;
		case 5: //»¹Ô­ÌúǹÈþ¶Ñµþ
//			NPC_reCheckItemPilenum( meindex, toindex);
			return;
			break;
		}
		break;
/*
	case WINDOW_SELECT3:
			{
				int petnum, petindex;
				petnum = atoi( data)-1;
				if( petnum >= CHAR_MAXPETHAVE || petnum < 0 ) return;
				petindex = CHAR_getCharPet( talker, petsel);
				if( !CHAR_CHECKINDEX(petindex) ) return;
				break;
			}
*/
	case WINDOW_SELECTLOSTPET:
#ifdef _PET_LOSTPET
		{
			int ret, i, ti, ltime, cost;
			Char ch;
			char msgbuf[256];
			char petstring1[2048];

			int havepetelement = CHAR_getCharPetElement( toindex);
			ti = flg;
			if( havepetelement < 0 ){
				CHAR_talkToCli( toindex, -1, "³èÎïÀ¸Î»ÒÑÂú£¡", CHAR_COLORYELLOW);
				return;
			}
			if( NPC_getLostPetString( meindex, toindex) == FALSE ) {
				CHAR_talkToCli( toindex, -1, "ÁìÈ¡³èÎïʧ°Ü£¡", CHAR_COLORYELLOW);
				return;
			}

			if( getStringFromIndexWithDelim( petstring[ti-1], "#", 2, petstring1, sizeof( petstring1)) == FALSE ){
				CHAR_talkToCli( toindex, -1, "ÁìÈ¡³èÎïʧ°Ü£¡", CHAR_COLORYELLOW);
				return;	
			}else{
				char buf1[256];
				if( getStringFromIndexWithDelim( petstring[ti-1], "|", 6, buf1, sizeof( buf1)) == FALSE ) return;
					ltime = atoi(buf1);
					ltime = time( NULL) - ltime;
					ltime = ltime/(60*60*24);
				if( getStringFromIndexWithDelim( petstring[ti-1], "|", 4, buf1, sizeof( buf1)) == FALSE ) return;
					cost = atoi( buf1);
#if 0	// ÐÞÕý±£Êͽð
				cost = cost + (ltime*100);
				cost = (cost>10000)?10000:cost;
#else
				cost = cost + (ltime*10000);
#endif
				if( CHAR_getInt( toindex, CHAR_GOLD) < cost ) {
					sprintf( buf1, "³èÎïÒѼķÅ%dÌ죬¹²Ðè%dʯ±Ò²Å¿ÉÁì»Ø¡£", ltime, cost);
					CHAR_talkToCli( toindex, meindex, buf1, CHAR_COLORYELLOW);
					return;	
				}
			}


			ret = CHAR_makePetFromStringToArg( petstring1, &ch, -2);
			strcpy( petstring[ti-1], "");
			if( ret ) {
				char buf1[256];
				int petindex = PET_initCharOneArray( &ch );
				if( !CHAR_CHECKINDEX( petindex) ){
					CHAR_talkToCli( toindex, -1, "ÁìÈ¡³èÎïʧ°Ü£¡", CHAR_COLORYELLOW);
					return;
				}
				print("ANDY petindex:%d[%s]\n", petindex, CHAR_getChar( petindex, CHAR_NAME) );

				CHAR_complianceParameter( petindex );
				CHAR_setInt( petindex, CHAR_HP, CHAR_getWorkInt( petindex, CHAR_WORKMAXHP));
				CHAR_setWorkInt( petindex, CHAR_WORKPLAYERINDEX, toindex);
				CHAR_setCharPet( toindex, havepetelement, petindex);
				CHAR_setChar( petindex, CHAR_OWNERCDKEY,
							CHAR_getChar( toindex, CHAR_CDKEY));
				CHAR_setChar( petindex, CHAR_OWNERCHARANAME,
							CHAR_getChar( toindex, CHAR_NAME));

				if( NPC_backupLostPetString( toindex) == FALSE ){
					print("ANDY err backup petstring !!\n");
					return;
				}
				
				sprintf( buf1, "LostPGet:%d", cost);
				LogPet(
					CHAR_getChar( toindex, CHAR_NAME ),
					CHAR_getChar( toindex, CHAR_CDKEY ),
					CHAR_getChar( petindex, CHAR_NAME),
					CHAR_getInt( petindex, CHAR_LV),
					buf1,
					CHAR_getInt( toindex,CHAR_FLOOR),
					CHAR_getInt( toindex,CHAR_X ),
					CHAR_getInt( toindex,CHAR_Y ),
					CHAR_getChar( petindex, CHAR_UNIQUECODE)   // shan 2001/12/14
				);
				sprintf( buf1, "ÁìÈ¡³èÎï%s¡£", CHAR_getUseName( petindex));
				CHAR_talkToCli( toindex, meindex, buf1, CHAR_COLORYELLOW);
				for( i = 0; i < CHAR_MAXPETHAVE; i++){
					int petindex = CHAR_getCharPet( toindex, i);
					if( !CHAR_CHECKINDEX( petindex) )
						continue;
					CHAR_complianceParameter( petindex );
					snprintf( msgbuf, sizeof( msgbuf ), "K%d", i );
					CHAR_sendStatusString( toindex, msgbuf );
					snprintf( msgbuf, sizeof( msgbuf ), "W%d", i );
					CHAR_sendStatusString( toindex, msgbuf );
				}
				CHAR_DelGold( toindex, cost);
			}else{
					CHAR_talkToCli( toindex, -1, "ÁìÈ¡³èÎïʧ°Ü£¡", CHAR_COLORYELLOW);
					return;
			}
			return;
 		}
#endif
		return;
		break;
	case WINDOW_DEFIND:
		{
			int i;
			int face = CHAR_getInt( toindex, CHAR_FACEIMAGENUMBER);
			if( NPC_Util_GetStrFromStrWithDelim( npcarg, "CHECK_MSG", token, sizeof( token) ) == NULL) {
				return;
			}
			for( i=0; i<48; i++){
				if( face >= checkPc[i][0] && face < checkPc[i][1] )
					break;
			}
			if( i >= 48 )return;
			CHAR_setWorkInt( toindex, CHAR_WORKNPCMETAMO, meindex);
			CHAR_setInt( toindex, CHAR_BASEIMAGENUMBER, checkPc[i][2]);
			CHAR_complianceParameter( toindex );
			CHAR_sendCToArroundCharacter( CHAR_getWorkInt( toindex , CHAR_WORKOBJINDEX ));
			CHAR_send_P_StatusString( toindex , CHAR_P_STRING_BASEBASEIMAGENUMBER);

			buttontype = WINDOW_BUTTONTYPE_YESNO;
			windowno = NPC_PROGRAMEGINEER_END;
		}
		break;
	case WINDOW_END:
		{
			CHAR_setWorkInt( toindex, CHAR_WORKNPCMETAMO, -1);
			CHAR_setInt( toindex, CHAR_BASEBASEIMAGENUMBER,
				CHAR_getInt( toindex, CHAR_BASEIMAGENUMBER) );

			CHAR_complianceParameter( toindex );
			CHAR_sendCToArroundCharacter( CHAR_getWorkInt( toindex , CHAR_WORKOBJINDEX ));
			CHAR_send_P_StatusString( toindex , CHAR_P_STRING_BASEBASEIMAGENUMBER);
			return;
		}
		break;
	}

	lssproto_WN_send( fd, windowtype, buttontype, windowno,
		CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX), token);
}