chuyiwen_gmsv/npc/npc_oldman.c

111 lines
3.3 KiB
C
Raw Normal View History

2016-12-24 08:45:52 +08:00
#include "version.h"
#include "object.h"
#include "char_base.h"
#include "char.h"
#include "util.h"
#include "npcutil.h"
#include "npc_oldman.h"
#include "title.h"
#include "char_data.h"
#include "readmap.h"
/* hoge */
BOOL NPC_OldmanInit( int meindex )
{
return FALSE;
}
/*
*
* Ӯ <EFBFBD><EFBFBD>
*
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ئ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> <EFBFBD>ƾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>į<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի
* <EFBFBD><EFBFBD><EFBFBD>³<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>
* * by ringo
*/
void NPC_OldmanTalked( int meindex , int talkerindex , char *msg , int color )
{
char message[1024];
char *n = CHAR_getChar( talkerindex , CHAR_NAME );
int title_change = 0;
/* <20><>ئ<EFBFBD>ƾ<EFBFBD><C6BE><EFBFBD><EFBFBD>׹Ʊ<D7B9><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD>IDë<44><C3AB>ʢ<EFBFBD><CAA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
CHAR_setInt( talkerindex, CHAR_LASTTALKELDER ,
CHAR_getWorkInt( meindex, CHAR_WORKOLDMANID ) );
/*
if( title_change == 0 && strcmp( n , "ƻ<EFBFBD><EFBFBD>" ) == 0 ){
if( NPC_Util_HaveTitle( talkerindex , 3 ) == 0 ){
char *ts;
NPC_Util_AddOneTitle( talkerindex , 3 );
ts = TITLE_makeTitleStatusString( talkerindex , 3 );
snprintf( message , sizeof(message),
"<EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ͽ<EFBFBD>%s<>ɣ<EFBFBD>",
ts );
title_change = 1;
}
}
*/
{
int addcnt,delcnt;
title_change = TITLE_TitleCheck_Nomsg( talkerindex, 0, &addcnt, &delcnt);
if( !title_change){
snprintf( message, sizeof( message ) ,
"<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>%s<>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD>ƺ<EFBFBD>ʱ"
"<EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" , n );
CHAR_talkToCli( talkerindex , meindex , message , CHAR_COLORWHITE );
}
else {
#define NPC_OLDMAN_TITLE_UNIT1 "TSU"
#define NPC_OLDMAN_TITLE_UNIT2 "KO"
snprintf( message, sizeof( message ) ,"<EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>%s",n );
CHAR_talkToCli( talkerindex , meindex , message , CHAR_COLORWHITE );
if( delcnt > 0 && addcnt > 0 ) {
snprintf( message, sizeof( message ) ,
"<EFBFBD><EFBFBD>ɥʧ<EFBFBD><EFBFBD>%d%s <20>ƺŵ<C6BA><C5B5>ʸ<EFBFBD><CAB8><EFBFBD>"
"<EFBFBD><EFBFBD><EFBFBD>ǵõ<EFBFBD><EFBFBD><EFBFBD>%d%s <20>ijƺ<C4B3><C6BA>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD>"
, delcnt,
delcnt < 10 ? NPC_OLDMAN_TITLE_UNIT1:NPC_OLDMAN_TITLE_UNIT2,
addcnt,
addcnt < 10 ? NPC_OLDMAN_TITLE_UNIT1:NPC_OLDMAN_TITLE_UNIT2
);
CHAR_talkToCli( talkerindex , meindex , message , CHAR_COLORWHITE );
}
else if( delcnt > 0 ) {
snprintf( message, sizeof( message ) ,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥʧ<EFBFBD>õ<EFBFBD>%d%s<>ƺŵ<C6BA><C5B5>ʸ<EFBFBD><CAB8><EFBFBD>", delcnt,
delcnt < 10 ? NPC_OLDMAN_TITLE_UNIT1:NPC_OLDMAN_TITLE_UNIT2);
CHAR_talkToCli( talkerindex , meindex , message , CHAR_COLORWHITE );
}
else if( addcnt > 0 ) {
snprintf( message, sizeof( message ) ,
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d%s<>ijƺŰɣ<C5B0>", addcnt, // CoolFish: d%s -> %d%s 2001/4/18
addcnt < 10 ? NPC_OLDMAN_TITLE_UNIT1:NPC_OLDMAN_TITLE_UNIT2);
CHAR_talkToCli( talkerindex , meindex , message , CHAR_COLORWHITE );
}
if( delcnt > 0 ) {
snprintf( message, sizeof( message),
"ʧȥ%d%s <20>ƺţ<C6BA>", delcnt,
delcnt < 10 ? NPC_OLDMAN_TITLE_UNIT1:NPC_OLDMAN_TITLE_UNIT2);
CHAR_talkToCli( talkerindex, -1, message, CHAR_COLORYELLOW);
}
if( addcnt > 0 ) {
snprintf( message, sizeof( message),
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d%s <20>ƺţ<C6BA>", addcnt,
addcnt < 10 ? NPC_OLDMAN_TITLE_UNIT1:NPC_OLDMAN_TITLE_UNIT2);
CHAR_talkToCli( talkerindex, -1, message, CHAR_COLORYELLOW);
}
}
}
if( title_change ) CHAR_sendStatusString( talkerindex , "T" );
}