BOOL NPC_NPCEnemy_BattleIn( int meindex, int charaindex) { int gym; int ret; char buf[256]; char argstr[NPC_UTIL_GETARGSTR_BUFSIZE]; memset( argstr, 0, sizeof( argstr)); NPC_Util_GetArgStr( meindex, argstr, sizeof( argstr)); gym = NPC_Util_GetNumFromStrWithDelim( argstr, "gym"); if( gym > 0 ){ ret = BATTLE_CreateVsEnemy( charaindex, 2, meindex); }else{ ret = BATTLE_CreateVsEnemy( charaindex, 1, meindex); } if( ret == 0 ) { BattleArray[CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX)].WinFunc = NPC_NPCEnemy_Dying; if( NPC_Util_GetStrFromStrWithDelim( argstr, "startmsg", buf, sizeof( buf)) != NULL ){ CHAR_talkToCliAndParty( charaindex, meindex ,buf , CHAR_COLORYELLOW ); } if( NPC_Util_GetStrFromStrWithDelim( argstr, "steal", buf, sizeof( buf))!= NULL ){ if( atoi( buf) == 0 ) { NPC_NPCEnemy_StealItem( argstr, meindex, charaindex); } } } return ( ret == 0 ) ?TRUE:FALSE ; }
BOOL NPC_NPCEnemy_BattleIn( int meindex, int charaindex) { int gym; int ret; char buf[256]; char argstr1[NPC_UTIL_GETARGSTR_BUFSIZE]; char *argstr; //memset( argstr, 0, sizeof( argstr)); argstr = NPC_Util_GetArgStr( meindex, argstr1, sizeof( argstr1)); gym = NPC_Util_GetNumFromStrWithDelim( argstr, "gym"); #ifdef _EMENY_CHANCEMAN { int masterindex=-1; masterindex = NPC_EmenyChanceCheck( meindex, charaindex, argstr); if( CHAR_CHECKINDEX( masterindex)){ charaindex = masterindex; }else { return TRUE; } } #endif if( gym > 0 ){ ret = BATTLE_CreateVsEnemy( charaindex, 2, meindex); }else{ ret = BATTLE_CreateVsEnemy( charaindex, 1, meindex); } if( ret == 0 ) { BattleArray[CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX)].WinFunc = NPC_NPCEnemy_Dying; if( NPC_Util_GetStrFromStrWithDelim( argstr, "startmsg", buf, sizeof( buf)) != NULL ){ CHAR_talkToCliAndParty( charaindex, meindex ,buf , CHAR_COLORYELLOW ); } if( NPC_Util_GetStrFromStrWithDelim( argstr, "steal", buf, sizeof( buf))!= NULL ){ if( atoi( buf) == 0 ) { NPC_NPCEnemy_StealItem( argstr, meindex, charaindex); } } } return ( ret == 0 ) ?TRUE:FALSE ; }