732 lines
19 KiB
C
732 lines
19 KiB
C
![]() |
#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"
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/*--<2D><> ---*/
|
|||
|
#define RATE 1000
|
|||
|
|
|||
|
|
|||
|
/*
|
|||
|
* ɬ<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>
|
|||
|
*
|
|||
|
*/
|
|||
|
|
|||
|
enum {
|
|||
|
CHAR_WORK_LEVEL = CHAR_NPCWORKINT1,
|
|||
|
CHAR_WORK_RANGE = CHAR_NPCWORKINT2,
|
|||
|
CHAR_WORK_HP = CHAR_NPCWORKINT3,
|
|||
|
CHAR_WORK_MP = CHAR_NPCWORKINT4,
|
|||
|
|
|||
|
};
|
|||
|
|
|||
|
|
|||
|
static void NPC_WindowHealer_selectWindow( int meindex, int toindex, int num);
|
|||
|
void NPC_WindowHealerAllHeal( int talker,int mode );
|
|||
|
BOOL NPC_WindowHealerLevelCheck(int meindex,int talker);
|
|||
|
BOOL NPC_WindowMoneyCheck(int meindex,int talker,int mode);
|
|||
|
int NPC_WindowCostCheck(int meindex,int talker);
|
|||
|
BOOL NPC_PetHealerCheck(int talker);
|
|||
|
int NPC_WindowCostCheckMp(int meindex,int talker);
|
|||
|
|
|||
|
|
|||
|
/*********************************
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*********************************/
|
|||
|
BOOL NPC_WindowHealerInit( int meindex )
|
|||
|
{
|
|||
|
|
|||
|
char *npcarg;
|
|||
|
char buf2[256];
|
|||
|
int range=1;
|
|||
|
int rate;
|
|||
|
double drate;
|
|||
|
CHAR_setInt( meindex , CHAR_WHICHTYPE , CHAR_TYPEHEALER );
|
|||
|
|
|||
|
npcarg = CHAR_getChar(meindex,CHAR_NPCARGUMENT);
|
|||
|
|
|||
|
/*--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>弰<EFBFBD><E5BCB0><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ì<EFBFBD><C3AC>ë<EFBFBD><C3AB>ʢ--*/
|
|||
|
/*-- <20><>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľئ<C4BE><D8A6>--*/
|
|||
|
if(getStringFromIndexWithDelim(npcarg,"|",1,buf2,sizeof(buf2))!=FALSE){
|
|||
|
CHAR_setWorkInt(meindex,CHAR_WORK_LEVEL,atoi(buf2));
|
|||
|
|
|||
|
}else{
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
/*--<2D><>ݼ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--*/
|
|||
|
if(getStringFromIndexWithDelim(npcarg, "|", 2, buf2, sizeof( buf2)) != FALSE ){
|
|||
|
drate = atof(buf2);
|
|||
|
if(drate==0) {
|
|||
|
rate=500;
|
|||
|
}else{
|
|||
|
rate=(int) (drate * RATE);
|
|||
|
}
|
|||
|
CHAR_setWorkInt(meindex,CHAR_WORK_HP,rate);
|
|||
|
}
|
|||
|
if(getStringFromIndexWithDelim(npcarg, "|", 3, buf2, sizeof( buf2)) != FALSE ){
|
|||
|
drate = atof(buf2);
|
|||
|
if(drate==0){
|
|||
|
rate=2000;
|
|||
|
}else{
|
|||
|
rate=(int)( drate * RATE);
|
|||
|
}
|
|||
|
CHAR_setWorkInt(meindex,CHAR_WORK_MP,rate);
|
|||
|
}
|
|||
|
if(getStringFromIndexWithDelim(npcarg, "|", 4, buf2, sizeof( buf2)) != FALSE ){
|
|||
|
range=atoi(buf2);
|
|||
|
if(range == 0){
|
|||
|
range=1;
|
|||
|
}
|
|||
|
}
|
|||
|
CHAR_setWorkInt(meindex,CHAR_WORK_RANGE,range);
|
|||
|
return TRUE;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
void NPC_WindowHealerTalked( int meindex , int talkerindex , char *szMes ,int color )
|
|||
|
{
|
|||
|
if( CHAR_getInt( talkerindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if( NPC_Util_CharDistance( talkerindex, meindex )
|
|||
|
> CHAR_getWorkInt(meindex,CHAR_WORK_RANGE)){
|
|||
|
return;
|
|||
|
}
|
|||
|
if( (CHAR_getWorkInt(talkerindex,CHAR_WORKPARTYMODE) == 0)
|
|||
|
|| (CHAR_getWorkInt(talkerindex,CHAR_WORKPARTYMODE) == 2) ){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex,0);
|
|||
|
}else{
|
|||
|
int i=0;
|
|||
|
int otherindex;
|
|||
|
|
|||
|
for( i=0 ; i < CHAR_PARTYMAX ;i++){
|
|||
|
otherindex=CHAR_getWorkInt(talkerindex,CHAR_WORKPARTYINDEX1+i);
|
|||
|
if(otherindex != -1){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, otherindex,0);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
void NPC_WindowHealerLooked( int meindex , int lookedindex)
|
|||
|
{
|
|||
|
if( CHAR_getInt( lookedindex , CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) {
|
|||
|
return;
|
|||
|
}
|
|||
|
if( NPC_Util_CharDistance( lookedindex, meindex )
|
|||
|
> CHAR_getWorkInt(meindex,CHAR_WORK_RANGE)){
|
|||
|
return;
|
|||
|
}
|
|||
|
NPC_WindowHealer_selectWindow( meindex, lookedindex,0);
|
|||
|
}
|
|||
|
|
|||
|
static void NPC_WindowHealer_selectWindow( int meindex, int toindex, int num)
|
|||
|
{
|
|||
|
|
|||
|
char token[1024];
|
|||
|
char escapedname[1024];
|
|||
|
int fd = getfdFromCharaIndex( toindex);
|
|||
|
int buttontype=0;
|
|||
|
int windowtype=0;
|
|||
|
int windowno=0;
|
|||
|
|
|||
|
/*--<2D><><EFBFBD>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⻥<EFBFBD><E2BBA5><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD>ƥ<EFBFBD>Ʊ<EFBFBD>ɬ<EFBFBD><C9AC>--*/
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
|
|||
|
switch( num){
|
|||
|
case 0:
|
|||
|
/*--<2D><> --*/
|
|||
|
sprintf(token," <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѽ<EFBFBD><D1BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣿡<EFBFBD> \n\n "
|
|||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>;<EFBFBD><CDBE><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n"
|
|||
|
" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n"
|
|||
|
" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n\n"
|
|||
|
" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>(<28><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "
|
|||
|
);
|
|||
|
|
|||
|
buttontype=WINDOW_BUTTONTYPE_CANCEL;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_SELECT;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_STARTMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 1:
|
|||
|
if( CHAR_getInt(toindex,CHAR_HP) ==CHAR_getWorkInt( toindex, CHAR_WORKMAXHP)){
|
|||
|
if(NPC_PetHealerCheck(toindex)==FALSE){
|
|||
|
sprintf(token,
|
|||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
}else{
|
|||
|
sprintf(token,
|
|||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD><E0A1A3><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>"
|
|||
|
"\n <20>Ȱ<EFBFBD><C8B0><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8>ɣ<EFBFBD>");
|
|||
|
|
|||
|
NPC_WindowHealerAllHeal(toindex,0 );
|
|||
|
}
|
|||
|
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_HPMSG;
|
|||
|
break;
|
|||
|
}else if(NPC_WindowHealerLevelCheck(meindex,toindex)==TRUE){
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n<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> "
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵĵȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD>");
|
|||
|
|
|||
|
}else{
|
|||
|
int gold;
|
|||
|
gold=NPC_WindowCostCheck(meindex,toindex);
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n<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> "
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>STONE <20><>"
|
|||
|
,gold);
|
|||
|
}
|
|||
|
|
|||
|
buttontype=WINDOW_BUTTONTYPE_YESNO;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_HPMSG;
|
|||
|
break;
|
|||
|
|
|||
|
case 2:
|
|||
|
if( CHAR_getInt(toindex,CHAR_MP) ==CHAR_getWorkInt( toindex, CHAR_WORKMAXMP)){
|
|||
|
if(NPC_PetHealerCheck(toindex)==FALSE){
|
|||
|
sprintf(token, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
}else{
|
|||
|
sprintf(token, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD><E0A1A3><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>"
|
|||
|
"\n <20>Ȱ<EFBFBD><C8B0><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8>ɣ<EFBFBD>");
|
|||
|
NPC_WindowHealerAllHeal(toindex,0 );
|
|||
|
}
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_SPIRITMSG;
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
if(NPC_WindowHealerLevelCheck(meindex,toindex)==TRUE){
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>"
|
|||
|
"\n\n<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> "
|
|||
|
"\n\n <20><><EFBFBD>ڵĵȼ<C4B5><C8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱ<EFBFBD><D1B0><EFBFBD><EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD>");
|
|||
|
}else{
|
|||
|
int cost;
|
|||
|
cost=NPC_WindowCostCheckMp(meindex,toindex);
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>"
|
|||
|
"\n\n\n<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> "
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>STONE <20><>",
|
|||
|
cost);
|
|||
|
}
|
|||
|
buttontype=WINDOW_BUTTONTYPE_YESNO;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_SPIRITMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 3:
|
|||
|
sprintf(token, "\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѻظ<EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>ѻظ<D1BB>һ<EFBFBD><D2BB>״̬<D7B4><CCAC>"
|
|||
|
"\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ӿ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
|
|||
|
/*--<2D><>ݼ <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--*/
|
|||
|
NPC_WindowHealerAllHeal( toindex ,1 );
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_OKHPMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 4:
|
|||
|
sprintf(token, "\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѻظ<EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>ѻظ<D1BB>һ<EFBFBD><D2BB>״̬<D7B4><CCAC>"
|
|||
|
"\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ӿ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
/*--<2D><> <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---*/
|
|||
|
NPC_WindowHealerAllHeal( toindex ,2 );
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_OKSPIRITMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 6:
|
|||
|
{
|
|||
|
int cost=0;
|
|||
|
|
|||
|
if(CHAR_getInt(toindex,CHAR_HP) < CHAR_getWorkInt( toindex, CHAR_WORKMAXHP))
|
|||
|
{
|
|||
|
cost+=NPC_WindowCostCheck(meindex,toindex);
|
|||
|
}
|
|||
|
|
|||
|
if( CHAR_getInt(toindex,CHAR_MP) < CHAR_getWorkInt( toindex, CHAR_WORKMAXMP))
|
|||
|
{
|
|||
|
cost=cost+NPC_WindowCostCheckMp(meindex,toindex);
|
|||
|
}
|
|||
|
|
|||
|
if(cost==0) {
|
|||
|
if(NPC_PetHealerCheck(toindex)==FALSE){
|
|||
|
sprintf(token,
|
|||
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
}else{
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD><E0A1A3><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>"
|
|||
|
"\n <20>Ȱ<EFBFBD><C8B0><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8>ɣ<EFBFBD>");
|
|||
|
NPC_WindowHealerAllHeal(toindex,0 );
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_SPIRITMSG;
|
|||
|
break;
|
|||
|
|
|||
|
}else{
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ҫ<EFBFBD>ظ<EFBFBD><D8B8>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ɣ<EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d<><64>STONE <20><>",cost);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if(NPC_WindowHealerLevelCheck(meindex,toindex)==TRUE){
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
"\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD><D8B8>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ɣ<EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵĵȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>ࡣ<EFBFBD>");
|
|||
|
}
|
|||
|
|
|||
|
buttontype=WINDOW_BUTTONTYPE_YESNO;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_ALLMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 7:
|
|||
|
sprintf(token,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>;<EFBFBD><CDBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѻظ<D1BB><D8B8><EFBFBD>"
|
|||
|
"\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>ѻظ<D1BB>һ<EFBFBD><D2BB>״̬<D7B4><CCAC>"
|
|||
|
"\n\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ͻظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>");
|
|||
|
|
|||
|
NPC_WindowHealerAllHeal( toindex ,3 );
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_OKALLMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case 8:
|
|||
|
sprintf(token,"\n\n\n\n <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϧ<EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD>Ǯ<EFBFBD><C7AE><EFBFBD><EFBFBD>ࡣ<EFBFBD>");
|
|||
|
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_OKHPMSG;
|
|||
|
break;
|
|||
|
|
|||
|
case 9:
|
|||
|
sprintf(token,"<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>"
|
|||
|
"\n\n\n<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>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD>ǿ<EFBFBD>Ļ<EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࡣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
NPC_WindowHealerAllHeal(toindex,0 );
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_OKHPMSG;
|
|||
|
break;
|
|||
|
|
|||
|
case 10:
|
|||
|
sprintf(token,"<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>"
|
|||
|
"\n\n\n<EFBFBD><EFBFBD> <20>ƺ<EFBFBD>û<EFBFBD>б<EFBFBD>Ҫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD>"
|
|||
|
"\n\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD>ǿ<EFBFBD>Ļ<EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࡣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|||
|
buttontype=WINDOW_BUTTONTYPE_OK;
|
|||
|
windowtype=WINDOW_MESSAGETYPE_MESSAGE;
|
|||
|
windowno=CHAR_WINDOWTYPE_WINDOWHEALER_OKHPMSG;
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
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_WindowHealerWindowTalked( int meindex, int talkerindex,
|
|||
|
int seqno, int select, char *data)
|
|||
|
{
|
|||
|
|
|||
|
if( NPC_Util_CharDistance( talkerindex, meindex ) > (CHAR_getWorkInt(meindex,CHAR_WORK_RANGE)+4)) return;
|
|||
|
|
|||
|
switch( seqno){
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_STARTMSG:
|
|||
|
if(atoi(data)==2) /*--<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1--*/
|
|||
|
{
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 1 );
|
|||
|
|
|||
|
}else if(atoi(data)==3){
|
|||
|
/*--<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2--*/
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 2 );
|
|||
|
|
|||
|
}else if(atoi(data)==4){
|
|||
|
/*--<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2--*/
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 6 );
|
|||
|
|
|||
|
}else if(atoi(data)==6){
|
|||
|
/*--<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2--*/
|
|||
|
if(NPC_PetHealerCheck( talkerindex)==TRUE){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 9 );
|
|||
|
}else{
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 10 );
|
|||
|
}
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_CANCEL){
|
|||
|
/*--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ئ<><D8A6>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ئ<EFBFBD><D8A6>--*/
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
/*-----<2D><>ݼ <20><><EFBFBD><EFBFBD>ë<EFBFBD>Ƴ<EFBFBD>ئ<EFBFBD><D8A6>-----*/
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_HPMSG:
|
|||
|
if(select==WINDOW_BUTTONTYPE_OK){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_YES){
|
|||
|
/*--<2D><><EFBFBD>ż<EFBFBD><C5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--*/
|
|||
|
if(NPC_WindowMoneyCheck(meindex,talkerindex,1)==TRUE){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 3 );
|
|||
|
}else{
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 8 );
|
|||
|
}
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_NO){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
/*-----<2D><> <20><><EFBFBD><EFBFBD>ë<EFBFBD>Ƴ<EFBFBD>ئ<EFBFBD><D8A6>-----*/
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_SPIRITMSG:
|
|||
|
if(select==WINDOW_BUTTONTYPE_OK){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_YES){
|
|||
|
/*--<2D><><EFBFBD>ż<EFBFBD><C5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--*/
|
|||
|
if(NPC_WindowMoneyCheck(meindex,talkerindex,2)==TRUE){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 4 );
|
|||
|
}else{
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 8 );
|
|||
|
}
|
|||
|
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_NO){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
}
|
|||
|
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
/*-----<2D><>ݼ <20><><EFBFBD>⼰<EFBFBD><E2BCB0><EFBFBD><EFBFBD>-----*/
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_OKHPMSG:
|
|||
|
if(select==WINDOW_BUTTONTYPE_OK){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_OKSPIRITMSG:
|
|||
|
if(select==WINDOW_BUTTONTYPE_OK){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
/*--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>--*/
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_ALLMSG:
|
|||
|
if(select==WINDOW_BUTTONTYPE_OK){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_YES){
|
|||
|
if(NPC_WindowMoneyCheck(meindex,talkerindex,3)==TRUE){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 7 );
|
|||
|
}else{
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 8 );
|
|||
|
}
|
|||
|
|
|||
|
}else if(select==WINDOW_BUTTONTYPE_NO){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
|
|||
|
/*--<2D><><EFBFBD><EFBFBD><EFBFBD>⼰<EFBFBD><E2BCB0><EFBFBD><EFBFBD>--*/
|
|||
|
case CHAR_WINDOWTYPE_WINDOWHEALER_OKALLMSG:
|
|||
|
if(select==WINDOW_BUTTONTYPE_YES){
|
|||
|
NPC_WindowHealer_selectWindow( meindex, talkerindex, 0 );
|
|||
|
}
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
if(select==WINDOW_BUTTONTYPE_CANCEL
|
|||
|
&& CHAR_getWorkInt( talkerindex, CHAR_WORKPARTYMODE ) == 2)
|
|||
|
{
|
|||
|
CHAR_sendWatchEvent( CHAR_getWorkInt( talkerindex, CHAR_WORKOBJINDEX),
|
|||
|
CHAR_ACTPLEASURE,NULL,0,TRUE);
|
|||
|
CHAR_setWorkInt( talkerindex, CHAR_WORKACTION, CHAR_ACTPLEASURE);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/*--ꢹ<><EAA2B9>л<EFBFBD><D0BB><EFBFBD><EFBFBD>¼<EFBFBD>ئ<EFBFBD>գ<EFBFBD>TRUEë߯<C3AB><DFAF>--*/
|
|||
|
BOOL NPC_PetHealerCheck(int talker)
|
|||
|
{
|
|||
|
|
|||
|
int petindex;
|
|||
|
int i;
|
|||
|
|
|||
|
/*--ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>ؤ<EFBFBD><D8A4><EFBFBD><EFBFBD>--*/
|
|||
|
for(i=0;i<CHAR_MAXPETHAVE;i++){
|
|||
|
petindex = CHAR_getCharPet(talker,i);
|
|||
|
|
|||
|
if( petindex == -1 ) continue;
|
|||
|
|
|||
|
/* ƽ<>ҷ¼<D2B7> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( !CHAR_CHECKINDEX( talker ) ) continue;
|
|||
|
|
|||
|
|
|||
|
if( CHAR_getInt(petindex,CHAR_HP) != CHAR_getWorkInt(petindex,CHAR_WORKMAXHP) )
|
|||
|
{
|
|||
|
return TRUE;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
return FALSE;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/*-------------------------------------
|
|||
|
<EFBFBD>˱<EFBFBD><EFBFBD><EFBFBD>ݼ <EFBFBD>翢 ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ
|
|||
|
---------------------------------------*/
|
|||
|
void NPC_WindowHealerAllHeal( int talker,int mode )
|
|||
|
{
|
|||
|
int i;
|
|||
|
int petindex;
|
|||
|
char petsend[64];
|
|||
|
char msgbuf[64];
|
|||
|
|
|||
|
/*--<2D><>ݼ <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>--*/
|
|||
|
if(mode==1){
|
|||
|
/*--HP<48><50><EFBFBD><EFBFBD>ݼ ئ<><D8A6>ƥؤ<C6A5><D8A4>--*/
|
|||
|
CHAR_setInt( talker , CHAR_HP ,CHAR_getWorkInt( talker, CHAR_WORKMAXHP ) );
|
|||
|
}else if(mode==2){
|
|||
|
/*--<2D><> <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>--*/
|
|||
|
/*--MP<4D><50><EFBFBD><EFBFBD> ئ<><D8A6>ƥؤ<C6A5><D8A4>--*/
|
|||
|
CHAR_setInt( talker , CHAR_MP ,CHAR_getWorkInt( talker, CHAR_WORKMAXMP ) );
|
|||
|
}else if(mode==3){
|
|||
|
/*--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---*/
|
|||
|
CHAR_setInt( talker , CHAR_HP ,CHAR_getWorkInt( talker, CHAR_WORKMAXHP ) );
|
|||
|
CHAR_setInt( talker , CHAR_MP ,CHAR_getWorkInt( talker, CHAR_WORKMAXMP ) );
|
|||
|
}
|
|||
|
|
|||
|
/*--ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>ؤ<EFBFBD><D8A4><EFBFBD><EFBFBD>--*/
|
|||
|
for(i=0;i<CHAR_MAXPETHAVE;i++){
|
|||
|
petindex = CHAR_getCharPet(talker,i);
|
|||
|
|
|||
|
if( petindex == -1 ) continue;
|
|||
|
|
|||
|
/* ƽ<>ҷ¼<D2B7> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( !CHAR_CHECKINDEX( talker ) ) continue;
|
|||
|
|
|||
|
/*--<2D><><EFBFBD><EFBFBD>--*/
|
|||
|
CHAR_setFlg( petindex,CHAR_ISDIE,0 );
|
|||
|
CHAR_setInt( petindex , CHAR_HP ,CHAR_getWorkInt( petindex, CHAR_WORKMAXHP ) );
|
|||
|
CHAR_setInt( petindex , CHAR_MP ,CHAR_getWorkInt( petindex, CHAR_WORKMAXMP ) );
|
|||
|
|
|||
|
/*--<2D>ɷ¶<C9B7><C2B6><EFBFBD><EFBFBD><EFBFBD>Ʃ<EFBFBD><C6A9>--*/
|
|||
|
CHAR_complianceParameter( petindex );
|
|||
|
sprintf( petsend, "K%d", i );
|
|||
|
CHAR_sendStatusString( talker , petsend );
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
/*--<2D>ɷ¶<C9B7><C2B6><EFBFBD><EFBFBD><EFBFBD>˪Ի--*/
|
|||
|
CHAR_send_P_StatusString(talker,CHAR_P_STRING_HP);
|
|||
|
CHAR_send_P_StatusString(talker,CHAR_P_STRING_MP);
|
|||
|
|
|||
|
|
|||
|
/*---<2D><><EFBFBD><EFBFBD><DEBB><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD>ޱ<EFBFBD><DEB1><EFBFBD>˪<EFBFBD><CBAA>--*/
|
|||
|
if(CHAR_getWorkInt( talker, CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE )
|
|||
|
{
|
|||
|
int topartyarray = -1;
|
|||
|
int oyaindex = CHAR_getWorkInt( talker , CHAR_WORKPARTYINDEX1);
|
|||
|
|
|||
|
if( CHAR_CHECKINDEX( oyaindex )) {
|
|||
|
int i;
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB> */
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int workindex = CHAR_getWorkInt( oyaindex, CHAR_WORKPARTYINDEX1 +i);
|
|||
|
|
|||
|
if( CHAR_CHECKINDEX( workindex) ) {
|
|||
|
if( workindex == talker ) {
|
|||
|
topartyarray = i;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int otherindex = CHAR_getPartyIndex( talker, i);
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ɷ¶<C9B7><C2B6><EFBFBD><EFBFBD><EFBFBD>ë˪<C3AB><CBAA> */
|
|||
|
if( CHAR_CHECKINDEX( otherindex) ) {
|
|||
|
snprintf( msgbuf, sizeof( msgbuf), "N%d", topartyarray);
|
|||
|
if( otherindex != talker) {
|
|||
|
CHAR_sendStatusString( otherindex, msgbuf);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/*-------------------------------------
|
|||
|
<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> TRUE
|
|||
|
ɬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ì<EFBFBD>ﶯ<EFBFBD><EFBFBD>ئ<EFBFBD><EFBFBD> FALSE
|
|||
|
---------------------------------------*/
|
|||
|
BOOL NPC_WindowHealerLevelCheck(int meindex,int talker)
|
|||
|
{
|
|||
|
int level;
|
|||
|
|
|||
|
level=CHAR_getWorkInt(meindex,CHAR_WORK_LEVEL);
|
|||
|
|
|||
|
if(level > CHAR_getInt(talker,CHAR_LV)){
|
|||
|
return TRUE;
|
|||
|
}
|
|||
|
|
|||
|
return FALSE;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/*-------------------------------------------
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>Ȼ<EFBFBD><EFBFBD>¾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
¦<EFBFBD><EFBFBD>
|
|||
|
meindex<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>̼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>
|
|||
|
talker<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>
|
|||
|
---------------------------------------------*/
|
|||
|
BOOL NPC_WindowMoneyCheck(int meindex,int talker,int mode)
|
|||
|
{
|
|||
|
int cost=0;
|
|||
|
int level;
|
|||
|
|
|||
|
level=CHAR_getWorkInt(meindex,CHAR_WORK_LEVEL);
|
|||
|
|
|||
|
if(mode==1){
|
|||
|
if(level <= CHAR_getInt(talker,CHAR_LV)){
|
|||
|
/*---<2D><><EFBFBD><EFBFBD>ë<EFBFBD><C3AB>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD>---*/
|
|||
|
cost=NPC_WindowCostCheck(meindex,talker);
|
|||
|
/*--<2D>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD><C9AC>---*/
|
|||
|
/*---<2D><><EFBFBD>Ż<EFBFBD><C5BB><EFBFBD>Ի<EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---*/
|
|||
|
if(CHAR_getInt(talker,CHAR_GOLD) < cost){
|
|||
|
return FALSE;
|
|||
|
|
|||
|
}
|
|||
|
CHAR_DelGold( talker, cost);
|
|||
|
}
|
|||
|
}
|
|||
|
if(mode==2){
|
|||
|
if(level <= CHAR_getInt(talker,CHAR_LV)){
|
|||
|
/*---<2D><><EFBFBD><EFBFBD>ë<EFBFBD><C3AB>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD>---*/
|
|||
|
cost=NPC_WindowCostCheckMp(meindex,talker);
|
|||
|
|
|||
|
/*--<2D>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD><C9AC>---*/
|
|||
|
/*---<2D><><EFBFBD>Ż<EFBFBD><C5BB><EFBFBD>Ի<EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>---*/
|
|||
|
if(CHAR_getInt(talker,CHAR_GOLD) < cost){
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
CHAR_DelGold( talker, cost);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if(mode==3){
|
|||
|
if(level <= CHAR_getInt(talker,CHAR_LV)){
|
|||
|
|
|||
|
/*--<2D><>ݼ <20><><EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD><C5BC><EFBFBD>ң--*/
|
|||
|
if( CHAR_getInt(talker,CHAR_HP) <CHAR_getWorkInt( talker, CHAR_WORKMAXHP))
|
|||
|
{
|
|||
|
cost=NPC_WindowCostCheck(meindex,talker);
|
|||
|
}
|
|||
|
|
|||
|
/*--<2D><> <20><><EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD><C5BC><EFBFBD>ң--*/
|
|||
|
if( CHAR_getInt(talker,CHAR_MP) < CHAR_getWorkInt( talker, CHAR_WORKMAXMP))
|
|||
|
{
|
|||
|
cost=cost+NPC_WindowCostCheckMp(meindex,talker);
|
|||
|
}
|
|||
|
|
|||
|
/*--<2D><>ɬ<EFBFBD><C9AC>--*/
|
|||
|
if(CHAR_getInt(talker,CHAR_GOLD) < cost){
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
|
|||
|
/*---<2D><><EFBFBD><EFBFBD>ëӼ<C3AB><D3BC><EFBFBD><EFBFBD>---*/
|
|||
|
CHAR_DelGold( talker, cost);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
CHAR_send_P_StatusString(talker,CHAR_P_STRING_GOLD);
|
|||
|
|
|||
|
return TRUE;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/*-----------------------------------------
|
|||
|
<EFBFBD>쵩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ң
|
|||
|
------------------------------------------*/
|
|||
|
int NPC_WindowCostCheck(int meindex,int talker)
|
|||
|
{
|
|||
|
int cost;
|
|||
|
double drate;
|
|||
|
int rate;
|
|||
|
|
|||
|
rate=CHAR_getWorkInt(meindex,CHAR_WORK_HP);
|
|||
|
drate=(double) rate / 1000 ;
|
|||
|
cost=CHAR_getInt(talker,CHAR_LV);
|
|||
|
cost=(int)cost*drate;
|
|||
|
if(cost < 1) cost=1;
|
|||
|
return cost;
|
|||
|
}
|
|||
|
|
|||
|
/*-----------------------------------------
|
|||
|
<EFBFBD><EFBFBD> <EFBFBD>쵩<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ң
|
|||
|
------------------------------------------*/
|
|||
|
int NPC_WindowCostCheckMp(int meindex,int talker)
|
|||
|
{
|
|||
|
int cost;
|
|||
|
double drate;
|
|||
|
int rate;
|
|||
|
|
|||
|
rate=CHAR_getWorkInt(meindex,CHAR_WORK_MP);
|
|||
|
drate=(double) rate / 1000 ;
|
|||
|
cost=CHAR_getInt(talker,CHAR_LV);
|
|||
|
cost=(int)cost*drate;
|
|||
|
if(cost==0) cost=1;
|
|||
|
return cost;
|
|||
|
}
|