#include "version.h" #include #include #include #include "object.h" #include "char_base.h" #include "char.h" #include "util.h" #include "npcutil.h" #include "item.h" #include "readmap.h" #include "enemy.h" #include "chatmagic.h" #include "log.h" #define EVFLG 118 // 58->白虎 118->青龙 void pet_make( int charaindex, char* message ); BOOL NPC_PetMakerInit( int meindex ) { CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPEPETMAKER ); CHAR_setFlg( meindex , CHAR_ISATTACKED , 0 ); return TRUE; } void NPC_PetMakerTalked( int meindex , int talker , char *msg ,int color ) { char* npcarg; char token[32],tmpbuf[256]; int msgNo/*,translv*/; int point,ckpoint,array,shift; int i,num=0; array = EVFLG / 32; shift = EVFLG % 32; point = CHAR_getInt( talker, CHAR_ENDEVENT + array); ckpoint = point; npcarg = CHAR_getChar(meindex,CHAR_NPCARGUMENT); getStringFromIndexWithDelim( npcarg, "|", 1, token,sizeof( token)); msgNo = atoi( token ); if( CHAR_getInt( talker , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) return; if( NPC_Util_isFaceToFace( talker, meindex , 2 ) == FALSE ) { if( NPC_Util_isFaceToFace( talker, meindex , 1 ) == FALSE ) return; } //translv = CHAR_getInt( talker, CHAR_TRANSMIGRATION); // 白虎 for(i=0; i=CHAR_MAXPETHAVE ){ sprintf(tmpbuf, "抱歉~没多余的空间可放置宠物。"); CHAR_talkToCli( talker, meindex, tmpbuf,CHAR_COLORWHITE); return; } pet_make( talker, "1845" ); point = point | (1 << shift); CHAR_setInt( talker, CHAR_ENDEVENT + array, point); } void pet_make( int charaindex, char* message ) { int ret; char msgbuf[64]; int enemynum; int enemyid; int i; enemyid = atoi(message); enemynum = ENEMY_getEnemyNum(); for( i=0; i