Example #1
0
int addNpcFamilyTax( int meindex, int talkerindex, int income )
{
			 int fmindex, fmindexi, village, i;
			 char fmname[256], token[256], buf2[64];
			 int clifd = CHAR_getWorkInt( talkerindex, CHAR_WORKFD );
			
			 sprintf( buf2, "%d", income );
			 for( i=0 ; i<FMPOINTNUM ; i++ ) {
				getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 9, token, sizeof(token));
				village = atoi(token);
				if( village == CHAR_getInt( meindex, CHAR_FMINDEX ) ) {
					getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 5, token, sizeof(token));
					fmindex = atoi(token);
					getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 6, token, sizeof(token));
					strcpy(fmname, token);
					getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 8, token, sizeof(token));
					fmindexi = atoi(token);
					saacproto_ACFixFMData_send( acfd, fmname, fmindex, fmindexi,
						FM_FIX_FMGOLD, buf2 , "",
						CHAR_getWorkInt(meindex, CHAR_WORKFMCHARINDEX),
						CONNECT_getFdid(clifd) );
					
//					print(" addNpcFamilyTax_fm:%s ", fmname);
					return 1;
				}
			 }
			 return 0;
}
Example #2
0
// CoolFish: Family Adv 2001/7/29
void AddFMAdv(int talker, int shiftbit)
{
	int fmadv = 0;
	char buf[256];
#ifdef _FMVER21
#else
	if (CHAR_getInt(talker, CHAR_FMINDEX) < 0)
		return;
	if (CHAR_getInt(talker, CHAR_FMLEADERFLAG) <= 0)
		return;
	if (strcmp(CHAR_getChar(talker, CHAR_FMNAME), "") == 0)
		return;
#endif
	if (shiftbit >= arraysizeof(FMAdvTbl))
		return;
	else
		fmadv = FMAdvTbl[shiftbit];
	if (fmadv <= 0)
		return;
	sprintf(buf, "%d", fmadv);
#ifdef _PERSONAL_FAME		// Arminius 8.30: 家族个人声望
	CHAR_earnFame(talker, fmadv);
#endif
#ifdef _FMVER21
	if (CHAR_getInt(talker, CHAR_FMLEADERFLAG) > 0
	    && CHAR_getInt(talker, CHAR_FMLEADERFLAG) != FMMEMBER_APPLY) {
		// CoolFish: 2001/10/03
		int fd = getfdFromCharaIndex(talker);
		saacproto_ACFixFMData_send(acfd,
					   CHAR_getChar(talker, CHAR_FMNAME),
					   CHAR_getInt(talker, CHAR_FMINDEX),
					   CHAR_getWorkInt(talker,
							   CHAR_WORKFMINDEXI),
					   FM_FIX_FMADV, buf, "",
					   // CoolFish: 2001/10/03
					   CHAR_getWorkInt(talker,
							   CHAR_WORKFMCHARINDEX),
					   CONNECT_getFdid(fd));
		// CHAR_getWorkInt(talker, CHAR_WORKFMCHARINDEX), 0);
	}
#else
	saacproto_ACFixFMData_send(acfd,
				   CHAR_getChar(talker, CHAR_FMNAME),
				   CHAR_getInt(talker, CHAR_FMINDEX),
				   CHAR_getWorkInt(talker, CHAR_WORKFMINDEXI),
				   FM_FIX_FMADV, buf, "",
				   CHAR_getWorkInt(talker,
						   CHAR_WORKFMCHARINDEX), 0);
#endif
}
Example #3
0
void NPC_RidermanWindowTalked( int meindex, int talkerindex,
                               int seqno, int select, char *data)

{


    int		button = -1;
    char	buf[512];

    if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;

    if( !NPC_Riderman_readData( meindex, seqno - 100, FALSE) ) {
        print( "riderman:readdata error\n");
        return;
    }
    /* 瓷仄凶示正件毛譬屯月 */
    if( w.windowtype == WINDOW_MESSAGETYPE_SELECT ) {
        button = atoi( data)+5;
        if( button > 12 ) {
            print( "riderman:invalid button[%d]\n", button);
            return;
        }
    }
    else if( select & WINDOW_BUTTONTYPE_OK) button = 0;
    else if( select & WINDOW_BUTTONTYPE_CANCEL) button = 1;
    else if( select & WINDOW_BUTTONTYPE_YES) button = 2;
    else if( select & WINDOW_BUTTONTYPE_NO) button = 3;
    else if( select & WINDOW_BUTTONTYPE_PREV) button = 4;
    else if( select & WINDOW_BUTTONTYPE_NEXT) button = 5;
    else {
        print( "riderman:invalid button[%d]\n", select);
        return;
    }
    if( buttonproc[button].use == TRUE ) {
        int	fd;
        int	newwin = -1;

        fd = getfdFromCharaIndex( talkerindex);

        if( newwin == -1 ) {
            newwin = buttonproc[button].gotowin;
        }


        //print(" takegold:%d ", w.takegold );

        // Robin
        // 学习 Lv 40
        if( newwin == 6 )	{

            int charImg;
            // int i, petindex, bFind = 0;

            charImg = CHAR_getInt( talkerindex, CHAR_BASEBASEIMAGENUMBER);
            if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) >= 40 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你已经学会初级班了呀。\n不需要再学了。",
                                                    buf, sizeof(buf)));
                return;
            }

            if( CHAR_getInt( talkerindex, CHAR_GOLD ) < w.takegold )
            {
                char buf2[512];

                sprintf( buf2, "\n很抱歉喔!你的学费不足!\n学习骑乘宠物初级班需要%d石币。", w.takegold);
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( buf2, buf, sizeof(buf)));
                return;
            }
            CHAR_DelGold( talkerindex, w.takegold );

            CHAR_setInt( talkerindex, CHAR_LEARNRIDE, 40 );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_GOLD );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_LEARNRIDE );

            //sprintf( buf, "R|L|1" );
            //lssproto_FM_send( fd, buf );
            lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                              WINDOW_BUTTONTYPE_OK, -1, -1,
                              makeEscapeString(
                                  "\n\n恭喜你!你已经完成骑乘初级班了。\n可以骑乘 Lv40 以下的宠物,\n请小心骑乘喔!",
                                  buf, sizeof(buf)));

            // 家族收入
            {
                int fmindex, fmindexi, village, i;
                char fmname[256], token[256], buf2[64];

                sprintf( buf2, "%d", w.takegold/5 );
                for( i=0 ; i<FMPOINTNUM ; i++ ) {
                    getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 9, token, sizeof(token));
                    village = atoi(token);
                    if( village == CHAR_getInt( meindex, CHAR_FMINDEX ) ) {
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 5, token, sizeof(token));
                        fmindex = atoi(token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 6, token, sizeof(token));
                        strcpy(fmname, token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 8, token, sizeof(token));
                        fmindexi = atoi(token);
                        saacproto_ACFixFMData_send( acfd, fmname, fmindex, fmindexi,
                                                    FM_FIX_FMGOLD, buf2 , "",
                                                    CHAR_getWorkInt(meindex, CHAR_WORKFMCHARINDEX),
                                                    CONNECT_getFdid(fd) );

                        //print(" rider_fm:%s ", fmname);
                    }
                }
            }

            return;
        }

        // 学习 Lv 80
        if( newwin == 7 )	{

            int charImg;
            // int i, petindex, bFind = 0;


            charImg = CHAR_getInt( talkerindex, CHAR_BASEBASEIMAGENUMBER);
            if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) >= 80 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你已经学会中级班了呀。\n不需要再学了。",
                                                    buf, sizeof(buf)));
                return;
            }
            else if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) < 40 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你必须先学过初级班才能来中级班唷。",
                                                    buf, sizeof(buf)));
                return;
            }

            if( CHAR_getInt( talkerindex, CHAR_GOLD ) < w.takegold )
            {
                char buf2[512];

                sprintf( buf2, "\n很抱歉喔!你的学费不足!\n学习骑乘宠物中级班需要%d石币", w.takegold);
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( buf2, buf, sizeof(buf)));
                return;
            }
            CHAR_DelGold( talkerindex, w.takegold );

            CHAR_setInt( talkerindex, CHAR_LEARNRIDE, 80 );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_GOLD );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_LEARNRIDE );

            //sprintf( buf, "R|L|1" );
            //lssproto_FM_send( fd, buf );
            lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                              WINDOW_BUTTONTYPE_OK, -1, -1,
                              makeEscapeString( "\n\n恭喜你!你已经完成骑乘中级班了。\n可以骑乘 Lv80 以下的宠物,\n请小心骑乘喔!",
                                                buf, sizeof(buf)));

            // 家族收入
            {
                int fmindex, fmindexi, village, i;
                char fmname[256], token[256], buf2[64];

                sprintf( buf2, "%d", w.takegold/5 );
                for( i=0 ; i<FMPOINTNUM ; i++ ) {
                    getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 9, token, sizeof(token));
                    village = atoi(token);
                    if( village == CHAR_getInt( meindex, CHAR_FMINDEX ) ) {
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 5, token, sizeof(token));
                        fmindex = atoi(token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 6, token, sizeof(token));
                        strcpy(fmname, token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 8, token, sizeof(token));
                        fmindexi = atoi(token);
                        saacproto_ACFixFMData_send( acfd, fmname, fmindex, fmindexi,
                                                    FM_FIX_FMGOLD, buf2 , "",
                                                    CHAR_getWorkInt(meindex, CHAR_WORKFMCHARINDEX),
                                                    CONNECT_getFdid(fd) );

                        //print(" rider_fm:%s ", fmname);
                    }
                }
            }

            return;
        }

        // 学习 Lv 120
        if( newwin == 8 )	{

            int charImg;
            // int i, petindex, bFind = 0;


            charImg = CHAR_getInt( talkerindex, CHAR_BASEBASEIMAGENUMBER);
            if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) >= 120 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你已经学会高级班了呀。\n不需要再学了。",
                                                    buf, sizeof(buf)));
                return;
            }
            else if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) < 80 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你必须先学过中级班才能来高级班唷。",
                                                    buf, sizeof(buf)));
                return;
            }

            if( CHAR_getInt( talkerindex, CHAR_GOLD ) < w.takegold )
            {
                char buf2[512];

                sprintf( buf2, "\n很抱歉喔!你的学费不足!\n学习骑乘宠物高级班需要%d石币", w.takegold);
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( buf2, buf, sizeof(buf)));
                return;
            }
            CHAR_DelGold( talkerindex, w.takegold );

            CHAR_setInt( talkerindex, CHAR_LEARNRIDE, 120 );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_GOLD );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_LEARNRIDE );

            //sprintf( buf, "R|L|1" );
            //lssproto_FM_send( fd, buf );
            lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                              WINDOW_BUTTONTYPE_OK, -1, -1,
                              makeEscapeString( "\n\n恭喜你!你已经完成骑乘高级班了。\n可以骑乘 Lv120 以下的宠物,\n请小心骑乘喔!",
                                                buf, sizeof(buf)));

            // 家族收入
            {
                int fmindex, fmindexi, village, i;
                char fmname[256], token[256], buf2[64];

                sprintf( buf2, "%d", w.takegold/5 );
                for( i=0 ; i<FMPOINTNUM ; i++ ) {
                    getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 9, token, sizeof(token));
                    village = atoi(token);
                    if( village == CHAR_getInt( meindex, CHAR_FMINDEX ) ) {
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 5, token, sizeof(token));
                        fmindex = atoi(token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 6, token, sizeof(token));
                        strcpy(fmname, token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 8, token, sizeof(token));
                        fmindexi = atoi(token);
                        saacproto_ACFixFMData_send( acfd, fmname, fmindex, fmindexi,
                                                    FM_FIX_FMGOLD, buf2 , "",
                                                    CHAR_getWorkInt(meindex, CHAR_WORKFMCHARINDEX),
                                                    CONNECT_getFdid(fd) );

                        //print(" rider_fm:%s ", fmname);
                    }
                }
            }

            return;
        }

        // 学习  Lv All
        if( newwin == 9 )	{

            int charImg;
            // int petindex, i, bFind = 0;

            charImg = CHAR_getInt( talkerindex, CHAR_BASEBASEIMAGENUMBER);
            if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) > 199 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你已经学会特级班了呀。\n不需要再学了。",
                                                    buf, sizeof(buf)));
                return;
            }
            else if( CHAR_getInt( talkerindex, CHAR_LEARNRIDE ) < 120 )
            {
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( "\n\n你必须先学过高级班才能来特级班唷。",
                                                    buf, sizeof(buf)));
                return;
            }

            if( CHAR_getInt( talkerindex, CHAR_GOLD ) < w.takegold )
            {
                char buf2[512];

                sprintf( buf2, "\n很抱歉喔!你的学费不足!\n学习骑乘宠物特级班需要%d石币", w.takegold);
                lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                                  WINDOW_BUTTONTYPE_OK, -1, -1,
                                  makeEscapeString( buf2, buf, sizeof(buf)));
                return;
            }
            CHAR_DelGold( talkerindex, w.takegold );

            CHAR_setInt( talkerindex, CHAR_LEARNRIDE, 200 );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_GOLD );
            CHAR_send_P_StatusString( talkerindex, CHAR_P_STRING_LEARNRIDE );

            //sprintf( buf, "R|L|1" );
            //lssproto_FM_send( fd, buf );
            lssproto_WN_send( fd, WINDOW_MESSAGETYPE_MESSAGE,
                              WINDOW_BUTTONTYPE_OK, -1, -1,
                              makeEscapeString( "\n\n恭喜你!你已经完成骑乘特级班了。\n可以骑乘所有等级的宠物,\n请小心骑乘喔!",
                                                buf, sizeof(buf)));

            // 家族收入
            {
                int fmindex, fmindexi, village, i;
                char fmname[256], token[256], buf2[64];

                sprintf( buf2, "%d", w.takegold/5 );
                for( i=0 ; i<FMPOINTNUM ; i++ ) {
                    getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 9, token, sizeof(token));
                    village = atoi(token);
                    if( village == CHAR_getInt( meindex, CHAR_FMINDEX ) ) {
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 5, token, sizeof(token));
                        fmindex = atoi(token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 6, token, sizeof(token));
                        strcpy(fmname, token);
                        getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 8, token, sizeof(token));
                        fmindexi = atoi(token);
                        saacproto_ACFixFMData_send( acfd, fmname, fmindex, fmindexi,
                                                    FM_FIX_FMGOLD, buf2 , "",
                                                    CHAR_getWorkInt(meindex, CHAR_WORKFMCHARINDEX),
                                                    CONNECT_getFdid(fd) );

                        //print(" rider_fm:%s ", fmname);
                    }
                }
            }

            return;
        }

        // 说明 , 列表
        if( newwin == 5 )
        {

            lssproto_WN_send( fd, WINDOW_MESSAGETYPE_SHOWRIDEPET,
                              WINDOW_BUTTONTYPE_OK, -1, -1,
                              "" );
            return;

        }

        if( !NPC_Riderman_readData( meindex, newwin, FALSE) ) {
            print( "riderman:readdata error\n");
            return;
        }

        //fd = getfdFromCharaIndex( talkerindex);
        if( fd != -1 ) {
            lssproto_WN_send( fd, w.windowtype,
                              w.buttontype,
                              w.windowno+100,
                              CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX),
                              makeEscapeString( w.message, buf, sizeof(buf)));
        }



    }
}
Example #4
0
void NPC_BankmanWindowTalked( int meindex, int talkerindex, 
								int seqno, int select, char *data)

{
	
	int	button = -1;
	char	buf[2048], buff[256];

	/* £±¥°¥ê¥Ã¥É°Ê  ¤Î¤ß */
	if( NPC_Util_CharDistance( talkerindex, meindex ) > 1) return;
	
	/* ¤³¤Î¥¦¥£¥ó¥É¥¦  ¹æ¤Î¥Ç¡¼¥¿¤ò  ¤ß  ¤à */	
	if( !NPC_Bankman_readData( meindex, seqno - 100, FALSE) ) {
		print( "familyman:readdata error\n");
		return;
	}
	/* ²¡¤·¤¿¥Ü¥¿¥ó¤òÄ´¤Ù¤ë */
	if( w.windowtype == WINDOW_MESSAGETYPE_SELECT ) {
	//if( w.windowtype == WINDOW_MESSAGETYPE_MESSAGE ) {
	// shan end
		button = atoi( data)+5;
		if( button > 12 ) {
			print( "familyman:invalid button[%d]\n", button);
			return;
		}
	}
	else if( select & WINDOW_BUTTONTYPE_OK) button = 0;
	else if( select & WINDOW_BUTTONTYPE_CANCEL) button = 1;
	else if( select & WINDOW_BUTTONTYPE_YES) button = 2;
	else if( select & WINDOW_BUTTONTYPE_NO) button = 3;
	else if( select & WINDOW_BUTTONTYPE_PREV) button = 4;
	else if( select & WINDOW_BUTTONTYPE_NEXT) button = 5;
	else {
		print( "familyman:invalid button[%d]\n", select);
		return;
	}
	// shan begin
	//if( buttonproc[button].use == TRUE ) {
	//if( select > 0) {
	if( button > 0 ) {
	// shan end
		int	fd;
		int	newwin = -1;
	
		fd = getfdFromCharaIndex( talkerindex);
		
		/* ¥Ü¥¿¥ó¤Ë¤è¤Ã¤Æ½è  ¤ò¤Õ¤ê¤ï¤±¤ë */
		if( newwin == -1 ) {
			newwin = buttonproc[button].gotowin;
		}
		
		// Robin
		// »È¦æ
		// shan begin
		if( select == WINDOW_BUTTONTYPE_YES) {
		        newwin = 5;
		}
		// shan end
		if( newwin == 5 )	{
			if( CHAR_getInt( talkerindex, CHAR_FMINDEX ) < 1 && 
			    CHAR_getInt( talkerindex, CHAR_BANKGOLD) < 1 )
			    	lssproto_WN_send(fd, WINDOW_MESSAGETYPE_MESSAGE,
			    		WINDOW_BUTTONTYPE_OK, -1, -1,
			    		makeEscapeString("\n±zªº¸ê®æ¤£²Å¦X¡I"
			    				 "\n½Ð¥ý¥[¤J®a±Ú¡I", buff, sizeof(buff)));
			else {
				sprintf(buf, "B|G|%d", CHAR_getInt( talkerindex, CHAR_BANKGOLD) );
				lssproto_FM_send( fd, buf );
			}
			return;
		}
		// ®a±Ú±b¤á
		if( newwin == 6 )
		{
			if( CHAR_getInt( talkerindex, CHAR_FMINDEX ) > 0 )
				saacproto_ACGetFMData_send( acfd, CHAR_getChar( talkerindex, CHAR_FMNAME),
								CHAR_getInt( talkerindex, CHAR_FMINDEX ),
								CHAR_getWorkInt( talkerindex, CHAR_WORKFMINDEXI ),
								1,
								CONNECT_getFdid(fd)
								);
			else
			    	lssproto_WN_send(fd, WINDOW_MESSAGETYPE_MESSAGE,
			    		WINDOW_BUTTONTYPE_OK, -1, -1,
			    		makeEscapeString("\n±zªº¸ê®æ¤£²Å¦X¡I"
			    				 "\n½Ð¥ý¥[¤J®a±Ú¡I", buff, sizeof(buff)));
			return;
		}
		// °h¥X
		if( newwin == 7 )
		{
			if( CHAR_getInt( talkerindex, CHAR_FMINDEX ) == -1 ) {
			    	lssproto_WN_send(fd, WINDOW_MESSAGETYPE_MESSAGE,
			    		WINDOW_BUTTONTYPE_OK, -1, -1,
			    		makeEscapeString("\n±zªº¸ê®æ¤£²Å¦X¡I"
			    				 "\n½Ð¥ý¥[¤J®a±Ú¡I", buff, sizeof(buff)));
				return;
			}
			
			print(" WN2FM ");
			FAMILY_Leave( fd, talkerindex, "E|1");
									
			return;
		}
		
		if( !NPC_Bankman_readData( meindex, newwin, FALSE) ) {
			print( "familyman:readdata error\n");
			return;
		}
		if( fd != -1 ) {
			lssproto_WN_send( fd, w.windowtype, 
							w.buttontype,
							w.windowno+100,
							CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX),
							makeEscapeString( w.message, buf, sizeof(buf)));
		}
		
		
		
	}
}
Example #5
0
int addNpcFamilyTax( int meindex, int talkerindex, int income )
{
	int fmindex, fmindexi, village, npc_village, i;
	char fmname[256], token[256], buf2[64];
	int clifd = CHAR_getWorkInt( talkerindex, CHAR_WORKFD );

	switch( (int)( CHAR_getInt( meindex, CHAR_FLOOR)/100 ) )
	{
		case 10:
			npc_village = 1;
			break;
		case 20:
			npc_village = 2;
			break;			
		case 30:
			npc_village = 3;
			break;		
		case 40:
			npc_village = 4;
			break;
#ifdef _FAMILY_MANORNUM_CHANGE
		case 50:
			npc_village = 5;
			break;	
		case 60:
			npc_village = 6;
			break;
// Syu ADD �����Ĵ����˰������
		case 71:
			npc_village = 6;
			break;
		case 72:
			npc_village = 7;
			break;
		case 73:
			npc_village = 8;
			break;
		case 74:
			npc_village = 9;
			break;

		case 70:
			npc_village = 7;
			break;			
		case 80:
			npc_village = 8;
			break;		
		case 90:
			npc_village = 9;
			break;			
		case 100:
			npc_village = 10;
			break;			
		default:
			return 0;
	}
			 sprintf( buf2, "%d", income );
			 for( i=0 ; i<FMPOINTNUM ; i++ ) {
				if( getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 9, token, sizeof(token)) == FALSE )
					continue;
				village = atoi(token);
				if( village == npc_village ) {
					if( getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 5, token, sizeof(token)) == FALSE)
						return 0;
					fmindex = atoi(token);
// Terry add for ���ׯ԰û��ռ���򲻼���
					if(fmindex < 0) return 0;
// end
					memset( token, 0, sizeof( token));
					if( getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 6, token, sizeof(token)) == FALSE)
						return 0;
					memset( fmname, 0, sizeof( fmname));
					sprintf( fmname, "%s", token);
					if( getStringFromIndexWithDelim(fmpointlist.pointlistarray[i], "|", 8, token, sizeof(token)) == FALSE )
						return 0;
					fmindexi = atoi(token);
					saacproto_ACFixFMData_send( acfd, fmname, fmindex, fmindexi,
						FM_FIX_FMGOLD, buf2 , "",
						CHAR_getWorkInt(meindex, CHAR_WORKFMCHARINDEX),
						CONNECT_getFdid(clifd) );
					
//					print(" addNpcFamilyTax_fm:%s ", fmname);
					return 1;
				}
			 }
			 return 0;
}
Example #6
0
// CoolFish: Family Adv 2001/7/29
void AddFMAdv(int talker, int shiftbit)
{
	int fmadv = 0;
	char	buf[256];
#ifdef _NEW_MANOR_LAW
	char buf1[16];
#endif
#ifdef _FMVER21	
#else
	if (CHAR_getInt(talker, CHAR_FMINDEX) < 0)	return;
	if (CHAR_getInt(talker, CHAR_FMLEADERFLAG) <= 0 )	return;
	if (strcmp(CHAR_getChar(talker, CHAR_FMNAME), "") == 0)	return;
#endif
	if (shiftbit >= arraysizeof(FMAdvTbl))
		return;
	else
		fmadv = FMAdvTbl[shiftbit];
	if (fmadv <= 0)	return;
	sprintf(buf, "%d", fmadv);
	#ifdef _PERSONAL_FAME	// Arminius 8.30: �����������
	  CHAR_earnFame(talker, fmadv);
	#endif
	#ifdef _NEW_MANOR_LAW
		sprintf(buf1, "%d", CHAR_getInt(talker,CHAR_FAME));
	#endif
#ifdef _FMVER21	
	if (CHAR_getInt(talker, CHAR_FMLEADERFLAG) > 0
	   && CHAR_getInt(talker, CHAR_FMLEADERFLAG) != FMMEMBER_APPLY)
	{
	   // CoolFish: 2001/10/03
	   int fd = getfdFromCharaIndex(talker);
		 saacproto_ACFixFMData_send(acfd,
			 CHAR_getChar(talker, CHAR_FMNAME),
			 CHAR_getInt(talker, CHAR_FMINDEX),
			 CHAR_getWorkInt(talker, CHAR_WORKFMINDEXI),
			 FM_FIX_FMADV, buf,
#ifndef _NEW_MANOR_LAW
			 "",
#else
			 buf1,
#endif
			 // CoolFish: 2001/10/03
			 CHAR_getWorkInt(talker, CHAR_WORKFMCHARINDEX),
			 CONNECT_getFdid(fd));
	   	// CHAR_getWorkInt(talker, CHAR_WORKFMCHARINDEX), 0);
#ifdef _NEW_MANOR_LAW
		 {
			 int i;
			 for(i=0;i<FAMILY_MAXHOME;i++){
				 // �κ�һ��ׯ԰������ս�ų�,����ֵһ�ı����ACҪ������������
				 if(fmpointlist.fm_inwar[i]){
					 saacproto_ACShowTopFMList_send(acfd, FM_TOP_MOMENTUM);
					 break;
				 }
			 }
		 }
#endif
	}
#ifdef _NEW_MANOR_LAW
	// δ���ͨ��ʱֻ���³�Ա����ֵ
	else if(CHAR_getInt(talker, CHAR_FMLEADERFLAG) == FMMEMBER_APPLY){
		int fd = getfdFromCharaIndex(talker);
		sprintf(buf,"%d",CHAR_getInt(talker,CHAR_FAME));
		saacproto_ACFixFMData_send(acfd,
			CHAR_getChar(talker,CHAR_FMNAME),
			CHAR_getInt(talker,CHAR_FMINDEX),
			CHAR_getWorkInt(talker,CHAR_WORKFMINDEXI),
			FM_FIX_FAME,buf,"",
			CHAR_getWorkInt(talker,CHAR_WORKFMCHARINDEX),
			CONNECT_getFdid(fd));
	}
#endif
#else
	saacproto_ACFixFMData_send(acfd,
	   	CHAR_getChar(talker, CHAR_FMNAME),
	   	CHAR_getInt(talker, CHAR_FMINDEX),
	   	CHAR_getWorkInt(talker, CHAR_WORKFMINDEXI),
	   	FM_FIX_FMADV, buf, "",
	   	CHAR_getWorkInt(talker, CHAR_WORKFMCHARINDEX), 0);
#endif	   	
}