chuyiwen_gmsv/npc/npc_bodylan.c

488 lines
12 KiB
C
Raw Normal View History

2016-12-24 08:45:52 +08:00
#include "version.h"
#include <string.h>
#include "char.h"
#include "object.h"
#include "char_base.h"
#include "npcutil.h"
#include "lssproto_serv.h"
#include "npc_windowhealer.h"
/*
*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>ū<EFBFBD>¼<EFBFBD><EFBFBD>ء<EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ɱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>NPC
* <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>NPC<EFBFBD><EFBFBD>INDEXë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
*
*<EFBFBD>ȣ<EFBFBD>NPC<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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*NPC<EFBFBD><EFBFBD>INDEXë<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>ˡ<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><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><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>
*
*/
enum {
BODYLAN_E_COMMANDNUM = CHAR_NPCWORKINT1, // <20><>Ѩ<EFBFBD><D1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӯ<EFBFBD><D3AE>
};
// <20><><EFBFBD>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD><EFBFBD>
enum{
BODYLAN_WIN_FIRST,
BODYLAN_WIN_LAST_GOOD,
BODYLAN_WIN_LAST_NG,
BODYLAN_WIN_GOOD_NO,
BODYLAN_WIN_ALREADY,
BODYLAN_WIN_NOT_PREEVENT,
BODYLAN_WIN_END
};
static void NPC_BodyLan_Profit( int meindex, int playerindex );
static void NPC_BodyLan_Window(
int meindex,
int talkerindex,
int mode
);
/*********************************
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************/
BOOL NPC_BodyLanInit( int meindex )
{
char szP[256], szArg[4096];
char buf[256];
int i, needSeq;
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPEEVENT );
if( NPC_Util_GetArgStr( meindex, szArg, sizeof( szArg ) ) == NULL ){
print( "npc_bodylan.c:û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n",
CHAR_getChar(meindex,CHAR_NPCARGUMENT) );
return FALSE;
}
// <20>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Act", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>趨(%s)\n", szArg );
return FALSE;
}
for( i = 0 ; ; i ++ ){
// ۢئ<DBA2><D8A6>
if( getStringFromIndexWithDelim( szP, ",", i, buf, sizeof( buf)) != FALSE ){
needSeq = atoi(buf);
// Ѩ<>̹ϵ<CCB9><CFB5><EFBFBD> <20><><EFBFBD>ճ<EFBFBD><D5B3><EFBFBD><EFBFBD><EFBFBD>ƥ
if( needSeq < 0 ){
if( i <= 0 ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>趨(%s)\n", szArg );
}
// <20><>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( meindex, BODYLAN_E_COMMANDNUM, i );
break;
}else{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}
}else{
if( i <= 0 ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>趨(%s)\n", szArg );
}
// <20><>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( meindex, BODYLAN_E_COMMANDNUM, i );
break;
}
}
return TRUE;
}
/*********************************
* <EFBFBD>ƾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD><EFBFBD>
*********************************/
void NPC_BodyLanTalked( int meindex , int talkerindex , char *szMes ,int color )
{
char szP[256], szArg[4096];
int EventNo = -1,Pre_Event = -1;
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD> ɱ<><C9B1><EFBFBD><EFBFBD> */
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
return;
}
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
if( NPC_Util_CharDistance( talkerindex, meindex ) > 2 )
{
return;
}
// ¦<><C2A6> ٯ
if( NPC_Util_GetArgStr( meindex, szArg, sizeof( szArg ) ) == NULL ){
print( "npc_bodylan.c:û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n",
CHAR_getChar(meindex,CHAR_NPCARGUMENT) );
return ;
}else{
// <20><>ì<EFBFBD><C3AC><EFBFBD><EFBFBD> į<><C4AF>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "EventNo", szP, sizeof( szP ) ) != NULL ){
EventNo = atoi(szP);
}
// <20><><EFBFBD><EFBFBD> ۢ<><DBA2>ì<EFBFBD><C3AC><EFBFBD><EFBFBD> į<><C4AF>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Pre_Event", szP, sizeof( szP ) ) != NULL ){
Pre_Event = atoi(szP);
}
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ۢ<><DBA2>ì<EFBFBD><C3AC><EFBFBD><EFBFBD> į<><C4AF>ؤľ<D8A4><C4BE>
if( Pre_Event >= 0 ){
// <20><>ì<EFBFBD><C3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_EventCheckFlg( talkerindex, Pre_Event ) == FALSE ){
// ۢ<><DBA2>ì<EFBFBD><C3AC><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD>ʧ<EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>ئ<EFBFBD><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ճ𼰱<D5B3><F0BCB0B1><EFBFBD><EFBFBD><EFBFBD>
NPC_BodyLan_Window( meindex, talkerindex, BODYLAN_WIN_NOT_PREEVENT );
return;
}
}
// <20><>ì<EFBFBD><C3AC><EFBFBD><EFBFBD> į<><C4AF>ؤľ<D8A4><C4BE>
if( EventNo >= 0 ){
// <20><>ì<EFBFBD><C3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_EventCheckFlg( talkerindex, EventNo ) == TRUE ){
// <20>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ճ𼰱<D5B3><F0BCB0B1><EFBFBD><EFBFBD><EFBFBD>
NPC_BodyLan_Window( meindex, talkerindex, BODYLAN_WIN_ALREADY );
return;
}
}
// <20><><EFBFBD>Գ<EFBFBD><D4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD>׾<EFBFBD>
if( CHAR_getWorkInt( talkerindex, CHAR_WORKTRADER ) == meindex ){
// <20><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>Ѩ<EFBFBD><D1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT )
>= CHAR_getWorkInt( meindex, BODYLAN_E_COMMANDNUM )
){
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
NPC_BodyLan_Window( meindex, talkerindex, BODYLAN_WIN_LAST_GOOD );
return;
}else{
// <20><>
NPC_BodyLan_Window( meindex, talkerindex, BODYLAN_WIN_LAST_NG );
return;
}
}else{
// <20>ٻ<EFBFBD><D9BB><EFBFBD>ئ<EFBFBD><D8A6>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( talkerindex, CHAR_WORKTRADER, meindex );
// <20>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE>ձ<EFBFBD><D5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 1 );
// <20><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E7BEAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>微ئؤ<D8A6><D8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
NPC_BodyLan_Window( meindex, talkerindex, BODYLAN_WIN_FIRST );
return;
}
}
/*=======================================
* watch <EFBFBD><EFBFBD>
*======================================*/
void NPC_BodyLanWatch(
int objmeindex,
int objmoveindex,
CHAR_ACTION act,
int x,
int y,
int dir,
int* opt,
int optlen
)
{
char szP[256], szArg[4096];
char buf[256];
int actindex;
int meindex;
int seqNo, needSeq;
// ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( OBJECT_getType(objmoveindex) != OBJTYPE_CHARA ) return;
actindex = OBJECT_getIndex(objmoveindex);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getInt( actindex, CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) return;
// <20><><EFBFBD>м<EFBFBD><D0BC>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>
meindex = OBJECT_getIndex(objmeindex);
// <20><><EFBFBD>м<EFBFBD>INDEXë<58><C3AB> <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD>ئ<EFBFBD><D8A6>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getWorkInt( actindex, CHAR_WORKTRADER ) != meindex ){
return;
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥʧ<C6A5><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>¾<EFBFBD>
seqNo = CHAR_getWorkInt( actindex, CHAR_WORKSHOPRELEVANT );
// ئ<><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE><EFBFBD>
if( seqNo < 1 )seqNo = 1;
// ¦<><C2A6> ٯ
if( NPC_Util_GetArgStr( meindex, szArg, sizeof( szArg ) ) == NULL ){
print( "npc_bodylan.c:û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n",
CHAR_getChar(meindex,CHAR_NPCARGUMENT) );
return ;
}
// <20>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Act", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>趨(%s)\n", szArg );
return;
}
// ۢئ<DBA2><D8A6>
if(getStringFromIndexWithDelim( szP, ",", seqNo, buf, sizeof( buf)) != FALSE ){
needSeq = atoi(buf);
}else{
// ئ<>⾮ئ<E2BEAE><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE><EFBFBD>
CHAR_setWorkInt( actindex, CHAR_WORKSHOPRELEVANT, 1 );
// print( "<22><><EFBFBD><EFBFBD>ͷ<EFBFBD>ˡ<EFBFBD><CBA1>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", seqNo, needSeq );
// <20>Ͼ<EFBFBD><CFBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5BEAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return;
}
// <20><><EFBFBD><EFBFBD> ۢئʧ<D8A6><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( needSeq == act ){
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ף۳<D7A3>ľ<EFBFBD><C4BE> <20><>
// print( "<22>ɹ<EFBFBD>\(%d<><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d)\n", seqNo, needSeq );
seqNo ++;
if( seqNo >= CHAR_getWorkInt( meindex, BODYLAN_E_COMMANDNUM ) ){
// print( "<22>ڴ˽<DAB4><CBBD><EFBFBD><EFBFBD><EFBFBD>\n" );
}
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ë<><C3AB><EFBFBD><EFBFBD>
CHAR_setWorkInt( actindex, CHAR_WORKSHOPRELEVANT, seqNo );
}else{
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE><EFBFBD>֧Ի <20><>
CHAR_setWorkInt( actindex, CHAR_WORKSHOPRELEVANT, 1 );
// print( "(%d<><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d)\n", seqNo, needSeq );
}
}
//********* <20><> <20>ݼ<EFBFBD><DDBC><EFBFBD> *********
static void NPC_BodyLan_Profit( int meindex, int playerindex )
{
char szArg[4096], szP[256];
int fl, x, y, pmode, i, subindex, parent;
// ¦<><C2A6> ٯ
if( NPC_Util_GetArgStr( meindex, szArg, sizeof( szArg ) ) == NULL ){
print( "npc_bodylan.c:û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n",
CHAR_getChar(meindex,CHAR_NPCARGUMENT) );
return ;
}
//*********************************************
//
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>۷<EFBFBD><DBB7><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD><C9AC>
//
//*********************************************
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Warp", szP, sizeof( szP ) ) != NULL ){
// <20><> <20><EFBFBD><E5B7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
if( sscanf( szP, "%d,%d,%d", &fl, &x, &y ) == 3 ){
}else{
print( "npc_bodylan: <20>޷<EFBFBD><DEB7><EFBFBD>ȡ<EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szP );
return;
}
// <20>ɡ<EFBFBD> ū׬<C5AB><D7AC>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҽ<EFBFBD><D2BC>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>
pmode = CHAR_getWorkInt( playerindex, CHAR_WORKPARTYMODE );
switch( pmode ){
case 1: // <20><><EFBFBD>л<EFBFBD><D0BB><EFBFBD>
parent = playerindex;
break;
case 2: // <20><><EFBFBD>л<EFBFBD><D0BB>Ҽ<EFBFBD><D2BC><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB>
parent = CHAR_getWorkInt( playerindex, CHAR_WORKPARTYINDEX1 );
break;
default:
// <20>ɡ<EFBFBD> ūԪ<C5AB><D4AA>ئ<EFBFBD><D8A6><EFBFBD><EFBFBD><EFBFBD>ף۷<D7A3><DBB7>з<EFBFBD><D0B7><EFBFBD><EAB7A5><EFBFBD><EFBFBD>
CHAR_warpToSpecificPoint( playerindex, fl, x, y );
return;
}
// <20><EFBFBD><E5B9BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for( i = 0; i < CHAR_PARTYMAX; i ++ ){
subindex = CHAR_getWorkInt( parent, CHAR_WORKPARTYINDEX1+i );
if( CHAR_CHECKINDEX( subindex ) == FALSE )continue;
// <20>ɡ<EFBFBD> ū<><EFBFBD><E5B9BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_warpToSpecificPoint( subindex, fl, x, y );
}
}
}
#if 1
static void NPC_BodyLan_Window(
int meindex,
int talkerindex,
int mode
)
{
char token[1024];
char escapedname[2048];
char szArg[4096];
char szP[256];
int fd;
int buttontype = 0, windowtype = 0, windowno = 0;
if( CHAR_CHECKINDEX( talkerindex ) == FALSE )return;
fd = getfdFromCharaIndex( talkerindex );
// ¦<><C2A6> ٯ
if( NPC_Util_GetArgStr( meindex, szArg, sizeof( szArg ) ) == NULL ){
print( "npc_bodylan.c:û<><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n",
CHAR_getChar(meindex,CHAR_NPCARGUMENT) );
return ;
}
szP[0] = 0;
switch( mode ){
case BODYLAN_WIN_FIRST:
// <20>ٱ<EFBFBD> <20><>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "First", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:һ<><D2BB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szArg );
return;
}
sprintf( token,"%s", szP );
buttontype=WINDOW_BUTTONTYPE_YES|WINDOW_BUTTONTYPE_NO;
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
windowno=mode;
break;
case BODYLAN_WIN_LAST_GOOD:
// ƥ<><C6A5>ݩ<EFBFBD><DDA9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Good", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD>ʱ˵<CAB1><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szArg );
return;
}
sprintf( token,"%s", szP );
buttontype=WINDOW_BUTTONTYPE_YESNO;// YES|NO
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
windowno=mode;
break;
case BODYLAN_WIN_LAST_NG:
// ƥ<><C6A5>ݩ<EFBFBD><DDA9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Ng", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD>ʱ˵<CAB1><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szArg );
return;
}
sprintf( token,"%s", szP );
buttontype=WINDOW_BUTTONTYPE_OK;// OK
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
windowno=mode;
break;
case BODYLAN_WIN_GOOD_NO:
// <20><>ݩ<EFBFBD>ݱ<EFBFBD> ëƽ<C3AB>Ҽ<EFBFBD><D2BC><EFBFBD><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Good_No", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:<3A><><EFBFBD><EFBFBD>ʱȡ<CAB1><C8A1><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szArg );
return;
}
sprintf( token,"%s", szP );
buttontype=WINDOW_BUTTONTYPE_OK;// OK
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
windowno=mode;
break;
case BODYLAN_WIN_ALREADY:
// <20><>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ì<EFBFBD><C3AC><EFBFBD><EFBFBD>ë<EFBFBD><C3AB> <20>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Good_No", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:<3A>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szArg );
return;
}
sprintf( token,"%s", szP );
buttontype=WINDOW_BUTTONTYPE_OK; // OK
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
windowno=mode;
break;
case BODYLAN_WIN_NOT_PREEVENT:
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ۢئ<DBA2><D8A6>ì<EFBFBD><C3AC><EFBFBD><EFBFBD>ë<EFBFBD><C3AB>ئ<EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>ئ<EFBFBD><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( NPC_Util_GetStrFromStrWithDelim( szArg, "Pre_Not", szP, sizeof( szP ) ) == NULL ){
print( "npc_bodylan:?<3F><>ǰ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%s)\n", szArg );
return;
}
sprintf( token,"%s", szP );
buttontype=WINDOW_BUTTONTYPE_OK; // OK
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
windowno=mode;
break;
default:
return;
}
makeEscapeString( token, escapedname, sizeof(escapedname));
/*-<2D><><EFBFBD><EFBFBD>ƥ˪<C6A5><CBAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--*/
lssproto_WN_send( fd, windowtype,
buttontype,
windowno,
CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX),
escapedname);
}
/*-----------------------------------------
<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>
-------------------------------------------*/
void NPC_BodyLanWindowTalked(
int meindex,
int talkerindex,
int seqno,
int select,
char *data
)
{
if( NPC_Util_CharDistance( talkerindex, meindex ) > 2) return;
switch( seqno){
case BODYLAN_WIN_LAST_GOOD: // <20><>ݩ<EFBFBD>ݱ<EFBFBD>OK<4F>ɽ<EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>
if(select==WINDOW_BUTTONTYPE_YES ){
NPC_BodyLan_Profit( meindex, talkerindex );
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ë٨ľ<D9A8><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( talkerindex, CHAR_WORKTRADER, -1 );
// <20>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE>ձ<EFBFBD><D5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 1 );
}else
if( select == WINDOW_BUTTONTYPE_NO ){
// <20><>ݩ<EFBFBD>ݱ<EFBFBD>ƽ<EFBFBD>Ҽ<EFBFBD><D2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>
NPC_BodyLan_Window( meindex, talkerindex, BODYLAN_WIN_GOOD_NO );
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ë٨ľ<D9A8><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( talkerindex, CHAR_WORKTRADER, -1 );
// <20>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE>ձ<EFBFBD><D5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CHAR_setWorkInt( talkerindex, CHAR_WORKSHOPRELEVANT, 1 );
}
break;
default:
break;
}
}
#endif