chuyiwen_gmsv/npc/npc_townpeople.c

62 lines
1.4 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 "handletime.h"
#include "anim_tbl.h"
#include "npc_door.h"
#include "lssproto_serv.h"
#include "npcutil.h"
/*
* <EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD> by nakamura
*
*
*/
/*
*/
void NPC_TownPeopleTalked( int index, int talker, char *msg, int color )
{
char arg[NPC_UTIL_GETARGSTR_BUFSIZE], token[NPC_UTIL_GETARGSTR_LINEMAX];
int i, tokennum;
if( CHAR_getInt(talker,CHAR_WHICHTYPE) == CHAR_TYPEPLAYER
&& NPC_Util_charIsInFrontOfChar( talker, index, 3 ) ){
NPC_Util_GetArgStr( index, arg, sizeof( arg));
tokennum = 1;
/* <20><><EFBFBD><EFBFBD>Ѩƥ<D1A8><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ϳ<EFBFBD>ؤ<EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
for( i=0;arg[i]!='\0';i++ ){
if( arg[i] == ',' ) tokennum++;
}
getStringFromIndexWithDelim( arg,",",
rand()%tokennum+1,token, sizeof(token));
CHAR_talkToCli( talker, index, token, CHAR_COLORWHITE );
}
}
/*
*/
BOOL NPC_TownPeopleInit( int meindex )
{
//CHAR_setInt( meindex , CHAR_HP , 0 );
//CHAR_setInt( meindex , CHAR_MP , 0 );
//CHAR_setInt( meindex , CHAR_MAXMP , 0 );
//CHAR_setInt( meindex , CHAR_STR , 0 );
//CHAR_setInt( meindex , CHAR_TOUGH, 0 );
//CHAR_setInt( meindex , CHAR_LV , 0 );
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPETOWNPEOPLE );
//CHAR_setFlg( meindex , CHAR_ISOVERED , 1 );
return TRUE;
}