736 lines
22 KiB
C
736 lines
22 KiB
C
![]() |
#include "version.h"
|
|||
|
#include <stdio.h>
|
|||
|
|
|||
|
#include "readmap.h"
|
|||
|
#include "object.h"
|
|||
|
#include "char.h"
|
|||
|
#include "char_base.h"
|
|||
|
#include "battle.h"
|
|||
|
#include "lssproto_serv.h"
|
|||
|
#include "npcutil.h"
|
|||
|
#include "npc_bus.h"
|
|||
|
#include "npc_airplane.h" // Arminius 7.10 Airplane
|
|||
|
#include "family.h" // shan
|
|||
|
|
|||
|
#ifdef _ITEM_QUITPARTY
|
|||
|
#include "init.h"
|
|||
|
#endif
|
|||
|
#ifdef _ALLBLUES_LUA
|
|||
|
#include "mylua/function.h"
|
|||
|
#endif
|
|||
|
// shan add
|
|||
|
extern struct FM_PKFLOOR fmpkflnum[FAMILY_FMPKFLOOR];
|
|||
|
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <EFBFBD>ɡ<EFBFBD> ū<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ĩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
------------------------------------------------------------*/
|
|||
|
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD> ū ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* ئ<EFBFBD><EFBFBD>ľ<EFBFBD><EFBFBD>-1ë߯<EFBFBD>ʣ<EFBFBD>
|
|||
|
------------------------------------------------------------*/
|
|||
|
int CHAR_getEmptyPartyArray( int charaindex)
|
|||
|
{
|
|||
|
int i = -1;
|
|||
|
int rc = FALSE;
|
|||
|
int toindex;
|
|||
|
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
|||
|
toindex = charaindex;
|
|||
|
}
|
|||
|
else {
|
|||
|
toindex = CHAR_getPartyIndex( charaindex, 0);
|
|||
|
}
|
|||
|
if( CHAR_CHECKINDEX( toindex)){
|
|||
|
for( i = 1; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
if( CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1) == -1 ) {
|
|||
|
rc = TRUE;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
return( rc ? i: -1);
|
|||
|
}
|
|||
|
|
|||
|
int CHAR_getPartyNum( int charaindex)
|
|||
|
{
|
|||
|
int i = -1;
|
|||
|
int rc = FALSE;
|
|||
|
int toindex;
|
|||
|
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
|||
|
return 1;
|
|||
|
}
|
|||
|
else {
|
|||
|
toindex = CHAR_getPartyIndex( charaindex, 0);
|
|||
|
}
|
|||
|
if( CHAR_CHECKINDEX( toindex)){
|
|||
|
for( i = 1; i <= CHAR_PARTYMAX; i ++ ) {
|
|||
|
if(i==CHAR_PARTYMAX) return i;
|
|||
|
if( CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1) == -1 ) {
|
|||
|
return i;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
return i;
|
|||
|
}
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <EFBFBD>˱<EFBFBD><EFBFBD>ɡ<EFBFBD> ū<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* charaindex int <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* targetindex int <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>켰<EFBFBD><EFBFBD>
|
|||
|
------------------------------------------------------------*/
|
|||
|
BOOL CHAR_JoinParty_Main( int charaindex, int targetindex)
|
|||
|
{
|
|||
|
int firstflg = FALSE;
|
|||
|
int i;
|
|||
|
char c[3];
|
|||
|
char buf[64];
|
|||
|
int toindex;
|
|||
|
int parray;
|
|||
|
|
|||
|
/* <20>ʻ<EFBFBD><CABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¦<EFBFBD>Ƚ<EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD> */
|
|||
|
if( CHAR_getWorkInt( targetindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
|||
|
toindex = targetindex;
|
|||
|
}
|
|||
|
else {
|
|||
|
toindex = CHAR_getPartyIndex( targetindex, 0);
|
|||
|
if( !CHAR_CHECKINDEX( toindex) ) {
|
|||
|
print( " %s:%d err\n", __FILE__, __LINE__);
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#ifdef _ALLBLUES_LUA_1_5
|
|||
|
if(FreePartyJoin(charaindex, toindex) == FALSE){
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
#endif
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD> ū<><C5AB><EFBFBD><EFBFBD><EFBFBD>ѷ<EFBFBD> <20><><EFBFBD><EFBFBD> */
|
|||
|
parray = CHAR_getEmptyPartyArray( toindex) ;
|
|||
|
if( parray == -1 ) {
|
|||
|
print( "%s : %d err\n", __FILE__,__LINE__);
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD>BUG
|
|||
|
int pi;
|
|||
|
for( pi = 0; pi < CHAR_PARTYMAX; pi ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, pi + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index)) {
|
|||
|
if(index == charaindex) return; //<2F><><EFBFBD><EFBFBD>BUG
|
|||
|
}
|
|||
|
}
|
|||
|
#ifdef _WARNPC_CTRL
|
|||
|
int mapi;
|
|||
|
for(mapi=0;mapi<10;mapi++){
|
|||
|
int floorid = getPartyMap(mapi);
|
|||
|
if(CHAR_getInt(charaindex,CHAR_FLOOR)==floorid){
|
|||
|
int sameipnum = getMapSameIp(mapi);
|
|||
|
int partyi;
|
|||
|
unsigned ip=CONNECT_get_userip(getfdFromCharaIndex(charaindex));
|
|||
|
unsigned teseip = ip;
|
|||
|
unsigned toip;
|
|||
|
int a, b, c, d,ipcnt=1;
|
|||
|
char ipstr[32];
|
|||
|
a=(teseip % 0x100); teseip=teseip / 0x100;
|
|||
|
b=(teseip % 0x100); teseip=teseip / 0x100;
|
|||
|
c=(teseip % 0x100); teseip=teseip / 0x100;
|
|||
|
d=(teseip % 0x100);
|
|||
|
sprintf(ipstr,"%d.%d.%d.%d",a,b,c,d);
|
|||
|
if(strcmp(ipstr,getNoAttIp(0))==0 || strcmp(ipstr,getNoAttIp(1))==0 || strcmp(ipstr,getNoAttIp(2))==0 || strcmp(ipstr,getNoAttIp(3))==0 || strcmp(ipstr,getNoAttIp(4))==0)
|
|||
|
break;
|
|||
|
if( CHAR_getWorkInt( toindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
|||
|
toip=CONNECT_get_userip(getfdFromCharaIndex(toindex));
|
|||
|
if(ip==toip){
|
|||
|
ipcnt++;
|
|||
|
if(ipcnt>sameipnum){
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD>˵<EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>IP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣", CHAR_COLORYELLOW);
|
|||
|
return;
|
|||
|
}
|
|||
|
else
|
|||
|
break;
|
|||
|
}
|
|||
|
break;
|
|||
|
}else{
|
|||
|
for( partyi = 0; partyi < CHAR_PARTYMAX; partyi ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, partyi + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index)) {
|
|||
|
toip = CONNECT_get_userip(getfdFromCharaIndex(index));
|
|||
|
if(ip==toip){
|
|||
|
ipcnt++;
|
|||
|
if(ipcnt>sameipnum){
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD>˵<EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>IP<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롣", CHAR_COLORYELLOW);
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
#ifdef _FLOOR_PARTY_CTRL
|
|||
|
int mapj;
|
|||
|
for(mapj=1;mapj<=5;mapj++){
|
|||
|
int floorid = getPartyFloor(mapj);
|
|||
|
if(CHAR_getInt(charaindex,CHAR_FLOOR)==floorid){
|
|||
|
time_t timep;
|
|||
|
struct tm *p;
|
|||
|
time(&timep);
|
|||
|
p=localtime(&timep); /*ȡ<>õ<EFBFBD><C3B5><EFBFBD>ʱ<EFBFBD><CAB1>*/
|
|||
|
int day=p->tm_wday;
|
|||
|
int hour=p->tm_hour;
|
|||
|
if(hour < 2) day = day - 1;
|
|||
|
if(day>5 || day<1) day = 5;
|
|||
|
int partyi,partycnt=1;
|
|||
|
if( CHAR_getWorkInt( toindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
|||
|
partycnt++;
|
|||
|
if(partycnt>day){
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޣ<EFBFBD><EFBFBD><EFBFBD>һΪ1<EFBFBD>ˣ<EFBFBD><EFBFBD>ܶ<EFBFBD>Ϊ2<EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ3<EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ4<EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
return;
|
|||
|
}
|
|||
|
else
|
|||
|
break;
|
|||
|
}else{
|
|||
|
for( partyi = 0; partyi < CHAR_PARTYMAX; partyi ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, partyi + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index)) {
|
|||
|
partycnt++;
|
|||
|
if(partycnt>day){
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޣ<EFBFBD><EFBFBD><EFBFBD>һΪ1<EFBFBD>ˣ<EFBFBD><EFBFBD>ܶ<EFBFBD>Ϊ2<EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ3<EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ4<EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
/* <20><><EFBFBD><EFBFBD> <20><> <20>ʼ<EFBFBD><CABC>ݷ<EFBFBD><DDB7>ʱ<EFBFBD>ئ<EFBFBD><D8A6><EFBFBD><EFBFBD>CAë˪<C3AB><CBAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( CHAR_getWorkInt( toindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
|||
|
CHAR_sendLeader( CHAR_getWorkInt( toindex, CHAR_WORKOBJINDEX), 1);
|
|||
|
/* <20><><EFBFBD>켰<EFBFBD><ECBCB0><EFBFBD>ؼ<EFBFBD>̤<EFBFBD>徧<EFBFBD><E5BEA7> */
|
|||
|
/* <20>ʱ<EFBFBD>ئ<EFBFBD><D8A6> */
|
|||
|
CHAR_setWorkInt( toindex, CHAR_WORKPARTYMODE, 1);
|
|||
|
CHAR_setWorkInt( toindex, CHAR_WORKPARTYINDEX1, toindex);
|
|||
|
firstflg = TRUE;
|
|||
|
}
|
|||
|
CHAR_setWorkInt( toindex, parray + CHAR_WORKPARTYINDEX1, charaindex);
|
|||
|
|
|||
|
CHAR_setWorkChar( charaindex, CHAR_WORKWALKARRAY, "");
|
|||
|
|
|||
|
CHAR_setWorkInt( charaindex, CHAR_WORKPARTYMODE, CHAR_PARTY_CLIENT);
|
|||
|
|
|||
|
CHAR_setWorkInt( charaindex, CHAR_WORKPARTYINDEX1, toindex);
|
|||
|
|
|||
|
if( firstflg ) {
|
|||
|
CHAR_sendStatusString( toindex, "N0");
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index)) {
|
|||
|
snprintf( c, sizeof(c), "N%d", i);
|
|||
|
CHAR_sendStatusString( charaindex, c);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
snprintf( buf,sizeof( buf), "%s <20><><EFBFBD><EFBFBD><EFBFBD>Ŷӣ<C5B6>",
|
|||
|
CHAR_getChar( charaindex, CHAR_NAME));
|
|||
|
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index)) {
|
|||
|
if( index != charaindex ) {
|
|||
|
snprintf( c, sizeof(c), "N%d", parray);
|
|||
|
CHAR_sendStatusString( index, c);
|
|||
|
CHAR_talkToCli( index, -1, buf, CHAR_COLORYELLOW);
|
|||
|
}
|
|||
|
else {
|
|||
|
CHAR_talkToCli( index, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷӣ<EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <EFBFBD>ɡ<EFBFBD> ū<EFBFBD><EFBFBD> Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|||
|
------------------------------------------------------------*/
|
|||
|
BOOL CHAR_JoinParty( int charaindex )
|
|||
|
{
|
|||
|
|
|||
|
int result = -1;
|
|||
|
int x,y;
|
|||
|
OBJECT object;
|
|||
|
int found = FALSE;
|
|||
|
int fd;
|
|||
|
int cnt;
|
|||
|
int i;
|
|||
|
|
|||
|
fd = getfdFromCharaIndex( charaindex );
|
|||
|
if( fd == -1 ) {
|
|||
|
print( "%s : %d err\n", __FILE__, __LINE__);
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
|
|||
|
/* <20><><EFBFBD>л<EFBFBD><D0BB>ɡ<EFBFBD> ū<C5AB><D7AC>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE ) {
|
|||
|
lssproto_PR_send( fd, 1, FALSE);
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
|
|||
|
/* <20><><EFBFBD><F3A1BCB0> ë <20><> */
|
|||
|
CHAR_getCoordinationDir( CHAR_getInt( charaindex, CHAR_DIR ) ,
|
|||
|
CHAR_getInt( charaindex , CHAR_X ),
|
|||
|
CHAR_getInt( charaindex , CHAR_Y ) ,
|
|||
|
1 , &x , &y );
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
for( i = 0; i < CONNECT_WINDOWBUFSIZE; i ++ ) {
|
|||
|
CONNECT_setJoinpartycharaindex(fd,i,-1);
|
|||
|
}
|
|||
|
cnt = 0;
|
|||
|
|
|||
|
/*<2A><><EFBFBD>м<EFBFBD> <20><>ƽ<F3A1BCB0>ҷ<EFBFBD>ë<EFBFBD><C3AB> <20><><EFBFBD><EFBFBD> */
|
|||
|
|
|||
|
for( object = MAP_getTopObj( CHAR_getInt( charaindex, CHAR_FLOOR),x,y) ;
|
|||
|
object ;
|
|||
|
object = NEXT_OBJECT(object ) )
|
|||
|
{
|
|||
|
int toindex;
|
|||
|
int parray;
|
|||
|
int objindex = GET_OBJINDEX(object);
|
|||
|
int targetindex = -1;
|
|||
|
|
|||
|
/* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA>ئ<EFBFBD><D8A6> */
|
|||
|
if( OBJECT_getType( objindex) != OBJTYPE_CHARA) continue;
|
|||
|
toindex = OBJECT_getIndex( objindex);
|
|||
|
|
|||
|
// shan begin
|
|||
|
if( CHAR_getInt(charaindex, CHAR_FMINDEX) > 0 && CHAR_getInt(toindex, CHAR_FMINDEX) >0){
|
|||
|
for( i = 0; i < FAMILY_FMPKFLOOR; i++){
|
|||
|
if( fmpkflnum[i].fl == CHAR_getInt( charaindex, CHAR_FLOOR) )
|
|||
|
if( CHAR_getInt(charaindex, CHAR_FMINDEX) != CHAR_getInt(toindex, CHAR_FMINDEX) ){
|
|||
|
lssproto_PR_send( fd, 1, FALSE);
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
// shan end
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( CHAR_getInt( toindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER || CHAR_getInt(toindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYERNPC){
|
|||
|
found = TRUE;
|
|||
|
/* <20><><EFBFBD>컥<EFBFBD>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë¦<C3AB>Ƚ<EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD> */
|
|||
|
if( CHAR_getWorkInt( toindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_CLIENT ) {
|
|||
|
targetindex = CHAR_getWorkInt( toindex, CHAR_WORKPARTYINDEX1);
|
|||
|
if( !CHAR_CHECKINDEX( targetindex) ) {
|
|||
|
print( " %s:%d err\n", __FILE__, __LINE__);
|
|||
|
continue;
|
|||
|
}
|
|||
|
if( CHAR_getInt( targetindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS) {
|
|||
|
continue;
|
|||
|
}
|
|||
|
}
|
|||
|
else {
|
|||
|
targetindex = toindex;
|
|||
|
}
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڶ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD> */
|
|||
|
if( NPC_Util_CharDistance( charaindex, targetindex ) > 1) {
|
|||
|
continue;
|
|||
|
}
|
|||
|
|
|||
|
/* <20><> <20><>ƥئ<C6A5><D8A6><EFBFBD>ǣ<EFBFBD>*/
|
|||
|
if( CHAR_getWorkInt( targetindex, CHAR_WORKBATTLEMODE) != BATTLE_CHARMODE_NONE ){
|
|||
|
continue;
|
|||
|
}
|
|||
|
/* <20><><EFBFBD><EFBFBD><DEB8><EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( !CHAR_getFlg( targetindex, CHAR_ISPARTY) ) continue;
|
|||
|
|
|||
|
#ifdef _ANGEL_SUMMON
|
|||
|
if( CHAR_getWorkInt( targetindex, CHAR_WORKANGELMODE) == TRUE) {
|
|||
|
CHAR_talkToCli( charaindex, -1, "ʹ<EFBFBD>߲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
continue;
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
/* Ѩ<><D1A8>ƹ<EFBFBD><C6B9><EFBFBD>ﵩ<EFBFBD><EFB5A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD> */
|
|||
|
else if( CHAR_getInt( toindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS ) {
|
|||
|
targetindex = toindex;
|
|||
|
cnt = 0;
|
|||
|
if( !NPC_BusCheckJoinParty( toindex, charaindex, TRUE)) {
|
|||
|
/* <20><><EFBFBD><EFBFBD>ë <20><EFBFBD>ئ<EFBFBD><D8A6><EFBFBD><EFBFBD><EFBFBD>ף<EFBFBD><D7A3><EFBFBD><EFBFBD><EFBFBD> <20>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD><DEBC><EFBFBD> <20><><EFBFBD><EFBFBD>ئ<EFBFBD>У<EFBFBD>
|
|||
|
* ֧֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD>ƥ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
break;
|
|||
|
}
|
|||
|
{ // Arminius 7.10 Airplane
|
|||
|
int busimg=CHAR_getInt(toindex, CHAR_BASEIMAGENUMBER);
|
|||
|
if ((busimg!=100355) && (busimg!=100461)) {
|
|||
|
CHAR_setInt(charaindex,CHAR_BASEIMAGENUMBER,busimg);
|
|||
|
CHAR_sendCToArroundCharacter( CHAR_getWorkInt( charaindex ,
|
|||
|
CHAR_WORKOBJINDEX ));
|
|||
|
// Robin debug 01/11/21
|
|||
|
if( CHAR_getInt( charaindex, CHAR_RIDEPET) != -1 ) {
|
|||
|
CHAR_setInt( charaindex, CHAR_RIDEPET, -1);
|
|||
|
CHAR_send_P_StatusString( charaindex, CHAR_P_STRING_RIDEPET);
|
|||
|
}
|
|||
|
/*
|
|||
|
CHAR_sendPMEToArroundCharacterFLXY(charaindex,
|
|||
|
CHAR_getInt( charaindex, CHAR_FLOOR),
|
|||
|
CHAR_getInt( charaindex, CHAR_X),
|
|||
|
CHAR_getInt( charaindex, CHAR_Y),
|
|||
|
0,1,CHAR_getInt( charaindex, CHAR_PETMAILEFFECT)
|
|||
|
);
|
|||
|
*/
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>跴Ѩ<E8B7B4><D1A8>ƹ<EFBFBD><C6B9><EFBFBD>ﵩ<EFBFBD><EFB5A9>½<EFBFBD><C2BD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
else {
|
|||
|
continue;
|
|||
|
}
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD> ū<><C5AB><EFBFBD><EFBFBD><EFBFBD>ѷ<EFBFBD> <20><><EFBFBD><EFBFBD> */
|
|||
|
parray = CHAR_getEmptyPartyArray( targetindex) ;
|
|||
|
if( parray == -1 ) continue;
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5>ľ<EFBFBD><C4BE> */
|
|||
|
CONNECT_setJoinpartycharaindex( fd,cnt,toindex);
|
|||
|
cnt++;
|
|||
|
if( cnt == CONNECT_WINDOWBUFSIZE ) break;
|
|||
|
|
|||
|
/* Ѩ<><D1A8>ƹ<EFBFBD><C6B9><EFBFBD>ﵩ έ<>Ʒ<EFBFBD><C6B7>Уݻ<D0A3><DDBB><EFBFBD><EFBFBD><EFBFBD>ë <20><><EFBFBD>£<EFBFBD> */
|
|||
|
if( CHAR_getInt( targetindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS ) break;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
if( cnt == 0 ) {
|
|||
|
if( found == TRUE) {
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷӡ<EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
}
|
|||
|
result = FALSE;
|
|||
|
}else if( cnt == 1 ) {
|
|||
|
#ifdef _AUTO_PK
|
|||
|
if(CHAR_getInt(charaindex,CHAR_FLOOR)==20000){
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD>Pϵͳ<EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!", CHAR_COLORYELLOW);
|
|||
|
result = FALSE;
|
|||
|
}else
|
|||
|
#endif
|
|||
|
{
|
|||
|
CHAR_JoinParty_Main( charaindex, CONNECT_getJoinpartycharaindex(fd,0));
|
|||
|
result = TRUE;
|
|||
|
}
|
|||
|
}else {
|
|||
|
int strlength;
|
|||
|
char msgbuf[1024];
|
|||
|
char escapebuf[2048];
|
|||
|
strcpy( msgbuf, "1\n<EFBFBD><EFBFBD>˭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD>أ<EFBFBD>\n");
|
|||
|
strlength = strlen( msgbuf);
|
|||
|
for( i = 0;
|
|||
|
CONNECT_getJoinpartycharaindex( fd,i ) != -1
|
|||
|
&& i< CONNECT_WINDOWBUFSIZE;
|
|||
|
i ++ ){
|
|||
|
char *a = CHAR_getChar(
|
|||
|
CONNECT_getJoinpartycharaindex(fd,i) , CHAR_NAME);
|
|||
|
char buf[256];
|
|||
|
snprintf( buf, sizeof( buf),"%s\n", a);
|
|||
|
if( strlength + strlen( buf) > arraysizeof( msgbuf)){
|
|||
|
print( "%s:%d<>Ӵ<EFBFBD>ѶϢbuffer<65><72><EFBFBD>㡣\n",
|
|||
|
__FILE__,__LINE__);
|
|||
|
break;
|
|||
|
}
|
|||
|
strcpy( &msgbuf[strlength], buf);
|
|||
|
strlength += strlen(buf);
|
|||
|
}
|
|||
|
lssproto_WN_send( fd, WINDOW_MESSAGETYPE_SELECT,
|
|||
|
WINDOW_BUTTONTYPE_CANCEL,
|
|||
|
CHAR_WINDOWTYPE_SELECTPARTY,
|
|||
|
-1,
|
|||
|
makeEscapeString( msgbuf, escapebuf, sizeof(escapebuf)));
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
if( result != -1 ) {
|
|||
|
lssproto_PR_send( fd, 1, result);
|
|||
|
}
|
|||
|
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
static BOOL CHAR_DischargePartySub( int charaindex, int msgflg)
|
|||
|
{
|
|||
|
char buf[64], c[3];
|
|||
|
int toindex,flg,i;
|
|||
|
#ifdef _ITEM_QUITPARTY
|
|||
|
int j = 0,k;
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_LEADER ) {
|
|||
|
int pindex, airplaneflag=0;
|
|||
|
// Arminius 7.10 Airplane
|
|||
|
if( CHAR_getInt(charaindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS ) {
|
|||
|
if ((CHAR_getInt(charaindex, CHAR_BASEIMAGENUMBER) !=100355) &&
|
|||
|
(CHAR_getInt(charaindex, CHAR_BASEIMAGENUMBER) !=100461)){
|
|||
|
airplaneflag=1;
|
|||
|
}
|
|||
|
}
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
pindex = CHAR_getWorkInt( charaindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX( pindex) ) {
|
|||
|
int fd = getfdFromCharaIndex( pindex );
|
|||
|
#ifdef _PLAYER_NPC
|
|||
|
if(CHAR_getInt( pindex, CHAR_WHICHTYPE ) == CHAR_TYPEPLAYERNPC){
|
|||
|
CHAR_CharaDelete(pindex);
|
|||
|
continue;
|
|||
|
}
|
|||
|
#endif
|
|||
|
CHAR_setWorkInt( pindex, CHAR_WORKPARTYINDEX1, -1);
|
|||
|
CHAR_setWorkInt( pindex, CHAR_WORKPARTYMODE, CHAR_PARTY_NONE);
|
|||
|
if( msgflg ){
|
|||
|
CHAR_talkToCli( pindex, -1, "<EFBFBD>Ŷ<EFBFBD><EFBFBD>ѽ<EFBFBD>ɢ<EFBFBD><EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
#ifdef _ITEM_QUITPARTY
|
|||
|
// won fix
|
|||
|
for( j=0;j<CHAR_MAXITEMHAVE;j++ ){
|
|||
|
int del_item_index = CHAR_getItemIndex( pindex , j );
|
|||
|
if( ITEM_CHECKINDEX(del_item_index) ){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>
|
|||
|
for( k=0;k<itemquitparty_num;k++ ){
|
|||
|
if( ITEM_getInt( del_item_index, ITEM_ID) == atoi(Disappear_Item[k].string) ){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>趨<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>ID
|
|||
|
CHAR_setItemIndex( pindex, j, -1); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ʧ
|
|||
|
ITEM_endExistItemsOne( del_item_index );
|
|||
|
CHAR_sendItemDataOne( pindex, j);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
if( fd != -1 ) {
|
|||
|
lssproto_PR_send( fd, 0, 1);
|
|||
|
}
|
|||
|
// Arminius 7.10 Airplane
|
|||
|
if (airplaneflag && (CHAR_getInt(pindex,CHAR_WHICHTYPE)!=CHAR_TYPEBUS)) {
|
|||
|
int bi,bbi,ii,category;
|
|||
|
bbi=CHAR_getInt(pindex,CHAR_BASEBASEIMAGENUMBER);
|
|||
|
ii=CHAR_getItemIndex(pindex,CHAR_ARM);
|
|||
|
if (!ITEM_CHECKINDEX(ii))
|
|||
|
category=ITEM_FIST;
|
|||
|
else
|
|||
|
category=ITEM_getInt(ii,ITEM_TYPE);
|
|||
|
bi=CHAR_getNewImagenumberFromEquip(bbi,category);
|
|||
|
if (bi==-1) bi=bbi;
|
|||
|
CHAR_setInt(pindex,CHAR_BASEIMAGENUMBER,bi);
|
|||
|
// Robin 0810 debug
|
|||
|
CHAR_complianceParameter( pindex );
|
|||
|
CHAR_sendCToArroundCharacter(CHAR_getWorkInt(pindex ,
|
|||
|
CHAR_WORKOBJINDEX));
|
|||
|
}
|
|||
|
}
|
|||
|
CHAR_setWorkInt( charaindex, i + CHAR_WORKPARTYINDEX1, -1);
|
|||
|
}
|
|||
|
CHAR_sendLeader( CHAR_getWorkInt( charaindex, CHAR_WORKOBJINDEX), 0);
|
|||
|
}else if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_CLIENT ) {
|
|||
|
int myarray = -1;
|
|||
|
int fd = getfdFromCharaIndex( charaindex );
|
|||
|
CHAR_setWorkInt( charaindex, CHAR_WORKPARTYMODE, CHAR_PARTY_NONE);
|
|||
|
toindex = CHAR_getWorkInt( charaindex, CHAR_WORKPARTYINDEX1);
|
|||
|
if( !CHAR_CHECKINDEX(toindex ) ) return FALSE;
|
|||
|
if( CHAR_getInt( toindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS ) {
|
|||
|
NPC_BusCheckAllowItem( toindex, charaindex, TRUE);
|
|||
|
// Arminius 7.9 Airplane
|
|||
|
if ((CHAR_getInt( toindex, CHAR_BASEIMAGENUMBER) !=100355) &&
|
|||
|
(CHAR_getInt( toindex, CHAR_BASEIMAGENUMBER) !=100461)){
|
|||
|
int bi,bbi,ii,category;
|
|||
|
|
|||
|
bbi=CHAR_getInt(charaindex,CHAR_BASEBASEIMAGENUMBER);
|
|||
|
ii=CHAR_getItemIndex(charaindex,CHAR_ARM);
|
|||
|
if (!ITEM_CHECKINDEX(ii))
|
|||
|
category=ITEM_FIST;
|
|||
|
else
|
|||
|
category=ITEM_getInt(ii,ITEM_TYPE);
|
|||
|
bi=CHAR_getNewImagenumberFromEquip(bbi,category);
|
|||
|
if (bi==-1) bi=bbi;
|
|||
|
CHAR_setInt(charaindex,CHAR_BASEIMAGENUMBER,bi);
|
|||
|
|
|||
|
// Robin 0810 debug
|
|||
|
CHAR_complianceParameter( charaindex );
|
|||
|
|
|||
|
CHAR_sendCToArroundCharacter( CHAR_getWorkInt( charaindex , CHAR_WORKOBJINDEX ));
|
|||
|
if(CHAR_getWorkInt(toindex,CHAR_NPCWORKINT5)==1) {
|
|||
|
if( CHAR_getInt( charaindex, CHAR_LASTTALKELDER)>=0){
|
|||
|
int fl,x,y;
|
|||
|
CHAR_getElderPosition( CHAR_getInt( charaindex, CHAR_LASTTALKELDER),
|
|||
|
&fl, &x, &y );
|
|||
|
CHAR_warpToSpecificPoint(charaindex, fl, x, y);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
CHAR_setWorkInt( charaindex, CHAR_WORKPARTYINDEX1, -1);
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index) ){
|
|||
|
if( index == charaindex) {
|
|||
|
myarray = i;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
if( myarray == CHAR_PARTYMAX) {
|
|||
|
print( "DischargeParty(): <20><><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD>");
|
|||
|
return FALSE;
|
|||
|
}
|
|||
|
CHAR_setWorkInt( toindex, CHAR_WORKPARTYINDEX1 + myarray, -1);
|
|||
|
snprintf( buf,sizeof( buf), "%s <20><><EFBFBD><EFBFBD><EFBFBD>Ŷӣ<C5B6>",
|
|||
|
CHAR_getChar( charaindex, CHAR_NAME));
|
|||
|
if( msgflg ){
|
|||
|
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŷӣ<EFBFBD>", CHAR_COLORYELLOW);
|
|||
|
#ifdef _ITEM_QUITPARTY
|
|||
|
// won fix
|
|||
|
for( i=0;i<CHAR_MAXITEMHAVE;i++ ){
|
|||
|
int del_item_index = CHAR_getItemIndex( charaindex , j );
|
|||
|
if( ITEM_CHECKINDEX(del_item_index) ){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>
|
|||
|
for( j=0;j<itemquitparty_num;j++ ){
|
|||
|
if( ITEM_getInt( del_item_index, ITEM_ID) == atoi(Disappear_Item[j].string) ){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>趨<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>ID
|
|||
|
CHAR_setItemIndex( charaindex, i, -1); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ʧ
|
|||
|
ITEM_endExistItemsOne( del_item_index );
|
|||
|
CHAR_sendItemDataOne( charaindex, i);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
snprintf( c, sizeof(c), "N%d", myarray);
|
|||
|
if( fd != -1 ) {
|
|||
|
lssproto_PR_send( fd, 0, 1);
|
|||
|
}
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index) ){
|
|||
|
#ifdef _ITEM_QUITPARTY
|
|||
|
// won fix
|
|||
|
for( j=0;j<CHAR_MAXITEMHAVE;j++ ){
|
|||
|
int del_item_index = CHAR_getItemIndex( index , j );
|
|||
|
if( ITEM_CHECKINDEX(del_item_index) ){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD>
|
|||
|
for( k=0;k<itemquitparty_num;k++ ){
|
|||
|
if( ITEM_getInt( del_item_index, ITEM_ID) == atoi(Disappear_Item[k].string) ){ //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>趨<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>ID
|
|||
|
CHAR_setItemIndex( index, j, -1); //<2F><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>ʧ
|
|||
|
ITEM_endExistItemsOne( del_item_index );
|
|||
|
CHAR_sendItemDataOne( index, j);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
if( msgflg ){
|
|||
|
CHAR_talkToCli( index, -1, buf, CHAR_COLORYELLOW);
|
|||
|
}
|
|||
|
CHAR_sendStatusString( index, c);
|
|||
|
}
|
|||
|
}
|
|||
|
flg = FALSE;
|
|||
|
for( i = 1; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX(index) ){
|
|||
|
flg = TRUE;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
if( !flg) {
|
|||
|
CHAR_setWorkInt( toindex, CHAR_WORKPARTYMODE, CHAR_PARTY_NONE);
|
|||
|
CHAR_sendLeader( CHAR_getWorkInt( toindex, CHAR_WORKOBJINDEX), 0);
|
|||
|
}else {
|
|||
|
|
|||
|
POINT start,end;
|
|||
|
int previndex = toindex;
|
|||
|
end.x = CHAR_getInt( charaindex, CHAR_X);
|
|||
|
end.y = CHAR_getInt( charaindex, CHAR_Y);
|
|||
|
for( i = 1; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getWorkInt( toindex, i + CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX( index) ) {
|
|||
|
if( NPC_Util_CharDistance( index, previndex) > 1) {
|
|||
|
int parent_dir;
|
|||
|
start.x = CHAR_getInt( index, CHAR_X);
|
|||
|
start.y = CHAR_getInt( index, CHAR_Y);
|
|||
|
parent_dir = NPC_Util_getDirFromTwoPoint( &start,&end );
|
|||
|
end = start;
|
|||
|
if( parent_dir != -1 ) {
|
|||
|
CHAR_walk( index, parent_dir, 0);
|
|||
|
}
|
|||
|
}
|
|||
|
previndex = index;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
return TRUE;
|
|||
|
}
|
|||
|
BOOL CHAR_DischargeParty( int charaindex, int flg)
|
|||
|
{
|
|||
|
return CHAR_DischargePartySub( charaindex, 1);
|
|||
|
}
|
|||
|
|
|||
|
BOOL CHAR_DischargePartyNoMsg( int charaindex)
|
|||
|
{
|
|||
|
return CHAR_DischargePartySub( charaindex, 0);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <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 CHAR_sendLeader( int objindex, int leader)
|
|||
|
{
|
|||
|
int opt[1];
|
|||
|
opt[0] = leader;
|
|||
|
CHAR_sendWatchEvent( objindex,CHAR_ACTLEADER,opt,1,TRUE);
|
|||
|
}
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD> CHAR_WORKPARTYINDEX)϶<EFBFBD><EFBFBD>ƥƽ<EFBFBD>ҷ<EFBFBD>indexë¦<EFBFBD>Ƚ<EFBFBD><EFBFBD>£<EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD>ֺ<EFBFBD>ƥ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|||
|
------------------------------------------------------------*/
|
|||
|
int CHAR_getPartyIndex( int index, int num)
|
|||
|
{
|
|||
|
int nindex = -1;
|
|||
|
|
|||
|
/* <20><><EFBFBD><EFBFBD><DEBC>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>ë<EFBFBD><C3AB> */
|
|||
|
/* <20>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
if( CHAR_getWorkInt( index, CHAR_WORKPARTYMODE) == CHAR_PARTY_LEADER ) {
|
|||
|
nindex = CHAR_getWorkInt( index, CHAR_WORKPARTYINDEX1 + num );
|
|||
|
}
|
|||
|
/* <20>Ҽ<EFBFBD><D2BC><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
else {
|
|||
|
int oyaindex = CHAR_getWorkInt( index, CHAR_WORKPARTYINDEX1);
|
|||
|
if( CHAR_CHECKINDEX( oyaindex)) {
|
|||
|
nindex = CHAR_getWorkInt( oyaindex, CHAR_WORKPARTYINDEX1+num);
|
|||
|
}
|
|||
|
}
|
|||
|
return nindex;
|
|||
|
}
|
|||
|
/*------------------------------------------------------------
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë˪<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<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 CHAR_talkToCliAndParty( int talkedcharaindex,int talkcharaindex,
|
|||
|
char* message, CHAR_COLOR color )
|
|||
|
{
|
|||
|
int i;
|
|||
|
/* <20><><EFBFBD>ڷ<EFBFBD><DAB7><EFBFBD> */
|
|||
|
CHAR_talkToCli( talkedcharaindex, talkcharaindex, message, color);
|
|||
|
|
|||
|
for( i = 0; i < CHAR_PARTYMAX; i ++ ) {
|
|||
|
int index = CHAR_getPartyIndex( talkedcharaindex, i);
|
|||
|
if( CHAR_CHECKINDEX( index) &&
|
|||
|
index != talkedcharaindex)
|
|||
|
{
|
|||
|
CHAR_talkToCli( index, talkcharaindex, message, color);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|