init commit
This commit is contained in:
commit
a2638072ef
550
gmsv/autil.c
Normal file
550
gmsv/autil.c
Normal file
@ -0,0 +1,550 @@
|
||||
// Arminius' protocol utilities ver 0.1
|
||||
//
|
||||
// Any questions and bugs, mailto: arminius@mail.hwaei.com.tw
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// The following definitions is to define game-dependent codes.
|
||||
// Before compiling, remove the "//".
|
||||
#define __STONEAGE
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "autil.h"
|
||||
#include "char.h"
|
||||
#ifdef __STONEAGE
|
||||
#include "lssproto_util.h"
|
||||
#include "common.h"
|
||||
#endif
|
||||
|
||||
|
||||
// Nuke 0701 fix
|
||||
char *MesgSlice[SLICE_MAX];
|
||||
int SliceCount;
|
||||
|
||||
char PersonalKey[4096];
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Initialize utilities
|
||||
//
|
||||
BOOL util_Init( void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<SLICE_MAX; i++){
|
||||
MesgSlice[i] = (char *) calloc( 1,SLICE_SIZE);
|
||||
if(MesgSlice[i]==NULL) return FALSE;
|
||||
}
|
||||
|
||||
SliceCount = 0;
|
||||
strcpy(PersonalKey, _DEFAULT_PKEY);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Split up a message into slices by spearator. Store those slices
|
||||
// into a global buffer "char **MesgSlice"
|
||||
//
|
||||
// arg: source=message string; separator=message separator (1 byte)
|
||||
// ret: (none)
|
||||
|
||||
// WON ADD
|
||||
//void util_SplitMessage(char *source, char *separator)
|
||||
BOOL util_SplitMessage(char *source, char *separator)
|
||||
{
|
||||
if (source && separator) { // NULL input is invalid.
|
||||
char *ptr;
|
||||
char *head = source;
|
||||
|
||||
// Nuke 1006 : Bug fix
|
||||
while ((ptr = (char *) strstr(head, separator)) && (SliceCount<SLICE_MAX) && (SliceCount>=0)) {
|
||||
ptr[0] = '\0';
|
||||
if (strlen(head)<SLICE_SIZE) { // discard slices too large
|
||||
|
||||
// Nuke 0701
|
||||
// if (*MesgSlice != *dumb) {
|
||||
//print("Warning! Mem may be broken\n");
|
||||
//}
|
||||
/*
|
||||
if (MesgSlice[SliceCount]==0xffffffff) {
|
||||
print("MesgSlice[%d] broken\n",SliceCount);
|
||||
return FALSE;
|
||||
} else {
|
||||
*/
|
||||
strcpy(MesgSlice[SliceCount], head);
|
||||
SliceCount++;
|
||||
//}
|
||||
|
||||
}
|
||||
head = ptr+1;
|
||||
}
|
||||
strcpy(source, head); // remove splited slices
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Encode the message
|
||||
//
|
||||
// arg: dst=output src=input
|
||||
// ret: (none)
|
||||
void util_EncodeMessage(char *dst, char *src)
|
||||
{
|
||||
// strcpy(dst, src);
|
||||
// util_xorstring(dst, src);
|
||||
|
||||
int rn = rand() % 99;
|
||||
int t1, t2;
|
||||
char t3[65500], tz[65500];
|
||||
|
||||
|
||||
|
||||
// encode seed
|
||||
#ifdef _BACK_VERSION
|
||||
util_swapint(&t1, &rn, "3421");
|
||||
#else
|
||||
util_swapint(&t1, &rn, "2413");
|
||||
#endif
|
||||
t2 = t1 ^ 0xffffffff;
|
||||
util_256to64(tz, (char *) &t2, sizeof(int), DEFAULTTABLE);
|
||||
|
||||
util_shlstring(t3, src, rn);
|
||||
strcat(tz, t3);
|
||||
util_xorstring(dst, tz);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Decode the message
|
||||
//
|
||||
// arg: dst=output src=input
|
||||
// ret: (none)
|
||||
void util_DecodeMessage(char *dst, char *src)
|
||||
{
|
||||
// strcpy(dst, src);
|
||||
// util_xorstring(dst, src);
|
||||
|
||||
#define INTCODESIZE (sizeof(int)*8+5)/6
|
||||
|
||||
int rn;
|
||||
int *t1, t2;
|
||||
char t3[4096], t4[4096]; // This buffer is enough for an integer.
|
||||
char tz[65500];
|
||||
|
||||
if (src[strlen(src)-1]=='\n') src[strlen(src)-1]='\0';
|
||||
util_xorstring(tz, src);
|
||||
|
||||
// get seed
|
||||
strncpy(t4, tz, INTCODESIZE);
|
||||
t4[INTCODESIZE] = '\0';
|
||||
util_64to256(t3, t4, DEFAULTTABLE);
|
||||
t1 = (int *) t3;
|
||||
t2 = *t1 ^ 0xffffffff;
|
||||
#ifdef _BACK_VERSION
|
||||
util_swapint(&rn, &t2, "4312");
|
||||
#else
|
||||
util_swapint(&rn, &t2, "3142");
|
||||
#endif
|
||||
|
||||
util_shrstring(dst, tz + INTCODESIZE, rn);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Get a function information from MesgSlice. A function is a complete
|
||||
// and identifiable message received, beginned at DEFAULTFUNCBEGIN and
|
||||
// ended at DEFAULTFUNCEND. This routine will return the function ID
|
||||
// (Action ID) and how many fields this function have.
|
||||
//
|
||||
// arg: func=return function ID fieldcount=return fields of the function
|
||||
// ret: 1=success 0=failed (function not complete)
|
||||
int util_GetFunctionFromSlice(int *func, int *fieldcount)
|
||||
{
|
||||
char t1[16384];
|
||||
int i;
|
||||
|
||||
// if (strcmp(MesgSlice[0], DEFAULTFUNCBEGIN)!=0) util_DiscardMessage();
|
||||
|
||||
strcpy(t1, MesgSlice[1]);
|
||||
// Robin adjust
|
||||
//*func=atoi(t1);
|
||||
*func=atoi(t1)-13;
|
||||
for (i=0; i<SLICE_MAX; i++)
|
||||
if (strcmp(MesgSlice[i], DEFAULTFUNCEND)==0) {
|
||||
*fieldcount=i-2; // - "&" - "#" - "func" 3 fields
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0; // failed: message not complete
|
||||
}
|
||||
|
||||
void util_DiscardMessage(void)
|
||||
{
|
||||
SliceCount=0;
|
||||
}
|
||||
|
||||
#ifdef _CHECK_BATTLE_IO
|
||||
extern int InBattleLoop;
|
||||
extern int battle_write;
|
||||
extern int other_write;
|
||||
extern int battle_write_cnt;
|
||||
extern int other_write_cnt;
|
||||
#endif
|
||||
|
||||
void _util_SendMesg(char *file, int line, int fd, int func, char *buffer)
|
||||
{
|
||||
//char t1[16384], t2[16384];
|
||||
char t1[1024*64], t2[1024*64];
|
||||
|
||||
// WON ADD
|
||||
if( fd < 0 ){
|
||||
print("\n SendMesg fd err %s:%d!! ==> func(%d)\n", file, line, func);
|
||||
return;
|
||||
}
|
||||
|
||||
// Robin adjust
|
||||
//sprintf(t1, "&;%d%s;#;", func, buffer);
|
||||
sprintf(t1, "&;%d%s;#;", func+23, buffer);
|
||||
util_EncodeMessage(t2, t1);
|
||||
#ifdef _CHECK_BATTLE_IO
|
||||
if( InBattleLoop) {
|
||||
battle_write_cnt++;
|
||||
battle_write += strlen( buffer);
|
||||
}
|
||||
else {
|
||||
other_write += strlen( buffer);
|
||||
other_write_cnt++;
|
||||
}
|
||||
#endif
|
||||
#ifdef __STONEAGE
|
||||
lssproto_Send(fd, t2);
|
||||
#endif
|
||||
}
|
||||
|
||||
int util_256to64(char *dst, char *src, int len, char *table)
|
||||
{
|
||||
unsigned int dw,dwcounter,i;
|
||||
|
||||
if (!dst || !src || !table) return 0;
|
||||
dw=0;
|
||||
dwcounter=0;
|
||||
for (i=0; i<len; i++) {
|
||||
dw = ( ((unsigned int)src[i] & 0xff) << ((i%3)*2) ) | dw;
|
||||
dst[ dwcounter++ ] = table[ dw & 0x3f ];
|
||||
dw = ( dw >> 6 );
|
||||
if (i%3==2) {
|
||||
dst[ dwcounter++ ] = table[ dw & 0x3f ];
|
||||
dw = 0;
|
||||
}
|
||||
}
|
||||
if (dw) dst[ dwcounter++ ] = table[ dw ];
|
||||
dst[ dwcounter ] = '\0';
|
||||
return dwcounter;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Convert 6-bit strings into 8-bit strings, buffers that store these strings
|
||||
// must have enough space.
|
||||
//
|
||||
// arg: dst=6-bit string; src=8-bit string; table=mapping table
|
||||
// ret: 0=failed >0=bytes converted
|
||||
int util_64to256(char *dst, char *src, char *table)
|
||||
{
|
||||
unsigned int dw,dwcounter,i;
|
||||
char *ptr = NULL;
|
||||
|
||||
dw=0;
|
||||
dwcounter=0;
|
||||
if (!dst || !src || !table) return 0;
|
||||
for (i=0; i<strlen(src); i++) {
|
||||
ptr = (char *) index(table, src[i]);
|
||||
if (!ptr) return 0;
|
||||
if (i%4) {
|
||||
dw = ((unsigned int)(ptr-table) & 0x3f) << ((4-(i%4))*2) | dw;
|
||||
dst[ dwcounter++ ] = dw & 0xff;
|
||||
dw = dw >> 8;
|
||||
} else {
|
||||
dw = (unsigned int)(ptr-table) & 0x3f;
|
||||
}
|
||||
}
|
||||
if (dw) dst[ dwcounter++ ] = dw & 0xff;
|
||||
dst[ dwcounter ] = '\0';
|
||||
return dwcounter;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// This basically is a 256to64 encoder. But it shifts the result by key.
|
||||
//
|
||||
// arg: dst=6-bit string; src=8-bit string; len=src strlen;
|
||||
// table=mapping table; key=rotate key;
|
||||
// ret: 0=failed >0=bytes converted
|
||||
int util_256to64_shr(char *dst, char *src, int len, char *table, char *key)
|
||||
{
|
||||
unsigned int dw,dwcounter,i,j;
|
||||
|
||||
if (!dst || !src || !table || !key) return 0;
|
||||
if (strlen(key)<1) return 0; // key can't be empty.
|
||||
dw=0;
|
||||
dwcounter=0;
|
||||
j=0;
|
||||
for (i=0; i<len; i++) {
|
||||
dw = ( ((unsigned int)src[i] & 0xff) << ((i%3)*2) ) | dw;
|
||||
dst[ dwcounter++ ] = table[ ((dw & 0x3f) + key[j]) % 64 ]; // check!
|
||||
j++; if (!key[j]) j=0;
|
||||
dw = ( dw >> 6 );
|
||||
if (i%3==2) {
|
||||
dst[ dwcounter++ ] = table[ ((dw & 0x3f) + key[j]) % 64 ];// check!
|
||||
j++; if (!key[j]) j=0;
|
||||
dw = 0;
|
||||
}
|
||||
}
|
||||
if (dw) dst[ dwcounter++ ] = table[ (dw + key[j]) % 64 ]; // check!
|
||||
dst[ dwcounter ] = '\0';
|
||||
return dwcounter;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Decoding function of util_256to64_shr.
|
||||
//
|
||||
// arg: dst=8-bit string; src=6-bit string; table=mapping table;
|
||||
// key=rotate key;
|
||||
// ret: 0=failed >0=bytes converted
|
||||
int util_shl_64to256(char *dst, char *src, char *table, char *key)
|
||||
{
|
||||
unsigned int dw,dwcounter,i,j;
|
||||
char *ptr = NULL;
|
||||
|
||||
if (!key || (strlen(key)<1)) return 0; // must have key
|
||||
|
||||
dw=0;
|
||||
dwcounter=0;
|
||||
j=0;
|
||||
if (!dst || !src || !table) return 0;
|
||||
for (i=0; i<strlen(src); i++) {
|
||||
ptr = (char *) index(table, src[i]);
|
||||
if (!ptr) return 0;
|
||||
if (i%4) {
|
||||
// check!
|
||||
dw = ((((unsigned int)(ptr-table) & 0x3f) + 64 - key[j]) % 64)
|
||||
<< ((4-(i%4))*2) | dw;
|
||||
j++; if (!key[j]) j=0;
|
||||
dst[ dwcounter++ ] = dw & 0xff;
|
||||
dw = dw >> 8;
|
||||
} else {
|
||||
// check!
|
||||
dw = (((unsigned int)(ptr-table) & 0x3f) + 64 - key[j]) % 64;
|
||||
j++; if (!key[j]) j=0;
|
||||
}
|
||||
}
|
||||
if (dw) dst[ dwcounter++ ] = dw & 0xff;
|
||||
dst[ dwcounter ] = '\0';
|
||||
return dwcounter;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// This basically is a 256to64 encoder. But it shifts the result by key.
|
||||
//
|
||||
// arg: dst=6-bit string; src=8-bit string; len=src strlen;
|
||||
// table=mapping table; key=rotate key;
|
||||
// ret: 0=failed >0=bytes converted
|
||||
int util_256to64_shl(char *dst, char *src, int len, char *table, char *key)
|
||||
{
|
||||
unsigned int dw,dwcounter,i,j;
|
||||
|
||||
if (!dst || !src || !table || !key) return 0;
|
||||
if (strlen(key)<1) return 0; // key can't be empty.
|
||||
dw=0;
|
||||
dwcounter=0;
|
||||
j=0;
|
||||
for (i=0; i<len; i++) {
|
||||
dw = ( ((unsigned int)src[i] & 0xff) << ((i%3)*2) ) | dw;
|
||||
dst[ dwcounter++ ] = table[ ((dw & 0x3f) + 64 - key[j]) % 64 ]; // check!
|
||||
j++; if (!key[j]) j=0;
|
||||
dw = ( dw >> 6 );
|
||||
if (i%3==2) {
|
||||
dst[ dwcounter++ ] = table[ ((dw & 0x3f) + 64 - key[j]) % 64 ]; // check!
|
||||
j++; if (!key[j]) j=0;
|
||||
dw = 0;
|
||||
}
|
||||
}
|
||||
if (dw) dst[ dwcounter++ ] = table[ (dw + 64 - key[j]) % 64 ]; // check!
|
||||
dst[ dwcounter ] = '\0';
|
||||
return dwcounter;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Decoding function of util_256to64_shl.
|
||||
//
|
||||
// arg: dst=8-bit string; src=6-bit string; table=mapping table;
|
||||
// key=rotate key;
|
||||
// ret: 0=failed >0=bytes converted
|
||||
int util_shr_64to256(char *dst, char *src, char *table, char *key)
|
||||
{
|
||||
unsigned int dw,dwcounter,i,j;
|
||||
char *ptr = NULL;
|
||||
|
||||
if (!key || (strlen(key)<1)) return 0; // must have key
|
||||
|
||||
dw=0;
|
||||
dwcounter=0;
|
||||
j=0;
|
||||
if (!dst || !src || !table) return 0;
|
||||
for (i=0; i<strlen(src); i++) {
|
||||
ptr = (char *) index(table, src[i]);
|
||||
if (!ptr) return 0;
|
||||
if (i%4) {
|
||||
// check!
|
||||
dw = ((((unsigned int)(ptr-table) & 0x3f) + key[j]) % 64)
|
||||
<< ((4-(i%4))*2) | dw;
|
||||
j++; if (!key[j]) j=0;
|
||||
dst[ dwcounter++ ] = dw & 0xff;
|
||||
dw = dw >> 8;
|
||||
} else {
|
||||
// check!
|
||||
dw = (((unsigned int)(ptr-table) & 0x3f) + key[j]) % 64;
|
||||
j++; if (!key[j]) j=0;
|
||||
}
|
||||
}
|
||||
if (dw) dst[ dwcounter++ ] = dw & 0xff;
|
||||
dst[ dwcounter ] = '\0';
|
||||
return dwcounter;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Swap a integer (4 byte).
|
||||
// The value "rule" indicates the swaping rule. It's a 4 byte string
|
||||
// such as "1324" or "2431".
|
||||
//
|
||||
void util_swapint(int *dst, int *src, char *rule)
|
||||
{
|
||||
char *ptr, *qtr;
|
||||
int i;
|
||||
|
||||
ptr = (char *) src;
|
||||
qtr = (char *) dst;
|
||||
for (i=0; i<4; i++) qtr[rule[i]-'1']=ptr[i];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Xor a string. Be careful that your string contains '0xff'. Your
|
||||
// data may lose.
|
||||
//
|
||||
void util_xorstring(char *dst, char *src)
|
||||
{
|
||||
int i;
|
||||
if (strlen(src)>65500) return;
|
||||
|
||||
DebugPoint=100000;
|
||||
|
||||
for (i=0; i<strlen(src); i++){
|
||||
DebugPoint=100000+i;
|
||||
dst[i]=src[i]^255;
|
||||
}
|
||||
dst[i]='\0';
|
||||
DebugPoint=1000;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Shift the string right.
|
||||
//
|
||||
void util_shrstring(char *dst, char *src, int offs)
|
||||
{
|
||||
char *ptr;
|
||||
if (!dst || !src || (strlen(src)<1)) return;
|
||||
|
||||
offs = strlen(src) - (offs % strlen(src));
|
||||
ptr = src+offs;
|
||||
strcpy(dst, ptr);
|
||||
strncat(dst, src, offs);
|
||||
dst[strlen(src)]='\0';
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Shift the string left.
|
||||
//
|
||||
void util_shlstring(char *dst, char *src, int offs)
|
||||
{
|
||||
char *ptr;
|
||||
if (!dst || !src || (strlen(src)<1)) return;
|
||||
|
||||
offs = offs % strlen(src);
|
||||
ptr = src+offs;
|
||||
strcpy(dst, ptr);
|
||||
strncat(dst, src, offs);
|
||||
dst[strlen(src)]='\0';
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Convert a message slice into integer. Return a checksum.
|
||||
//
|
||||
// arg: sliceno=slice index in MesgSlice value=result
|
||||
// ret: checksum, this value must match the one generated by util_mkint
|
||||
int util_deint(int sliceno, int *value)
|
||||
{
|
||||
int *t1, t2;
|
||||
char t3[4096]; // This buffer is enough for an integer.
|
||||
|
||||
if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);
|
||||
|
||||
util_shl_64to256(t3, MesgSlice[sliceno], DEFAULTTABLE, PersonalKey);
|
||||
t1 = (int *) t3;
|
||||
t2 = *t1 ^ 0xffffffff;
|
||||
#ifdef _BACK_VERSION
|
||||
util_swapint(value, &t2, "3421");
|
||||
#else
|
||||
util_swapint(value, &t2, "2413");
|
||||
#endif
|
||||
|
||||
return *value;
|
||||
}
|
||||
|
||||
int util_mkint(char *buffer, int value)
|
||||
{
|
||||
int t1, t2;
|
||||
char t3[4096];
|
||||
|
||||
if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);
|
||||
|
||||
#ifdef _BACK_VERSION
|
||||
util_swapint(&t1, &value, "4312");
|
||||
#else
|
||||
util_swapint(&t1, &value, "3142");
|
||||
#endif
|
||||
t2 = t1 ^ 0xffffffff;
|
||||
util_256to64_shr(t3, (char *) &t2, sizeof(int), DEFAULTTABLE, PersonalKey);
|
||||
strcat(buffer, ";");
|
||||
strcat(buffer, t3);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Convert a message slice into string. Return a checksum.
|
||||
//
|
||||
// arg: sliceno=slice index in MesgSlice value=result
|
||||
// ret: checksum, this value must match the one generated by util_mkstring
|
||||
int util_destring(int sliceno, char *value)
|
||||
{
|
||||
|
||||
if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);
|
||||
|
||||
util_shr_64to256(value, MesgSlice[sliceno], DEFAULTTABLE, PersonalKey);
|
||||
|
||||
return strlen(value);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Convert a string into buffer (a string). Return a checksum.
|
||||
//
|
||||
// arg: buffer=output value=data to pack
|
||||
// ret: checksum, this value must match the one generated by util_destring
|
||||
int util_mkstring(char *buffer, char *value)
|
||||
{
|
||||
char t1[SLICE_SIZE];
|
||||
|
||||
if (strlen(PersonalKey)==0) strcpy(PersonalKey, _DEFAULT_PKEY);
|
||||
|
||||
util_256to64_shl(t1, value, strlen(value), DEFAULTTABLE, PersonalKey);
|
||||
strcat(buffer, ";"); // It's important to append a SEPARATOR between fields
|
||||
strcat(buffer, t1);
|
||||
|
||||
return strlen(value);
|
||||
}
|
9437
gmsv/battle/battle.c
Normal file
9437
gmsv/battle/battle.c
Normal file
File diff suppressed because it is too large
Load Diff
9437
gmsv/battle/battle.c.bak
Normal file
9437
gmsv/battle/battle.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
533
gmsv/battle/battle_ai.c
Normal file
533
gmsv/battle/battle_ai.c
Normal file
@ -0,0 +1,533 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include "common.h"
|
||||
#include "char.h"
|
||||
#include "char_base.h"
|
||||
#include "battle.h"
|
||||
#include "npcutil.h"
|
||||
#include "pet_skill.h"
|
||||
|
||||
struct B_AI_RESULT {
|
||||
BATTLE_COM command; /* 窒毛允月井 */
|
||||
int target; /* 簿卞 */
|
||||
};
|
||||
|
||||
static int BATTLE_ai_normal( int, int, BATTLE_ENTRY *,struct B_AI_RESULT *);
|
||||
|
||||
static int (*functbl[])( int, int, BATTLE_ENTRY *,struct B_AI_RESULT *) = {
|
||||
NULL,
|
||||
BATTLE_ai_normal,
|
||||
};
|
||||
|
||||
int BATTLE_ai_all( int battleindex, int side, int turn)
|
||||
{
|
||||
int i;
|
||||
int rc = FALSE;
|
||||
BATTLE_ENTRY *pEntry;
|
||||
struct B_AI_RESULT result;
|
||||
|
||||
if( BATTLE_CHECKINDEX( battleindex ) == FALSE )return BATTLE_ERR_BATTLEINDEX;
|
||||
if( BATTLE_CHECKSIDE( side ) == FALSE )return BATTLE_ERR_PARAM;
|
||||
if( BATTLE_CHECKSIDE( side ^1) == FALSE )return BATTLE_ERR_PARAM;
|
||||
if( BattleArray[battleindex].Side[side].type != BATTLE_S_TYPE_ENEMY ) return FALSE;
|
||||
pEntry = BattleArray[battleindex].Side[side^1].Entry;
|
||||
for( i = 0; i < BATTLE_ENTRY_MAX; i ++ ){
|
||||
int charaindex = BattleArray[battleindex].Side[side].Entry[i].charaindex;
|
||||
int mode;
|
||||
if( CHAR_CHECKINDEX( charaindex ) == FALSE )continue;
|
||||
|
||||
mode = CHAR_getWorkInt( charaindex, CHAR_WORKTACTICS);
|
||||
if( mode < 0 || mode >= arraysizeof( functbl)){
|
||||
print( "BATTLE_ai_all 中,战斗逻辑模式很奇怪(%s)(%d)\n",
|
||||
CHAR_getUseName( charaindex ), mode );
|
||||
mode = 1;
|
||||
}
|
||||
if( BATTLE_IsCharge( charaindex ) == TRUE ){
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLEMODE, BATTLE_CHARMODE_C_OK );
|
||||
continue;
|
||||
}
|
||||
if( BattleArray[battleindex].Side[side].flg & BSIDE_FLG_SURPRISE) {
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLECOM1, BATTLE_COM_NONE );
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLEMODE, BATTLE_CHARMODE_C_OK );
|
||||
}else {
|
||||
if( functbl[mode] != NULL ) {
|
||||
rc = functbl[mode]( turn, charaindex, pEntry, &result);
|
||||
if( BATTLE_CanMoveCheck( charaindex ) == FALSE ){
|
||||
result.command = BATTLE_COM_NONE;
|
||||
}
|
||||
}
|
||||
if( rc ) {
|
||||
#ifdef _BATTLENPC_WARP_PLAYER
|
||||
if(result.command==BATTLE_COM_WARP){
|
||||
for( i=0; i<BATTLE_ENTRY_MAX; i++){
|
||||
int tindex = (pEntry+i)->charaindex;
|
||||
if( !CHAR_CHECKINDEX( tindex ))continue;
|
||||
if( CHAR_getFlg( tindex, CHAR_ISDIE)) continue;
|
||||
if( CHAR_getWorkInt( tindex, CHAR_WORKBATTLEMODE)
|
||||
== BATTLE_CHARMODE_RESCUE ) continue;
|
||||
if( CHAR_getInt( tindex, CHAR_WHICHTYPE)==CHAR_TYPEPLAYER){
|
||||
char sBuff[1024]="", sBuff1[1024]="";
|
||||
int ss[3];
|
||||
int sii;
|
||||
int rc = 1;
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_ACT_CONDITION),
|
||||
"wp", sBuff, sizeof( sBuff))!=NULL){
|
||||
for( sii=1; sii<=3; sii++){
|
||||
if(getStringFromIndexWithDelim( sBuff, ";", sii, sBuff1, sizeof( sBuff1)))
|
||||
{ss[sii-1]=atoi(sBuff1);}
|
||||
else
|
||||
{rc=0;}
|
||||
}
|
||||
if(rc){
|
||||
CHAR_warpToSpecificPoint( tindex, ss[0], ss[1], ss[2]);
|
||||
BATTLE_WatchStop( tindex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLECOM1, result.command );
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLECOM2,
|
||||
result.target + (side^1)*SIDE_OFFSET);
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLEMODE, BATTLE_CHARMODE_C_OK );
|
||||
//CHAR_SETWORKINT_LOW( charaindex, CHAR_WORKBATTLECOM3, array);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int BATTLE_ai_one( int charaindex, int battleindex, int side, int turn)
|
||||
{
|
||||
int rc = FALSE;
|
||||
BATTLE_ENTRY *pEntry;
|
||||
struct B_AI_RESULT result;
|
||||
int mode;
|
||||
|
||||
/* 由仿丢□正民尼永弁 */
|
||||
if( BATTLE_CHECKINDEX( battleindex ) == FALSE )return BATTLE_ERR_BATTLEINDEX;
|
||||
if( BATTLE_CHECKSIDE( side ) == FALSE )return BATTLE_ERR_PARAM;
|
||||
if( BATTLE_CHECKSIDE( side ^1) == FALSE )return BATTLE_ERR_PARAM;
|
||||
|
||||
/* 及扔奶玉隋垫丹 */
|
||||
/* 衬平乓仿动陆反 仃月 */
|
||||
if( BattleArray[battleindex].Side[side].type != BATTLE_S_TYPE_ENEMY ) return 0;
|
||||
|
||||
/* 覆础扔奶玉 */
|
||||
pEntry = BattleArray[battleindex].Side[side^1].Entry;
|
||||
|
||||
mode = CHAR_getWorkInt( charaindex, CHAR_WORKTACTICS);
|
||||
/* 质 毛蕊曰坌仃月 */
|
||||
if( mode < 0 || mode >= arraysizeof( functbl)) return FALSE;
|
||||
/* 质 毛蕊曰坌仃月 */
|
||||
if( functbl[mode] != NULL ) {
|
||||
rc = functbl[mode]( turn, charaindex, pEntry, &result);
|
||||
}
|
||||
if( rc ) {
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLECOM1, result.command );
|
||||
if( result.command == BATTLE_COM_ATTACK) {
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLECOM2,
|
||||
result.target + (side^1)*SIDE_OFFSET);
|
||||
}
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKBATTLEMODE, BATTLE_CHARMODE_C_OK );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 骚卞锹澎毛瑁户月 */
|
||||
|
||||
#define B_AI_NORMAL_ATTACKOPTION "at" /* 猾左皿扑亦件 */
|
||||
#define B_AI_NORMAL_GUARDOPTION "gu" /* 豢左皿扑亦件 */
|
||||
#define B_AI_NORMAL_MAGICOPTION "ma" /* 热诸左皿扑亦件 */
|
||||
#define B_AI_NORMAL_ESCAPEOPTION "es" /* 仆月左皿扑亦件 */
|
||||
#define B_AI_NORMAL_WAZAOPTION "wa" /* 左皿扑亦件 */
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
#define B_AI_NORMAL_RANDAOPTION "rn"
|
||||
#define B_AI_NORMAL_RANDOMOPTIONNUM 1
|
||||
#endif
|
||||
|
||||
#define B_AI_NORMAL_ATTACKSUBOPTIONNUM 3
|
||||
#define B_AI_NORMAL_GUARDSUBOPTIONNUM 1
|
||||
#define B_AI_NORMAL_MAGICSUBOPTIONNUM 1
|
||||
#define B_AI_NORMAL_ESCAPESUBOPTIONNUM 1
|
||||
#define B_AI_NORMAL_WAZASUBOPTIONNUM 7
|
||||
|
||||
/* 左皿扑亦件娄醒及 侬及烂聒 */
|
||||
#define B_AI_NORMAL_TARGET_ALL 1
|
||||
#define B_AI_NORMAL_TARGET_PLAYER 2
|
||||
#define B_AI_NORMAL_TARGET_PET 3
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
#define B_AI_NORMAL_TARGET_LEADER 4
|
||||
#endif
|
||||
#define B_AI_NORMAL_SELECT_RANDOM 1
|
||||
#define B_AI_NORMAL_SELECT_HP_MAX 2
|
||||
#define B_AI_NORMAL_SELECT_HP_MIN 3
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
#define B_AI_NORMAL_SELECT_STR_MAX 4
|
||||
#define B_AI_NORMAL_SELECT_DEX_MAX 5
|
||||
#define B_AI_NORMAL_SELECT_DEX_MIN 6
|
||||
#define B_AI_NORMAL_SELECT_ATT_SUBDUE 7
|
||||
enum{
|
||||
AI_ATT_EARTHAT = 1,
|
||||
AI_ATT_WATERAT,
|
||||
AI_ATT_FIREAT,
|
||||
AI_ATT_WINDAT
|
||||
};
|
||||
int GetSubdueAttribute(int index){
|
||||
int s_a = CHAR_getWorkInt( index, CHAR_WORKFIXEARTHAT);
|
||||
int s_b = CHAR_getWorkInt( index, CHAR_WORKFIXWATERAT);
|
||||
int s_c = CHAR_getWorkInt( index, CHAR_WORKFIXFIREAT);
|
||||
int s_d = CHAR_getWorkInt( index, CHAR_WORKFIXWINDAT);
|
||||
return ((s_a>s_c)?((s_b>s_d)?((s_a>s_b)?(2):(3)):((s_a>s_d)?(2):(1))):((s_b>s_d)?((s_c>s_b)?(4):(3)):((s_c>s_d)?(4):(1))));
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
B_AI_ATTACKMODE = 1,
|
||||
B_AI_GURADMODE,
|
||||
B_AI_MAGICMODE,
|
||||
B_AI_ESCAPEMODE,
|
||||
B_AI_WAZAMODE0,
|
||||
B_AI_WAZAMODE1,
|
||||
B_AI_WAZAMODE2,
|
||||
B_AI_WAZAMODE3,
|
||||
B_AI_WAZAMODE4,
|
||||
B_AI_WAZAMODE5,
|
||||
B_AI_WAZAMODE6,
|
||||
}B_AI_MODE;
|
||||
|
||||
static int BATTLE_ai_normal( int turn, int charaindex,
|
||||
BATTLE_ENTRY *pEntry,
|
||||
struct B_AI_RESULT *result)
|
||||
{
|
||||
int at[B_AI_NORMAL_ATTACKSUBOPTIONNUM] = { 0,0,0}; /* 猾左皿扑亦件 */
|
||||
int gu[B_AI_NORMAL_GUARDSUBOPTIONNUM] = {0}; /* 左皿扑亦件 */
|
||||
int ma[B_AI_NORMAL_MAGICSUBOPTIONNUM] = {0}; /* 左皿扑亦件 */
|
||||
int es[B_AI_NORMAL_ESCAPESUBOPTIONNUM] = {0}; /* 左皿扑亦件 */
|
||||
int wa[B_AI_NORMAL_WAZASUBOPTIONNUM] = {0,0,0,0, 0,0,0};/* 左皿扑亦件 */
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
int rn[B_AI_NORMAL_RANDOMOPTIONNUM] = {1};
|
||||
#endif
|
||||
int target[BATTLE_ENTRY_MAX];
|
||||
int cnt;
|
||||
int i;
|
||||
int r;
|
||||
int rc;
|
||||
int mode=0;
|
||||
char buff[256];
|
||||
char buff2[256];
|
||||
|
||||
if( turn == 1 ) {
|
||||
print( "应该没这回事。\n" );
|
||||
return FALSE;
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION),
|
||||
B_AI_NORMAL_ATTACKOPTION, buff, sizeof( buff)) != NULL ){
|
||||
for( i = 1; i < B_AI_NORMAL_ATTACKSUBOPTIONNUM + 1; i ++ ) {
|
||||
rc = getStringFromIndexWithDelim( buff, ";", i, buff2, sizeof( buff2));
|
||||
if( rc != TRUE ) {
|
||||
print( "battle_ai.c:Invarid Param [%s]\n",
|
||||
CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION));
|
||||
return FALSE;
|
||||
}
|
||||
at[i-1] = atoi( buff2);
|
||||
}
|
||||
}
|
||||
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION),
|
||||
B_AI_NORMAL_GUARDOPTION, buff, sizeof( buff)) != NULL ){
|
||||
for( i = 1; i < B_AI_NORMAL_GUARDSUBOPTIONNUM + 1; i ++ ) {
|
||||
rc = getStringFromIndexWithDelim( buff, ";", i, buff2, sizeof( buff2));
|
||||
if( rc != TRUE ) {
|
||||
print( "battle_ai.c:Invarid Param [%s]\n",
|
||||
CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION));
|
||||
return FALSE;
|
||||
}
|
||||
gu[i-1] = atoi( buff2);
|
||||
}
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION),
|
||||
B_AI_NORMAL_MAGICOPTION,
|
||||
buff, sizeof( buff)) != NULL ){
|
||||
for( i = 1; i < B_AI_NORMAL_MAGICSUBOPTIONNUM + 1; i ++ ) {
|
||||
rc = getStringFromIndexWithDelim( buff, ";", i, buff2, sizeof( buff2));
|
||||
if( rc != TRUE ) {
|
||||
print( "battle_ai.c:Invarid Param [%s]\n",
|
||||
CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION));
|
||||
return FALSE;
|
||||
}
|
||||
ma[i-1] = atoi( buff2);
|
||||
|
||||
}
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION),
|
||||
B_AI_NORMAL_ESCAPEOPTION,
|
||||
buff, sizeof( buff)) != NULL ){
|
||||
for( i = 1; i < B_AI_NORMAL_ESCAPESUBOPTIONNUM + 1; i ++ ) {
|
||||
rc = getStringFromIndexWithDelim( buff, ";", i, buff2, sizeof( buff2));
|
||||
|
||||
if( rc != TRUE ) {
|
||||
print( "battle_ai.c:Invarid Param [%s]\n",
|
||||
CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION));
|
||||
return FALSE;
|
||||
}
|
||||
es[i-1] = atoi( buff2);
|
||||
}
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION),
|
||||
B_AI_NORMAL_WAZAOPTION,
|
||||
buff, sizeof( buff)) != NULL ){
|
||||
for( i = 1; i < B_AI_NORMAL_WAZASUBOPTIONNUM + 1; i ++ ) {
|
||||
rc = getStringFromIndexWithDelim( buff, ";", i, buff2, sizeof( buff2));
|
||||
if( rc != TRUE ) {
|
||||
}else{
|
||||
wa[i-1] = atoi( buff2);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION),
|
||||
B_AI_NORMAL_RANDAOPTION,
|
||||
buff, sizeof( buff))!=NULL){
|
||||
for( i=1; i<B_AI_NORMAL_RANDOMOPTIONNUM+1; i++){
|
||||
rc = getStringFromIndexWithDelim( buff, ";", i, buff2, sizeof( buff2));
|
||||
if(rc!=TRUE){
|
||||
print( "battle_ai.c:Invarid Param [%s]\n",
|
||||
CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_TACTICSOPTION));
|
||||
return FALSE;
|
||||
}
|
||||
rn[i-1] = atoi( buff2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef _BATTLENPC_WARP_PLAYER
|
||||
if( NPC_Util_GetStrFromStrWithDelim( CHAR_getWorkChar( charaindex, CHAR_WORKBATTLE_ACT_CONDITION),
|
||||
"tn", buff, sizeof( buff))!=NULL){
|
||||
int sTurn = atoi( buff);
|
||||
if(CHAR_getWorkInt( charaindex, CHAR_WORKTURN)==0)
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKTURN, 1);
|
||||
else
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKTURN, CHAR_getWorkInt( charaindex, CHAR_WORKTURN)+1);
|
||||
if(sTurn==CHAR_getWorkInt( charaindex, CHAR_WORKTURN)){
|
||||
result->command = BATTLE_COM_WARP;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if( at[0] == 0 && gu[0] == 0 && ma[0] == 0 && es[0] == 0 ){
|
||||
for( i = 0; i < B_AI_NORMAL_WAZASUBOPTIONNUM; i ++ ){
|
||||
if( wa[i] != 0 )break;
|
||||
}
|
||||
if( i >= B_AI_NORMAL_WAZASUBOPTIONNUM ){
|
||||
print( "无指定任何的攻击方式。\n" );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
while( !mode ) {
|
||||
int work = 0;
|
||||
work = at[0]+gu[0]+ma[0]+es[0];
|
||||
for( i = 0; i < B_AI_NORMAL_WAZASUBOPTIONNUM; i ++ ){
|
||||
work += wa[i];
|
||||
}
|
||||
r = RAND( 0, work - 1 );
|
||||
if( at[0] != 0 && r < at[0] ) mode = B_AI_ATTACKMODE;
|
||||
else if( gu[0] != 0 && r < at[0] + gu[0]) mode = B_AI_GURADMODE;
|
||||
else if( ma[0] != 0 && r < at[0] + gu[0] + ma[0]) mode = B_AI_MAGICMODE;
|
||||
else if( es[0] != 0 && r < at[0] + gu[0] + ma[0] + es[0] ){
|
||||
mode = B_AI_ESCAPEMODE;
|
||||
}
|
||||
if( mode ) break;
|
||||
work = at[0] + gu[0] + ma[0] + es[0];
|
||||
for( i = 0; i < B_AI_NORMAL_WAZASUBOPTIONNUM; i ++ ){
|
||||
work += wa[i];
|
||||
if( wa[i] != 0 && r < work ){
|
||||
mode = B_AI_WAZAMODE0+i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( mode == B_AI_ATTACKMODE || ( B_AI_WAZAMODE0 <= mode && mode <= B_AI_WAZAMODE6 )){
|
||||
while( 1 ) {
|
||||
for( i = 0 ; i < BATTLE_ENTRY_MAX; i ++ ) {
|
||||
target[i] = -1;
|
||||
}
|
||||
cnt = 0;
|
||||
for( i = 0; i < BATTLE_ENTRY_MAX ; i ++ ) {
|
||||
int tindex = (pEntry+i)->charaindex;
|
||||
if( !CHAR_CHECKINDEX( tindex ))continue;
|
||||
if( CHAR_getFlg( tindex, CHAR_ISDIE)) continue;
|
||||
if( CHAR_getWorkInt( tindex, CHAR_WORKBATTLEMODE) == BATTLE_CHARMODE_RESCUE ) continue;
|
||||
switch( at[1]) {
|
||||
case B_AI_NORMAL_TARGET_PLAYER:
|
||||
if( CHAR_getInt( tindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER ){
|
||||
target[cnt++] = i;
|
||||
}
|
||||
break;
|
||||
case B_AI_NORMAL_TARGET_PET:
|
||||
if( CHAR_getInt( tindex, CHAR_WHICHTYPE) == CHAR_TYPEPET){
|
||||
target[cnt++] = i;
|
||||
}
|
||||
break;
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
case B_AI_NORMAL_TARGET_LEADER:
|
||||
if( CHAR_getWorkInt( tindex, CHAR_WORKPARTYMODE ) == CHAR_PARTY_LEADER) {
|
||||
target[cnt++] = i;
|
||||
}else if(!RAND( 0, 2)) {
|
||||
target[cnt++] = i;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
target[cnt++] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( cnt == 0 && at[1] == B_AI_NORMAL_TARGET_ALL ) return FALSE;
|
||||
if( cnt > 0 ) break;
|
||||
at[1] = B_AI_NORMAL_TARGET_ALL;
|
||||
}
|
||||
result->command = BATTLE_COM_NONE;
|
||||
if( at[2] == B_AI_NORMAL_SELECT_RANDOM ) {
|
||||
r = RAND( 0, cnt-1);
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
result->target = target[r];
|
||||
}else if( at[2] == B_AI_NORMAL_SELECT_HP_MAX || at[2] == B_AI_NORMAL_SELECT_HP_MIN ){
|
||||
int top = 0;
|
||||
for( i = 0; i < cnt; i ++ ) {
|
||||
if( i ==0 ) top = target[i];
|
||||
else {
|
||||
int tophp = CHAR_getInt((pEntry+top)->charaindex, CHAR_HP);
|
||||
int comphp = CHAR_getInt((pEntry+target[i])->charaindex, CHAR_HP);
|
||||
if( at[2] == B_AI_NORMAL_SELECT_HP_MAX ) {
|
||||
if( comphp > tophp ) top = target[i];
|
||||
}
|
||||
else {
|
||||
if( comphp < tophp ) top = target[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
if(!RAND( 0, rn[0]))
|
||||
result->target = target[RAND( 0, cnt-1)];
|
||||
else
|
||||
result->target = top;
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
#else
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
result->target = top;
|
||||
#endif
|
||||
}
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
else if(at[2] == B_AI_NORMAL_SELECT_STR_MAX) {
|
||||
int top = 0;
|
||||
for( i=0; i<cnt; i++) {
|
||||
if(i==0) top = target[i];
|
||||
else {
|
||||
int topstr = CHAR_getInt( (pEntry+top)->charaindex, CHAR_STR);
|
||||
int compstr = CHAR_getInt( (pEntry+target[i])->charaindex, CHAR_STR);
|
||||
if(compstr>topstr) top = target[i];
|
||||
}
|
||||
}
|
||||
if(!RAND( 0, rn[0]))
|
||||
result->target = target[RAND( 0, cnt-1)];
|
||||
else
|
||||
result->target = top;
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
}
|
||||
else if(at[2] == B_AI_NORMAL_SELECT_DEX_MAX ||
|
||||
at[2] == B_AI_NORMAL_SELECT_DEX_MIN) {
|
||||
int top = 0;
|
||||
for( i=0; i<cnt; i++) {
|
||||
if(i==0) top = target[i];
|
||||
else {
|
||||
int topdex = CHAR_getInt( (pEntry+top)->charaindex, CHAR_DEX);
|
||||
int compdex = CHAR_getInt( (pEntry+target[i])->charaindex, CHAR_DEX);
|
||||
if(at[2]==B_AI_NORMAL_SELECT_DEX_MAX) {
|
||||
if(compdex>topdex) top = target[i];
|
||||
}else {
|
||||
if(compdex<topdex) top = target[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!RAND( 0, rn[0]))
|
||||
result->target = target[RAND( 0, cnt-1)];
|
||||
else
|
||||
result->target = top;
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
}
|
||||
else if(at[2] == B_AI_NORMAL_SELECT_ATT_SUBDUE) {
|
||||
int top = 0;
|
||||
for( i=0; i<cnt; i++) {
|
||||
if(i==0) top = target[i];
|
||||
else {
|
||||
switch(GetSubdueAttribute(charaindex))
|
||||
{
|
||||
case AI_ATT_EARTHAT:
|
||||
{
|
||||
int topatt = CHAR_getWorkInt( (pEntry+top)->charaindex, CHAR_WORKFIXEARTHAT);
|
||||
int compatt = CHAR_getWorkInt( (pEntry+target[i])->charaindex, CHAR_WORKFIXEARTHAT);
|
||||
if(compatt>topatt) top = target[i];
|
||||
}
|
||||
break;
|
||||
case AI_ATT_WATERAT:
|
||||
{
|
||||
int topatt = CHAR_getWorkInt( (pEntry+top)->charaindex, CHAR_WORKFIXWATERAT);
|
||||
int compatt = CHAR_getWorkInt( (pEntry+target[i])->charaindex, CHAR_WORKFIXWATERAT);
|
||||
if(compatt>topatt) top = target[i];
|
||||
}
|
||||
break;
|
||||
case AI_ATT_FIREAT:
|
||||
{
|
||||
int topatt = CHAR_getWorkInt( (pEntry+top)->charaindex, CHAR_WORKFIXFIREAT);
|
||||
int compatt = CHAR_getWorkInt( (pEntry+target[i])->charaindex, CHAR_WORKFIXFIREAT);
|
||||
if(compatt>topatt) top = target[i];
|
||||
}
|
||||
break;
|
||||
case AI_ATT_WINDAT:
|
||||
{
|
||||
int topatt = CHAR_getWorkInt( (pEntry+top)->charaindex, CHAR_WORKFIXWINDAT);
|
||||
int compatt = CHAR_getWorkInt( (pEntry+target[i])->charaindex, CHAR_WORKFIXWINDAT);
|
||||
if(compatt>topatt) top = target[i];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!RAND( 0, rn[0]))
|
||||
result->target = target[RAND( 0, cnt-1)];
|
||||
else
|
||||
result->target = top;
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
}
|
||||
#endif
|
||||
else{
|
||||
return FALSE;
|
||||
}
|
||||
if( B_AI_WAZAMODE0 <= mode && mode <= B_AI_WAZAMODE6 ){
|
||||
if( PETSKILL_Use( charaindex, mode - B_AI_WAZAMODE0, result->target,NULL ) == TRUE ){
|
||||
result->command = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLECOM1 );
|
||||
return TRUE;
|
||||
}else{
|
||||
print( "此项技能尚未设定(%s):(%d)\n",
|
||||
CHAR_getUseName( charaindex), mode - B_AI_WAZAMODE0 );
|
||||
return FALSE;
|
||||
}
|
||||
}else
|
||||
if( mode == B_AI_ATTACKMODE ){
|
||||
result->command = BATTLE_COM_ATTACK;
|
||||
return TRUE;
|
||||
}
|
||||
}else if( mode == B_AI_GURADMODE ) {
|
||||
result->command = BATTLE_COM_GUARD;
|
||||
return TRUE;
|
||||
}else if( mode == B_AI_ESCAPEMODE ) {
|
||||
result->command = BATTLE_COM_ESCAPE;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
1087
gmsv/battle/battle_command.c
Normal file
1087
gmsv/battle/battle_command.c
Normal file
File diff suppressed because it is too large
Load Diff
10231
gmsv/battle/battle_event.c
Normal file
10231
gmsv/battle/battle_event.c
Normal file
File diff suppressed because it is too large
Load Diff
1137
gmsv/battle/battle_item.c
Normal file
1137
gmsv/battle/battle_item.c
Normal file
File diff suppressed because it is too large
Load Diff
5627
gmsv/battle/battle_magic.c
Normal file
5627
gmsv/battle/battle_magic.c
Normal file
File diff suppressed because it is too large
Load Diff
376
gmsv/battle/makefile
Normal file
376
gmsv/battle/makefile
Normal file
@ -0,0 +1,376 @@
|
||||
|
||||
INCFLAGS=-I.. -I../include
|
||||
|
||||
CFLAGS=-w -O3 $(INCFLAGS)
|
||||
|
||||
PROG=libbattle.a
|
||||
|
||||
SRC=battle.c battle_event.c battle_command.c battle_ai.c battle_magic.c pet_skill.c battle_item.c profession_skill.c
|
||||
OBJ=$(SRC:.c=.o)
|
||||
|
||||
ifeq (0,$(MAKELEVEL))
|
||||
CC=gcc
|
||||
RM=rm -f
|
||||
AR=ar cr
|
||||
MV=mv
|
||||
RANLIB=ranlib
|
||||
SED=sed
|
||||
SHELL=/bin/sh
|
||||
endif
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): $(OBJ)
|
||||
$(RM) $(PROG)
|
||||
$(AR) $(PROG) $(OBJ)
|
||||
$(RANLIB) $(PROG)
|
||||
|
||||
depend:
|
||||
$(MV) makefile makefile.bak
|
||||
$(SED) -ne '1,/^# DO NOT DELETE THIS LINE/p' makefile.bak>makefile
|
||||
$(CC) $(INCFLAGS) -M $(SRC) >> makefile
|
||||
|
||||
clean:
|
||||
$(RM) $(PROG)
|
||||
$(RM) $(OBJ)
|
||||
$(RM) *~
|
||||
|
||||
distclean:
|
||||
$(RM) $(PROG)
|
||||
$(RM) $(OBJ)
|
||||
$(RM) *~
|
||||
$(MV) makefile makefile.bak
|
||||
$(SED) -ne '1,/^# DO NOT DELETE THIS LINE/p' makefile.bak>makefile
|
||||
$(RM) makefile.bak
|
||||
|
||||
# DO NOT DELETE THIS LINE
|
||||
battle.o: battle.c ../include/version.h ../include/correct_bug.h \
|
||||
../include/version_pk.h /usr/include/string.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/buf.h ../include/common.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/usr/include/linux/errno.h /usr/include/asm/errno.h ../include/object.h \
|
||||
../include/char.h ../include/char_base.h ../include/skill.h \
|
||||
../include/util.h /usr/include/sys/time.h ../include/title.h \
|
||||
../include/addressbook.h ../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/include/stdint.h /usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/battle_event.h \
|
||||
../include/battle_command.h ../include/battle_ai.h \
|
||||
../include/configfile.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/encount.h ../include/enemy.h \
|
||||
../include/handletime.h ../include/readmap.h ../include/pet_skill.h \
|
||||
../include/npcutil.h ../include/magic.h ../include/npc_npcenemy.h \
|
||||
../include/log.h ../include/pet_skillinfo.h ../include/anim_tbl.h \
|
||||
../include/battle_magic.h ../include/profession_skill.h
|
||||
battle_event.o: battle_event.c ../include/version.h \
|
||||
../include/correct_bug.h ../include/version_pk.h /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/math.h /usr/include/bits/huge_val.h \
|
||||
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
|
||||
../include/char.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
|
||||
/usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/usr/include/linux/errno.h /usr/include/asm/errno.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/char_event.h ../include/battle.h ../include/battle_event.h \
|
||||
../include/configfile.h ../include/pet.h ../include/log.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/anim_tbl.h ../include/battle_magic.h \
|
||||
../include/enemy.h ../include/pet_skill.h ../include/item_event.h \
|
||||
../include/profession_skill.h ../include/magic_base.h
|
||||
battle_command.o: battle_command.c ../include/version.h \
|
||||
../include/correct_bug.h ../include/version_pk.h /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/time.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/char.h ../include/common.h \
|
||||
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/usr/include/linux/errno.h /usr/include/asm/errno.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/pet_skill.h ../include/battle_event.h \
|
||||
../include/battle_command.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/magic.h ../include/magic_base.h \
|
||||
../include/handletime.h ../include/profession_skill.h
|
||||
battle_ai.o: battle_ai.c ../include/version.h ../include/correct_bug.h \
|
||||
../include/version_pk.h /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
|
||||
/usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
../include/common.h /usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/usr/include/linux/errno.h /usr/include/asm/errno.h ../include/char.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/npcutil.h ../include/pet_skill.h
|
||||
battle_magic.o: battle_magic.c ../include/version.h \
|
||||
../include/correct_bug.h ../include/version_pk.h /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
../include/char.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
|
||||
/usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/usr/include/linux/errno.h /usr/include/asm/errno.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/battle_event.h ../include/magic_base.h \
|
||||
../include/battle_magic.h ../include/item_event.h ../include/anim_tbl.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/profession_skill.h
|
||||
pet_skill.o: pet_skill.c ../include/version.h ../include/correct_bug.h \
|
||||
../include/version_pk.h /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
|
||||
/usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/string.h ../include/common.h /usr/include/errno.h \
|
||||
/usr/include/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h ../include/buf.h ../include/configfile.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/char.h ../include/pet_skill.h ../include/battle.h \
|
||||
../include/battle_event.h ../include/battle_magic.h \
|
||||
../include/item_gen.h ../include/char_talk.h
|
||||
battle_item.o: battle_item.c ../include/version.h \
|
||||
../include/correct_bug.h ../include/version_pk.h /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
../include/char.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
|
||||
/usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/errno.h /usr/include/bits/errno.h \
|
||||
/usr/include/linux/errno.h /usr/include/asm/errno.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/battle_event.h ../include/battle_item.h \
|
||||
../include/battle_magic.h ../include/item_event.h ../include/log.h \
|
||||
../include/anim_tbl.h ../include/npcutil.h ../include/magic_base.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h
|
||||
profession_skill.o: profession_skill.c ../include/version.h \
|
||||
../include/correct_bug.h ../include/version_pk.h /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
|
||||
/usr/include/gconv.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/string.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
../include/buf.h ../include/common.h /usr/include/errno.h \
|
||||
/usr/include/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h ../include/profession_skill.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/sched.h \
|
||||
/usr/include/alloca.h ../include/skill.h ../include/char_base.h \
|
||||
../include/title.h ../include/addressbook.h ../include/net.h \
|
||||
/usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/socket.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/bits/sockaddr.h \
|
||||
/usr/include/asm/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/bits/in.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h \
|
||||
/usr/include/bits/sigstack.h /usr/include/bits/sigthread.h \
|
||||
../include/link.h ../include/battle.h ../include/magic_base.h \
|
||||
../include/configfile.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h
|
281
gmsv/battle/makefile.bak
Normal file
281
gmsv/battle/makefile.bak
Normal file
@ -0,0 +1,281 @@
|
||||
|
||||
INCFLAGS=-I.. -I../include
|
||||
|
||||
CFLAGS=-w -O3 $(INCFLAGS)
|
||||
|
||||
PROG=libbattle.a
|
||||
|
||||
SRC=battle.c battle_event.c battle_command.c battle_ai.c battle_magic.c pet_skill.c battle_item.c profession_skill.c
|
||||
OBJ=$(SRC:.c=.o)
|
||||
|
||||
ifeq (0,$(MAKELEVEL))
|
||||
CC=gcc
|
||||
RM=rm -f
|
||||
AR=ar cr
|
||||
MV=mv
|
||||
RANLIB=ranlib
|
||||
SED=sed
|
||||
SHELL=/bin/sh
|
||||
endif
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): $(OBJ)
|
||||
$(RM) $(PROG)
|
||||
$(AR) $(PROG) $(OBJ)
|
||||
$(RANLIB) $(PROG)
|
||||
|
||||
depend:
|
||||
$(MV) makefile makefile.bak
|
||||
$(SED) -ne '1,/^# DO NOT DELETE THIS LINE/p' makefile.bak>makefile
|
||||
$(CC) $(INCFLAGS) -M $(SRC) >> makefile
|
||||
|
||||
clean:
|
||||
$(RM) $(PROG)
|
||||
$(RM) $(OBJ)
|
||||
$(RM) *~
|
||||
|
||||
distclean:
|
||||
$(RM) $(PROG)
|
||||
$(RM) $(OBJ)
|
||||
$(RM) *~
|
||||
$(MV) makefile makefile.bak
|
||||
$(SED) -ne '1,/^# DO NOT DELETE THIS LINE/p' makefile.bak>makefile
|
||||
$(RM) makefile.bak
|
||||
|
||||
# DO NOT DELETE THIS LINE
|
||||
battle.o: battle.c /usr/include/string.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/bits/types.h /usr/include/time.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/alloca.h ../include/buf.h \
|
||||
../include/common.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/bits/stdio_lim.h ../include/object.h ../include/char.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/bits/time.h ../include/title.h \
|
||||
../include/addressbook.h ../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/battle_event.h \
|
||||
../include/battle_command.h ../include/battle_ai.h \
|
||||
../include/configfile.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/strings.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h \
|
||||
../include/encount.h ../include/enemy.h ../include/handletime.h \
|
||||
../include/readmap.h ../include/pet_skill.h ../include/npcutil.h \
|
||||
../include/magic.h ../include/npc_npcenemy.h ../include/log.h \
|
||||
../include/pet_skillinfo.h
|
||||
battle_event.o: battle_event.c /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/math.h /usr/include/bits/huge_val.h \
|
||||
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/float.h \
|
||||
../include/char.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/char_event.h ../include/battle.h ../include/battle_event.h \
|
||||
../include/configfile.h ../include/pet.h ../include/log.h
|
||||
battle_command.o: battle_command.c /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/bits/types.h /usr/include/time.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/alloca.h ../include/char.h \
|
||||
../include/common.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/bits/stdio_lim.h ../include/char_base.h \
|
||||
../include/skill.h ../include/util.h /usr/include/sys/time.h \
|
||||
/usr/include/bits/time.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/pet_skill.h ../include/battle_event.h \
|
||||
../include/battle_command.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/strings.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h ../include/magic.h \
|
||||
../include/magic_base.h
|
||||
battle_ai.o: battle_ai.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/common.h ../include/char.h ../include/char_base.h \
|
||||
../include/skill.h ../include/util.h /usr/include/sys/time.h \
|
||||
/usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/npcutil.h ../include/pet_skill.h
|
||||
battle_magic.o: battle_magic.c /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
../include/char.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/battle_event.h ../include/magic_base.h \
|
||||
../include/battle_magic.h ../include/item_event.h \
|
||||
../include/anim_tbl.h
|
||||
pet_skill.o: pet_skill.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/string.h ../include/common.h ../include/buf.h \
|
||||
../include/configfile.h ../include/char_base.h ../include/skill.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/char.h ../include/pet_skill.h ../include/battle.h \
|
||||
../include/battle_event.h ../include/item_gen.h
|
||||
battle_item.o: battle_item.c /usr/include/string.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
../include/char.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/battle_event.h \
|
||||
../include/battle_item.h ../include/battle_magic.h \
|
||||
../include/item_event.h ../include/log.h ../include/anim_tbl.h
|
||||
profession_skill.o: profession_skill.c /usr/include/stdio.h \
|
||||
/usr/include/string.h ../include/buf.h ../include/profession_skill.h \
|
||||
../include/char_base.h ../include/battle.h ../include/magic_base.h \
|
||||
../include/configfile.h
|
||||
|
2462
gmsv/battle/pet_skill.c
Normal file
2462
gmsv/battle/pet_skill.c
Normal file
File diff suppressed because it is too large
Load Diff
1295
gmsv/battle/profession_skill.c
Normal file
1295
gmsv/battle/profession_skill.c
Normal file
File diff suppressed because it is too large
Load Diff
195
gmsv/buf.c
Normal file
195
gmsv/buf.c
Normal file
@ -0,0 +1,195 @@
|
||||
#define __BUF_C__
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "buf.h"
|
||||
#include "handletime.h"
|
||||
|
||||
static int UNIT;
|
||||
static int UNITNUMBER;
|
||||
static int memconfig;
|
||||
static int readblock;
|
||||
static int NowMemory;
|
||||
static struct timeval AllocOldTime;
|
||||
|
||||
|
||||
typedef struct tagMemory
|
||||
{
|
||||
char* pointer;
|
||||
BOOL used;
|
||||
|
||||
unsigned int nsize;
|
||||
}Memory;
|
||||
static Memory *mem;
|
||||
|
||||
|
||||
void memEnd( void )
|
||||
{
|
||||
if( mem != NULL && mem[0].pointer != NULL ){
|
||||
free(mem[0].pointer);
|
||||
free(mem);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL configmem( int unit , int unitnumber )
|
||||
{
|
||||
if( memconfig == TRUE )
|
||||
return FALSE;
|
||||
UNIT = unit;
|
||||
UNITNUMBER = unitnumber;
|
||||
if( UNIT <= 0 || UNITNUMBER <= 0 )
|
||||
return memconfig = FALSE;
|
||||
return memconfig = TRUE;
|
||||
}
|
||||
|
||||
BOOL memInit( void )
|
||||
{
|
||||
int i;
|
||||
if( memconfig == FALSE )
|
||||
return FALSE;
|
||||
mem = calloc( 1, sizeof( Memory ) * UNITNUMBER );
|
||||
if( mem == NULL ){
|
||||
print( "memInit: Can't alloc memory: %d\n" ,
|
||||
sizeof(Memory)*UNITNUMBER );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
memset( mem , 0 , sizeof( Memory )* UNITNUMBER );
|
||||
for( i = 0 ; i < UNITNUMBER ; i ++ ){
|
||||
mem[i].pointer = NULL;
|
||||
mem[i].used = FALSE;
|
||||
mem[i].nsize = 0;
|
||||
}
|
||||
mem[0].pointer = calloc( 1, UNIT*UNITNUMBER );
|
||||
if( mem[0].pointer == NULL ){
|
||||
print( "memInit: Can't Allocate %d byte\n" , UNIT*UNITNUMBER );
|
||||
free( mem );
|
||||
return FALSE;
|
||||
}
|
||||
memset( mem[0].pointer , 0 , sizeof( UNIT*UNITNUMBER ));
|
||||
|
||||
#ifdef DEBUG
|
||||
print( "Allocate %d byte( %.2fK byte %.2fM byte )\n" ,
|
||||
UNIT*UNITNUMBER,
|
||||
UNIT*UNITNUMBER/1024.0,
|
||||
UNIT*UNITNUMBER/1024.0/1024.0
|
||||
);
|
||||
#endif
|
||||
readblock = 0;
|
||||
for( i = 0 ; i < UNITNUMBER ; i ++ )
|
||||
mem[i].pointer = mem[0].pointer + i * UNIT;
|
||||
|
||||
NowMemory = 0;
|
||||
AllocOldTime.tv_sec = NowTime.tv_sec;
|
||||
AllocOldTime.tv_usec = NowTime.tv_usec;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void* allocateMemory( const unsigned int nbyte )
|
||||
{
|
||||
int i;
|
||||
int arrayAllocSize;
|
||||
BOOL flg = FALSE;
|
||||
void *ret;
|
||||
int first = 0;
|
||||
|
||||
arrayAllocSize = nbyte/UNIT + ( nbyte%UNIT ? 1 : 0 );
|
||||
if( arrayAllocSize == 0 )return NULL;
|
||||
#ifdef DEBUG
|
||||
debug( arrayAllocSize , d );
|
||||
#endif
|
||||
i = readblock;
|
||||
while( 1 ) {
|
||||
if( i > UNITNUMBER - arrayAllocSize) {
|
||||
i = 0;
|
||||
}
|
||||
if( mem[i].used != FALSE ){
|
||||
i += mem[i].nsize;
|
||||
}else{
|
||||
int j;
|
||||
BOOL found = TRUE;
|
||||
for( j = i; j < i + arrayAllocSize; j ++ ) {
|
||||
if( mem[j].used != FALSE ){
|
||||
i = j + mem[j].nsize;
|
||||
found = FALSE;
|
||||
if( first == 0 ) first = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( found ) {
|
||||
mem[i].used=TRUE;
|
||||
mem[i].nsize = arrayAllocSize;
|
||||
readblock = i + arrayAllocSize;
|
||||
ret = mem[i].pointer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( ( i >= readblock || i > UNITNUMBER - arrayAllocSize )
|
||||
&& flg == TRUE ) {
|
||||
ret = NULL;
|
||||
break;
|
||||
}
|
||||
if( i > UNITNUMBER - arrayAllocSize) {
|
||||
i = 0;
|
||||
flg = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
if( ret == NULL ) {
|
||||
print( "Can't Allocate %d byte .remnants:%4.2f\n" , nbyte, (float)(NowMemory/UNITNUMBER));
|
||||
}else {
|
||||
NowMemory += arrayAllocSize;
|
||||
|
||||
if( NowTime.tv_sec > AllocOldTime.tv_sec +10 ) {
|
||||
print( "\n");
|
||||
if( NowMemory > (double)UNITNUMBER * 0.9) {
|
||||
print( "Warning!! Memory use rate exceeded 90%% .remnants:%d\n", UNITNUMBER-NowMemory);
|
||||
}else if( NowMemory > (double)UNITNUMBER * 0.8) {
|
||||
print( "Warning!! Memory use rate exceeded 80%% .remnants:%d\n", UNITNUMBER-NowMemory);
|
||||
}else if( NowMemory > (double)UNITNUMBER * 0.7) {
|
||||
print( "Memory use rate exceeded 70%% .remnants:%d\n", UNITNUMBER-NowMemory);
|
||||
}
|
||||
memcpy( &AllocOldTime, &NowTime, sizeof( AllocOldTime));
|
||||
}
|
||||
//print( "NowMemory.remnants:%4.2f\n", (float)(UNITNUMBER-NowMemory)/UNITNUMBER);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* allocateMemory匹割忡仄凶丢乒伉□毛free允月[
|
||||
* 娄醒
|
||||
* freepointer int 割忡允月燮 及禾奶件正□
|
||||
* 忒曰袄
|
||||
* 卅仄
|
||||
------------------------------------------------------------*/
|
||||
void freeMemory( void* freepointer )
|
||||
{
|
||||
int arrayindex;
|
||||
char* toppointer;
|
||||
toppointer = mem[0].pointer;
|
||||
if( freepointer == NULL )return;
|
||||
arrayindex = ((int)freepointer-(int)toppointer)/UNIT;
|
||||
if( arrayindex < readblock) {
|
||||
readblock = arrayindex;
|
||||
}
|
||||
mem[arrayindex].used = FALSE;
|
||||
|
||||
NowMemory -= mem[arrayindex].nsize;
|
||||
|
||||
}
|
||||
|
||||
void showMem( char *buf)
|
||||
{
|
||||
sprintf( buf, "NowMemory.remnants:%d%%", ((UNITNUMBER-NowMemory)*100)/UNITNUMBER);
|
||||
printf( "\n" );
|
||||
printf( buf );
|
||||
}
|
||||
|
1854
gmsv/callfromac.c
Normal file
1854
gmsv/callfromac.c
Normal file
File diff suppressed because it is too large
Load Diff
2139
gmsv/callfromcli.c
Normal file
2139
gmsv/callfromcli.c
Normal file
File diff suppressed because it is too large
Load Diff
907
gmsv/char/addressbook.c
Normal file
907
gmsv/char/addressbook.c
Normal file
@ -0,0 +1,907 @@
|
||||
#define __ADDRESSBOOK_C_
|
||||
#include "version.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "addressbook.h"
|
||||
#include "char.h"
|
||||
#include "handletime.h"
|
||||
#include "buf.h"
|
||||
#include "net.h"
|
||||
#include "lssproto_serv.h"
|
||||
#include "saacproto_cli.h"
|
||||
#include "object.h"
|
||||
#include "battle.h"
|
||||
#include "configfile.h"
|
||||
#include "npcutil.h"
|
||||
#include "pet.h"
|
||||
#include "petmail.h"
|
||||
#include "log.h"
|
||||
|
||||
/*裔烂丢永本□斥及 赢赢今[票匹烂聒允月 侬 及赢今反
|
||||
仇木动票卞允月仇午*/
|
||||
#define ADDRESSBOOK_FIXEDMESSAGE_MAXLEN 128
|
||||
|
||||
/* 愤坌及蟆卞簿手中卅井匀凶及匹}失玉伊旦皮永弁卞馨笛匹五卅井匀凶
|
||||
午五及裔烂丢永本□斥 */
|
||||
#define ADDRESSBOOK_CANTADD "那里没有任何人。"
|
||||
#define ADDRESSBOOK_CANTADD2 "无法交换名片。"
|
||||
|
||||
/* 簿井毛笛尹月仇午互匹五凶午五}笛尹方丹午仄凶谛卞霜耨允月丢永本□斥*/
|
||||
#define ADDRESSBOOK_ADDED "和%s交换名片 。"
|
||||
|
||||
/* 簿井卞涌毛创尹日木凶日 */
|
||||
#define ADDRESSBOOK_BEINGADDED "和%s交换名片 。"
|
||||
|
||||
/* 巨件玄伉互中匀天中分匀凶午五及丢永本□斥 */
|
||||
#define ADDRESSBOOK_MYTABLEFULL "名片匣已满。"
|
||||
|
||||
/* 锹澎及巨件玄伉互中匀天中分匀凶午五及丢永本□斥 */
|
||||
#define ADDRESSBOOK_HISTABLEFULL "对方的名片匣已满。"
|
||||
|
||||
|
||||
/* 丢永本□斥毛霜耨允月及卞岳 仄凶午五 */
|
||||
#define ADDRESSBOOK_SENT "送信给%s 。"
|
||||
|
||||
/* 丢永本□斥毛霜耨允月及卞撩 仄凶午五 */
|
||||
#define ADDRESSBOOK_UNSENT "无法送信给%s 。"
|
||||
|
||||
/* 簿井毛创尹方丹午仄凶互}湃卞创尹化中凶 */
|
||||
#define ADDRESSBOOK_ALREADYADDED "已经和%s交换过名片了。 "
|
||||
|
||||
/* 铜毛域 读卞 丹橇谪 */
|
||||
#define ADDRESSBOOK_GIVEADDRESS "从%s得到名片。"
|
||||
|
||||
/* 铜毛域 读卞丐仆月橇谪 */
|
||||
#define ADDRESSBOOK_TAKEADDRESS1 "给%s自己的名片。"
|
||||
/* 铜毛域 读卞丐仆月橇谪 */
|
||||
#define ADDRESSBOOK_TAKEADDRESS2 "因为%s想要名片,所以将名片给他了。"
|
||||
|
||||
#define ADDRESSBOOK_RETURNED1 \
|
||||
"从%s寄来信件,但由於没有%s的名片又将信件退回。"
|
||||
|
||||
#define ADDRESSBOOK_RETURNED2 \
|
||||
"寄信件给%s,但由於%s 没有名片,所以信件又被退回来了。"
|
||||
|
||||
#define PETMAIL_RETURNED1 \
|
||||
"%s不在这个世界里,所以无法寄送信件给他。"
|
||||
|
||||
|
||||
/* static匹银丹迕[ 五中袄手*/
|
||||
char ADDRESSBOOK_returnstring[25*128];
|
||||
|
||||
|
||||
|
||||
static int ADDRESSBOOK_findBlankEntry( int cindex );
|
||||
static BOOL ADDRESSBOOK_makeEntryFromCharaindex( int charaindex,
|
||||
ADDRESSBOOK_entry* ae);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 失玉伊旦皮永弁及丢永本□斥毛霜耨允月
|
||||
* MSG皿夫玄戊伙井日勾井歹木月[
|
||||
*
|
||||
* 支月仇午反}connection井日cdkey匹腹绸仄化}平乓仿 手
|
||||
* 甲永玄仄凶日} MSG_send允月[公及午五卞}愤坌及树 互
|
||||
* 锹澎及伉旦玄卞卅井匀凶日窒手仄卅中午中丹仇午分[
|
||||
* 娄醒
|
||||
* cindex int 平乓仿及index
|
||||
* aindex int 失玉伊旦皮永弁及index
|
||||
* text char* 霜耨允月 侬
|
||||
* color int 缙
|
||||
* 忒曰袄
|
||||
* 左件仿奶件及平乓仿卞丢永本□斥毛霜耨仄凶日TRUE ,
|
||||
* 左白仿奶件卞瓒 仄凶日FALSE毛井尹允
|
||||
------------------------------------------------------------*/
|
||||
BOOL ADDRESSBOOK_sendMessage( int cindex, int aindex, char* text , int color )
|
||||
{
|
||||
int i ;
|
||||
char tmpmsg[256];
|
||||
char textbuffer[2048];
|
||||
char *mycd;
|
||||
char *mycharaname = CHAR_getChar(cindex,CHAR_NAME );
|
||||
struct tm tm1;
|
||||
ADDRESSBOOK_entry *ae;
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
|
||||
if( !CHAR_CHECKINDEX(cindex) )return FALSE;
|
||||
|
||||
ae = CHAR_getAddressbookEntry( cindex , aindex );
|
||||
if( ae == NULL )return FALSE;
|
||||
|
||||
//getcdkeyFromCharaIndex(cindex, mycd,sizeof(mycd) );
|
||||
mycd = CHAR_getChar( cindex, CHAR_CDKEY);
|
||||
|
||||
memcpy( &tm1, localtime( (time_t *)&NowTime.tv_sec), sizeof( tm1));
|
||||
|
||||
snprintf( textbuffer, sizeof( textbuffer),
|
||||
"%2d/%02d %2d:%02d|%s|-1",
|
||||
tm1.tm_mon +1, tm1.tm_mday, tm1.tm_hour, tm1.tm_min,
|
||||
text);
|
||||
|
||||
/* 扔□田□ 卞中月凛 */
|
||||
for( i = 0 ; i < playernum ; i ++){
|
||||
if( CHAR_CHECKINDEX( i) &&
|
||||
strcmp( CHAR_getChar( i, CHAR_CDKEY), ae->cdkey) == 0 &&
|
||||
strcmp( CHAR_getChar( i, CHAR_NAME), ae->charname) == 0 )
|
||||
{
|
||||
/*
|
||||
* CDKEY 手 平乓仿 手域谯仄凶[公及平乓仿弁正及
|
||||
* 失玉伊旦皮永弁卞愤坌及树 互丐月井譬屯化}
|
||||
* 绣箕仄凶日}MSG允月[
|
||||
*/
|
||||
int index_to_my_info =
|
||||
ADDRESSBOOK_getIndexInAddressbook( i ,
|
||||
mycd, mycharaname);
|
||||
|
||||
int fd;
|
||||
if( index_to_my_info < 0 ){
|
||||
/*
|
||||
* 锹澎互愤坌毛坫壅仄化仄引匀化月[
|
||||
* 域杀 谛卞]丢□伙互 凶午分仃骚襞允月[
|
||||
*/
|
||||
//snprintf( tmpmsg, sizeof( tmpmsg),
|
||||
// ADDRESSBOOK_RETURNED1,
|
||||
// ae->charname
|
||||
// );
|
||||
|
||||
//CHAR_talkToCli( CONNECT_getCharaindex(i), -1,
|
||||
// tmpmsg , CHAR_COLORYELLOW );
|
||||
|
||||
snprintf( tmpmsg, sizeof( tmpmsg),
|
||||
ADDRESSBOOK_RETURNED2,
|
||||
CHAR_getChar( i, CHAR_NAME),
|
||||
CHAR_getChar( i, CHAR_NAME));
|
||||
|
||||
/* 霜曰潜卞手丢永本□斥 */
|
||||
CHAR_talkToCli( cindex, -1,
|
||||
tmpmsg , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
fd = getfdFromCharaIndex( i);
|
||||
if( fd != -1 ) {
|
||||
lssproto_MSG_send( fd , index_to_my_info , textbuffer , color );
|
||||
/* 夫弘午曰 */
|
||||
printl( LOG_TALK, "CD=%s\tNM=%s\tT=%s" , mycd, mycharaname, textbuffer );
|
||||
|
||||
}
|
||||
|
||||
snprintf( tmpmsg , sizeof( tmpmsg),ADDRESSBOOK_SENT,
|
||||
ae->charname );
|
||||
CHAR_talkToCli(cindex,-1, tmpmsg , color );
|
||||
|
||||
// WON ADD 修正snprintf会导致当机的bug
|
||||
{
|
||||
char tmp[1000];
|
||||
sprintf( tmp , "ADDRESSBOOK_sendMessage:"
|
||||
"Send MSG to: %s %s\n",
|
||||
ae->cdkey , ae->charname );
|
||||
// print( tmp );
|
||||
}
|
||||
|
||||
CHAR_setInt( cindex, CHAR_SENDMAILCOUNT,
|
||||
CHAR_getInt( cindex, CHAR_SENDMAILCOUNT)+1);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
/* 苇勾井日卅井匀凶凛反]失市它件玄扔□田□卞霜月 */
|
||||
saacproto_Message_send( acfd, mycd, mycharaname,
|
||||
ae->cdkey, ae->charname, textbuffer, color);
|
||||
CHAR_setInt( cindex, CHAR_SENDMAILCOUNT,
|
||||
CHAR_getInt( cindex, CHAR_SENDMAILCOUNT)+1);
|
||||
|
||||
|
||||
snprintf( tmpmsg , sizeof( tmpmsg),ADDRESSBOOK_SENT,ae->charname );
|
||||
CHAR_talkToCli( cindex,-1, tmpmsg , CHAR_COLORWHITE );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 失玉伊旦皮永弁及丢永本□斥毛霜耨允月
|
||||
* saac 井日msg 毛熬仃午匀化弁仿奶失件玄卞禾旦玄允月[
|
||||
*
|
||||
* 忒曰袄
|
||||
------------------------------------------------------------*/
|
||||
BOOL ADDRESSBOOK_sendMessage_FromOther( char *fromcdkey, char *fromcharaname,
|
||||
char *tocdkey, char *tocharaname,
|
||||
char* text , int color )
|
||||
{
|
||||
#define ADDRESSBOOK_SYSTEM "system"
|
||||
|
||||
int i ;
|
||||
char tmpmsg[256];
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
|
||||
/* 扔□田□ 毛腹绸允月 */
|
||||
for( i = 0 ; i < playernum ; i ++){
|
||||
if( CHAR_CHECKINDEX( i) &&
|
||||
strcmp( CHAR_getChar( i, CHAR_CDKEY), tocdkey) == 0 &&
|
||||
strcmp( CHAR_getChar( i, CHAR_NAME), tocharaname) == 0)
|
||||
{
|
||||
int index_to_my_info;
|
||||
/*
|
||||
* CDKEY 手 平乓仿 手域谯仄凶[公及平乓仿弁正及
|
||||
* 失玉伊旦皮永弁卞愤坌及树 互丐月井譬屯化}
|
||||
* 绣箕仄凶日}MSG允月[
|
||||
*/
|
||||
|
||||
/* 扑旦 丞丢永本□斥互窖匀化五凶 */
|
||||
if( strcmp( fromcdkey, ADDRESSBOOK_SYSTEM) == 0 &&
|
||||
strcmp( fromcharaname, ADDRESSBOOK_SYSTEM ) == 0 )
|
||||
{
|
||||
/* 扑旦 丞丢永本□斥毛龚仁 */
|
||||
CHAR_talkToCli( i, -1, text , color );
|
||||
break;
|
||||
}
|
||||
|
||||
index_to_my_info =
|
||||
ADDRESSBOOK_getIndexInAddressbook( i ,
|
||||
fromcdkey, fromcharaname);
|
||||
if( index_to_my_info < 0 ){
|
||||
/*
|
||||
* 锹澎互愤坌毛坫壅仄化仄引匀化月[
|
||||
*/
|
||||
|
||||
snprintf( tmpmsg, sizeof( tmpmsg), ADDRESSBOOK_RETURNED2,
|
||||
tocharaname, tocharaname);
|
||||
|
||||
/* 霜曰潜卞手丢永本□斥 */
|
||||
saacproto_Message_send( acfd, ADDRESSBOOK_SYSTEM , ADDRESSBOOK_SYSTEM,
|
||||
fromcdkey, fromcharaname, tmpmsg, CHAR_COLORYELLOW);
|
||||
|
||||
}
|
||||
else {
|
||||
int fd = getfdFromCharaIndex( i);
|
||||
if( fd != -1 ) {
|
||||
lssproto_MSG_send( fd , index_to_my_info , text , color );
|
||||
/* 夫弘午曰 */
|
||||
printl( LOG_TALK, "CD=%s\tNM=%s\tT=%s" , fromcdkey,
|
||||
fromcharaname, text );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i == playernum ) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int ADDRESSBOOK_getIndexInAddressbook(int cindex , char *cdkey,
|
||||
char *charname)
|
||||
{
|
||||
int i ;
|
||||
|
||||
if( !CHAR_CHECKINDEX( cindex ) ) return -1;
|
||||
|
||||
for( i = 0 ; i < ADDRESSBOOK_MAX ; i++){
|
||||
ADDRESSBOOK_entry *ae = CHAR_getAddressbookEntry( cindex , i );
|
||||
if( ae && ae->use && strcmp( ae->cdkey, cdkey )==0 &&
|
||||
strcmp( ae->charname , charname ) == 0 ){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
BOOL ADDRESSBOOK_deleteEntry( int meindex ,int index )
|
||||
{
|
||||
ADDRESSBOOK_entry ent;
|
||||
BOOL ret;
|
||||
if( !CHAR_CHECKINDEX( meindex ) ) return FALSE;
|
||||
|
||||
memset( &ent ,0, sizeof( ADDRESSBOOK_entry ));
|
||||
ret = CHAR_setAddressbookEntry( meindex , index , &ent );
|
||||
if( ret == TRUE ){
|
||||
ADDRESSBOOK_sendAddressbookTable( meindex );
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ADDRESSBOOK_addEntry( int meindex )
|
||||
{
|
||||
int objbuf[20];
|
||||
int found_count;
|
||||
int front_x , front_y;
|
||||
int i;
|
||||
int cnt = 0;
|
||||
int fd;
|
||||
char *mycd , *tocd;
|
||||
BOOL found = FALSE;
|
||||
|
||||
if( !CHAR_CHECKINDEX( meindex ) )return FALSE;
|
||||
|
||||
fd = getfdFromCharaIndex( meindex);
|
||||
if( fd == -1 ) return FALSE;
|
||||
|
||||
if( ADDRESSBOOK_findBlankEntry( meindex ) < 0) {
|
||||
CHAR_talkToCli( meindex , -1,ADDRESSBOOK_MYTABLEFULL,CHAR_COLORWHITE );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for( i = 0; i < CONNECT_WINDOWBUFSIZE; i ++ ) {
|
||||
CONNECT_setTradecardcharaindex( fd,i,-1);
|
||||
}
|
||||
|
||||
CHAR_getCoordinationDir( CHAR_getInt( meindex, CHAR_DIR ) ,
|
||||
CHAR_getInt( meindex , CHAR_X ),
|
||||
CHAR_getInt( meindex , CHAR_Y ) ,
|
||||
1 , &front_x , &front_y );
|
||||
|
||||
found_count = CHAR_getSameCoordinateObjects( objbuf,
|
||||
arraysizeof( objbuf),
|
||||
CHAR_getInt(meindex,CHAR_FLOOR),
|
||||
front_x,front_y );
|
||||
if( found_count == 0 ){
|
||||
CHAR_talkToCli( meindex, -1, ADDRESSBOOK_CANTADD, CHAR_COLORWHITE);
|
||||
return FALSE;
|
||||
}
|
||||
for( i = 0 ; i < found_count; i++ ){
|
||||
int objindex = objbuf[i];
|
||||
int index = OBJECT_getIndex( objindex);
|
||||
if( OBJECT_getType(objindex) != OBJTYPE_CHARA ) {
|
||||
continue;
|
||||
}
|
||||
if( CHAR_getInt( index,CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ){
|
||||
continue;
|
||||
}
|
||||
if( index == meindex ) {
|
||||
continue;
|
||||
}
|
||||
found = TRUE;
|
||||
if( CHAR_getWorkInt( index, CHAR_WORKBATTLEMODE) != BATTLE_CHARMODE_NONE) {
|
||||
continue;
|
||||
}
|
||||
if(!CHAR_getFlg( index, CHAR_ISTRADECARD)) {
|
||||
continue;
|
||||
}
|
||||
if( ADDRESSBOOK_findBlankEntry( index ) < 0 ) {
|
||||
continue;
|
||||
}
|
||||
tocd = CHAR_getChar( index, CHAR_CDKEY);
|
||||
mycd = CHAR_getChar( meindex, CHAR_CDKEY);
|
||||
if( ADDRESSBOOK_getIndexInAddressbook( meindex, tocd,
|
||||
CHAR_getChar( index, CHAR_NAME)) >= 0 &&
|
||||
ADDRESSBOOK_getIndexInAddressbook( index, mycd,
|
||||
CHAR_getChar(meindex, CHAR_NAME) ) >= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
CONNECT_setTradecardcharaindex( fd,cnt,index);
|
||||
cnt ++;
|
||||
if( cnt == CONNECT_WINDOWBUFSIZE ) break;
|
||||
}
|
||||
|
||||
if( cnt == 0 ) {
|
||||
if( found ) {
|
||||
CHAR_talkToCli( meindex, -1, ADDRESSBOOK_CANTADD2, CHAR_COLORWHITE);
|
||||
}else {
|
||||
CHAR_talkToCli( meindex, -1, ADDRESSBOOK_CANTADD, CHAR_COLORWHITE);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
if( cnt == 1 ) {
|
||||
ADDRESSBOOK_addAddressBook( meindex,
|
||||
CONNECT_getTradecardcharaindex(fd,0) );
|
||||
return TRUE;
|
||||
}else if( cnt > 1 ) {
|
||||
int strlength;
|
||||
char msgbuf[1024];
|
||||
char escapebuf[2048];
|
||||
strcpy( msgbuf, "1\n和谁交换名片呢?\n");
|
||||
strlength = strlen( msgbuf);
|
||||
for( i = 0;
|
||||
CONNECT_getTradecardcharaindex(fd,i) != -1
|
||||
&& i< CONNECT_WINDOWBUFSIZE; i ++ ){
|
||||
char *a = CHAR_getChar( CONNECT_getTradecardcharaindex(fd,i),
|
||||
CHAR_NAME);
|
||||
char buf[256];
|
||||
snprintf( buf, sizeof( buf),"%s\n", a);
|
||||
if( strlength + strlen( buf) > arraysizeof( msgbuf)){
|
||||
print( "%s:%d视窗讯息buffer不足。\n",
|
||||
__FILE__,__LINE__);
|
||||
break;
|
||||
}
|
||||
strcpy( &msgbuf[strlength], buf);
|
||||
strlength += strlen(buf);
|
||||
}
|
||||
lssproto_WN_send( fd, WINDOW_MESSAGETYPE_SELECT,
|
||||
WINDOW_BUTTONTYPE_CANCEL,
|
||||
CHAR_WINDOWTYPE_SELECTTRADECARD,
|
||||
-1,
|
||||
makeEscapeString( msgbuf, escapebuf, sizeof(escapebuf)));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int ADDRESSBOOK_findBlankEntry( int cindex )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( CHAR_CHECKINDEX( cindex ) == FALSE )return -1;
|
||||
|
||||
for( i=0 ; i<ADDRESSBOOK_MAX ; i++){
|
||||
ADDRESSBOOK_entry *ae;
|
||||
ae = CHAR_getAddressbookEntry( cindex , i );
|
||||
if( ae && ae->use == FALSE ) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static BOOL ADDRESSBOOK_makeEntryFromCharaindex( int charaindex,
|
||||
ADDRESSBOOK_entry* ae)
|
||||
{
|
||||
char *cdkey;
|
||||
|
||||
if( !CHAR_CHECKINDEX(charaindex) ) return FALSE;
|
||||
|
||||
memset( ae,0,sizeof(ADDRESSBOOK_entry) );
|
||||
cdkey = CHAR_getChar( charaindex, CHAR_CDKEY);
|
||||
if( cdkey == NULL ){
|
||||
print( "ADDRESSBOOK_makeEntryFromCharaindex:"
|
||||
" strange! getcdkeyFromCharaIndex returns NULL!"
|
||||
" charaindex: %d\n" , charaindex );
|
||||
return FALSE;
|
||||
}
|
||||
strcpysafe( ae->cdkey , sizeof( ae->cdkey ),cdkey);
|
||||
|
||||
strcpysafe( ae->charname,sizeof( ae->charname),
|
||||
CHAR_getChar(charaindex,CHAR_NAME) );
|
||||
ae->level = CHAR_getInt( charaindex , CHAR_LV );
|
||||
ae->duelpoint = CHAR_getInt( charaindex, CHAR_DUELPOINT);
|
||||
ae->graphicsno = CHAR_getInt( charaindex , CHAR_FACEIMAGENUMBER );
|
||||
ae->online = getServernumber();
|
||||
ae->use = TRUE;
|
||||
ae->transmigration = CHAR_getInt( charaindex, CHAR_TRANSMIGRATION);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void ADDRESSBOOK_notifyLoginLogout( int cindex , int flg )
|
||||
{
|
||||
int i;
|
||||
char *cd=NULL;
|
||||
char *nm = CHAR_getChar( cindex , CHAR_NAME );
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
|
||||
if( !CHAR_CHECKINDEX( cindex ) )return;
|
||||
cd = CHAR_getChar( cindex, CHAR_CDKEY);
|
||||
|
||||
CHAR_send_DpDBUpdate_AddressBook( cindex, flg );
|
||||
|
||||
for( i = 0 ; i < playernum ; i++){
|
||||
if( CHAR_CHECKINDEX( i) && i != cindex ) {
|
||||
int j;
|
||||
for( j = 0 ; j<ADDRESSBOOK_MAX ; j++){
|
||||
ADDRESSBOOK_entry *ae;
|
||||
ae = CHAR_getAddressbookEntry( i , j );
|
||||
if( ae && ae->use == TRUE &&
|
||||
strcmp( ae->cdkey , cd ) == 0 &&
|
||||
strcmp( ae->charname, nm ) == 0 ){
|
||||
|
||||
ae->online = (flg == 0 ) ? 0: getServernumber();
|
||||
ae->level = CHAR_getInt( cindex , CHAR_LV );
|
||||
ae->duelpoint = CHAR_getInt( cindex, CHAR_DUELPOINT);
|
||||
ae->graphicsno = CHAR_getInt( cindex, CHAR_FACEIMAGENUMBER );
|
||||
ae->transmigration = CHAR_getInt( cindex, CHAR_TRANSMIGRATION);
|
||||
|
||||
ADDRESSBOOK_sendAddressbookTableOne( i,j );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( flg == 0 ){
|
||||
saacproto_Broadcast_send( acfd,cd, nm, "offline", 1);
|
||||
}else if( flg == 1 ) {
|
||||
for( i = 0 ; i < ADDRESSBOOK_MAX; i++ ){
|
||||
int j;
|
||||
ADDRESSBOOK_entry* ae;
|
||||
ae = CHAR_getAddressbookEntry( cindex, i );
|
||||
if( ae->use == 0 )continue;
|
||||
ae->online = 0;
|
||||
for( j=0 ; j < playernum ; j++ ) {
|
||||
if( CHAR_CHECKINDEX( j) &&
|
||||
strcmp( ae->cdkey, CHAR_getChar( j, CHAR_CDKEY)) == 0 &&
|
||||
strcmp( ae->charname, CHAR_getChar( j, CHAR_NAME) )== 0){
|
||||
ae->level = CHAR_getInt( j, CHAR_LV );
|
||||
ae->graphicsno = CHAR_getInt( j, CHAR_FACEIMAGENUMBER );
|
||||
ae->online = getServernumber();
|
||||
ae->transmigration = CHAR_getInt( j, CHAR_TRANSMIGRATION);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( j == playernum) {
|
||||
#ifndef _DEATH_CONTEND
|
||||
char buff[512];
|
||||
char escapebuf[1024];
|
||||
ae->online = 0;
|
||||
snprintf( buff, sizeof(buff), "%s_%s", ae->cdkey, ae->charname);
|
||||
makeEscapeString( buff, escapebuf, sizeof(escapebuf));
|
||||
saacproto_DBGetEntryString_send( acfd, DB_ADDRESSBOOK, escapebuf, 0,0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
ADDRESSBOOK_sendAddressbookTable(cindex);
|
||||
saacproto_Broadcast_send( acfd,cd, nm, "online", 1);
|
||||
saacproto_MessageFlush_send( acfd, cd, nm);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL ADDRESSBOOK_sendAddressbookTable( int cindex )
|
||||
{
|
||||
int stringlen=0;
|
||||
int i;
|
||||
|
||||
if( !CHAR_CHECKINDEX( cindex ) )return FALSE;
|
||||
|
||||
for( i=0 ; i<ADDRESSBOOK_MAX ; i++){
|
||||
ADDRESSBOOK_entry *ae;
|
||||
ae = CHAR_getAddressbookEntry( cindex , i );
|
||||
if( ae && ae->use ){
|
||||
char tmp[CHARNAMELEN+32];
|
||||
char charname_escaped[CHARNAMELEN*2];
|
||||
makeEscapeString( ae->charname, charname_escaped ,
|
||||
sizeof(charname_escaped ));
|
||||
/* 银迕白仿弘| 蟆|伊矛伙|仿奶白|白仿弘 */
|
||||
snprintf( tmp , sizeof( tmp ),
|
||||
"%d|%s|%d|%d|%d|%d|%d|" ,
|
||||
ae->use,
|
||||
charname_escaped , ae->level ,
|
||||
ae->duelpoint,ae->online,ae->graphicsno,
|
||||
ae->transmigration);
|
||||
strcpysafe ( ADDRESSBOOK_returnstring + stringlen ,
|
||||
sizeof(ADDRESSBOOK_returnstring) - stringlen,
|
||||
tmp );
|
||||
stringlen += strlen( tmp );
|
||||
if( stringlen >= sizeof(ADDRESSBOOK_returnstring) ) {
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
/*银匀化卅中犯□正手冲徇及心匹霜月 */
|
||||
char tmp[32];
|
||||
snprintf( tmp , sizeof( tmp ), "|||||||" );
|
||||
strcpysafe ( ADDRESSBOOK_returnstring + stringlen ,
|
||||
sizeof(ADDRESSBOOK_returnstring) - stringlen,
|
||||
tmp );
|
||||
stringlen += strlen( tmp );
|
||||
if( stringlen >= sizeof(ADDRESSBOOK_returnstring)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dchop( ADDRESSBOOK_returnstring, "|" );
|
||||
|
||||
{
|
||||
int fd;
|
||||
fd = getfdFromCharaIndex( cindex );
|
||||
if( fd == -1 ) return FALSE;
|
||||
lssproto_AB_send( fd, ADDRESSBOOK_returnstring );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL ADDRESSBOOK_sendAddressbookTableOne( int cindex, int num )
|
||||
{
|
||||
int stringlen=0;
|
||||
ADDRESSBOOK_entry *ae;
|
||||
|
||||
if( !CHAR_CHECKINDEX( cindex ) )return FALSE;
|
||||
if( num < 0 || num > ADDRESSBOOK_MAX) return FALSE;
|
||||
|
||||
ae = CHAR_getAddressbookEntry( cindex , num );
|
||||
|
||||
if( ae && ae->use ){
|
||||
char tmp[CHARNAMELEN+32];
|
||||
char charname_escaped[CHARNAMELEN*2];
|
||||
makeEscapeString( ae->charname, charname_escaped ,
|
||||
sizeof(charname_escaped ));
|
||||
snprintf( tmp , sizeof( tmp ),
|
||||
"%d|%s|%d|%d|%d|%d|%d|" ,
|
||||
ae->use,
|
||||
charname_escaped , ae->level ,
|
||||
ae->duelpoint,ae->online,ae->graphicsno,
|
||||
ae->transmigration);
|
||||
strcpysafe ( ADDRESSBOOK_returnstring + stringlen ,
|
||||
sizeof(ADDRESSBOOK_returnstring) - stringlen,
|
||||
tmp );
|
||||
stringlen += strlen( tmp );
|
||||
if( stringlen >= sizeof(ADDRESSBOOK_returnstring) ) {
|
||||
return FALSE;
|
||||
}
|
||||
}else{
|
||||
char tmp[32];
|
||||
snprintf( tmp , sizeof( tmp ), "|||||||" );
|
||||
strcpysafe ( ADDRESSBOOK_returnstring + stringlen ,
|
||||
sizeof(ADDRESSBOOK_returnstring) - stringlen,
|
||||
tmp );
|
||||
stringlen += strlen( tmp );
|
||||
if( stringlen >= sizeof(ADDRESSBOOK_returnstring)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int fd;
|
||||
fd = getfdFromCharaIndex( cindex );
|
||||
if( fd == -1 ) return FALSE;
|
||||
lssproto_ABI_send( fd, num, ADDRESSBOOK_returnstring );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 夫午勾及失玉伊旦皮永弁巨件玄伉毛} 侬 卞卅云允[
|
||||
* 仇木反平乓仿忡绣迕卅及匹弁仿奶失件玄卞霜耨允月方曰手恳割
|
||||
* 卅手及匹丐月 邰互丐月[
|
||||
* 娄醒
|
||||
* a ADDRESSBOOK_entry* 侬 卞仄凶中厌瞻 尺及禾奶件正
|
||||
* 忒曰袄
|
||||
* char *
|
||||
------------------------------------------------------------*/
|
||||
char *ADDRESSBOOK_makeAddressbookString( ADDRESSBOOK_entry *a )
|
||||
{
|
||||
char work1[256], work2[256];
|
||||
|
||||
if( a->use == 0 ){
|
||||
/* 坞巨件玄伉分匀凶日坞 侬 */
|
||||
ADDRESSBOOK_returnstring[0] = '\0';
|
||||
return ADDRESSBOOK_returnstring;
|
||||
}
|
||||
|
||||
makeEscapeString( a->cdkey, work1, sizeof( work1 ));
|
||||
makeEscapeString( a->charname , work2 , sizeof( work2 ));
|
||||
snprintf( ADDRESSBOOK_returnstring,
|
||||
sizeof( ADDRESSBOOK_returnstring ),
|
||||
"%s|%s|%d|%d|%d|%d",
|
||||
work1, work2, a->level, a->duelpoint, a->graphicsno,a->transmigration);
|
||||
|
||||
return ADDRESSBOOK_returnstring;
|
||||
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 侬 祭今木化中月失玉伊旦皮永弁巨件玄伉毛}厌瞻 卞卅云允[
|
||||
* 仇及瑛绊厌瞻 及use动陆及树 反敦僬卞卅月[
|
||||
* 娄醒
|
||||
* in char* 侬
|
||||
* a ADDRESSBOOK_entry* 犯□正毛璋户月赭
|
||||
* 忒曰袄
|
||||
* 勾友卞TRUE
|
||||
------------------------------------------------------------*/
|
||||
BOOL ADDRESSBOOK_makeAddressbookEntry( char *in , ADDRESSBOOK_entry *a )
|
||||
{
|
||||
char work1[256], work2[256] , work3[256] , work4[256],work5[256],work6[256];
|
||||
int ret;
|
||||
if( strlen( in ) == 0 ){
|
||||
memset( a,0,sizeof(ADDRESSBOOK_entry) );
|
||||
a->use = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
getStringFromIndexWithDelim( in, "|" , 1 , work1 , sizeof( work1 ));
|
||||
getStringFromIndexWithDelim( in, "|" , 2 , work2 , sizeof( work2 ));
|
||||
getStringFromIndexWithDelim( in, "|" , 3 , work3 , sizeof( work3 ));
|
||||
getStringFromIndexWithDelim( in, "|" , 4 , work4 , sizeof( work4 ));
|
||||
getStringFromIndexWithDelim( in, "|" , 5 , work5 , sizeof( work5 ));
|
||||
work6[0] = '\0';
|
||||
ret = getStringFromIndexWithDelim( in, "|" , 6 , work6 , sizeof( work6 ));
|
||||
if( ret == FALSE ) {
|
||||
a->transmigration = 0;
|
||||
}
|
||||
else {
|
||||
a->transmigration = atoi( work6);
|
||||
}
|
||||
a->use = 1;
|
||||
|
||||
makeStringFromEscaped( work1 );
|
||||
makeStringFromEscaped( work2 );
|
||||
|
||||
strcpysafe( a->cdkey , sizeof(a->cdkey) , work1 );
|
||||
strcpysafe( a->charname , sizeof(a->charname), work2 );
|
||||
|
||||
a->level = atoi( work3 );
|
||||
a->duelpoint = atoi( work4 );
|
||||
a->graphicsno = atoi( work5 );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ADDRESSBOOK_addAddressBook( int meindex, int toindex)
|
||||
{
|
||||
char tmpstring[CHARNAMELEN +
|
||||
ADDRESSBOOK_FIXEDMESSAGE_MAXLEN];
|
||||
|
||||
int hisblank;
|
||||
int myblank;
|
||||
int myaddindex, toaddindex;
|
||||
int dir;
|
||||
char *cdkey;
|
||||
|
||||
hisblank = ADDRESSBOOK_findBlankEntry( toindex );
|
||||
if( hisblank < 0 ) {
|
||||
CHAR_talkToCli( meindex, -1, ADDRESSBOOK_HISTABLEFULL, CHAR_COLORWHITE);
|
||||
return ;
|
||||
}
|
||||
myblank = ADDRESSBOOK_findBlankEntry( meindex );
|
||||
if( myblank < 0 ){
|
||||
CHAR_talkToCli( meindex , -1, ADDRESSBOOK_MYTABLEFULL, CHAR_COLORWHITE );
|
||||
return ;
|
||||
}
|
||||
|
||||
cdkey = CHAR_getChar( toindex, CHAR_CDKEY);
|
||||
myaddindex = ADDRESSBOOK_getIndexInAddressbook( meindex, cdkey,
|
||||
CHAR_getChar( toindex, CHAR_NAME));
|
||||
cdkey = CHAR_getChar( meindex, CHAR_CDKEY);
|
||||
toaddindex = ADDRESSBOOK_getIndexInAddressbook( toindex, cdkey,
|
||||
CHAR_getChar(meindex, CHAR_NAME));
|
||||
if( myaddindex < 0 ){
|
||||
ADDRESSBOOK_entry hisentry;
|
||||
|
||||
if( ADDRESSBOOK_makeEntryFromCharaindex(toindex,&hisentry) == FALSE ){
|
||||
return ;
|
||||
}
|
||||
CHAR_setAddressbookEntry( meindex, myblank,&hisentry );
|
||||
|
||||
snprintf( tmpstring, sizeof( tmpstring),
|
||||
toaddindex < 0 ? ADDRESSBOOK_ADDED: ADDRESSBOOK_GIVEADDRESS,
|
||||
hisentry.charname);
|
||||
CHAR_talkToCli( meindex , -1,tmpstring, CHAR_COLORWHITE );
|
||||
ADDRESSBOOK_sendAddressbookTableOne( meindex, myblank);
|
||||
}else{
|
||||
snprintf( tmpstring, sizeof( tmpstring), ADDRESSBOOK_TAKEADDRESS1,
|
||||
CHAR_getChar( toindex, CHAR_NAME));
|
||||
CHAR_talkToCli( meindex, -1, tmpstring, CHAR_COLORWHITE);
|
||||
|
||||
}
|
||||
if( toaddindex < 0 ) {
|
||||
ADDRESSBOOK_entry meae;
|
||||
if( ADDRESSBOOK_makeEntryFromCharaindex(meindex,&meae) == FALSE) {
|
||||
return;
|
||||
}
|
||||
CHAR_setAddressbookEntry( toindex, hisblank,&meae );
|
||||
snprintf( tmpstring , sizeof( tmpstring),
|
||||
myaddindex < 0 ? ADDRESSBOOK_ADDED : ADDRESSBOOK_GIVEADDRESS,
|
||||
CHAR_getChar( meindex, CHAR_NAME ) );
|
||||
CHAR_talkToCli( toindex, -1, tmpstring, CHAR_COLORWHITE);
|
||||
ADDRESSBOOK_sendAddressbookTableOne( toindex , hisblank);
|
||||
}else {
|
||||
if( myaddindex < 0 ) {
|
||||
snprintf( tmpstring , sizeof( tmpstring),
|
||||
ADDRESSBOOK_TAKEADDRESS2,
|
||||
CHAR_getChar( meindex, CHAR_NAME ) );
|
||||
CHAR_talkToCli( toindex, -1, tmpstring, CHAR_COLORWHITE);
|
||||
}
|
||||
}
|
||||
dir = NPC_Util_GetDirCharToChar( toindex, meindex, 0);
|
||||
if( dir != -1) {
|
||||
|
||||
if( CHAR_getInt( toindex, CHAR_DIR) != dir) {
|
||||
CHAR_setInt( toindex, CHAR_DIR, dir);
|
||||
}
|
||||
CHAR_sendWatchEvent( CHAR_getWorkInt( toindex, CHAR_WORKOBJINDEX),
|
||||
CHAR_ACTNOD,NULL,0,TRUE);
|
||||
CHAR_setWorkInt( toindex, CHAR_WORKACTION, CHAR_ACTNOD);
|
||||
CHAR_sendWatchEvent( CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX),
|
||||
CHAR_ACTNOD,NULL,0,TRUE);
|
||||
CHAR_setWorkInt( meindex, CHAR_WORKACTION, CHAR_ACTNOD);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void ADDRESSBOOK_DispatchMessage( char *cd, char *nm, char *value, int mode)
|
||||
{
|
||||
int i;
|
||||
char work[256];
|
||||
int online,level,duelpoint, faceimagenumber, transmigration;
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
int ret;
|
||||
|
||||
getStringFromIndexWithDelim( value, "|" , 1 , work , sizeof( work ));
|
||||
online = atoi( work);
|
||||
getStringFromIndexWithDelim( value, "|" , 2 , work , sizeof( work ));
|
||||
level = atoi( work);
|
||||
getStringFromIndexWithDelim( value, "|" , 3 , work , sizeof( work ));
|
||||
duelpoint = atoi( work);
|
||||
getStringFromIndexWithDelim( value, "|" , 4 , work , sizeof( work ));
|
||||
faceimagenumber = atoi( work);
|
||||
ret = getStringFromIndexWithDelim( value, "|" , 5 , work , sizeof( work ));
|
||||
if( ret ) {
|
||||
transmigration = atoi( work);
|
||||
}
|
||||
else {
|
||||
transmigration = 0;
|
||||
}
|
||||
|
||||
if( online == getServernumber()) {
|
||||
for( i = 0 ; i < playernum ; i++) {
|
||||
if( CHAR_CHECKINDEX( i )) {
|
||||
char *c = CHAR_getChar( i, CHAR_CDKEY);
|
||||
char *n = CHAR_getChar( i, CHAR_NAME);
|
||||
if( c == NULL || n == NULL ) continue;
|
||||
if( strcmp( c , cd ) == 0 && strcmp( n, nm ) == 0 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( i == playernum ) {
|
||||
online = 0;
|
||||
saacproto_Broadcast_send( acfd,cd, nm, "offline", 1);
|
||||
}
|
||||
}
|
||||
|
||||
for( i = 0 ; i < playernum ; i++) {
|
||||
if( CHAR_CHECKINDEX( i )) {
|
||||
int j;
|
||||
for( j = 0 ; j < ADDRESSBOOK_MAX ; j++) {
|
||||
ADDRESSBOOK_entry *ae;
|
||||
ae = CHAR_getAddressbookEntry( i ,j );
|
||||
if( ae && ae->use == TRUE &&
|
||||
strcmp( ae->cdkey , cd ) == 0 &&
|
||||
strcmp( ae->charname, nm ) == 0 )
|
||||
{
|
||||
if( mode == 0 ) {
|
||||
ae->use = FALSE;
|
||||
}else {
|
||||
ae->online = online;
|
||||
ae->level = level;
|
||||
ae->duelpoint = duelpoint;
|
||||
ae->graphicsno = faceimagenumber;
|
||||
ae->transmigration = transmigration;
|
||||
}
|
||||
ADDRESSBOOK_sendAddressbookTableOne( i,j );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOL ADDRESSBOOK_AutoaddAddressBook( int meindex, int toindex)
|
||||
{
|
||||
int hisblank;
|
||||
int myblank;
|
||||
int myaddindex, toaddindex;
|
||||
|
||||
char *cdkey;
|
||||
|
||||
myblank = ADDRESSBOOK_findBlankEntry( meindex );
|
||||
hisblank = ADDRESSBOOK_findBlankEntry( toindex );
|
||||
if( hisblank < 0 || myblank < 0) { //"名片匣已满。"
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cdkey = CHAR_getChar( toindex, CHAR_CDKEY);
|
||||
myaddindex = ADDRESSBOOK_getIndexInAddressbook( meindex, cdkey,
|
||||
CHAR_getChar( toindex, CHAR_NAME));
|
||||
cdkey = CHAR_getChar( meindex, CHAR_CDKEY);
|
||||
toaddindex = ADDRESSBOOK_getIndexInAddressbook( toindex, cdkey,
|
||||
CHAR_getChar(meindex, CHAR_NAME));
|
||||
if( myaddindex < 0 ){
|
||||
ADDRESSBOOK_entry meae;
|
||||
ADDRESSBOOK_entry hisentry;
|
||||
if( ADDRESSBOOK_makeEntryFromCharaindex(toindex,&hisentry) == FALSE ||
|
||||
ADDRESSBOOK_makeEntryFromCharaindex(meindex,&meae) == FALSE ){
|
||||
return FALSE;
|
||||
}
|
||||
CHAR_setAddressbookEntry( meindex, myblank,&hisentry );
|
||||
CHAR_setAddressbookEntry( toindex, hisblank,&meae );
|
||||
ADDRESSBOOK_sendAddressbookTableOne( meindex, myblank);
|
||||
ADDRESSBOOK_sendAddressbookTableOne( toindex , hisblank);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
8706
gmsv/char/char.c
Normal file
8706
gmsv/char/char.c
Normal file
File diff suppressed because it is too large
Load Diff
8701
gmsv/char/char.c.bak
Normal file
8701
gmsv/char/char.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
685
gmsv/char/char_angel.c
Normal file
685
gmsv/char/char_angel.c
Normal file
@ -0,0 +1,685 @@
|
||||
#include "version.h"
|
||||
#ifdef _ANGEL_SUMMON
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h> // shan
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include "common.h"
|
||||
#include "char_base.h"
|
||||
#include "char_data.h"
|
||||
#include "char.h"
|
||||
#include "lssproto_serv.h"
|
||||
#include "item.h"
|
||||
#include "item_event.h"
|
||||
#include "buf.h"
|
||||
#include "object.h"
|
||||
#include "map_deal.h"
|
||||
#include "saacproto_cli.h"
|
||||
#include "readmap.h"
|
||||
#include "handletime.h"
|
||||
#include "char_event.h"
|
||||
#include "npccreate.h"
|
||||
#include "addressbook.h"
|
||||
#include "item_event.h"
|
||||
#include "magic_base.h"
|
||||
#include "magic.h"
|
||||
#include "chatmagic.h"
|
||||
#include "configfile.h"
|
||||
#include "log.h"
|
||||
#include "anim_tbl.h"
|
||||
#include "encount.h"
|
||||
#include "battle.h"
|
||||
#include "pet_skill.h"
|
||||
#include "util.h"
|
||||
#include "enemy.h"
|
||||
#include "npcutil.h"
|
||||
#include "pet.h"
|
||||
#include "family.h"
|
||||
#include "defend.h"
|
||||
#include "npcserver.h"
|
||||
|
||||
|
||||
struct MissionInfo missionlist[MAXMISSION];
|
||||
int mission_num =0;
|
||||
struct MissionTable missiontable[MAXMISSIONTABLE];
|
||||
|
||||
//#define ANGELITEM 2884 //20701 //使者的信物 道具编号
|
||||
//#define HEROITEM 2885 //20702 //勇者的信物 道具编号
|
||||
|
||||
extern int AngelReady;
|
||||
|
||||
char* getMissionNameInfo( int charaindex, char* nameinfo)
|
||||
{
|
||||
sprintf( nameinfo, "%s:%s", CHAR_getChar( charaindex, CHAR_CDKEY), CHAR_getChar( charaindex, CHAR_NAME) );
|
||||
return nameinfo;
|
||||
}
|
||||
|
||||
int checkIfAngel( int charaindex)
|
||||
{
|
||||
int i;
|
||||
char nameinfo[512];
|
||||
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar( charaindex, CHAR_CDKEY), CHAR_getChar( charaindex, CHAR_NAME) );
|
||||
getMissionNameInfo( charaindex, nameinfo);
|
||||
for( i =0; i <MAXMISSIONTABLE; i++) {
|
||||
if( missiontable[i].angelinfo[0] == NULL)
|
||||
continue;
|
||||
if( !strcmp( nameinfo, missiontable[i].angelinfo) ) {
|
||||
return i;
|
||||
}
|
||||
else if( !strcmp( nameinfo, missiontable[i].heroinfo) ) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int checkIfOnlyAngel( int charaindex)
|
||||
{
|
||||
int i;
|
||||
char nameinfo[512];
|
||||
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar( charaindex, CHAR_CDKEY), CHAR_getChar( charaindex, CHAR_NAME) );
|
||||
getMissionNameInfo( charaindex, nameinfo);
|
||||
for( i =0; i <MAXMISSIONTABLE; i++) {
|
||||
if( missiontable[i].angelinfo[0] == NULL)
|
||||
continue;
|
||||
if( !strcmp( nameinfo, missiontable[i].angelinfo) ) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int checkIfOnlyHero( int charaindex)
|
||||
{
|
||||
int i;
|
||||
char nameinfo[512];
|
||||
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar( charaindex, CHAR_CDKEY), CHAR_getChar( charaindex, CHAR_NAME) );
|
||||
getMissionNameInfo( charaindex, nameinfo);
|
||||
for( i =0; i <MAXMISSIONTABLE; i++) {
|
||||
if( missiontable[i].angelinfo[0] == NULL)
|
||||
continue;
|
||||
if( !strcmp( nameinfo, missiontable[i].heroinfo) ) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int checkIfAngelByName( char* nameinfo)
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i =0; i <MAXMISSIONTABLE; i++) {
|
||||
if( missiontable[i].angelinfo[0] == NULL)
|
||||
continue;
|
||||
if( !strcmp( nameinfo, missiontable[i].angelinfo) ) {
|
||||
return i;
|
||||
}
|
||||
else if( !strcmp( nameinfo, missiontable[i].heroinfo) ) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void addAngelData( int angelindex, int heroindex, int mission, int flag)
|
||||
{
|
||||
int i;
|
||||
char buf[1024];
|
||||
char angelinfo[512];
|
||||
char heroinfo[512];
|
||||
|
||||
//if( checkIfAngel( angelindex) != -1 || checkIfAngel( heroindex) != -1 )
|
||||
// return;
|
||||
//sprintf( angelinfo, "%s:%s", CHAR_getChar( angelindex, CHAR_CDKEY), CHAR_getChar( angelindex, CHAR_NAME) );
|
||||
getMissionNameInfo( angelindex, angelinfo);
|
||||
//sprintf( heroinfo, "%s:%s", CHAR_getChar( heroindex, CHAR_CDKEY), CHAR_getChar( heroindex, CHAR_NAME) );
|
||||
getMissionNameInfo( heroindex, heroinfo);
|
||||
|
||||
sprintf( buf, "%s|%s|%d|%d", angelinfo, heroinfo, mission, flag );
|
||||
//saacproto_ACMissionTable_send( acfd, -1, 2, buf, angelindex);
|
||||
saacproto_ACMissionTable_send( acfd, -1, 2, buf, angelinfo);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//void selectAngel( int charaindex)
|
||||
void selectAngel( int charaindex, int heroindex, int mission, int gm_cmd)
|
||||
{
|
||||
// gm_cmd 表示是否由GM指令产生,
|
||||
|
||||
//int heroindex =-1;
|
||||
int findindex, startindex;
|
||||
char msg[1024];
|
||||
int max_char;
|
||||
//int mission;
|
||||
|
||||
if( AngelReady <= 0 && gm_cmd == FALSE)
|
||||
return;
|
||||
|
||||
sprintf( msg, " 使者资格检查: %s %s ", CHAR_getChar( charaindex, CHAR_CDKEY), CHAR_getChar( charaindex, CHAR_NAME));
|
||||
print( msg);
|
||||
LogAngel( msg);
|
||||
|
||||
// 天使条件检查
|
||||
if( gm_cmd == FALSE )
|
||||
{
|
||||
if( checkIfAngel( charaindex) != -1) // 是否天使或勇者
|
||||
{
|
||||
print(" ANGEL已经是天使或勇者了 ");
|
||||
return;
|
||||
}
|
||||
|
||||
if( CHAR_getInt( charaindex, CHAR_LV) < 30 || !NPC_EventCheckFlg( charaindex, 4 ) )
|
||||
{
|
||||
print(" ANGEL资格不符 ");
|
||||
return;
|
||||
}
|
||||
|
||||
srand( time(NULL));
|
||||
if( rand()%3 == 0 ) // 天使的机率 2/3
|
||||
{
|
||||
print(" ANGEL机率检查不通过 ");
|
||||
return;
|
||||
}
|
||||
}
|
||||
print(" ANGEL决定 ");
|
||||
|
||||
|
||||
// 挑选勇者
|
||||
if( heroindex == -1 )
|
||||
{
|
||||
//heroindex = -1;
|
||||
max_char = CHAR_getPlayerMaxNum();
|
||||
startindex = RAND( 0, max_char-1);
|
||||
findindex = startindex;
|
||||
while(1) {
|
||||
if( findindex == startindex-1) break;
|
||||
findindex = (findindex+1) % max_char;
|
||||
if( !CHAR_CHECKINDEX( findindex) ) continue;
|
||||
if( CHAR_getInt( findindex, CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) continue;
|
||||
if( findindex == charaindex ) continue;
|
||||
if( checkIfAngel( findindex) != -1) continue; // 是否天使或勇者
|
||||
if( CHAR_getInt( findindex, CHAR_LV) < 80 || !NPC_EventCheckFlg( findindex, 4 ) ) continue; // 勇者的条件
|
||||
if( rand()%3 == 0 ) continue; // 勇者的机率 2/3
|
||||
|
||||
heroindex = findindex;
|
||||
|
||||
print(" ANGEL勇者决定 ");
|
||||
|
||||
break;
|
||||
}
|
||||
if( heroindex < 0) {
|
||||
sprintf( msg, " 没有找到勇者人选!! ");
|
||||
print( msg);
|
||||
//LogAngel( msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 决定任务
|
||||
if( mission == -1 )
|
||||
{
|
||||
int mlist[MAXMISSION]; // 符合条件的任务列表
|
||||
char eventlist[1024];
|
||||
char buf[64];
|
||||
int i, j, mindex =0;
|
||||
|
||||
memset( mlist, 0, sizeof(mlist));
|
||||
for( i =0; i <MAXMISSION; i++) {
|
||||
int checked =TRUE;
|
||||
if( missionlist[i].id <= 0) continue;
|
||||
if( CHAR_getInt( heroindex, CHAR_LV) < missionlist[i].level )
|
||||
continue;
|
||||
strcpy( eventlist, missionlist[i].eventflag); // 检查必要旗标
|
||||
j =0;
|
||||
while(1) {
|
||||
j++;
|
||||
if( getStringFromIndexWithDelim( eventlist, ";", j, buf, sizeof(buf)) == FALSE )
|
||||
break;
|
||||
if( buf[0] != '!') { // 必要旗标或禁止旗标
|
||||
if( !NPC_EventCheckFlg( heroindex, atoi(buf) )) {
|
||||
checked = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( NPC_EventCheckFlg( heroindex, atoi(buf+1) )) {
|
||||
checked = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( checked ) {
|
||||
mlist[mindex] = missionlist[i].id;
|
||||
print(" mlist[%d]=%d ", mindex, mlist[mindex]);
|
||||
mindex++;
|
||||
}
|
||||
}
|
||||
if( mindex <= 0 ) {
|
||||
sprintf( msg, " 找不到合适的任务 ");
|
||||
print( msg);
|
||||
//LogAngel( msg);
|
||||
return;
|
||||
}
|
||||
|
||||
mission = mlist[rand()%mindex];
|
||||
}
|
||||
|
||||
|
||||
addAngelData( charaindex, heroindex, mission, MISSION_WAIT_ANSWER); // 传到AC
|
||||
|
||||
// 清除旗标 event8 224~255 为精灵召唤专用
|
||||
CHAR_setInt( charaindex, CHAR_NOWEVENT8, 0);
|
||||
CHAR_setInt( charaindex, CHAR_ENDEVENT8, 0);
|
||||
CHAR_setInt( heroindex, CHAR_NOWEVENT8, 0);
|
||||
CHAR_setInt( heroindex, CHAR_ENDEVENT8, 0);
|
||||
|
||||
if( gm_cmd == FALSE )
|
||||
AngelReady = 0; // 清除缺额
|
||||
|
||||
{
|
||||
sprintf( msg, " 产生 %s 天使候补: %s %s Lv:%d 勇者候补: %s %s Lv:%d 任务:%d ci=%d hi=%d ",
|
||||
gm_cmd ? ("(GM指令)") : (" "),
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY), CHAR_getChar( charaindex, CHAR_NAME), CHAR_getInt( charaindex, CHAR_LV),
|
||||
CHAR_getChar( heroindex, CHAR_CDKEY), CHAR_getChar( heroindex, CHAR_NAME), CHAR_getInt( heroindex, CHAR_LV),
|
||||
mission, charaindex, heroindex);
|
||||
print( msg);
|
||||
LogAngel( msg);
|
||||
}
|
||||
}
|
||||
|
||||
void sendAngelCleanToCli( int fd)
|
||||
{
|
||||
lssproto_WN_send( fd, //getfdFromCharaIndex(charaindex),
|
||||
WINDOW_MESSAGETYPE_ANGELMESSAGE, -1,
|
||||
CHAR_WINDOWTYPE_ANGEL_CLEAN,
|
||||
-1, "");
|
||||
}
|
||||
|
||||
int AngelCreate( int angelindex)
|
||||
{
|
||||
int emptyitem1, emptyitem2;
|
||||
int angeltokenindex, herotokenindex;
|
||||
char msgbuf[1024]/*, nameinfo[1024]*/;
|
||||
int mindex, mission;
|
||||
char heroname[64];
|
||||
|
||||
if( !CHAR_CHECKINDEX( angelindex)) return FALSE;
|
||||
|
||||
print(" 天使答应了!! ");
|
||||
|
||||
mindex = checkIfAngel( angelindex);
|
||||
if( mindex == -1 || missiontable[mindex].flag == MISSION_TIMEOVER ) {
|
||||
//print("\n ANGEL错误!!Table逾时或无资料??:%d ", angelindex );
|
||||
CHAR_talkToCli( angelindex, -1, "很抱歉,你太晚回答,已经逾时了。", CHAR_COLORYELLOW);
|
||||
|
||||
sprintf( msgbuf, " 回答逾时或无资料 i:%d 使者:%s %s ", mindex, CHAR_getChar( angelindex, CHAR_CDKEY), CHAR_getChar( angelindex, CHAR_NAME));
|
||||
print( msgbuf);
|
||||
LogAngel( msgbuf);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( missiontable[mindex].flag != MISSION_WAIT_ANSWER ) {
|
||||
print(" 旗标不符:%d ", missiontable[mindex].flag);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( CHAR_findEmptyItemBoxNo( angelindex ) < 2 ){
|
||||
CHAR_talkToCli( angelindex, -1, "空间栏位不足。至少要有两个空道具栏位。", CHAR_COLORYELLOW);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
getStringFromIndexWithDelim( missiontable[mindex].heroinfo, ":", 2, heroname, sizeof(heroname));
|
||||
|
||||
angeltokenindex = ITEM_makeItemAndRegist( ANGELITEM );
|
||||
if( angeltokenindex != -1 ){
|
||||
/*if( ITEM_getInt( angeltokenindex, ITEM_TYPE) != ITEM_ANGELTOKEN) {
|
||||
print(" 制作使者信物失败 ");
|
||||
ITEM_endExistItemsOne( angeltokenindex);
|
||||
return;
|
||||
}*/
|
||||
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar( angelindex, CHAR_CDKEY), CHAR_getChar( angelindex, CHAR_NAME ) );
|
||||
ITEM_setChar( angeltokenindex, ITEM_ANGELINFO, missiontable[mindex].angelinfo);
|
||||
ITEM_setChar( angeltokenindex, ITEM_HEROINFO, missiontable[mindex].heroinfo);
|
||||
sprintf( msgbuf, "%d", missiontable[mindex].mission);
|
||||
ITEM_setChar( angeltokenindex, ITEM_ANGELMISSION, msgbuf);
|
||||
//sprintf( msgbuf, "%s(%s)", ITEM_getChar( angeltokenindex, ITEM_NAME), CHAR_getChar( angelindex, CHAR_NAME ) );
|
||||
//ITEM_setChar( angeltokenindex, ITEM_NAME, msgbuf);
|
||||
//ITEM_setChar( angeltokenindex, ITEM_SECRETNAME, msgbuf);
|
||||
//sprintf( msgbuf, "这是使者 %s 与勇者 %s 专属的信物", CHAR_getChar( angelindex, CHAR_NAME), heroname );
|
||||
sprintf( msgbuf, "精灵使者 %s 的信物,装备後不遇敌。", CHAR_getChar( angelindex, CHAR_NAME) );
|
||||
ITEM_setChar( angeltokenindex, ITEM_EFFECTSTRING, msgbuf);
|
||||
|
||||
emptyitem1 = CHAR_addItemSpecificItemIndex( angelindex, angeltokenindex);
|
||||
CHAR_sendItemDataOne( angelindex, emptyitem1);
|
||||
LogItem(
|
||||
CHAR_getChar( angelindex, CHAR_NAME ),
|
||||
CHAR_getChar( angelindex, CHAR_CDKEY ),
|
||||
angeltokenindex,
|
||||
"AddItem(制作道具 使者信物)",
|
||||
CHAR_getInt( angelindex,CHAR_FLOOR),
|
||||
CHAR_getInt( angelindex,CHAR_X ),
|
||||
CHAR_getInt( angelindex,CHAR_Y ),
|
||||
ITEM_getChar( angeltokenindex, ITEM_UNIQUECODE),
|
||||
ITEM_getChar( angeltokenindex, ITEM_NAME),
|
||||
ITEM_getInt( angeltokenindex, ITEM_ID) );
|
||||
CHAR_talkToCli( angelindex, -1,"得到使者的信物。", CHAR_COLORYELLOW);
|
||||
}else{
|
||||
print("制作使者的信物失败。" );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
herotokenindex = ITEM_makeItemAndRegist( HEROITEM );
|
||||
if( herotokenindex != -1 ){
|
||||
/*if( ITEM_getInt( herotokenindex, ITEM_TYPE) != ITEM_HEROTOKEN) {
|
||||
print(" 制作勇者信物失败 ");
|
||||
ITEM_endExistItemsOne( herotokenindex);
|
||||
ITEM_endExistItemsOne( angeltokenindex);
|
||||
CHAR_sendItemDataOne( angelindex, emptyitem1);
|
||||
return;
|
||||
}*/
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar( angelindex, CHAR_CDKEY), CHAR_getChar( angelindex, CHAR_NAME ) );
|
||||
ITEM_setChar( herotokenindex, ITEM_ANGELINFO, missiontable[mindex].angelinfo);
|
||||
ITEM_setChar( herotokenindex, ITEM_HEROINFO, missiontable[mindex].heroinfo);
|
||||
sprintf( msgbuf, "%d", missiontable[mindex].mission);
|
||||
ITEM_setChar( herotokenindex, ITEM_ANGELMISSION, msgbuf);
|
||||
//sprintf( msgbuf, "%s(%s)", ITEM_getChar( herotokenindex, ITEM_NAME), heroname );
|
||||
//ITEM_setChar( herotokenindex, ITEM_NAME, msgbuf);
|
||||
//ITEM_setChar( herotokenindex, ITEM_SECRETNAME, msgbuf);
|
||||
//sprintf( msgbuf, "这是勇者 %s 与使者 %s 专属的信物", heroname, CHAR_getChar( angelindex, CHAR_NAME) );
|
||||
sprintf( msgbuf, "勇者 %s 的信物,使者使用可传送至勇者身边。", heroname );
|
||||
ITEM_setChar( herotokenindex, ITEM_EFFECTSTRING, msgbuf);
|
||||
|
||||
emptyitem2 = CHAR_addItemSpecificItemIndex( angelindex, herotokenindex);
|
||||
CHAR_sendItemDataOne( angelindex, emptyitem2);
|
||||
LogItem(
|
||||
CHAR_getChar( angelindex, CHAR_NAME ),
|
||||
CHAR_getChar( angelindex, CHAR_CDKEY ),
|
||||
herotokenindex,
|
||||
"AddItem(制作道具 勇者信物)",
|
||||
CHAR_getInt( angelindex,CHAR_FLOOR),
|
||||
CHAR_getInt( angelindex,CHAR_X ),
|
||||
CHAR_getInt( angelindex,CHAR_Y ),
|
||||
ITEM_getChar( herotokenindex, ITEM_UNIQUECODE),
|
||||
ITEM_getChar( herotokenindex, ITEM_NAME),
|
||||
ITEM_getInt( herotokenindex, ITEM_ID) );
|
||||
CHAR_talkToCli( angelindex, -1,"得到勇者的信物。", CHAR_COLORYELLOW);
|
||||
}else{
|
||||
print("制作勇者的信物失败。" );
|
||||
ITEM_endExistItemsOne( angeltokenindex);
|
||||
CHAR_sendItemDataOne( angelindex, emptyitem1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// 更新至AC Server
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar( angelindex, CHAR_CDKEY), CHAR_getChar( angelindex, CHAR_NAME ) );
|
||||
sprintf( msgbuf, "%s|%d", missiontable[mindex].angelinfo, missionlist[missiontable[mindex].mission].limittime );
|
||||
saacproto_ACMissionTable_send( acfd, MISSION_DOING, 4, msgbuf, "");
|
||||
|
||||
//CHAR_talkToCli( angelindex, -1, "天之声:非常感谢你答应帮忙,那我就将信物交给你了,请将勇者的信物转交给勇者。", CHAR_COLORYELLOW);
|
||||
|
||||
lssproto_WN_send( getfdFromCharaIndex(angelindex), WINDOW_MESSAGETYPE_MESSAGE,
|
||||
WINDOW_BUTTONTYPE_YES, -1, -1,
|
||||
"非常感谢你答应帮忙,那我就将信物交给你了,请将勇者的信物转交给勇者。");
|
||||
|
||||
sprintf( msgbuf, " 使者答应帮忙了 i:%d 使者:%s 勇者:%s ci=%d ", mindex, missiontable[mindex].angelinfo, missiontable[mindex].heroinfo, angelindex);
|
||||
print( msgbuf);
|
||||
LogAngel( msgbuf);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// 使用使者信物时
|
||||
void Use_AngelToken( int charaindex, int toindex, int haveitemindex )
|
||||
{
|
||||
int itemindex;
|
||||
char nameinfo[1024];
|
||||
int mindex;
|
||||
char msg[1024];
|
||||
char tokenbuf[64];
|
||||
|
||||
print(" 使用使者信物 ");
|
||||
|
||||
if( !CHAR_CHECKINDEX( charaindex) ) return;
|
||||
itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
|
||||
if( !ITEM_CHECKINDEX( itemindex) ) return;
|
||||
|
||||
mindex = checkIfAngel( charaindex);
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar(charaindex, CHAR_CDKEY), CHAR_getChar(charaindex, CHAR_NAME));
|
||||
getMissionNameInfo( charaindex, nameinfo);
|
||||
|
||||
if( mindex == -1 ||
|
||||
( strcmp( nameinfo, ITEM_getChar( itemindex, ITEM_ANGELINFO)) && strcmp( nameinfo, ITEM_getChar( itemindex, ITEM_HEROINFO)) ) ) {
|
||||
// 路人甲使用时
|
||||
CHAR_talkToCli( charaindex, -1, "这并不是属於你的信物,不可随便使用喔。", CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
if( strcmp( ITEM_getChar( itemindex, ITEM_ANGELINFO), missiontable[mindex].angelinfo)
|
||||
|| strcmp( ITEM_getChar( itemindex, ITEM_HEROINFO), missiontable[mindex].heroinfo) ) {
|
||||
|
||||
CHAR_talkToCli( charaindex, -1, "这是无用的信物,还是丢掉吧。", CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
if( !strcmp( nameinfo, missiontable[mindex].angelinfo) ) { // 使者使用时
|
||||
|
||||
int lefttime, hour, min;
|
||||
lefttime = missiontable[mindex].time + missiontable[mindex].limittime*60*60 - (int)time(NULL);
|
||||
hour = lefttime / (60*60);
|
||||
min = (lefttime % (60*60)) / 60;
|
||||
|
||||
if( missiontable[mindex].flag == MISSION_DOING ) {
|
||||
// 显示任务资料
|
||||
getStringFromIndexWithDelim( missiontable[mindex].heroinfo, ":", 2, tokenbuf, sizeof(tokenbuf));
|
||||
sprintf( msg, "你的使命是将勇者的信物交给 %s ,%s,时间还剩馀%d小时%d分。",
|
||||
tokenbuf, missionlist[missiontable[mindex].mission].detail, hour, min);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
}
|
||||
else if( missiontable[mindex].flag == MISSION_HERO_COMPLETE ) {
|
||||
// 可以去领奖了
|
||||
getStringFromIndexWithDelim( missiontable[mindex].heroinfo, ":", 2, tokenbuf, sizeof(tokenbuf));
|
||||
sprintf( msg, "勇者 %s 的使命已经完成了,你可以去领奖了,时间还剩馀%d小时%d分。",
|
||||
tokenbuf, hour, min);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
}
|
||||
else if( missiontable[mindex].flag == MISSION_TIMEOVER ) {
|
||||
// 时间超过了
|
||||
sprintf( msg, "很可惜,使者和勇者并没有在时限内完成使命,下次再加油吧。");
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if( !strcmp( nameinfo, missiontable[mindex].heroinfo) ) { // 勇者使用时
|
||||
// 传送至使者身旁
|
||||
int maxchar, i;
|
||||
char cdkey[64], name[64];
|
||||
int fl =0, fx =0, fy =0;
|
||||
|
||||
if( checkUnlawWarpFloor( CHAR_getInt( charaindex, CHAR_FLOOR) ) ) {
|
||||
CHAR_talkToCli( charaindex, -1, "你所在的地方无法传送。", CHAR_COLORYELLOW );
|
||||
return;
|
||||
}
|
||||
|
||||
getStringFromIndexWithDelim( missiontable[mindex].angelinfo, ":", 1, cdkey, sizeof(cdkey));
|
||||
getStringFromIndexWithDelim( missiontable[mindex].angelinfo, ":", 2, name, sizeof(name));
|
||||
maxchar = CHAR_getPlayerMaxNum();
|
||||
for( i =0; i <maxchar; i++)
|
||||
{
|
||||
if( !CHAR_CHECKINDEX( i) ) continue;
|
||||
if( CHAR_getInt( i, CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) continue;
|
||||
//sprintf( tempinfo, "%s:%s", CHAR_getChar( i, CHAR_CDKEY), CHAR_getChar( i, CHAR_NAME));
|
||||
if( strcmp( cdkey, CHAR_getChar( i, CHAR_CDKEY)) ) continue;
|
||||
if( strcmp( name, CHAR_getChar( i, CHAR_NAME)) ) continue;
|
||||
|
||||
fl = CHAR_getInt( i, CHAR_FLOOR);
|
||||
fx = CHAR_getInt( i, CHAR_X);
|
||||
fy = CHAR_getInt( i, CHAR_Y);
|
||||
|
||||
if( checkUnlawWarpFloor( fl) ) {
|
||||
CHAR_talkToCli( charaindex, -1, "对象所在的地方无法传送。", CHAR_COLORYELLOW );
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if( fl <= 0 )
|
||||
{
|
||||
sprintf( msg, "使者 %s 目前不在线上或不在本伺服器上。", name);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf( msg, "传送至使者 %s 身边。", name);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORYELLOW);
|
||||
CHAR_warpToSpecificPoint( charaindex, fl, fx, fy);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 使用勇者信物时
|
||||
void Use_HeroToken( int charaindex, int toindex, int haveitemindex )
|
||||
{
|
||||
int itemindex;
|
||||
int mindex;
|
||||
char nameinfo[64];
|
||||
char msg[1024];
|
||||
|
||||
print(" 使用勇者信物 ");
|
||||
|
||||
if( !CHAR_CHECKINDEX( charaindex) ) return;
|
||||
itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
|
||||
if( !ITEM_CHECKINDEX( itemindex) ) return;
|
||||
|
||||
mindex = checkIfAngel( charaindex);
|
||||
//sprintf( nameinfo, "%s:%s", CHAR_getChar(charaindex, CHAR_CDKEY), CHAR_getChar(charaindex, CHAR_NAME));
|
||||
getMissionNameInfo( charaindex, nameinfo);
|
||||
|
||||
if( mindex == -1 ||
|
||||
( strcmp( nameinfo, ITEM_getChar( itemindex, ITEM_ANGELINFO)) && strcmp( nameinfo, ITEM_getChar( itemindex, ITEM_HEROINFO)) ) ) {
|
||||
// 路人甲使用时
|
||||
CHAR_talkToCli( charaindex, -1, "这并不是属於你的信物,不可随便使用喔。", CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
if( strcmp( ITEM_getChar( itemindex, ITEM_ANGELINFO), missiontable[mindex].angelinfo)
|
||||
|| strcmp( ITEM_getChar( itemindex, ITEM_HEROINFO), missiontable[mindex].heroinfo) ){
|
||||
|
||||
CHAR_talkToCli( charaindex, -1, "这是无用的信物,还是丢掉吧。", CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( !strcmp( nameinfo, missiontable[mindex].heroinfo) ) { // 勇者使用时
|
||||
|
||||
int lefttime, hour, min;
|
||||
lefttime = missiontable[mindex].time + missiontable[mindex].limittime*60*60 - (int)time(NULL);
|
||||
hour = lefttime / (60*60);
|
||||
min = (lefttime % (60*60)) / 60;
|
||||
|
||||
if( missiontable[mindex].flag == MISSION_DOING ) {
|
||||
// 显示任务资料
|
||||
sprintf( msg, "你的使命是 %s,时间还剩馀%d小时%d分。",
|
||||
missionlist[missiontable[mindex].mission].detail, hour, min);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
}
|
||||
else if( missiontable[mindex].flag == MISSION_HERO_COMPLETE ) {
|
||||
// 可以去领奖了
|
||||
sprintf( msg, "你的使命已经完成了,可以去领奖了,时间还剩馀%d小时%d分。",
|
||||
hour, min);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
}
|
||||
else if( missiontable[mindex].flag == MISSION_TIMEOVER ) {
|
||||
// 时间超过了
|
||||
sprintf( msg, "很可惜,使者和勇者并没有在时限内完成使命,下次再加油吧。");
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
else if( !strcmp( nameinfo, missiontable[mindex].angelinfo) ) { // 使者使用时
|
||||
// 传送至勇者身旁
|
||||
int maxchar, i;
|
||||
char cdkey[64], name[64];
|
||||
int fl =0, fx =0, fy =0;
|
||||
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE ) {
|
||||
CHAR_talkToCli( charaindex, -1, "组队中无法传送。", CHAR_COLORYELLOW );
|
||||
return;
|
||||
}
|
||||
|
||||
if( checkUnlawWarpFloor( CHAR_getInt( charaindex, CHAR_FLOOR) ) ) {
|
||||
CHAR_talkToCli( charaindex, -1, "你所在的地方无法传送。", CHAR_COLORYELLOW );
|
||||
return;
|
||||
}
|
||||
|
||||
//if( CHAR_CheckInItemForWares( charaindex, 0) == FALSE ){
|
||||
if( CheckDropatLogout( charaindex) == TRUE ) {
|
||||
CHAR_talkToCli( charaindex, -1, "携带登出後消失的道具时无法使用。", CHAR_COLORYELLOW);
|
||||
return;
|
||||
}
|
||||
|
||||
getStringFromIndexWithDelim( missiontable[mindex].heroinfo, ":", 1, cdkey, sizeof(cdkey));
|
||||
getStringFromIndexWithDelim( missiontable[mindex].heroinfo, ":", 2, name, sizeof(name));
|
||||
maxchar = CHAR_getPlayerMaxNum();
|
||||
for( i =0; i <maxchar; i++)
|
||||
{
|
||||
if( !CHAR_CHECKINDEX( i) ) continue;
|
||||
if( CHAR_getInt( i, CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) continue;
|
||||
//sprintf( tempinfo, "%s:%s", CHAR_getChar( i, CHAR_CDKEY), CHAR_getChar( i, CHAR_NAME));
|
||||
if( strcmp( cdkey, CHAR_getChar( i, CHAR_CDKEY)) ) continue;
|
||||
if( strcmp( name, CHAR_getChar( i, CHAR_NAME)) ) continue;
|
||||
|
||||
fl = CHAR_getInt( i, CHAR_FLOOR);
|
||||
fx = CHAR_getInt( i, CHAR_X);
|
||||
fy = CHAR_getInt( i, CHAR_Y);
|
||||
|
||||
if( checkUnlawWarpFloor( fl) ) {
|
||||
CHAR_talkToCli( charaindex, -1, "对象所在的地方无法传送过去。", CHAR_COLORYELLOW );
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if( fl <= 0 )
|
||||
{
|
||||
sprintf( msg, "勇者 %s 目前不在线上或不在本伺服器上。", name);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
sprintf( msg, "传送至勇者 %s 身边。", name);
|
||||
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORYELLOW);
|
||||
CHAR_warpToSpecificPoint( charaindex, fl, fx, fy);
|
||||
|
||||
}
|
||||
else { // 路人甲使用时
|
||||
CHAR_talkToCli( charaindex, -1, "这并不是属於你的信物,不可随便使用喔。", CHAR_COLORRED);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CHAR_sendAngelMark( int objindex, int flag)
|
||||
{
|
||||
int opt[1];
|
||||
opt[0] = flag;
|
||||
CHAR_sendWatchEvent( objindex,CHAR_ACTANGEL,opt,1,TRUE);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
3884
gmsv/char/char_base.c
Normal file
3884
gmsv/char/char_base.c
Normal file
File diff suppressed because it is too large
Load Diff
3654
gmsv/char/char_base.c.bak
Normal file
3654
gmsv/char/char_base.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
1908
gmsv/char/char_data.c
Normal file
1908
gmsv/char/char_data.c
Normal file
File diff suppressed because it is too large
Load Diff
1915
gmsv/char/char_data.c.bak
Normal file
1915
gmsv/char/char_data.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
564
gmsv/char/char_event.c
Normal file
564
gmsv/char/char_event.c
Normal file
@ -0,0 +1,564 @@
|
||||
#include "version.h"
|
||||
#include <ctype.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "char.h"
|
||||
#include "item_event.h"
|
||||
#include "net.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
#include "lssproto_serv.h"
|
||||
#include "util.h"
|
||||
#include "char_data.h"
|
||||
#include "readmap.h"
|
||||
#include "map_deal.h"
|
||||
#include "item.h"
|
||||
#include "saacproto_cli.h"
|
||||
#include "npccreate.h"
|
||||
#include "handletime.h"
|
||||
#include "anim_tbl.h"
|
||||
#include "family.h"
|
||||
|
||||
#define SPR_kmydam CG_HIT_MARK_00
|
||||
BOOL CHAR_allprewalk( int index,int* dir,int* mode)
|
||||
{
|
||||
int poisonvalue;
|
||||
poisonvalue = CHAR_getInt(index, CHAR_POISON );
|
||||
if( poisonvalue >= 1 ){
|
||||
CHAR_setInt(index,CHAR_HP , CHAR_getInt(index,CHAR_HP)
|
||||
- poisonvalue );
|
||||
CHAR_setWorkInt(index,CHAR_WORKLASTATTACKCHARAINDEX,-2);
|
||||
{
|
||||
int opt[2] = { SPR_kmydam,poisonvalue};
|
||||
CHAR_sendWatchEvent( CHAR_getWorkInt(index,CHAR_WORKOBJINDEX),
|
||||
CHAR_ACTDAMAGE,opt,2,TRUE);
|
||||
|
||||
CHAR_sendStatusString( index,"M");
|
||||
}
|
||||
poisonvalue--;
|
||||
if( poisonvalue <= 0)poisonvalue = 1;
|
||||
CHAR_setInt(index,CHAR_POISON,poisonvalue);
|
||||
}
|
||||
if( CHAR_getInt(index,CHAR_CONFUSION) != 0 )
|
||||
*dir = RAND(0,7);
|
||||
if( CHAR_getInt(index,CHAR_STONE) != 0 )
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHAR_allpostwalk( int index )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL CHAR_makeCADefaultString( int objindex,char* buf,int buflen, int act )
|
||||
{
|
||||
char objindexbuf[64];
|
||||
/* 民尼永弁 */
|
||||
if( CHECKOBJECT(objindex) == FALSE ) return FALSE;
|
||||
if( OBJECT_getType(objindex) != OBJTYPE_CHARA ) return FALSE;
|
||||
snprintf( buf,buflen,"%s|%d|%d|%d|%d",
|
||||
cnv10to62( objindex,objindexbuf, sizeof(objindexbuf)),
|
||||
OBJECT_getX(objindex), OBJECT_getY(objindex),
|
||||
act,
|
||||
CHAR_getInt(OBJECT_getIndex(objindex),CHAR_DIR));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void CHAR_makeCADAMAGEStringFromSpecifiedCoordinate(
|
||||
int x , int y, char* buf,int buflen,int ef1,int damagevalue )
|
||||
{
|
||||
snprintf( buf,buflen,"%d|%d|%d|%d|%d|%d|%d",
|
||||
-1,x,y, CHAR_ACTDAMAGE,0, ef1,damagevalue);
|
||||
}
|
||||
|
||||
BOOL CHAR_makeCAOPT1String( int objindex,char* buf, int buflen, int act,int opt1 )
|
||||
{
|
||||
char objindexbuf[64];
|
||||
if( CHECKOBJECT(objindex) == FALSE ) return FALSE;
|
||||
if( OBJECT_getType(objindex) != OBJTYPE_CHARA ) return FALSE;
|
||||
snprintf( buf,buflen,"%s|%d|%d|%d|%d|%d",
|
||||
cnv10to62( objindex,objindexbuf, sizeof(objindexbuf)),
|
||||
OBJECT_getX(objindex), OBJECT_getY(objindex),
|
||||
act,
|
||||
CHAR_getInt(OBJECT_getIndex(objindex),CHAR_DIR), opt1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef _STREET_VENDOR
|
||||
BOOL CHAR_makeCAOPTString(int objindex,char* buf,int buflen,int act,char *string)
|
||||
{
|
||||
char objindexbuf[64];
|
||||
|
||||
if(CHECKOBJECT(objindex) == FALSE ) return FALSE;
|
||||
if(OBJECT_getType(objindex) != OBJTYPE_CHARA ) return FALSE;
|
||||
snprintf( buf,buflen,"%s|%d|%d|%d|%d|%s",
|
||||
cnv10to62(objindex,objindexbuf, sizeof(objindexbuf)),
|
||||
OBJECT_getX(objindex), OBJECT_getY(objindex),act,
|
||||
CHAR_getInt(OBJECT_getIndex(objindex),CHAR_DIR),string);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL CHAR_makeCAOPT3String( int objindex,char* buf, int buflen, int act,int opt1,int opt2,int opt3 )
|
||||
{
|
||||
char objindexbuf[64];
|
||||
|
||||
if( CHECKOBJECT(objindex) == FALSE ) return FALSE;
|
||||
if( OBJECT_getType(objindex) != OBJTYPE_CHARA ) return FALSE;
|
||||
snprintf( buf,buflen,"%s|%d|%d|%d|%d|%d|%d|%d",
|
||||
cnv10to62( objindex,objindexbuf, sizeof(objindexbuf)),
|
||||
OBJECT_getX(objindex), OBJECT_getY(objindex),
|
||||
act,
|
||||
CHAR_getInt(OBJECT_getIndex(objindex),CHAR_DIR),
|
||||
opt1,opt2,opt3);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHAR_playerWatchfunc( int objmeindex, int objmoveindex,
|
||||
CHAR_ACTION act, int x, int y, int dir, int* opt, int optlen )
|
||||
{
|
||||
int fd;
|
||||
int meindex;
|
||||
if( !CHECKOBJECTUSE(objmeindex) )return;
|
||||
if( !CHECKOBJECTUSE(objmoveindex))return;
|
||||
if( OBJECT_getType(objmeindex) != OBJTYPE_CHARA )return;
|
||||
|
||||
meindex = OBJECT_getIndex(objmeindex);
|
||||
if( CHAR_getInt( meindex,CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER )return;
|
||||
|
||||
fd = getfdFromCharaIndex( meindex );
|
||||
if( fd == -1 )return;
|
||||
switch( OBJECT_getType(objmoveindex) ){
|
||||
case OBJTYPE_CHARA:
|
||||
{
|
||||
char buf[128];
|
||||
if( !CHAR_getFlg( OBJECT_getIndex(objmoveindex),CHAR_ISVISIBLE) )
|
||||
return;
|
||||
|
||||
switch( act ){
|
||||
case CHAR_ACTSTAND:
|
||||
case CHAR_ACTWALK:
|
||||
case CHAR_ACTATTACK:
|
||||
case CHAR_ACTDEAD:
|
||||
case CHAR_ACTMAGIC:
|
||||
case CHAR_ACTITEM:
|
||||
case CHAR_ACTDOWN:
|
||||
case CHAR_ACTSIT:
|
||||
case CHAR_ACTHAND:
|
||||
case CHAR_ACTPLEASURE:
|
||||
case CHAR_ACTANGRY:
|
||||
case CHAR_ACTSAD:
|
||||
case CHAR_ACTDAMAGE:
|
||||
case CHAR_ACTGUARD:
|
||||
case CHAR_ACTTURN:
|
||||
case CHAR_ACTWARP:
|
||||
case CHAR_ACTACTIONWALK:
|
||||
case CHAR_ACTNOD:
|
||||
case CHAR_ACTTHROW:
|
||||
case CHAR_ACTACTIONSTAND:
|
||||
if( CHAR_makeCADefaultString(objmoveindex,buf,sizeof(buf),act) ) {
|
||||
CONNECT_appendCAbuf( fd,buf,strlen(buf));
|
||||
}
|
||||
break;
|
||||
// shan begin
|
||||
case CHAR_ACTTRADE:
|
||||
if( optlen == 1 )
|
||||
if( CHAR_makeCAOPT1String( objmoveindex, buf,
|
||||
sizeof( buf), act, opt[0] ) )
|
||||
CONNECT_appendCAbuf( fd, buf, strlen(buf));
|
||||
break;
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
case CHAR_ACTANGEL:
|
||||
if( optlen == 1 )
|
||||
if( CHAR_makeCAOPT1String( objmoveindex, buf,
|
||||
sizeof( buf), act, opt[0] ) )
|
||||
CONNECT_appendCAbuf( fd, buf, strlen(buf));
|
||||
break;
|
||||
#endif
|
||||
|
||||
// shan end
|
||||
#ifdef _MIND_ICON
|
||||
case CHAR_MIND:
|
||||
if( optlen == 1 )
|
||||
if( CHAR_makeCAOPT1String( objmoveindex, buf,
|
||||
sizeof(buf), act, opt[0]))
|
||||
CONNECT_appendCAbuf( fd, buf, strlen(buf));
|
||||
break;
|
||||
#endif
|
||||
#ifdef _STREET_VENDOR
|
||||
case CHAR_STREETVENDOR_OPEN:
|
||||
if(CHAR_makeCAOPTString(objmoveindex,buf,sizeof(buf),
|
||||
act,CHAR_getWorkChar(OBJECT_getIndex(objmoveindex),CHAR_STREETVENDOR_NAME)))
|
||||
CONNECT_appendCAbuf(fd,buf,strlen(buf));
|
||||
break;
|
||||
case CHAR_STREETVENDOR_CLOSE:
|
||||
if(CHAR_makeCAOPTString(objmoveindex,buf,sizeof(buf),
|
||||
act,CHAR_getWorkChar(OBJECT_getIndex(objmoveindex),CHAR_STREETVENDOR_NAME)))
|
||||
CONNECT_appendCAbuf(fd,buf,strlen(buf));
|
||||
break;
|
||||
#endif
|
||||
#ifdef _ITEM_CRACKER
|
||||
case CHAR_ITEM_CRACKER:
|
||||
if( optlen == 1 )
|
||||
if( CHAR_makeCAOPT1String( objmoveindex, buf,
|
||||
sizeof(buf), act, opt[0]))
|
||||
CONNECT_appendCAbuf( fd, buf, strlen(buf));
|
||||
break;
|
||||
#endif
|
||||
case CHAR_ACTEFFECT:
|
||||
if( optlen == 1 )
|
||||
if( CHAR_makeCAOPT1String(objmoveindex,buf,
|
||||
sizeof(buf),act,opt[0] ) )
|
||||
CONNECT_appendCAbuf( fd,buf,strlen(buf));
|
||||
break;
|
||||
case CHAR_ACTPOPUPNAME:
|
||||
case CHAR_ACTLEADER:
|
||||
case CHAR_ACTBATTLEWATCH:
|
||||
if( optlen == 1 )
|
||||
if( CHAR_makeCAOPT1String(objmoveindex,buf,
|
||||
sizeof(buf),act,opt[0] ) )
|
||||
CONNECT_appendCAbuf( fd,buf,strlen(buf));
|
||||
break;
|
||||
case CHAR_ACTBATTLE:
|
||||
if( optlen == 3 )
|
||||
if( CHAR_makeCAOPT3String( objmoveindex,buf, sizeof(buf),
|
||||
act,opt[0],opt[1],opt[2] ) )
|
||||
CONNECT_appendCAbuf( fd,buf,strlen(buf));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case OBJTYPE_ITEM:
|
||||
case OBJTYPE_GOLD:
|
||||
CHAR_sendSpecifiedobjindexCToCharaindex(meindex,objmoveindex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CHAR_sendWallDamage( int charaindex,int x, int y, int damage )
|
||||
{
|
||||
int fd;
|
||||
char cabuf[256]="";
|
||||
|
||||
fd = getfdFromCharaIndex(charaindex);
|
||||
if( fd == -1 )return;
|
||||
|
||||
CHAR_makeCADAMAGEStringFromSpecifiedCoordinate(
|
||||
x,y,cabuf,sizeof(cabuf),SPR_kmydam,damage );
|
||||
CONNECT_appendCAbuf( fd,cabuf,strlen(cabuf));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static struct ParamShow
|
||||
{
|
||||
int paramindex; /* 由仿丢□正及奶件犯永弁旦 */
|
||||
char* offmessage; /* 匀凶凛及丢永本□斥 侬 */
|
||||
}pShow[]={
|
||||
{CHAR_PARALYSIS, CHAR_RECOVERPARALYSISSTRING},
|
||||
{CHAR_SLEEP, CHAR_RECOVERSILENCESTRING},
|
||||
{CHAR_STONE, CHAR_RECOVERSTONESTRING},
|
||||
{CHAR_DRUNK, CHAR_RECOVERDARKNESSSTRING},
|
||||
{CHAR_CONFUSION, CHAR_RECOVERCONFUSIONSTRING},
|
||||
};
|
||||
|
||||
void CHAR_recoveryStatus( int charaindex )
|
||||
{
|
||||
int i;
|
||||
int cure=FALSE;
|
||||
if( !CHAR_CHECKINDEX(charaindex) )return;
|
||||
|
||||
for( i=0 ; i < arraysizeof(pShow) ; i ++ ){
|
||||
if( CHAR_getInt(charaindex,pShow[i].paramindex) > 0 ){
|
||||
int old;
|
||||
old = CHAR_setInt(charaindex,pShow[i].paramindex,
|
||||
CHAR_getInt(charaindex,
|
||||
pShow[i].paramindex) - 1 );
|
||||
if( old == 1 ){
|
||||
if( CHAR_getInt(charaindex,CHAR_WHICHTYPE) == CHAR_TYPEPLAYER){
|
||||
CHAR_talkToCli( charaindex,-1, pShow[i].offmessage,
|
||||
CHAR_COLORWHITE );
|
||||
}
|
||||
cure = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( cure ){
|
||||
CHAR_sendStatusString( charaindex, "P" );
|
||||
CHAR_sendCToArroundCharacter( CHAR_getWorkInt(
|
||||
charaindex, CHAR_WORKOBJINDEX) );
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL CHAR_clairvoyance_gold(int objindex,char* buf )
|
||||
{
|
||||
if( OBJECT_getType( objindex ) == OBJTYPE_GOLD ){
|
||||
*buf = 'G';
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL CHAR_clairvoyance_item(int objindex,char* buf )
|
||||
{
|
||||
if( OBJECT_getType( objindex ) == OBJTYPE_ITEM){
|
||||
*buf = 'I';
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL CHAR_clairvoyance_player(int objindex,char* buf )
|
||||
{
|
||||
if( OBJECT_getType( objindex ) == OBJTYPE_CHARA
|
||||
&& CHAR_getInt(OBJECT_getIndex(objindex),CHAR_WHICHTYPE)
|
||||
== CHAR_TYPEPLAYER ){
|
||||
*buf = 'P';
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL CHAR_clairvoyance_enemy(int objindex,char* buf )
|
||||
{
|
||||
if( OBJECT_getType( objindex ) == OBJTYPE_CHARA
|
||||
&& CHAR_getInt(OBJECT_getIndex(objindex),CHAR_WHICHTYPE)
|
||||
== CHAR_TYPEENEMY ){
|
||||
*buf = 'E';
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static char CHAR_clairvoyanceString[STRINGBUFSIZ];
|
||||
|
||||
static void CHAR_clairvoyance( int charaindex )
|
||||
{
|
||||
char onebuf[128];
|
||||
int stringlen=0;
|
||||
int clairvoyancelevel;
|
||||
int centerx,centery,fl;
|
||||
int i,j;
|
||||
BOOL sendclairvoyance=FALSE;
|
||||
|
||||
#define CHAR_CLAIRVOYANCEWIDTH 81
|
||||
BOOL (*clairvoyancefunc[])(int,char*) ={
|
||||
CHAR_clairvoyance_gold,
|
||||
CHAR_clairvoyance_item,
|
||||
CHAR_clairvoyance_player,
|
||||
CHAR_clairvoyance_enemy,
|
||||
};
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKLOOPSTARTSEC)%10 != 0 )
|
||||
return;
|
||||
|
||||
clairvoyancelevel = CHAR_getInt(charaindex,CHAR_RADARSTRENGTH );
|
||||
|
||||
if( clairvoyancelevel <= 0 )return;
|
||||
if( clairvoyancelevel > arraysizeof( clairvoyancefunc ) )
|
||||
clairvoyancelevel = arraysizeof( clairvoyancefunc );
|
||||
|
||||
centerx = CHAR_getInt(charaindex,CHAR_X);
|
||||
centery = CHAR_getInt(charaindex,CHAR_Y);
|
||||
fl = CHAR_getInt(charaindex,CHAR_FLOOR);
|
||||
|
||||
|
||||
for( i = centerx - CHAR_CLAIRVOYANCEWIDTH/2 ;
|
||||
i < centerx + CHAR_CLAIRVOYANCEWIDTH/2 ; i ++ ){
|
||||
for( j = centery - CHAR_CLAIRVOYANCEWIDTH/2 ;
|
||||
j < centery + CHAR_CLAIRVOYANCEWIDTH/2 ; j ++ ){
|
||||
OBJECT object;
|
||||
for( object = MAP_getTopObj(fl,i,j) ; object ;
|
||||
object = NEXT_OBJECT( object ) ){
|
||||
int objindex = GET_OBJINDEX(object);
|
||||
int loop;
|
||||
|
||||
if( OBJECT_getType(objindex) == OBJTYPE_NOUSE )continue;
|
||||
if( OBJECT_getType(objindex) == OBJTYPE_CHARA
|
||||
&& OBJECT_getIndex(objindex) == charaindex) continue;
|
||||
for( loop = 0 ; loop < clairvoyancelevel ; loop ++ ){
|
||||
BOOL ret;
|
||||
char id;
|
||||
ret = clairvoyancefunc[loop](objindex,&id);
|
||||
if( ret == TRUE ){
|
||||
sendclairvoyance=TRUE;
|
||||
snprintf( onebuf,sizeof(onebuf),
|
||||
"%d|%d|%c|",i,j,id );
|
||||
strcpysafe( CHAR_clairvoyanceString + stringlen,
|
||||
sizeof(CHAR_clairvoyanceString)
|
||||
- stringlen, onebuf);
|
||||
stringlen += strlen(onebuf);
|
||||
if( stringlen > sizeof(CHAR_clairvoyanceString) )
|
||||
goto RETURN;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RETURN:
|
||||
if( stringlen >= 1 ){
|
||||
int fd;
|
||||
fd = getfdFromCharaIndex( charaindex );
|
||||
dchop( CHAR_clairvoyanceString, "|" );
|
||||
if( fd != -1 )
|
||||
lssproto_R_send( fd, CHAR_clairvoyanceString );
|
||||
}else if( !sendclairvoyance ){
|
||||
int fd;
|
||||
fd = getfdFromCharaIndex( charaindex );
|
||||
if( fd != -1 )
|
||||
lssproto_R_send( fd, "" );
|
||||
}
|
||||
}
|
||||
|
||||
void CHAR_loopFunc( int charaindex )
|
||||
{
|
||||
CHAR_recoveryStatus( charaindex );
|
||||
CHAR_clairvoyance( charaindex );
|
||||
}
|
||||
|
||||
void CHAR_playerresurrect( int charaindex, int hp )
|
||||
{
|
||||
CHAR_setInt(charaindex,CHAR_BASEIMAGENUMBER,
|
||||
CHAR_getInt(charaindex,CHAR_BASEBASEIMAGENUMBER));
|
||||
CHAR_setFlg(charaindex,CHAR_ISDIE, 0);
|
||||
CHAR_setFlg(charaindex,CHAR_ISATTACKED, 1);
|
||||
CHAR_setFlg(charaindex,CHAR_ISOVERED, 0);
|
||||
if( hp >= CHAR_getWorkInt(charaindex,CHAR_WORKMAXHP) )
|
||||
hp = CHAR_getWorkInt(charaindex,CHAR_WORKMAXHP);
|
||||
else if( hp <= 0 )
|
||||
hp = 1;
|
||||
CHAR_setInt(charaindex,CHAR_HP, hp);
|
||||
}
|
||||
|
||||
int CHAR_die( int charaindex )
|
||||
{
|
||||
CHAR_DischargeParty( charaindex, 0);
|
||||
{
|
||||
int bymonster = 0;
|
||||
int attackindex = CHAR_getWorkInt(charaindex,
|
||||
CHAR_WORKLASTATTACKCHARAINDEX);
|
||||
if( attackindex == -2 )
|
||||
bymonster = 0;
|
||||
else if( CHAR_CHECKINDEX(attackindex) == TRUE ){
|
||||
if( CHAR_getInt(attackindex,CHAR_WHICHTYPE)
|
||||
== CHAR_TYPEENEMY ){
|
||||
bymonster = 1;
|
||||
}else{
|
||||
bymonster = 2;
|
||||
}
|
||||
}
|
||||
if( bymonster == 0 || bymonster == 1 ){
|
||||
int i;
|
||||
for( i=0 ; i<CHAR_EQUIPPLACENUM ; i++ )
|
||||
CHAR_DropItem(charaindex,i);
|
||||
}else{
|
||||
int eqindex[CHAR_EQUIPPLACENUM];
|
||||
int itemhavenum=0;
|
||||
int i;
|
||||
|
||||
for( i=0 ; i<CHAR_EQUIPPLACENUM ; i++ )
|
||||
if( ITEM_CHECKINDEX(CHAR_getItemIndex(charaindex,i)) )
|
||||
eqindex[itemhavenum++] = i;
|
||||
|
||||
if( itemhavenum >= 1 ){
|
||||
int randomindex = RAND(0,itemhavenum-1);
|
||||
CHAR_DropItem(charaindex,eqindex[randomindex]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
CHAR_DropMoney(charaindex,
|
||||
CHAR_getInt(charaindex,CHAR_GOLD)/2 );
|
||||
CHAR_setInt(charaindex,CHAR_GOLD,0);
|
||||
}
|
||||
CHAR_complianceParameter(charaindex);
|
||||
CHAR_sendCToArroundCharacter( CHAR_getWorkInt(charaindex, CHAR_WORKOBJINDEX) );
|
||||
CHAR_setInt(charaindex,CHAR_DEADCOUNT,
|
||||
CHAR_getInt(charaindex,CHAR_DEADCOUNT)+1);
|
||||
{
|
||||
int i;
|
||||
BOOL old=FALSE;
|
||||
for( i=0 ; i<arraysizeof(pShow);i++)
|
||||
if( CHAR_setInt( charaindex, pShow[i].paramindex, 0 ) > 0 ){
|
||||
old = TRUE;
|
||||
}
|
||||
if( CHAR_setInt( charaindex, CHAR_POISON, 0 ) > 0 )old=TRUE;
|
||||
if( old )
|
||||
CHAR_sendCToArroundCharacter( CHAR_getInt(charaindex, CHAR_WORKOBJINDEX));
|
||||
}
|
||||
CHAR_sendStatusString( charaindex, "P");
|
||||
CHAR_sendStatusString( charaindex, "I");
|
||||
CHAR_setFlg(charaindex,CHAR_ISDIE,1);
|
||||
CHAR_setFlg(charaindex,CHAR_ISATTACKED,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CHAR_playerTalkedfunc( int charaindex, int talkindex,char* message, int color, int channel )
|
||||
{
|
||||
int fd;
|
||||
char lastbuf[4096];
|
||||
char mesgbuf[4096];
|
||||
char escapebuf[4096];
|
||||
int fmindex = CHAR_getInt( charaindex, CHAR_FMINDEX );
|
||||
fd = getfdFromCharaIndex( charaindex );
|
||||
if( fd == -1 )return;
|
||||
if( (channel>-1) && (fmindex>0) ){
|
||||
if( channel == 0 ){
|
||||
#ifndef _CHANNEL_MODIFY
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|[族]%s",
|
||||
#else
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|F|[族]%s",
|
||||
#endif
|
||||
makeEscapeString( CHAR_appendNameAndTitle(talkindex, message, mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ));
|
||||
}
|
||||
#ifdef _FMVER21
|
||||
else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == FMMEMBER_LEADER ){
|
||||
#else
|
||||
else if( channel == FAMILY_MAXCHANNEL && CHAR_getInt( talkindex, CHAR_FMLEADERFLAG ) == 1 ){
|
||||
#endif
|
||||
#ifndef _CHANNEL_MODIFY
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|[族长广播]%s",
|
||||
#else
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|F|[族长广播]%s",
|
||||
#endif
|
||||
makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ));
|
||||
}else{
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|[%d]%s",channel,
|
||||
makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ));
|
||||
}
|
||||
}else{
|
||||
#ifdef _CHANNEL_MODIFY
|
||||
if(CHAR_getFlg(talkindex,CHAR_ISPARTYCHAT) && (CHAR_getWorkInt(talkindex,CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE))
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|T|[队]%s",
|
||||
makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ));
|
||||
else
|
||||
#ifdef _FONT_SIZE
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|P|%s|%d",
|
||||
makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ), CHAR_getWorkInt( talkindex, CHAR_WORKFONTSIZE) );
|
||||
#else
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|P|%s",
|
||||
makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ));
|
||||
#endif
|
||||
|
||||
#else
|
||||
snprintf( lastbuf,sizeof(lastbuf),"P|%s",
|
||||
makeEscapeString(CHAR_appendNameAndTitle(talkindex, message,mesgbuf,sizeof(mesgbuf)),
|
||||
escapebuf,sizeof(escapebuf) ));
|
||||
#endif
|
||||
}
|
||||
lssproto_TK_send( fd, CHAR_getWorkInt( talkindex, CHAR_WORKOBJINDEX ),lastbuf, color);
|
||||
}
|
2355
gmsv/char/char_item.c
Normal file
2355
gmsv/char/char_item.c
Normal file
File diff suppressed because it is too large
Load Diff
2355
gmsv/char/char_item.c.bak
Normal file
2355
gmsv/char/char_item.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
635
gmsv/char/char_party.c
Normal file
635
gmsv/char/char_party.c
Normal file
@ -0,0 +1,635 @@
|
||||
#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
|
||||
// shan add
|
||||
extern struct FM_PKFLOOR fmpkflnum[FAMILY_FMPKFLOOR];
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 由□ 奴楮 及末□旦
|
||||
------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 坞中化中月由□ 奴 毛茧允
|
||||
* 卅仃木壬-1毛忒允[
|
||||
------------------------------------------------------------*/
|
||||
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);
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 端卞由□ 奴卞 月质
|
||||
*
|
||||
* charaindex int 愤坌
|
||||
* targetindex int 月锹澎及谛
|
||||
------------------------------------------------------------*/
|
||||
void CHAR_JoinParty_Main( int charaindex, int targetindex)
|
||||
{
|
||||
int firstflg = FALSE;
|
||||
int i;
|
||||
char c[3];
|
||||
char buf[64];
|
||||
int toindex;
|
||||
int parray;
|
||||
|
||||
/* 褪互中凶日娄匀舰曰请允 */
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 锹澎由□ 奴及谛醒反 井" */
|
||||
parray = CHAR_getEmptyPartyArray( toindex) ;
|
||||
if( parray == -1 ) {
|
||||
print( "%s : %d err\n", __FILE__,__LINE__);
|
||||
return;
|
||||
}
|
||||
/* 窒手 仄 褪及凛反褪卞卅匀凶CA毛霜耨允月 */
|
||||
if( CHAR_getWorkInt( toindex, CHAR_WORKPARTYMODE) == CHAR_PARTY_NONE ) {
|
||||
CHAR_sendLeader( CHAR_getWorkInt( toindex, CHAR_WORKOBJINDEX), 1);
|
||||
/* 锹澎及橇谪及踏五晶尹 */
|
||||
/* 褪卞卅月 */
|
||||
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 加入团队!",
|
||||
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, "加入团队!", CHAR_COLORYELLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 由□ 奴卞 欠丹午允月[
|
||||
------------------------------------------------------------*/
|
||||
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;
|
||||
}
|
||||
|
||||
/* 愤坌互由□ 奴赚氏匹凶日蛲 */
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE) != CHAR_PARTY_NONE ) {
|
||||
lssproto_PR_send( fd, 1, FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* 及蟆及甄 毛 月 */
|
||||
CHAR_getCoordinationDir( CHAR_getInt( charaindex, CHAR_DIR ) ,
|
||||
CHAR_getInt( charaindex , CHAR_X ),
|
||||
CHAR_getInt( charaindex , CHAR_Y ) ,
|
||||
1 , &x , &y );
|
||||
|
||||
/* 赓渝祭允月 */
|
||||
for( i = 0; i < CONNECT_WINDOWBUFSIZE; i ++ ) {
|
||||
CONNECT_setJoinpartycharaindex(fd,i,-1);
|
||||
}
|
||||
cnt = 0;
|
||||
|
||||
/*愤坌及 及蟆及平乓仿毛潸 允月 */
|
||||
|
||||
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;
|
||||
|
||||
/* 平乓仿弁正□元扎卅中 */
|
||||
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
|
||||
|
||||
/* 皿伊奶乩□及凛 */
|
||||
if( CHAR_getInt( toindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER ){
|
||||
found = TRUE;
|
||||
/* 锹澎互阂分匀凶日褪毛娄匀舰曰请允 */
|
||||
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;
|
||||
}
|
||||
|
||||
/* 褪午 ㄠ汹动 卞中月井 */
|
||||
if( NPC_Util_CharDistance( charaindex, targetindex ) > 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* 爵 反匹卅中仪[*/
|
||||
if( CHAR_getWorkInt( targetindex, CHAR_WORKBATTLEMODE) != BATTLE_CHARMODE_NONE ){
|
||||
continue;
|
||||
}
|
||||
/* 醮棉袱第乒□玉井 */
|
||||
if( !CHAR_getFlg( targetindex, CHAR_ISPARTY) ) continue;
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
if( CHAR_getWorkInt( targetindex, CHAR_WORKANGELMODE) == TRUE) {
|
||||
CHAR_talkToCli( charaindex, -1, "使者不可以当领队。", CHAR_COLORYELLOW);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef _ESCAPE_RESET // 使用恶宝逃跑後x分钟内不可与人组队
|
||||
if( getStayEncount( getfdFromCharaIndex(targetindex) ) ) {
|
||||
//print(" 恶宝中组队 ");
|
||||
if( time(NULL) - CHAR_getWorkInt( targetindex, CHAR_WORKLASTESCAPE) < 5*60 ) {
|
||||
//print(" 恶宝逃跑後组队 ");
|
||||
CHAR_talkToCli( charaindex, -1, "此人暂时不可以当领队。", CHAR_COLORYELLOW);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/* 穴件乒旦田旦互中月凛反]谛棉方曰穸燮允月[ */
|
||||
else if( CHAR_getInt( toindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS ) {
|
||||
targetindex = toindex;
|
||||
cnt = 0;
|
||||
if( !NPC_BusCheckJoinParty( toindex, charaindex, TRUE)) {
|
||||
/* 椭瘀毛 凶今卅井匀凶[醮棉 月及反蔽歹月[谛棉及质 手仄卅中[
|
||||
* 支支仇仄中及匹[
|
||||
*/
|
||||
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)
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
/* 皿伊奶乩□坭反穴件乒旦田旦动陆反 骰允月 */
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
/* 锹澎由□ 奴及谛醒反 井" */
|
||||
parray = CHAR_getEmptyPartyArray( targetindex) ;
|
||||
if( parray == -1 ) continue;
|
||||
|
||||
/* 仇仇引匹仁木壬 */
|
||||
CONNECT_setJoinpartycharaindex( fd,cnt,toindex);
|
||||
cnt++;
|
||||
if( cnt == CONNECT_WINDOWBUFSIZE ) break;
|
||||
|
||||
/* 穴件乒旦田旦 苇仄分中]伙□皿毛 仃月[ */
|
||||
if( CHAR_getInt( targetindex, CHAR_WHICHTYPE) == CHAR_TYPEBUS ) break;
|
||||
|
||||
}
|
||||
|
||||
if( cnt == 0 ) {
|
||||
if( found == TRUE) {
|
||||
CHAR_talkToCli( charaindex, -1, "无法加入团队。", CHAR_COLORYELLOW);
|
||||
}
|
||||
result = FALSE;
|
||||
}else if( cnt == 1 ) {
|
||||
#ifdef _DEATH_CONTEND
|
||||
int toindex = CONNECT_getJoinpartycharaindex( fd, 0);
|
||||
if(CHAR_getInt(toindex,CHAR_PKLISTTEAMNUM) == -1 && CHAR_getInt(charaindex,CHAR_PKLISTTEAMNUM) == -1){
|
||||
}else if( CHAR_getInt( charaindex, CHAR_PKLISTLEADER ) > 0 ||
|
||||
CHAR_getInt( toindex, CHAR_PKLISTTEAMNUM) < 0 ||
|
||||
CHAR_getInt( charaindex, CHAR_PKLISTTEAMNUM) < 0 ||
|
||||
CHAR_getInt( toindex, CHAR_PKLISTTEAMNUM) != CHAR_getInt( charaindex, CHAR_PKLISTTEAMNUM) ||
|
||||
CHAR_getInt(toindex,CHAR_WHICHTYPE) != CHAR_TYPEPLAYER){
|
||||
|
||||
CHAR_talkToCli( charaindex, -1, "队伍不同,无法加入团队。", CHAR_COLORYELLOW);
|
||||
result = FALSE;
|
||||
}else{
|
||||
#endif
|
||||
CHAR_JoinParty_Main( charaindex, CONNECT_getJoinpartycharaindex(fd,0));
|
||||
result = TRUE;
|
||||
#ifdef _DEATH_CONTEND
|
||||
}
|
||||
#endif
|
||||
}else {
|
||||
int strlength;
|
||||
char msgbuf[1024];
|
||||
char escapebuf[2048];
|
||||
#ifdef _DEATH_CONTEND
|
||||
int toindex = CONNECT_getJoinpartycharaindex( fd, 0);
|
||||
if(CHAR_getInt(toindex,CHAR_PKLISTTEAMNUM) == -1 && CHAR_getInt(charaindex,CHAR_PKLISTTEAMNUM) == -1){
|
||||
}else if( CHAR_getInt( charaindex, CHAR_PKLISTLEADER ) > 0 ||
|
||||
CHAR_getInt( toindex, CHAR_PKLISTTEAMNUM) < 0 ||
|
||||
CHAR_getInt( charaindex, CHAR_PKLISTTEAMNUM) < 0 ||
|
||||
CHAR_getInt( toindex, CHAR_PKLISTTEAMNUM) != CHAR_getInt( charaindex, CHAR_PKLISTTEAMNUM) ||
|
||||
CHAR_getInt(toindex,CHAR_WHICHTYPE) != CHAR_TYPEPLAYER){
|
||||
|
||||
CHAR_talkToCli( charaindex, -1, "队伍不同,无法加入团队。", CHAR_COLORYELLOW);
|
||||
result = FALSE;
|
||||
}
|
||||
#endif
|
||||
strcpy( msgbuf, "1\n和谁组成团队呢?\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视窗讯息buffer不足。\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 );
|
||||
CHAR_setWorkInt( pindex, CHAR_WORKPARTYINDEX1, -1);
|
||||
CHAR_setWorkInt( pindex, CHAR_WORKPARTYMODE, CHAR_PARTY_NONE);
|
||||
if( msgflg ){
|
||||
CHAR_talkToCli( pindex, -1, "团队已解散!", 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) ){ //格子内有道具
|
||||
for( k=0;k<itemquitparty_num;k++ ){
|
||||
if( ITEM_getInt( del_item_index, ITEM_ID) == atoi(Disappear_Item[k].string) ){ //若等於所设定的道具ID
|
||||
CHAR_setItemIndex( pindex, j, -1); //格子内道具消失
|
||||
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(): 真奇怪!");
|
||||
return FALSE;
|
||||
}
|
||||
CHAR_setWorkInt( toindex, CHAR_WORKPARTYINDEX1 + myarray, -1);
|
||||
snprintf( buf,sizeof( buf), "%s 脱离团队!",
|
||||
CHAR_getChar( charaindex, CHAR_NAME));
|
||||
if( msgflg ){
|
||||
CHAR_talkToCli( charaindex, -1, "脱离团队!", 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) ){ //格子内有道具
|
||||
for( j=0;j<itemquitparty_num;j++ ){
|
||||
if( ITEM_getInt( del_item_index, ITEM_ID) == atoi(Disappear_Item[j].string) ){ //若等於所设定的道具ID
|
||||
CHAR_setItemIndex( charaindex, i, -1); //格子内道具消失
|
||||
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) ){ //格子内有道具
|
||||
for( k=0;k<itemquitparty_num;k++ ){
|
||||
if( ITEM_getInt( del_item_index, ITEM_ID) == atoi(Disappear_Item[k].string) ){ //若等於所设定的道具ID
|
||||
CHAR_setItemIndex( index, j, -1); //格子内道具消失
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 愤坌互伉□母□井升丹井毛霜耨允月[
|
||||
------------------------------------------------------------*/
|
||||
void CHAR_sendLeader( int objindex, int leader)
|
||||
{
|
||||
int opt[1];
|
||||
opt[0] = leader;
|
||||
CHAR_sendWatchEvent( objindex,CHAR_ACTLEADER,opt,1,TRUE);
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 醮棉毛赐 CHAR_WORKPARTYINDEX)隙烂匹平乓仿index毛娄匀舰月[
|
||||
* 愤坌互褪匹手阂匹手 [
|
||||
------------------------------------------------------------*/
|
||||
int CHAR_getPartyIndex( int index, int num)
|
||||
{
|
||||
int nindex = -1;
|
||||
|
||||
/* 醮棉及奶件犯永弁旦毛潸 */
|
||||
/* 褪及桦宁 */
|
||||
if( CHAR_getWorkInt( index, CHAR_WORKPARTYMODE) == CHAR_PARTY_LEADER ) {
|
||||
nindex = CHAR_getWorkInt( index, CHAR_WORKPARTYINDEX1 + num );
|
||||
}
|
||||
/* 阂及桦宁 */
|
||||
else {
|
||||
int oyaindex = CHAR_getWorkInt( index, CHAR_WORKPARTYINDEX1);
|
||||
if( CHAR_CHECKINDEX( oyaindex)) {
|
||||
nindex = CHAR_getWorkInt( oyaindex, CHAR_WORKPARTYINDEX1+num);
|
||||
}
|
||||
}
|
||||
return nindex;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 丢永本□斥毛霜耨允月[
|
||||
* 醮棉互中木壬公及醮棉卞手丢永本□斥毛霜耨允月[
|
||||
------------------------------------------------------------*/
|
||||
void CHAR_talkToCliAndParty( int talkedcharaindex,int talkcharaindex,
|
||||
char* message, CHAR_COLOR color )
|
||||
{
|
||||
int i;
|
||||
/* 引内愤坌 */
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1561
gmsv/char/char_talk.c
Normal file
1561
gmsv/char/char_talk.c
Normal file
File diff suppressed because it is too large
Load Diff
1308
gmsv/char/char_walk.c
Normal file
1308
gmsv/char/char_walk.c
Normal file
File diff suppressed because it is too large
Load Diff
5828
gmsv/char/chatmagic.c
Normal file
5828
gmsv/char/chatmagic.c
Normal file
File diff suppressed because it is too large
Load Diff
5592
gmsv/char/chatmagic.c.bak
Normal file
5592
gmsv/char/chatmagic.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
903
gmsv/char/chatroom.c
Normal file
903
gmsv/char/chatroom.c
Normal file
@ -0,0 +1,903 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "readmap.h"
|
||||
#include "object.h"
|
||||
#include "char.h"
|
||||
#include "char_base.h"
|
||||
#include "chatmagic.h"
|
||||
#include "battle.h"
|
||||
#include "log.h"
|
||||
#include "configfile.h"
|
||||
#include "lssproto_serv.h"
|
||||
#include "saacproto_cli.h"
|
||||
#include "family.h"
|
||||
#include "chatroom.h"
|
||||
#include "net.h"
|
||||
#include "util.h"
|
||||
#ifdef _CHATROOMPROTOCOL // (不可开) Syu ADD 聊天室频道
|
||||
|
||||
|
||||
|
||||
#ifdef _UNIVERSE_CHATROOM
|
||||
|
||||
UniChatRoomlist ChatRoom[MAX_CHATROOM];
|
||||
BOOL ChatCheck_BeMaster( int myindex, int chatnum)
|
||||
{
|
||||
if( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return FALSE;
|
||||
|
||||
if( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM ) == 0 ) return FALSE;
|
||||
|
||||
if( chatnum != -1 ){
|
||||
if( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM ) != chatnum )
|
||||
return FALSE;
|
||||
}
|
||||
if( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ChatCheck_Free( int myindex)
|
||||
{
|
||||
int old_gold;
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return FALSE;
|
||||
old_gold = CHAR_getInt( myindex, CHAR_GOLD );
|
||||
if( old_gold < 200 ){
|
||||
CHAR_talkToCli ( myindex , -1 , "成立聊天室需花费200石币" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
if ( CHAR_getInt ( myindex , CHAR_LV ) < 30 &&
|
||||
CHAR_getInt ( myindex , CHAR_TRANSMIGRATION ) < 1 ) {
|
||||
CHAR_talkToCli ( myindex , -1 , "成立聊天室需0转30级以上!" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) != 0 ) {
|
||||
CHAR_talkToCli ( myindex , -1 , "你已经在其他聊天室中!" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void resetChat_users( int chat, int ti)
|
||||
{
|
||||
if( chat<0 || chat >= MAX_CHATROOM ) return;
|
||||
if( ti<0 || ti >= MAX_PPLINROOM ) return;
|
||||
memset( ChatRoom[chat].charalist[ti].cdkey, 0, sizeof(ChatRoom[chat].charalist[ti].cdkey));
|
||||
memset( ChatRoom[chat].charalist[ti].name, 0, sizeof(ChatRoom[chat].charalist[ti].name));
|
||||
memset( ChatRoom[chat].charalist[ti].own, 0, sizeof(ChatRoom[chat].charalist[ti].own));
|
||||
}
|
||||
|
||||
void InitChatRoom( void )
|
||||
{
|
||||
int i, j;
|
||||
for ( i = 0 ; i < MAX_CHATROOM ; i ++ ) {
|
||||
ChatRoom[ i ].use=0;
|
||||
ChatRoom[ i ].masindex= -1;
|
||||
ChatRoom[ i ].charanum= 0;
|
||||
for ( j = 0 ; j < MAX_PPLINROOM ; j ++ )
|
||||
resetChat_users( i, j);
|
||||
}
|
||||
}
|
||||
|
||||
int ChatRoom_getfree( void)
|
||||
{
|
||||
int i;
|
||||
for ( i=0; i<MAX_CHATROOM; i++) {
|
||||
if( ChatRoom[ i ].use !=0 ) continue;
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ChatRoom_Refresh ( int Num )
|
||||
{
|
||||
int fd , i, j;
|
||||
char token[4096];
|
||||
char token2[4096];
|
||||
char buf[64];
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
if( ChatRoom[ Num ].use == FALSE ) return;
|
||||
if( ChatRoom[Num].masindex<0 || ChatRoom[Num].masindex>MAX_PPLINROOM ) return;
|
||||
|
||||
sprintf ( token , "R|r%d|%s|%d|%s|p%d|" ,
|
||||
Num, ChatRoom[ Num ].chatname, ChatRoom[ Num ].masindex,
|
||||
ChatRoom[Num].charalist[ChatRoom[Num].masindex].name, ChatRoom[ Num ].charanum );
|
||||
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].charalist[i].use == 0 ) continue;
|
||||
sprintf( buf , "I%d|%s|%s|" ,
|
||||
i, ChatRoom[Num].charalist[i].name, ChatRoom[Num].charalist[i].own );
|
||||
strncat ( token , buf , sizeof ( buf ) ) ;
|
||||
}
|
||||
|
||||
for ( j=0; j<playernum; j++) {
|
||||
if( !CHAR_getCharUse( j) ||
|
||||
CHAR_getInt( j, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ) continue;
|
||||
if( CHAR_getWorkInt ( j, CHAR_WORKCHATROOMNUM) != Num ) continue;
|
||||
if( CHAR_getWorkInt( j, CHAR_WORKCHATROOMTYPE) == 0 ) continue;
|
||||
// if( !strcmp( ChatRoom[Num].charalist[ChatRoom[Num].masindex].cdkey, CHAR_getChar( j, CHAR_CDKEY)) &&
|
||||
// !strcmp( ChatRoom[Num].charalist[ChatRoom[Num].masindex].name, CHAR_getChar( j, CHAR_NAME)) ){
|
||||
fd=getfdFromCharaIndex ( j);
|
||||
sprintf ( token2, "%s%d|", token, CHAR_getWorkInt( j, CHAR_WORKCHATROOMTYPE));
|
||||
lssproto_CHATROOM_send ( fd , token2 ) ;
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
void ChatRoom_List ( int fd )
|
||||
{
|
||||
int i;
|
||||
char buf[256];
|
||||
char token[2048] = "B|";
|
||||
for( i=0; i<MAX_CHATROOM; i++) {
|
||||
if( ChatRoom[ i ].use == 0 ) continue;
|
||||
sprintf( buf, "r%d|%s|%d|%s|p%d|",
|
||||
i , ChatRoom[ i ].chatname,
|
||||
ChatRoom[ i ].masindex ,
|
||||
ChatRoom[ i ].charalist[ChatRoom[ i ].masindex].name,
|
||||
ChatRoom[ i ].charanum );
|
||||
strncat ( token , buf , sizeof ( buf ) ) ;
|
||||
|
||||
}
|
||||
lssproto_CHATROOM_send( fd, token);
|
||||
}
|
||||
|
||||
void ChatRoom_Leave( int charaindex)
|
||||
{
|
||||
int i, ti=-1, chat, fd;
|
||||
char token[1024];
|
||||
fd = getfdFromCharaIndex( charaindex);
|
||||
|
||||
if( (chat = CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMNUM)) < 0 ) return;
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKCHATROOMNUM, -1);
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMTYPE) == 0 ) return;
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKCHATROOMTYPE, 0);
|
||||
|
||||
for( i=0; i<MAX_PPLINROOM; i++){
|
||||
if( ChatRoom[chat].charalist[i].use == 0 ) continue;
|
||||
if( !strcmp( ChatRoom[chat].charalist[i].cdkey, CHAR_getChar(charaindex, CHAR_CDKEY)) &&
|
||||
!strcmp( ChatRoom[chat].charalist[i].name, CHAR_getChar(charaindex, CHAR_NAME)) ){
|
||||
ti = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( ti == -1 ) return;
|
||||
snprintf( token, sizeof( token),"L|%d|%d|", chat, ti );
|
||||
fd = getfdFromCharaIndex( charaindex);
|
||||
saacproto_ACUniChatroom_send( acfd, charaindex, CONNECT_getFdid(fd),
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY), token);
|
||||
|
||||
}
|
||||
|
||||
void ChatRoom_Destroy ( char *data)
|
||||
{
|
||||
char buf[256];
|
||||
int chat, j, fd;
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
|
||||
sprintf ( buf , "D|%d", chat);
|
||||
for ( j=0; j<playernum; j++) {
|
||||
if( !CHAR_getCharUse( j) ||
|
||||
CHAR_getInt( j, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ) continue;
|
||||
if( CHAR_getWorkInt ( j, CHAR_WORKCHATROOMNUM) != chat ) continue;
|
||||
fd = getfdFromCharaIndex( j);
|
||||
lssproto_CHATROOM_send ( fd, buf);
|
||||
CHAR_setWorkInt ( j, CHAR_WORKCHATROOMTYPE, 0) ;
|
||||
CHAR_setWorkInt ( j, CHAR_WORKCHATROOMNUM, -1) ;
|
||||
}
|
||||
ChatRoom[ chat].use=0;
|
||||
ChatRoom[ chat].masindex= -1;
|
||||
ChatRoom[ chat].charanum= 0;
|
||||
for ( j = 0 ; j < MAX_PPLINROOM ; j ++ )
|
||||
resetChat_users( chat, j);
|
||||
|
||||
}
|
||||
|
||||
//saacproto_ACUniChatroom_recv
|
||||
void ChatRoom_recvall ( int fd , char *data )
|
||||
{
|
||||
char Head[4];
|
||||
char token[1024];
|
||||
char buf[256];
|
||||
int charaindex;
|
||||
|
||||
charaindex = CONNECT_getCharaindex(fd);
|
||||
if ( !CHAR_CHECKINDEX ( charaindex ) )return ;
|
||||
|
||||
getStringFromIndexWithDelim( data , "|", 1, Head, sizeof(Head));
|
||||
|
||||
//andy_log
|
||||
print( "CR:%s.\n", data);
|
||||
if ( strcmp ( Head , "C" ) == 0 ) { // 成立频道
|
||||
char chatname[256];
|
||||
if( ChatCheck_Free( charaindex) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, chatname, sizeof(chatname)) == FALSE ) return;
|
||||
if( strlen( chatname) >= 32 ) return;
|
||||
snprintf( token, sizeof( token),"C|%s|%s|%s|%s|",
|
||||
chatname, CHAR_getChar( charaindex, CHAR_CDKEY),
|
||||
CHAR_getChar( charaindex, CHAR_NAME),
|
||||
CHAR_getChar( charaindex, CHAR_OWNTITLE)
|
||||
);
|
||||
}else if ( strcmp ( Head , "D" ) == 0 ) { // 删除频道
|
||||
int chat;
|
||||
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMTYPE) != 1 ) return;
|
||||
if( (chat = CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMNUM)) < 0 ) return;
|
||||
if( chat >= MAX_CHATROOM ) return;
|
||||
snprintf( token, sizeof( token),"D|%d|%s|%s|",
|
||||
chat, CHAR_getChar( charaindex, CHAR_CDKEY),
|
||||
CHAR_getChar( charaindex, CHAR_NAME)
|
||||
);
|
||||
//ChatRoom_Destroy( myindex);
|
||||
/*
|
||||
}else if ( strcmp ( Head, "A") == 0 ) {// 同意加入频道
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
getStringFromIndexWithDelim( data , "|", 3, buf, sizeof(buf));
|
||||
ChatRoom_Agree ( myindex , atoi( message ) , atoi( buf ) ) ;
|
||||
*/
|
||||
}else if ( strcmp( Head , "J") == 0 ) {//加入频道
|
||||
int chat;
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof(buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
snprintf( token, sizeof( token),"J|%d|%s|%s|%s|",
|
||||
chat, CHAR_getChar( charaindex, CHAR_CDKEY),
|
||||
CHAR_getChar( charaindex, CHAR_NAME),
|
||||
CHAR_getChar( charaindex, CHAR_OWNTITLE)
|
||||
);
|
||||
// ChatRoom_Join ( myindex , atoi( message ) ) ;
|
||||
}else if ( strcmp( Head , "L") == 0 ) {// 离开频道
|
||||
ChatRoom_Leave( charaindex);
|
||||
return;
|
||||
}else if ( strcmp ( Head , "K" ) == 0 ) {//踢出频道
|
||||
int ti, chat;
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
ti = atoi( buf);
|
||||
if( ti<0 || ti>=MAX_PPLINROOM ) return;
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMTYPE) != 1 ) return;
|
||||
if( (chat = CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMNUM)) < 0 ) return;
|
||||
|
||||
if( chat >= MAX_CHATROOM ) return;
|
||||
snprintf( token, sizeof( token),"K|%d|%s|%s|%d|",
|
||||
chat,
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY),
|
||||
CHAR_getChar( charaindex, CHAR_NAME),
|
||||
ti );
|
||||
|
||||
// ChatRoom_Kick ( myindex , atoi( message ) );
|
||||
}else if ( strcmp ( Head , "M" ) == 0 ) { // 更换室长
|
||||
int ti, chat;
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof(buf)) == FALSE ) return;
|
||||
ti = atoi( buf);
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMTYPE) != 1 ) return;
|
||||
if( (chat = CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMNUM)) < 0 ) return;
|
||||
if( chat >= MAX_CHATROOM ) return;
|
||||
if( ChatRoom[chat].charalist[ti].use == 0 ) return;
|
||||
snprintf( token, sizeof( token),"M|%d|%s|%s|%d|",
|
||||
chat,
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY),
|
||||
CHAR_getChar( charaindex, CHAR_NAME),
|
||||
ti );
|
||||
// ChatRoom_Make ( myindex , atoi( message ) );
|
||||
}else if ( strcmp ( Head , "T" ) == 0 ) {// 频道讯息
|
||||
int chat;
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof(buf)) == FALSE ) return;
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMTYPE) == 0 ) return;
|
||||
if( (chat = CHAR_getWorkInt( charaindex, CHAR_WORKCHATROOMNUM)) < 0 ) return;
|
||||
if( chat >= MAX_CHATROOM ) return;
|
||||
snprintf( token, sizeof( token),"T|%d|%s|", chat, buf);
|
||||
|
||||
// ChatRoom_Message ( myindex , message ) ;
|
||||
}else if ( strcmp ( Head , "B" ) == 0 ) {// 聊天室清单
|
||||
ChatRoom_List ( fd );
|
||||
return;
|
||||
}
|
||||
|
||||
fd = getfdFromCharaIndex( charaindex);
|
||||
saacproto_ACUniChatroom_send( acfd, charaindex, CONNECT_getFdid(fd),
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY), token);
|
||||
}
|
||||
|
||||
void saac_ChatRoom_recvall ( int fd , char *result, char *data, int charaindex, int clifdid)
|
||||
{
|
||||
char Head[4], buf[256];
|
||||
int chat;
|
||||
|
||||
charaindex = getCharindexFromFdid(clifdid);
|
||||
//andy_log
|
||||
print( "saac CR:%s.\n", data);
|
||||
if( getStringFromIndexWithDelim( data , "|", 1, Head, sizeof(Head)) == FALSE ) return;
|
||||
|
||||
if( strcmp( Head, "C") == 0 ) { // 成立频道
|
||||
// int fd = getfdFromCharaIndex( charaindex);
|
||||
// if( getStringFromIndexWithDelim( data , "|", 2, result, sizeof(result)) == FALSE ) return;
|
||||
if( !strcmp( result, SUCCESSFUL) ){
|
||||
|
||||
if( getStringFromIndexWithDelim( data , "|", 3, buf, sizeof(buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 4, ChatRoom[chat].chatname,
|
||||
sizeof(ChatRoom[chat].chatname)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 5, buf, sizeof(buf)) == FALSE ) return;
|
||||
ChatRoom[chat].masindex = atoi( buf);
|
||||
if( getStringFromIndexWithDelim( data , "|", 6,
|
||||
ChatRoom[chat].charalist[0].cdkey, sizeof(ChatRoom[chat].charalist[0].cdkey)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 7,
|
||||
ChatRoom[chat].charalist[0].name, sizeof(ChatRoom[chat].charalist[0].name)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 8,
|
||||
ChatRoom[chat].charalist[0].own, sizeof(ChatRoom[chat].charalist[0].own)) == FALSE ) return;
|
||||
ChatRoom[chat].charalist[0].use=1;
|
||||
if( CHAR_DelGold( charaindex, 200) == 0 ) return;
|
||||
ChatRoom[chat].use = 1;
|
||||
CHAR_setWorkInt ( charaindex , CHAR_WORKCHATROOMTYPE , 1 ) ;
|
||||
CHAR_setWorkInt ( charaindex , CHAR_WORKCHATROOMNUM , chat ) ;
|
||||
CHAR_talkToCli ( charaindex , -1 , "成立聊天室扣除200石币。" , CHAR_COLORYELLOW );
|
||||
|
||||
ChatRoom_Refresh( chat);
|
||||
}else{
|
||||
CHAR_talkToCli ( charaindex , -1 , "无法成立聊天室,聊天频道已满或条件不足!" , CHAR_COLORYELLOW );
|
||||
}
|
||||
}else if( strcmp( Head, "U") == 0 ) {
|
||||
int k=2, ti;
|
||||
char bufarg[512];
|
||||
if( getStringFromIndexWithDelim( data , ",", 1, bufarg, sizeof(bufarg)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 2, buf, sizeof(buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 3, buf, sizeof(buf)) == FALSE ) return;
|
||||
ChatRoom[chat].use = atoi( buf);
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 4,
|
||||
ChatRoom[chat].chatname, sizeof(ChatRoom[chat].chatname)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 5, buf, sizeof(buf)) == FALSE ) return;
|
||||
ChatRoom[chat].masindex = atoi( buf);
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 6, buf, sizeof(buf)) == FALSE ) return;
|
||||
ChatRoom[chat].charanum = atoi( buf);
|
||||
|
||||
while( getStringFromIndexWithDelim( data , ",", k, bufarg, sizeof( bufarg) ) ){
|
||||
k++;
|
||||
if( bufarg[0] == 0 || strlen( bufarg) <= 0 ) continue;
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 1, buf, sizeof(buf)) == FALSE ) return;
|
||||
ti = atoi( buf);
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 2,
|
||||
ChatRoom[chat].charalist[ti].cdkey, sizeof(ChatRoom[chat].charalist[ti].cdkey)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 3,
|
||||
ChatRoom[chat].charalist[ti].name, sizeof(ChatRoom[chat].charalist[ti].name)) == FALSE ) return;
|
||||
if( getStringFromIndexWithDelim( bufarg , "|", 4,
|
||||
ChatRoom[chat].charalist[ti].own, sizeof(ChatRoom[chat].charalist[ti].own)) == FALSE ) return;
|
||||
ChatRoom[chat].charalist[ti].use = 1;
|
||||
}
|
||||
ChatRoom_Refresh( chat);
|
||||
}else if( strcmp( Head, "D") == 0 ) {
|
||||
ChatRoom_Destroy ( data);
|
||||
}else if( strcmp( Head, "L") == 0 ) {
|
||||
int chat, ti;
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
chat = atoi(buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 3, buf, sizeof( buf)) == FALSE ) return;
|
||||
ti = atoi(buf);
|
||||
if( ti<0||ti>=MAX_PPLINROOM)return;
|
||||
ChatRoom[chat].charalist[ti].use = 0;
|
||||
ChatRoom_Refresh( chat);
|
||||
}else if( strcmp( Head, "M") == 0 ) {
|
||||
int ti, chat, j;
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 3, buf, sizeof( buf)) == FALSE ) return;
|
||||
ti = atoi( buf);
|
||||
if( ti<0 || ti>=MAX_PPLINROOM )return;
|
||||
if( ChatRoom[chat].charalist[ti].use == 0 ) return;
|
||||
for ( j=0; j<playernum; j++) {
|
||||
if( !CHAR_getCharUse( j) ||
|
||||
CHAR_getInt( j, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ) continue;
|
||||
if( CHAR_getWorkInt ( j, CHAR_WORKCHATROOMNUM) != chat ) continue;
|
||||
|
||||
|
||||
if( !strcmp( CHAR_getChar( j, CHAR_CDKEY), ChatRoom[chat].charalist[ti].cdkey) &&
|
||||
!strcmp( CHAR_getChar( j, CHAR_NAME), ChatRoom[chat].charalist[ti].name) ){
|
||||
CHAR_setWorkInt( j, CHAR_WORKCHATROOMTYPE, 1);
|
||||
CHAR_talkToCli( j, -1 , "你现在是聊天室的室长!", CHAR_COLORRED);
|
||||
}
|
||||
if( !strcmp( CHAR_getChar( j, CHAR_CDKEY), ChatRoom[chat].charalist[ChatRoom[chat].masindex].cdkey) &&
|
||||
!strcmp( CHAR_getChar( j, CHAR_NAME), ChatRoom[chat].charalist[ChatRoom[chat].masindex].name) ){
|
||||
CHAR_setWorkInt( j, CHAR_WORKCHATROOMTYPE, 2);
|
||||
CHAR_talkToCli( j, -1 , "你现在已经不是聊天室的室长!", CHAR_COLORRED);
|
||||
}
|
||||
}
|
||||
ChatRoom[ chat].masindex = ti;
|
||||
ChatRoom_Refresh( chat);
|
||||
}else if( strcmp( Head, "K") == 0 ) {
|
||||
int ti, j, chat, fd;
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 3, buf, sizeof( buf)) == FALSE ) return;
|
||||
ti = atoi( buf);
|
||||
if( ti<0 || ti>=MAX_PPLINROOM ) return;
|
||||
//andy_log
|
||||
print( "\nK|%d|%d|\n", chat, ti);
|
||||
|
||||
for ( j=0; j<playernum; j++) {
|
||||
if( !CHAR_getCharUse( j) ||
|
||||
CHAR_getInt( j, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ) continue;
|
||||
if( CHAR_getWorkInt ( j, CHAR_WORKCHATROOMNUM) != chat ) continue;
|
||||
if( CHAR_getWorkInt ( j, CHAR_WORKCHATROOMTYPE) != 2 ) continue;
|
||||
|
||||
if( !strcmp( CHAR_getChar( j, CHAR_CDKEY), ChatRoom[chat].charalist[ti].cdkey) &&
|
||||
!strcmp( CHAR_getChar( j, CHAR_NAME), ChatRoom[chat].charalist[ti].name) ){
|
||||
fd = getfdFromCharaIndex( j );
|
||||
|
||||
CHAR_setWorkInt ( j, CHAR_WORKCHATROOMNUM, -1);
|
||||
CHAR_setWorkInt ( j, CHAR_WORKCHATROOMTYPE, 0);
|
||||
//andy_log
|
||||
print( "_CHATROOM_send( %d, K|) \n", fd );
|
||||
lssproto_CHATROOM_send ( fd , "K|" );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
//andy_log
|
||||
print( "ChatRoom_Refresh( %d) \n", chat);
|
||||
ChatRoom[chat].charalist[ti].use = 0;
|
||||
ChatRoom_Refresh( chat);
|
||||
}else if ( strcmp ( Head , "J" ) == 0 ) {//加入频道
|
||||
}else if ( strcmp ( Head , "A" ) == 0 ) {
|
||||
if ( !CHAR_CHECKINDEX ( charaindex ) ) return;
|
||||
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 3, result, sizeof( result)) == FALSE ) return;
|
||||
if( !strcmp( result, "FULL") ){
|
||||
CHAR_talkToCli( charaindex, -1, "该频道已满!", CHAR_COLORYELLOW);
|
||||
}else if( !strcmp( result, "OK") ){
|
||||
CHAR_talkToCli( charaindex, -1, "加入聊天频道!", CHAR_COLORYELLOW);
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKCHATROOMNUM, chat);
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKCHATROOMTYPE, 2);
|
||||
}
|
||||
ChatRoom_Refresh( chat);
|
||||
}else if( !strcmp( Head, "T") ) {//频道讯息
|
||||
int j;
|
||||
char message[256];
|
||||
int playernum = CHAR_getPlayerMaxNum();
|
||||
if( getStringFromIndexWithDelim( data , "|", 2, buf, sizeof( buf)) == FALSE ) return;
|
||||
chat = atoi( buf);
|
||||
if( chat < 0 || chat >= MAX_CHATROOM ) return;
|
||||
if( getStringFromIndexWithDelim( data , "|", 3, buf, sizeof( buf)) == FALSE ) return;
|
||||
snprintf ( message, sizeof ( message ) , "T|%s" , buf );
|
||||
for ( j=0; j<playernum; j++) {
|
||||
if( !CHAR_getCharUse( j) ||
|
||||
CHAR_getInt( j, CHAR_WHICHTYPE) != CHAR_TYPEPLAYER ) continue;
|
||||
if( CHAR_getWorkInt ( j, CHAR_WORKCHATROOMNUM) != chat ) continue;
|
||||
if( CHAR_getWorkInt( j, CHAR_WORKCHATROOMTYPE) == 0 ) continue;
|
||||
snprintf ( message, sizeof ( message ) , "T|%s" , buf );
|
||||
fd = getfdFromCharaIndex ( j);
|
||||
lssproto_CHATROOM_send ( fd , message) ;
|
||||
}
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CHATROOM_getChatRoomList( void)
|
||||
{
|
||||
char token[512];
|
||||
snprintf( token, sizeof( token),"U|-1|" );
|
||||
saacproto_ACUniChatroom_send( acfd, -1, -1, "SYS", token);
|
||||
}
|
||||
#else
|
||||
|
||||
|
||||
/*
|
||||
CHAR_WORKCHATROOMTYPE :
|
||||
0 : 无
|
||||
1 : 聊天室室长
|
||||
2 : 聊天室成员
|
||||
*/
|
||||
typedef struct {
|
||||
BOOL useFlag ;
|
||||
int NowPeople;
|
||||
int Maker;
|
||||
int MemberList[MAX_PPLINROOM];
|
||||
char RoomName[32];
|
||||
} CHATROOM_CLASS ;
|
||||
CHATROOM_CLASS ChatRoom[MAX_CHATROOM];
|
||||
|
||||
|
||||
BOOL ChatCheck_BeMaster( int myindex, int chatnum)
|
||||
{
|
||||
if( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return FALSE;
|
||||
|
||||
if( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM ) == 0 ) return FALSE;
|
||||
|
||||
if( chatnum != -1 ){
|
||||
if( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM ) != chatnum )
|
||||
return FALSE;
|
||||
}
|
||||
if( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ChatCheck_Free( int myindex)
|
||||
{
|
||||
int old_gold;
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return FALSE;
|
||||
old_gold = CHAR_getInt( myindex, CHAR_GOLD );
|
||||
if( old_gold < 200 ){
|
||||
CHAR_talkToCli ( myindex , -1 , "成立聊天室需花费200石币" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
if ( CHAR_getInt ( myindex , CHAR_LV ) < 30 &&
|
||||
CHAR_getInt ( myindex , CHAR_TRANSMIGRATION ) < 1 ) {
|
||||
CHAR_talkToCli ( myindex , -1 , "成立聊天室需0转30级以上!" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) != 0 ) {
|
||||
CHAR_talkToCli ( myindex , -1 , "你已经在其他聊天室中!" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void InitChatRoom ( void ) {
|
||||
int i , j ;
|
||||
for ( i = 0 ; i < MAX_CHATROOM ; i ++ ) {
|
||||
ChatRoom[ i ].useFlag = FALSE ;
|
||||
ChatRoom[ i ].Maker = -1 ;
|
||||
ChatRoom[ i ].NowPeople = -1 ;
|
||||
sprintf ( ChatRoom[ i ].RoomName , " " ) ;
|
||||
for ( j = 0 ; j < MAX_PPLINROOM ; j ++ )
|
||||
ChatRoom[ i ].MemberList[ j ] = -1 ;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL ChatRoom_Create ( int myindex , char *message )
|
||||
{
|
||||
int i ;
|
||||
|
||||
if( ChatCheck_Free( myindex) == FALSE ) return FALSE;
|
||||
|
||||
for ( i = 0 ; i < MAX_CHATROOM ; i ++ ) {
|
||||
if ( !ChatRoom[ i ].useFlag ) {
|
||||
ChatRoom[ i ].useFlag = TRUE ;
|
||||
ChatRoom[ i ].Maker = myindex ;
|
||||
ChatRoom[ i ].NowPeople = 1 ;
|
||||
ChatRoom[ i ].MemberList[ 0 ] = myindex ;
|
||||
sprintf ( ChatRoom[ i ].RoomName , "%s" , message ) ;
|
||||
CHAR_setWorkInt ( myindex , CHAR_WORKCHATROOMTYPE , 1 ) ;
|
||||
CHAR_setWorkInt ( myindex , CHAR_WORKCHATROOMNUM , i ) ;
|
||||
ChatRoom_Refresh ( i ) ;
|
||||
|
||||
CHAR_DelGold( myindex, 200);
|
||||
CHAR_talkToCli ( myindex , -1 , "成立聊天室扣除200石币" , CHAR_COLORYELLOW );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
CHAR_talkToCli ( myindex , -1 , "聊天室已满无法建立新的聊天频道!" , CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL ChatRoom_Destroy ( int myindex )
|
||||
{
|
||||
int i , j ;
|
||||
int fd ;/*= getfdFromCharaIndex(myindex);*/
|
||||
char buf[16];
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return FALSE;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) {
|
||||
i = CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM ) ;
|
||||
ChatRoom[ i ].useFlag = FALSE ;
|
||||
ChatRoom[ i ].Maker = -1 ;
|
||||
ChatRoom[ i ].NowPeople = -1 ;
|
||||
|
||||
// WON FIX
|
||||
memset( ChatRoom[ i ].RoomName, 0 , sizeof(ChatRoom[ i ].RoomName) );
|
||||
//sprintf ( ChatRoom[ i ].RoomName , " " ) ;
|
||||
|
||||
for ( j = 0 ; j < MAX_PPLINROOM ; j ++ ) {
|
||||
if ( !CHAR_CHECKINDEX ( ChatRoom[ i ].MemberList[ j ] ) ) {
|
||||
ChatRoom[ i ].MemberList[ j ] = -1 ;
|
||||
continue;
|
||||
}
|
||||
CHAR_setWorkInt ( ChatRoom[ i ].MemberList[ j ] , CHAR_WORKCHATROOMTYPE , 0 ) ;
|
||||
CHAR_setWorkInt ( ChatRoom[ i ].MemberList[ j ] , CHAR_WORKCHATROOMNUM , 0 ) ;
|
||||
fd = getfdFromCharaIndex( ChatRoom[ i ].MemberList[ j ] );
|
||||
sprintf ( buf , "D|%d" , i ) ;
|
||||
lssproto_CHATROOM_send ( fd , buf ) ;
|
||||
ChatRoom[ i ].MemberList[ j ] = -1 ;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ChatRoom_Message ( int myindex , char *message )
|
||||
{
|
||||
int i , j , fd ;
|
||||
char buf[1024];
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return ;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) > 0 ) {
|
||||
i = CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM ) ;
|
||||
|
||||
// WON FIX
|
||||
if( i < 0 ) return;
|
||||
|
||||
for ( j = 0 ; j < MAX_PPLINROOM ; j ++ ) {
|
||||
if ( !CHAR_CHECKINDEX ( ChatRoom[ i ].MemberList[ j ] ) )
|
||||
continue;
|
||||
snprintf ( buf , sizeof ( buf ) , "T|%s" , message ) ;
|
||||
fd = getfdFromCharaIndex ( ChatRoom[ i ].MemberList[ j ] );
|
||||
lssproto_CHATROOM_send ( fd , buf ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatRoom_Kick ( int myindex , int toindex )
|
||||
{
|
||||
int i , fd ;
|
||||
int Num = CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM );
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return ;
|
||||
if ( !CHAR_CHECKINDEX ( toindex ) )
|
||||
return ;
|
||||
if ( myindex == toindex ) return;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) {
|
||||
if ( Num != CHAR_getWorkInt ( toindex , CHAR_WORKCHATROOMNUM ) )
|
||||
return;
|
||||
else {
|
||||
CHAR_setWorkInt ( toindex , CHAR_WORKCHATROOMTYPE , 0 ) ;
|
||||
CHAR_setWorkInt ( toindex , CHAR_WORKCHATROOMNUM , -1) ;
|
||||
//CHAR_talkToCli ( toindex , -1 , "室长将你踢出聊天室!" , CHAR_COLORRED ) ;
|
||||
fd = getfdFromCharaIndex( toindex );
|
||||
lssproto_CHATROOM_send ( fd , "K|" ) ;
|
||||
ChatRoom[ Num ].NowPeople --;
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] == toindex ) {
|
||||
ChatRoom[ Num ].MemberList[ i ] = -1 ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ChatRoom_Refresh ( Num ) ;
|
||||
}
|
||||
|
||||
void ChatRoom_Make ( int myindex , int toindex )
|
||||
{
|
||||
int Num = CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM );
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return ;
|
||||
if ( !CHAR_CHECKINDEX ( toindex ) )
|
||||
return ;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) {
|
||||
if ( Num != CHAR_getWorkInt ( toindex , CHAR_WORKCHATROOMNUM ) )
|
||||
return;
|
||||
else if ( CHAR_getInt ( toindex , CHAR_LV ) >= 30 ||
|
||||
CHAR_getInt ( toindex , CHAR_TRANSMIGRATION ) >= 1 ) {
|
||||
CHAR_setWorkInt ( myindex , CHAR_WORKCHATROOMTYPE , 2 ) ;
|
||||
CHAR_setWorkInt ( toindex , CHAR_WORKCHATROOMTYPE , 1 ) ;
|
||||
CHAR_talkToCli ( toindex , -1 , "你现在是聊天室的室长!" , CHAR_COLORRED ) ;
|
||||
|
||||
ChatRoom[ Num ].Maker = toindex ;
|
||||
}
|
||||
else {
|
||||
CHAR_talkToCli ( myindex , -1 , "您选择的继任人物等级不足以担任室长!" , CHAR_COLORRED ) ;
|
||||
}
|
||||
}
|
||||
ChatRoom_Refresh ( Num ) ;
|
||||
}
|
||||
|
||||
void ChatRoom_Leave ( int myindex )
|
||||
{
|
||||
int i , NextMaker = -1 ;
|
||||
int Num = CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM );
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return ;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) {
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] != myindex &&
|
||||
ChatRoom[ Num ].MemberList[ i ] != -1 ) {
|
||||
if ( CHAR_CHECKINDEX ( ChatRoom[ Num ].MemberList[ i ] ) ) {
|
||||
if ( CHAR_getInt ( ChatRoom[ Num ].MemberList[ i ] , CHAR_LV ) >= 30 ||
|
||||
CHAR_getInt ( ChatRoom[ Num ].MemberList[ i ] , CHAR_TRANSMIGRATION ) >= 1 ) {
|
||||
NextMaker = ChatRoom[ Num ].MemberList[ i ] ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( NextMaker != -1 ) {
|
||||
ChatRoom_Make( myindex , NextMaker ) ;
|
||||
CHAR_setWorkInt ( myindex , CHAR_WORKCHATROOMTYPE , 0) ;
|
||||
CHAR_setWorkInt ( myindex , CHAR_WORKCHATROOMNUM, -1) ;
|
||||
ChatRoom[ Num ].NowPeople --;
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] == myindex ) {
|
||||
ChatRoom[ Num ].MemberList[ i ] = -1 ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ChatRoom_Destroy( myindex ) ;
|
||||
return ;
|
||||
}
|
||||
|
||||
}else if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 2 ) {
|
||||
CHAR_setWorkInt ( myindex, CHAR_WORKCHATROOMTYPE, 0) ;
|
||||
CHAR_setWorkInt ( myindex, CHAR_WORKCHATROOMNUM, -1) ;
|
||||
ChatRoom[ Num ].NowPeople --;
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] == myindex ) {
|
||||
ChatRoom[ Num ].MemberList[ i ] = -1 ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ChatRoom_Refresh ( Num ) ;
|
||||
}
|
||||
|
||||
void ChatRoom_Join ( int myindex , int num )
|
||||
{
|
||||
int fd ;
|
||||
char buf[64];
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return ;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) != 0 )
|
||||
return ;
|
||||
if ( ChatRoom[ num ].useFlag == TRUE && ChatRoom[ num ].NowPeople < MAX_PPLINROOM ) {
|
||||
sprintf ( buf , "J|%s|%d" , CHAR_getChar( myindex , CHAR_NAME ) , myindex ) ;
|
||||
fd = getfdFromCharaIndex( ChatRoom[ num ].Maker );
|
||||
lssproto_CHATROOM_send ( fd , buf );
|
||||
}else if ( ChatRoom[ num ].NowPeople >= MAX_PPLINROOM )
|
||||
CHAR_talkToCli ( myindex , -1 , "聊天室人数已满!" , CHAR_COLORRED ) ;
|
||||
|
||||
}
|
||||
|
||||
void ChatRoom_Agree ( int myindex , int toindex , int YesNo ) {
|
||||
int i ;
|
||||
int Num = CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMNUM );
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )
|
||||
return ;
|
||||
if ( !CHAR_CHECKINDEX ( toindex ) )
|
||||
return ;
|
||||
if ( CHAR_getWorkInt ( toindex , CHAR_WORKCHATROOMTYPE ) != 0 )
|
||||
return;
|
||||
if ( CHAR_getWorkInt ( myindex , CHAR_WORKCHATROOMTYPE ) == 1 ) {
|
||||
if ( ChatRoom[ Num ].NowPeople < MAX_PPLINROOM && YesNo == 1 ) {
|
||||
CHAR_setWorkInt ( toindex , CHAR_WORKCHATROOMTYPE , 2 ) ;
|
||||
CHAR_setWorkInt ( toindex , CHAR_WORKCHATROOMNUM , Num ) ;
|
||||
ChatRoom[ Num ].NowPeople ++ ;
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] == -1 ) {
|
||||
ChatRoom[ Num ].MemberList[ i ] = toindex ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else if ( YesNo == 0 ) {
|
||||
CHAR_talkToCli ( toindex , -1 , "您申请的聊天室室长拒绝您的加入!" , CHAR_COLORRED ) ;
|
||||
}else if ( ChatRoom[ Num ].NowPeople >= MAX_PPLINROOM ) {
|
||||
CHAR_talkToCli ( toindex , -1 , "您申请的聊天室人数已满!" , CHAR_COLORRED ) ;
|
||||
CHAR_talkToCli ( myindex , -1 , "聊天室人数已满!" , CHAR_COLORRED ) ;
|
||||
}
|
||||
}
|
||||
ChatRoom_Refresh ( Num ) ;
|
||||
}
|
||||
|
||||
void ChatRoom_List ( int fd )
|
||||
{
|
||||
int i ;
|
||||
char buf[128];
|
||||
char token[2048] = "B|";
|
||||
for ( i = 0 ; i < MAX_CHATROOM ; i ++ ) {
|
||||
if ( ChatRoom[ i ].useFlag == TRUE ) {
|
||||
sprintf ( buf , "聊天室%2d资讯:室名=>%20s , 室长=>%16s , 人数=>%2d" ,
|
||||
i ,
|
||||
ChatRoom[ i ].RoomName ,
|
||||
CHAR_getChar ( ChatRoom[ i ].Maker , CHAR_NAME ) ,
|
||||
ChatRoom[ i ].NowPeople );
|
||||
|
||||
sprintf ( buf , "r%d|%s|%d|%s|p%d|" ,
|
||||
i ,
|
||||
ChatRoom[ i ].RoomName ,
|
||||
ChatRoom[ i ].Maker ,
|
||||
CHAR_getChar ( ChatRoom[ i ].Maker , CHAR_NAME ) ,
|
||||
ChatRoom[ i ].NowPeople );
|
||||
strncat ( token , buf , sizeof ( buf ) ) ;
|
||||
}
|
||||
}
|
||||
lssproto_CHATROOM_send ( fd , token ) ;
|
||||
}
|
||||
|
||||
void ChatRoom_Refresh ( int Num )
|
||||
{
|
||||
int fd , i , RoomLeader = -1 ;
|
||||
char token[2048] ;
|
||||
char token2[2096] ;
|
||||
char buf[64] ;
|
||||
if ( ChatRoom[ Num ].useFlag == TRUE ) {
|
||||
sprintf ( token , "R|r%d|%s|%d|%s|p%d|" ,
|
||||
Num ,
|
||||
ChatRoom[ Num ].RoomName ,
|
||||
ChatRoom[ Num ].Maker ,
|
||||
CHAR_getChar ( ChatRoom[ Num ].Maker , CHAR_NAME ) ,
|
||||
ChatRoom[ Num ].NowPeople );
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] != -1 ) {
|
||||
sprintf( buf , "I%d|%s|%s|" ,
|
||||
ChatRoom[ Num ].MemberList[ i ] ,
|
||||
CHAR_getChar ( ChatRoom[ Num ].MemberList[ i ] , CHAR_NAME ) ,
|
||||
CHAR_getChar ( ChatRoom[ Num ].MemberList[ i ] , CHAR_OWNTITLE )
|
||||
);
|
||||
strncat ( token , buf , sizeof ( buf ) ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
for ( i = 0 ; i < MAX_PPLINROOM ; i ++ ) {
|
||||
if ( ChatRoom[ Num ].MemberList[ i ] != -1 ) {
|
||||
if ( CHAR_getWorkInt ( ChatRoom[ Num ].MemberList[ i ] , CHAR_WORKCHATROOMTYPE ) == 1 ) RoomLeader = 1;
|
||||
else RoomLeader = 0 ;
|
||||
sprintf ( token2 , "%s%d|" , token , RoomLeader ) ;
|
||||
fd= getfdFromCharaIndex ( ChatRoom[ Num ].MemberList[ i ] );
|
||||
lssproto_CHATROOM_send ( fd , token2 ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChatRoom_recvall ( int fd , char *data )
|
||||
{
|
||||
char Head[4];
|
||||
char message[1024];
|
||||
char buf[16];
|
||||
int myindex ;
|
||||
|
||||
myindex = CONNECT_getCharaindex(fd);
|
||||
if ( !CHAR_CHECKINDEX ( myindex ) )return ;
|
||||
getStringFromIndexWithDelim( data , "|", 1, Head, sizeof(Head));
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
|
||||
if ( strcmp ( Head , "C" ) == 0 ) { // 成立频道
|
||||
if ( !ChatRoom_Create ( myindex , message ) )
|
||||
print("\nSyu log Create Channel Error" );
|
||||
}else if ( strcmp ( Head , "D" ) == 0 ) { // 删除频道
|
||||
if ( !ChatRoom_Destroy ( myindex ) )
|
||||
print("\nSyu log Destroy Channel Error" ) ;
|
||||
}else if ( strcmp ( Head , "A" ) == 0 ) {// 同意加入频道
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
getStringFromIndexWithDelim( data , "|", 3, buf, sizeof(buf));
|
||||
ChatRoom_Agree ( myindex , atoi( message ) , atoi( buf ) ) ;
|
||||
}else if ( strcmp ( Head , "J" ) == 0 ) {// 申请频道
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
ChatRoom_Join ( myindex , atoi( message ) ) ;
|
||||
}else if ( strcmp ( Head , "L" ) == 0 ) {// 离开频道
|
||||
ChatRoom_Leave ( myindex ) ;
|
||||
}else if ( strcmp ( Head , "K" ) == 0 ) {//踢出频道
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
ChatRoom_Kick ( myindex , atoi( message ) );
|
||||
}else if ( strcmp ( Head , "M" ) == 0 ) { // 更换室长
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
ChatRoom_Make ( myindex , atoi( message ) );
|
||||
}else if ( strcmp ( Head , "T" ) == 0 ) {// 频道讯息
|
||||
getStringFromIndexWithDelim( data , "|", 2, message, sizeof(message));
|
||||
ChatRoom_Message ( myindex , message ) ;
|
||||
}else if ( strcmp ( Head , "B" ) == 0 ) {// 聊天室清单
|
||||
ChatRoom_List ( fd );
|
||||
}else
|
||||
print("\nSyu log None");
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
2022
gmsv/char/deathcontend.c
Normal file
2022
gmsv/char/deathcontend.c
Normal file
File diff suppressed because it is too large
Load Diff
158
gmsv/char/defaultGroundEnemy.h
Normal file
158
gmsv/char/defaultGroundEnemy.h
Normal file
@ -0,0 +1,158 @@
|
||||
#if 0
|
||||
static Char slime=
|
||||
{
|
||||
FALSE, /* use どうでもいい*/
|
||||
|
||||
/* data */
|
||||
{
|
||||
0, /* CHAR_DATAPLACENUMBER */
|
||||
0, /* CHAR_BASEIMAGENUMBER */
|
||||
0, /* CHAR_BASEBASEIMAGENUMBER */
|
||||
0, /* CHAR_FACEIMAGENUMBER */
|
||||
0, /* CHAR_FLOOR */
|
||||
0, /* CHAR_X */
|
||||
0, /* CHAR_Y */
|
||||
0, /* CHAR_DIR 12時を0に時計周りに */
|
||||
0, /* CHAR_LV */
|
||||
0, /* CHAR_GOLD */
|
||||
1, /* CHAR_HP */
|
||||
0, /* CHAR_MP */
|
||||
0, /* CHAR_MAXMP */
|
||||
|
||||
0, /* CHAR_VITAL */
|
||||
0, /* CHAR_STR */
|
||||
0, /* CHAR_TOUGH */
|
||||
0, /* CHAR_DEX */
|
||||
|
||||
0, /* CHAR_CHARM */
|
||||
0, /* CHAR_LUCK */
|
||||
|
||||
0, /* 地属性 */
|
||||
0, /* 水属性 */
|
||||
0, /* 火属性 */
|
||||
0, /* 風属性 */
|
||||
|
||||
0, /* CHAR_SLOT */
|
||||
0, /* CHAR_CRITIAL */
|
||||
0, /* CHAR_COUNTER */
|
||||
0, /* CHAR_RARE */
|
||||
0, /* CHAR_RADARSTRLENGTH */
|
||||
0, /* CHAR_CHATVOLUME */
|
||||
MAKE2VALUE(100,20), /* CHAR_MERCHANTLEVEL */
|
||||
0, /* CHAR_HEALERLEVEL */
|
||||
0, /* CHAR_DETERMINEITEM */
|
||||
|
||||
-1, /* CHAR_INDEXOFEQTITLE */
|
||||
|
||||
0, /* CHAR_POISON */
|
||||
0, /* CHAR_PARALYSIS */
|
||||
0, /* CHAR_SILENCE */
|
||||
0, /* CHAR_STONE */
|
||||
0, /* CHAR_DARKNESS */
|
||||
0, /* CHAR_CONFUSION */
|
||||
|
||||
0, /* CHAR_LOGINCOUNT */
|
||||
0, /* CHAR_DEADCOUNT */
|
||||
0, /* CHAR_WALKCOUNT */
|
||||
0, /* CHAR_TALKCOUNT */
|
||||
0, /* CHAR_DAMAGECOUNT */
|
||||
0, /* CHAR_GETPETCOUNT */
|
||||
0, /* CHAR_KILLPETCOUNT */
|
||||
0, /* CHAR_DEADPETCOUNT */
|
||||
0, /* CHAR_SENDMAILCOUNT */
|
||||
0, /* CHAR_MERGEITEMCOUNT */
|
||||
0, /* CHAR_DUELBATTLECOUNT */
|
||||
0, /* CHAR_DUELWINCOUNT */
|
||||
0, /* CHAR_DUELLOSECOUNT */
|
||||
0, /* CHAR_DUELSTWINCOUNT */
|
||||
0, /* CHAR_DUELMAXSTWINCOUNT */
|
||||
|
||||
CHAR_TYPEENEMY, /* CHAR_WHICHPLAYER */
|
||||
1000, /* CHAR_WALKINTERVAL */
|
||||
1000, /* CHAR_LOOPINTERVAL */
|
||||
|
||||
0, /* CHAR_LEVELEXP */
|
||||
|
||||
-1, /*CHAR_LASTTALKELDER*/
|
||||
0, /*CHAR_SKILLUPPOINT */
|
||||
0, /* CHAR_LEVELUPPOINT */
|
||||
|
||||
0, /*CHAR_IMAGETYPE */
|
||||
CHAR_COLORYELLOW, /* CHAR_NAMECOLOR */
|
||||
CHAR_COLORYELLOW, /* CHAR_POPUPNAMECOLOR */
|
||||
0, /* CHAR_LASTTIMESETLUCK */
|
||||
0, /* CHAR_DUELPOINT */
|
||||
0, /* CHAR_EVENT */
|
||||
0, /* CHAR_EVENT2 */
|
||||
0, /* CHAR_EVENT3 */
|
||||
#ifdef _NEWEVENT
|
||||
0, /* CHAR_EVENT4 */
|
||||
0, /* CHAR_EVENT5 */
|
||||
0, /* CHAR_EVENT6 */
|
||||
#endif
|
||||
0, /* CHAR_NOWEVENT */
|
||||
0, /* CHAR_NOWEVENT2 */
|
||||
0, /* CHAR_NOWEVENT3 */
|
||||
#ifdef _NEWEVENT
|
||||
0, /* CHAR_NOWEVENT4 */
|
||||
0, /* CHAR_NOWEVENT5 */
|
||||
0, /* CHAR_NOWEVENT6 */
|
||||
#endif
|
||||
0, /* CHAR_TRANSMIGRATION */
|
||||
0, /* CHAR_TRANSEQUATION */
|
||||
|
||||
0, /*CHAR_INITDATA */
|
||||
},
|
||||
{
|
||||
{""}, /* CHAR_NAME */
|
||||
{""}, /* CHAR_OWNTITLE */
|
||||
{""}, /* CHAR_ARGUMENT */
|
||||
{""}, /* CHAR_OWNERCDKEY */
|
||||
{""}, /* CHAR_OWNERCHARANAME */
|
||||
#if 0
|
||||
{""}, /* CHAR_INITFUNC */
|
||||
{""}, /* CHAR_WALKPREFUNC */
|
||||
{""}, /* CHAR_WALKPOSTFUNC */
|
||||
{""}, /* CHAR_PREOVERFUNC */
|
||||
{""}, /* CHAR_PREOVERFUNC */
|
||||
{""}, /* CHAR_WATCHFUNC */
|
||||
{""}, /* CHAR_LOOPFUNC */
|
||||
{""}, /* CHAR_DYINGFUNC */
|
||||
{""}, /* CHAR_TALKEDFUNC */
|
||||
{""}, /* CHAR_PREATTACKEDFUNC */
|
||||
{""}, /* CHAR_POSTATTACKEDFUNC */
|
||||
{""}, /* CHAR_OFFFUNC */
|
||||
{""}, /* CHAR_LOOKEDFUNC */
|
||||
{""}, /* CHAR_ITEMPUTFUNC */
|
||||
{""}, /* CHAR_SPECIALTALKEDFUNC */
|
||||
{""}, /* CHAR_WINDOWTALKEDFUNC */
|
||||
#endif
|
||||
},
|
||||
{
|
||||
/* CHAR_ISATTACK */
|
||||
/* CHAR_ISATTACKED */
|
||||
/* CHAR_ISOVER */
|
||||
/* CHAR_ISOVERED */
|
||||
/* CHAR_HAVEHEIGHT */
|
||||
/* CHAR_ISVISIBLE */
|
||||
/* CHAR_ISTRANSPARENT */
|
||||
/* CHAR_ISFLYING */
|
||||
|
||||
SETFLG(1,1,1,1,1,1,0,0 ),
|
||||
|
||||
/* CHAR_ISDIE */
|
||||
/* CHAR_ISBIG */
|
||||
/* CHAR_ISSHOWDAMAGE */
|
||||
/* CHAR_ISPARTY */
|
||||
/* CHAR_ISWARP */
|
||||
/* CHAR_ISDUEL */
|
||||
/* CHAR_ISPARTYCHAT */
|
||||
/* CHAR_ISTRADECARD */
|
||||
|
||||
SETFLG(0,0,1,0,0,0,0,0 ),
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
372
gmsv/char/defaultPlayer.h
Normal file
372
gmsv/char/defaultPlayer.h
Normal file
@ -0,0 +1,372 @@
|
||||
#include "version.h"
|
||||
|
||||
static Char player=
|
||||
{
|
||||
FALSE, /* use 升丹匹手中中*/
|
||||
{
|
||||
0, /* CHAR_DATAPLACENUMBER */
|
||||
0, /* CHAR_BASEIMAGENUMBER */
|
||||
0, /* CHAR_BASEBASEIMAGENUMBER */
|
||||
0, /* CHAR_FACEIMAGENUMBER */
|
||||
0, /* CHAR_FLOOR */
|
||||
0, /* CHAR_X */
|
||||
0, /* CHAR_Y */
|
||||
5, /* CHAR_DIR 12凜毛0卞凜煌璃曰卞 */
|
||||
1, /* CHAR_LV */
|
||||
0, /* CHAR_GOLD */
|
||||
1, /* CHAR_HP */
|
||||
0, /* CHAR_MP */
|
||||
|
||||
0, /* CHAR_MAXMP */
|
||||
|
||||
0, /* CHAR_VITAL */
|
||||
0, /* CHAR_STR */
|
||||
0, /* CHAR_TOUGH */
|
||||
0, /* CHAR_DEX */
|
||||
|
||||
0, /* CHAR_CHARM */
|
||||
0, /* CHAR_LUCK */
|
||||
|
||||
0, /* 譁簞嶺 */
|
||||
0, /* 踹簞嶺 */
|
||||
0, /* 紹簞嶺 */
|
||||
0, /* 氘簞嶺 */
|
||||
|
||||
0, /* CHAR_SLOT*/
|
||||
0, /* CHAR_CRITIAL */
|
||||
0, /* CHAR_COUNTER */
|
||||
0, /* CHAR_RARE */
|
||||
0, /* CHAR_RADARSTRLENGTH */
|
||||
0, /* CHAR_CHATVOLUME */
|
||||
MAKE2VALUE(100,20), /* CHAR_MERCHANTLEVEL */
|
||||
0, /* CHAR_HEALERLEVEL */
|
||||
0, /* CHAR_DETERMINEITEM */
|
||||
|
||||
-1, /* CHAR_INDEXOFEQTITLE */
|
||||
|
||||
|
||||
0, /* CHAR_POISON */
|
||||
0, /* CHAR_PARALYSIS */
|
||||
0, /* CHAR_SILENCE */
|
||||
0, /* CHAR_STONE */
|
||||
0, /* CHAR_DARKNESS */
|
||||
0, /* CHAR_CONFUSION */
|
||||
|
||||
0, /* CHAR_LOGINCOUNT */
|
||||
0, /* CHAR_DEADCOUNT */
|
||||
0, /* CHAR_WALKCOUNT */
|
||||
0, /* CHAR_TALKCOUNT */
|
||||
|
||||
0, /* CHAR_DAMAGECOUNT */
|
||||
0, /* CHAR_GETPETCOUNT */
|
||||
0, /* CHAR_KILLPETCOUNT */
|
||||
0, /* CHAR_DEADPETCOUNT */
|
||||
0, /* CHAR_SENDMAILCOUNT */
|
||||
0, /* CHAR_MERGEITEMCOUNT */
|
||||
|
||||
0, /* CHAR_DUELBATTLECOUNT */
|
||||
0, /* CHAR_DUELWINCOUNT */
|
||||
0, /* CHAR_DUELLOSECOUNT */
|
||||
0, /* CHAR_DUELSTWINCOUNT */
|
||||
0, /* CHAR_DUELMAXSTWINCOUNT */
|
||||
|
||||
CHAR_TYPEPLAYER, /* CHAR_WHICHTYPE */
|
||||
1000, /* CHAR_WALKINTERVAL */
|
||||
1000, /* CHAR_LOOPINTERVAL */
|
||||
#ifdef _NEWOPEN_MAXEXP
|
||||
0, // CHAR_OLDEXP,
|
||||
#endif
|
||||
0, // CHAR_EXP,
|
||||
-1, /* CHAR_LASTTALKELDER*/
|
||||
0, /* CHAR_SKILLUPPOINT */
|
||||
0, /* CHAR_LEVELUPPOINT */
|
||||
|
||||
0, /* CHAR_IMAGETYPE */
|
||||
CHAR_COLORWHITE, /* CHAR_NAMECOLOR */
|
||||
CHAR_COLORWHITE, /* CHAR_POPUPNAMECOLOR */
|
||||
0, /* CHAR_LASTTIMESETLUCK */
|
||||
100, /* CHAR_DUELPOINT */
|
||||
0, /* CHAR_EVENT */
|
||||
0, /* CHAR_EVENT2 */
|
||||
0, /* CHAR_EVENT3 */
|
||||
#ifdef _NEWEVENT
|
||||
0, /* CHAR_EVENT4 */
|
||||
0, /* CHAR_EVENT5 */
|
||||
0, /* CHAR_EVENT6 */
|
||||
#endif
|
||||
#ifdef _ADD_NEWEVENT
|
||||
0, /* CHAR_EVENT7 */
|
||||
0, /* CHAR_EVENT8 */
|
||||
#endif
|
||||
|
||||
0, /* CHAR_NOWEVENT */
|
||||
0, /* CHAR_NOWEVENT2 */
|
||||
0, /* CHAR_NOWEVENT3 */
|
||||
#ifdef _NEWEVENT
|
||||
0, /* CHAR_NOWEVENT4 */
|
||||
0, /* CHAR_NOWEVENT5 */
|
||||
0, /* CHAR_NOWEVENT6 */
|
||||
#endif
|
||||
#ifdef _ADD_NEWEVENT
|
||||
0, /* CHAR_NOWEVENT7 */
|
||||
0, /* CHAR_NOWEVENT8 */
|
||||
#endif
|
||||
|
||||
0, /* CHAR_TRANSMIGRATION */
|
||||
0, /* CHAR_TRANSEQUATION */
|
||||
|
||||
0, /* CHAR_INITDATA */
|
||||
|
||||
//#ifdef _PETSKILL_BECOMEPIG
|
||||
// -1,
|
||||
//#endif
|
||||
|
||||
0, //CHAR_SILENT, /* char shutup time */
|
||||
0, // CHAR_FMINDEX, // 家族 index
|
||||
0, // CHAR_FMLEADERFLAG,
|
||||
/* 家族成員種類
|
||||
* FMMEMBER_NONE :沒有加入任何家族
|
||||
* FMMEMBER_APPLY :申請加入家族中
|
||||
* FMMEMBER_LEADER :族長
|
||||
* FMMEMBER_MEMBER :一般成員
|
||||
* FMMEMBER_ELDER :長老
|
||||
* FMMEMBER_INVITE :祭司 // 暫時不用
|
||||
* FMMEMBER_BAILEE :財務長 // 暫時不用
|
||||
* FMMEMBER_VICELEADER :副族長 // 暫時不用
|
||||
*/
|
||||
0, // CHAR_FMSPRITE, // 家族守護精靈
|
||||
|
||||
0, // CHAR_BANKGOLD,
|
||||
0, // CHAR_RIDEPET,
|
||||
0, // CHAR_LEARNRIDE,
|
||||
#ifdef _NEW_RIDEPETS
|
||||
0, // CHAR_LOWRIDEPETS,
|
||||
#endif
|
||||
0, // CHAR_LIMITLEVEL,
|
||||
#ifdef _PET_FUSION
|
||||
0, // CHAR_FUSIONCODE, //物種編碼
|
||||
0, // CHAR_FUSIONINDEX, //孵化寵物編號
|
||||
0, // CHAR_FUSIONRAISE, //餵養次數
|
||||
0, // CHAR_FUSIONBEIT, //寵蛋旗標
|
||||
0, // CHAR_FUSIONTIMELIMIT, //餵養時間
|
||||
#endif
|
||||
|
||||
#ifdef _DEATH_CONTEND
|
||||
0, // CHAR_PKLISTTEAMNUM,
|
||||
0, // CHAR_PKLISTLEADER,
|
||||
#endif
|
||||
|
||||
#ifdef _PERSONAL_FAME // Arminius 8.30: 家族個人聲望
|
||||
0, // CHAR_FAME,
|
||||
#endif
|
||||
|
||||
#ifdef _NEWSAVE
|
||||
0, // CHAR_SAVEINDEXNUMBER, /* SaveFile .0.char or .1.char */
|
||||
#endif
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
0, // CHAR_EARTH_EXP, // 玩家的地魔法熟練度
|
||||
0, // CHAR_WATER_EXP, // 玩家的水魔法熟練度
|
||||
0, // CHAR_FIRE_EXP, // 玩家的火魔法熟練度
|
||||
0, // CHAR_WIND_EXP, // 玩家的風魔法熟練度
|
||||
0, // CHAR_EARTH_RESIST, // 玩家的地魔法抗性
|
||||
0, // CHAR_WATER_RESIST, // 玩家的水魔法抗性
|
||||
0, // CHAR_FIRE_RESIST, // 玩家的火魔法抗性
|
||||
0, // CHAR_WIND_RESIST, // 玩家的風魔法抗性
|
||||
0, // CHAR_EARTH_ATTMAGIC_EXP, // 玩家的地魔法熟練度經驗值
|
||||
0, // CHAR_WATER_ATTMAGIC_EXP, // 玩家的水魔法熟練度經驗值
|
||||
0, // CHAR_FIRE_ATTMAGIC_EXP, // 玩家的火魔法熟練度經驗值
|
||||
0, // CHAR_WIND_ATTMAGIC_EXP, // 玩家的風魔法熟練度經驗值
|
||||
0, // CHAR_EARTH_DEFMAGIC_EXP, // 玩家的地魔法抗性經驗值
|
||||
0, // CHAR_WATER_DEFMAGIC_EXP, // 玩家的水魔法抗性經驗值
|
||||
0, // CHAR_FIRE_DEFMAGIC_EXP, // 玩家的火魔法抗性經驗值
|
||||
0, // CHAR_WIND_DEFMAGIC_EXP, // 玩家的風魔法抗性經驗值
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _GAMBLE_BANK
|
||||
0, // CHAR_PERSONAGOLD, //賭場個人銀行
|
||||
#endif
|
||||
#ifdef _DROPSTAKENEW
|
||||
0, // CHAR_GAMBLENUM, //賭場積分
|
||||
#endif
|
||||
#ifdef _ADD_ACTION //npc動作
|
||||
0, // CHAR_ACTIONSTYLE,
|
||||
#endif
|
||||
#ifdef _AUCTIONEER
|
||||
0, // CHAR_AUCGOLD, // 拍賣所得
|
||||
#endif
|
||||
#ifdef _PET_EVOLUTION
|
||||
0, // CHAR_EVOLUTIONBASEVTL,
|
||||
0, // CHAR_EVOLUTIONBASESTR,
|
||||
0, // CHAR_EVOLUTIONBASETGH,
|
||||
0, // CHAR_EVOLUTIONBASEDEX,
|
||||
#endif
|
||||
#ifdef _ACTION_BULLSCR
|
||||
0, // CHAR_ABULLSTART,
|
||||
0, // CHAR_ABULLSCORE,
|
||||
0, // CHAR_ABULLTIME,
|
||||
0, // CHAR_ABULLSTARTTIME,
|
||||
#endif
|
||||
|
||||
#ifdef _ACTION_GMQUE
|
||||
0, // CHAR_GMQUEFLG,
|
||||
0, // CHAR_GMQUENUMS,
|
||||
#endif
|
||||
|
||||
#ifdef _FAMILYBANKSTONELOG
|
||||
0, // CHAR_FMBANKGOLD, //家族銀行存款
|
||||
#endif
|
||||
|
||||
#ifdef _FM_JOINLIMIT
|
||||
0, // CHAR_FMTIMELIMIT,
|
||||
#endif
|
||||
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物職業
|
||||
0, // PROFESSION_CLASS, // 職業別
|
||||
0, // PROFESSION_LEVEL, // 職業等級
|
||||
// 0, // PROFESSION_EXP, // 職業經驗值
|
||||
0, // PROFESSION_SKILL_POINT, // 技能點數
|
||||
0, // ATTACHPILE, // 增加堆疊
|
||||
0, // PROFESSION_FIRE_P, // 火熟練度
|
||||
0, // PROFESSION_ICE_P, // 冰熟練度
|
||||
0, // PROFESSION_THUNDER_P, // 雷熟練度
|
||||
0, // PROFESSION_FIRE_R, // 火抗性
|
||||
0, // PROFESSION_ICE_R, // 冰抗性
|
||||
0, // PROFESSION_THUNDER_R, // 雷抗性
|
||||
#endif
|
||||
#ifdef _ALLDOMAN // (不可開) Syu ADD 排行榜NPC
|
||||
0, // CHAR_HEROFLOOR,
|
||||
#endif
|
||||
#ifdef _PETSKILL_BECOMEPIG
|
||||
-1, // CHAR_BECOMEPIG,
|
||||
100250, //CHAR_BECOMEPIG_BBI
|
||||
#endif
|
||||
0, // CHAR_LASTLEAVETIME, // Robin add 最後離線時間
|
||||
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
0, // CHAR_MOMENTUM,
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_ADDEXP2
|
||||
0, // CHAR_ADDEXPPOWER,
|
||||
0, // CHAR_ADDEXPTIME,
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
0, // CHAR_HEROCNT, // 完成勇者任務的次數
|
||||
#endif
|
||||
|
||||
#ifdef _RACEMAN
|
||||
0, // CHAR_CHECKIN, //寵物是否登記
|
||||
0, // CHAR_CATCHCNT, //獵寵次數
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
#endif
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
{""}, /* CHAR_NAME */
|
||||
{""}, /* CHAR_OWNTITLE */
|
||||
{""}, /* CHAR_ARGUMENT */
|
||||
{""}, /* CHAR_OWNERCDKEY */
|
||||
{""}, /* CHAR_OWNERCHARANAME */
|
||||
#if 0
|
||||
{""}, /* CHAR_INITFUNC */
|
||||
{"core_PreWalk"}, /* CHAR_WALKPREFUNC */
|
||||
{"core_PostWalk"}, /* CHAR_WALKPOSTFUNC */
|
||||
{""}, /* CHAR_PREOVERFUNC */
|
||||
{""}, /* CHAR_PREOVERFUNC */
|
||||
{"core_PlayerWatch"}, /* CHAR_WATCHFUNC */
|
||||
{"core_Loop"}, /* CHAR_LOOPFUNC */
|
||||
{"core_Dying"}, /* CHAR_DYINGFUNC */
|
||||
{"core_PlayerTalked"}, /* CHAR_TALKEDFUNC */
|
||||
{""}, /* CHAR_PREATTACKEDFUNC */
|
||||
{""}, /* CHAR_POSTATTACKEDFUNC */
|
||||
{""}, /* CHAR_OFFFUNC */
|
||||
{""}, /* CHAR_LOOKEDFUNC */
|
||||
{""}, /* CHAR_ITEMPUTFUNC */
|
||||
{""}, /* CHAR_SPECIALTALKEDFUNC */
|
||||
{""}, /* CHAR_WINDOWTALKEDFUNC */
|
||||
#endif
|
||||
},
|
||||
{
|
||||
SETFLG(1,1,1,1,1,1,0,0 ),
|
||||
SETFLG(0,0,0,0,0,0,0,1 ),
|
||||
}
|
||||
};
|
||||
|
||||
LevelUpPattern lvplayer00={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer10={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer20={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer30={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer01={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer11={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer21={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer31={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer02={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer12={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer22={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer32={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer03={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer13={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer23={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer33={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer04={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer14={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer24={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer34={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer05={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer15={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer25={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer35={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer06={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer16={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer26={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer36={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer07={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer17={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer27={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer37={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer08={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer18={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer28={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer38={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
LevelUpPattern lvplayer09={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer19={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer29={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
LevelUpPattern lvplayer39={ {{100,10},{200,10},{50,8}},9,11,10};
|
||||
|
||||
|
29
gmsv/char/defend.c
Normal file
29
gmsv/char/defend.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "readmap.h"
|
||||
#include "object.h"
|
||||
#include "char.h"
|
||||
#include "char_base.h"
|
||||
#include "lssproto_serv.h"
|
||||
#include "saacproto_cli.h"
|
||||
#include "npcutil.h"
|
||||
#include "family.h"
|
||||
#include "log.h"
|
||||
#include "handletime.h"
|
||||
#include "buf.h"
|
||||
#include "net.h"
|
||||
#include "char_base.h"
|
||||
#include "battle.h"
|
||||
#include "npc_bus.h"
|
||||
#include "char_talk.h"
|
||||
#include "npc_scheduleman.h"
|
||||
#include "defend.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
597
gmsv/char/encount.c
Normal file
597
gmsv/char/encount.c
Normal file
@ -0,0 +1,597 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#ifdef _REDHAT_V9
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "buf.h"
|
||||
#include "char_base.h"
|
||||
#include "char.h"
|
||||
#include "configfile.h"
|
||||
#include "encount.h"
|
||||
#include "enemy.h"
|
||||
|
||||
#ifdef _ADD_ENCOUNT // WON ADD 增加敌遭遇触发修件
|
||||
#include "encount.h"
|
||||
#endif
|
||||
|
||||
/* 巨件市它件玄楮 及末□旦 */
|
||||
|
||||
#ifndef _ADD_ENCOUNT // WON ADD 增加敌遭遇触发修件
|
||||
typedef struct tagENCOUNT_Table
|
||||
{
|
||||
int index;
|
||||
int floor;
|
||||
int encountprob_min; /* 巨件市它件玄割 */
|
||||
int encountprob_max; /* 巨件市它件玄割 */
|
||||
int enemymaxnum; /* 升木分仃衬毛综月井 */
|
||||
int zorder;
|
||||
int groupid[ENCOUNT_GROUPMAXNUM]; /* 弘伙□皿No */
|
||||
int createprob[ENCOUNT_GROUPMAXNUM]; /* 公及弘伙□皿及请蜇 */
|
||||
RECT rect;
|
||||
}ENCOUNT_Table;
|
||||
ENCOUNT_Table *ENCOUNT_table;
|
||||
#endif
|
||||
|
||||
int ENCOUNT_encountnum;
|
||||
#define ENCOUNT_ENEMYMAXCREATENUM 10
|
||||
|
||||
static INLINE BOOL ENCOUNT_CHECKENCOUNTTABLEARRAY( int array)
|
||||
{
|
||||
if( array < 0 || array > ENCOUNT_encountnum-1) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 巨件市它件玄涩烂及赓渝祭毛允月[
|
||||
* 娄醒
|
||||
* filename char* 涩烂白央奶伙
|
||||
* 忒曰袄
|
||||
* 岳 TRUE(1)
|
||||
* 撩 FALSE(0)
|
||||
*------------------------------------------------------------*/
|
||||
BOOL ENCOUNT_initEncount( char* filename )
|
||||
{
|
||||
FILE* f;
|
||||
char line[256];
|
||||
int linenum=0;
|
||||
int encount_readlen=0;
|
||||
|
||||
f = fopen(filename,"r");
|
||||
if( f == NULL ){
|
||||
errorprint;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ENCOUNT_encountnum=0;
|
||||
|
||||
/* 引内 躲卅垫互窒垫丐月井升丹井譬屯月 */
|
||||
while( fgets( line, sizeof( line ), f ) ){
|
||||
linenum ++;
|
||||
if( line[0] == '#' )continue; /* comment */
|
||||
if( line[0] == '\n' )continue; /* none */
|
||||
chomp( line );
|
||||
|
||||
ENCOUNT_encountnum++;
|
||||
}
|
||||
|
||||
if( fseek( f, 0, SEEK_SET ) == -1 ){
|
||||
fprint( "寻找错误\n" );
|
||||
fclose(f);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ENCOUNT_table = allocateMemory( sizeof(struct tagENCOUNT_Table)
|
||||
* ENCOUNT_encountnum );
|
||||
if( ENCOUNT_table == NULL ){
|
||||
fprint( "无法分配内存 %d\n" ,
|
||||
sizeof(ENCOUNT_table)*ENCOUNT_encountnum);
|
||||
fclose( f );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* 赓渝祭 */
|
||||
{
|
||||
int i,j;
|
||||
for( i = 0; i < ENCOUNT_encountnum; i ++ ) {
|
||||
ENCOUNT_table[i].index = -1;
|
||||
ENCOUNT_table[i].floor = 0;
|
||||
ENCOUNT_table[i].encountprob_min = 1;
|
||||
ENCOUNT_table[i].encountprob_min = 50;
|
||||
ENCOUNT_table[i].enemymaxnum = 4;
|
||||
ENCOUNT_table[i].rect.x = 0;
|
||||
ENCOUNT_table[i].rect.y = 0;
|
||||
ENCOUNT_table[i].rect.height = 0;
|
||||
ENCOUNT_table[i].rect.width = 0;
|
||||
ENCOUNT_table[i].zorder = 0;
|
||||
for( j = 0; j < ENCOUNT_GROUPMAXNUM; j ++ ) {
|
||||
ENCOUNT_table[i].groupid[j] = -1;
|
||||
ENCOUNT_table[i].createprob[j] = -1;
|
||||
}
|
||||
#ifdef _ADD_ENCOUNT // WON ADD 增加敌遭遇触发修件
|
||||
ENCOUNT_table[i].event_now = -1;
|
||||
ENCOUNT_table[i].event_end = -1;
|
||||
ENCOUNT_table[i].enemy_group = -1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* 引凶 心 允 */
|
||||
linenum = 0;
|
||||
while( fgets( line, sizeof( line ), f ) ){
|
||||
linenum ++;
|
||||
if( line[0] == '#' )continue; /* comment */
|
||||
if( line[0] == '\n' )continue; /* none */
|
||||
chomp( line );
|
||||
|
||||
/* 垫毛帮溥允月 */
|
||||
/* 引内 tab 毛 " " 卞 五晶尹月 */
|
||||
replaceString( line, '\t' , ' ' );
|
||||
/* 燮 及旦矢□旦毛潸月[*/
|
||||
{
|
||||
int i;
|
||||
char buf[256];
|
||||
for( i = 0; i < strlen( line); i ++) {
|
||||
if( line[i] != ' ' ) {
|
||||
break;
|
||||
}
|
||||
strcpy( buf, &line[i]);
|
||||
}
|
||||
if( i != 0 ) {
|
||||
strcpy( line, buf);
|
||||
}
|
||||
}
|
||||
{
|
||||
char token[256];
|
||||
int ret;
|
||||
int x1,x2,y1,y2;
|
||||
int j;
|
||||
|
||||
/* 蘸户及伙□皿卞 匀凶凛及啃及赓渝祭 */
|
||||
ENCOUNT_table[encount_readlen].index = -1;
|
||||
ENCOUNT_table[encount_readlen].floor = 0;
|
||||
ENCOUNT_table[encount_readlen].encountprob_min = 1;
|
||||
ENCOUNT_table[encount_readlen].encountprob_min = 50;
|
||||
ENCOUNT_table[encount_readlen].enemymaxnum = 4;
|
||||
ENCOUNT_table[encount_readlen].rect.x = 0;
|
||||
ENCOUNT_table[encount_readlen].rect.y = 0;
|
||||
ENCOUNT_table[encount_readlen].rect.height = 0;
|
||||
ENCOUNT_table[encount_readlen].rect.width = 0;
|
||||
ENCOUNT_table[encount_readlen].zorder = 0;
|
||||
for( j = 0; j < ENCOUNT_GROUPMAXNUM; j ++ ) {
|
||||
ENCOUNT_table[encount_readlen].groupid[j] = -1;
|
||||
ENCOUNT_table[encount_readlen].createprob[j] = -1;
|
||||
}
|
||||
#ifdef _ADD_ENCOUNT // WON ADD 增加敌遭遇触发修件
|
||||
ENCOUNT_table[encount_readlen].event_now = -1;
|
||||
ENCOUNT_table[encount_readlen].event_end = -1;
|
||||
ENCOUNT_table[encount_readlen].enemy_group = -1;
|
||||
#endif
|
||||
|
||||
|
||||
/* 夫午勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",1,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].index = atoi(token);
|
||||
|
||||
/* 2勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",2,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].floor = atoi(token);
|
||||
|
||||
/* 3勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",3,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
x1 = atoi(token);
|
||||
|
||||
/* 4勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",4,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
y1= atoi(token);
|
||||
|
||||
/* 5勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",5,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
|
||||
x2 = atoi(token);
|
||||
|
||||
/* 6勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",6,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
y2= atoi(token);
|
||||
|
||||
ENCOUNT_table[encount_readlen].rect.x = min(x1,x2);
|
||||
ENCOUNT_table[encount_readlen].rect.width = max(x1,x2) - min(x1,x2);
|
||||
ENCOUNT_table[encount_readlen].rect.y = min(y1,y2);
|
||||
ENCOUNT_table[encount_readlen].rect.height = max(y1,y2) - min(y1,y2);
|
||||
|
||||
/* 7户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",7,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].encountprob_min = atoi(token);
|
||||
|
||||
/* 8户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",8,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].encountprob_max = atoi(token);
|
||||
|
||||
{
|
||||
int a,b;
|
||||
a = ENCOUNT_table[encount_readlen].encountprob_min;
|
||||
b = ENCOUNT_table[encount_readlen].encountprob_max;
|
||||
/* 凝及譬帮 */
|
||||
ENCOUNT_table[encount_readlen].encountprob_min
|
||||
= min( a,b);
|
||||
ENCOUNT_table[encount_readlen].encountprob_max
|
||||
= max( a,b);
|
||||
}
|
||||
/* 9勾户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",9,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
{
|
||||
int maxnum = atoi( token);
|
||||
/* 醒及恳癫岭及民尼永弁 */
|
||||
if( maxnum < 1 || maxnum > ENCOUNT_ENEMYMAXCREATENUM ) {
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].enemymaxnum = maxnum;
|
||||
}
|
||||
/* 10户及玄□弁件毛苇月 */
|
||||
ret = getStringFromIndexWithDelim( line,",",10,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].zorder = atoi(token);
|
||||
#define CREATEPROB_TOKEN 11
|
||||
|
||||
/* 11 31户及玄□弁件毛苇月 */
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = CREATEPROB_TOKEN; i < CREATEPROB_TOKEN +ENCOUNT_GROUPMAXNUM*2; i ++) {
|
||||
ret = getStringFromIndexWithDelim( line,",",i,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
if( strlen( token) != 0 ) {
|
||||
if( i < CREATEPROB_TOKEN + ENCOUNT_GROUPMAXNUM ) {
|
||||
ENCOUNT_table[encount_readlen].groupid[i-CREATEPROB_TOKEN]
|
||||
= atoi(token);
|
||||
}
|
||||
else {
|
||||
ENCOUNT_table[encount_readlen].createprob[i-(CREATEPROB_TOKEN + ENCOUNT_GROUPMAXNUM)]
|
||||
= atoi(token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 褐 民尼永弁 */
|
||||
if( checkRedundancy( ENCOUNT_table[encount_readlen].groupid,
|
||||
arraysizeof( ENCOUNT_table[encount_readlen].groupid)))
|
||||
{
|
||||
fprint( "文件语法错误:%s 第%d行\n",
|
||||
filename,linenum);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef _ADD_ENCOUNT // WON ADD 增加敌遭遇触发修件
|
||||
ret = getStringFromIndexWithDelim( line,",",31,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].event_now = atoi(token);
|
||||
|
||||
ret = getStringFromIndexWithDelim( line,",",32,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].event_end = atoi(token);
|
||||
|
||||
ret = getStringFromIndexWithDelim( line,",",33,token,
|
||||
sizeof(token));
|
||||
if( ret==FALSE ){
|
||||
fprint("文件语法错误:%s 第%d行\n",filename,linenum);
|
||||
continue;
|
||||
}
|
||||
ENCOUNT_table[encount_readlen].enemy_group = atoi(token);
|
||||
#endif
|
||||
|
||||
encount_readlen ++;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
ENCOUNT_encountnum = encount_readlen;
|
||||
|
||||
print( "有效的遇敌坐标数是 %d..", ENCOUNT_encountnum );
|
||||
|
||||
#if 0
|
||||
|
||||
{
|
||||
int i;
|
||||
for( i=0; i <ENCOUNT_encountnum ; i++ )
|
||||
print( "encount idx[%d] fl[%d] prob_min[%d] prob_max[%d] e_max[%d] x[%d] wth[%d] y[%d] hgt[%d] \n",
|
||||
ENCOUNT_table[i].index,
|
||||
ENCOUNT_table[i].floor,
|
||||
ENCOUNT_table[i].encountprob_min,
|
||||
ENCOUNT_table[i].encountprob_max,
|
||||
ENCOUNT_table[i].enemymaxnum,
|
||||
ENCOUNT_table[i].rect.x,
|
||||
ENCOUNT_table[i].rect.width,
|
||||
ENCOUNT_table[i].rect.y,
|
||||
ENCOUNT_table[i].rect.height);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
/*------------------------------------------------------------------------
|
||||
* 巨件市它件玄涩烂白央奶伙 心 仄
|
||||
*-----------------------------------------------------------------------*/
|
||||
BOOL ENCOUNT_reinitEncount( void )
|
||||
{
|
||||
freeMemory( ENCOUNT_table);
|
||||
return( ENCOUNT_initEncount( getEncountfile()));
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及ENCOUNT_table及骄侬毛譬屯月[
|
||||
* zorder及醒侬毛苇化穸燮赐匏及嫖中 毛潸 允月[
|
||||
* 娄醒
|
||||
* floor int 白夫失ID
|
||||
* x int x甄
|
||||
* y int y甄
|
||||
* 忒曰袄
|
||||
* 恳橘 骄侬
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getEncountAreaArray( int floor, int x, int y)
|
||||
{
|
||||
int i;
|
||||
int index = -1;
|
||||
for( i=0 ; i<ENCOUNT_encountnum ; i++ ) {
|
||||
if( ENCOUNT_table[i].floor == floor ) {
|
||||
if( CoordinateInRect( &ENCOUNT_table[i].rect, x, y) ) {
|
||||
int curZorder = ENCOUNT_getZorderFromArray(i);
|
||||
if( curZorder >0) {
|
||||
if( index != -1 ) {
|
||||
/* 穸燮赐匏毛譬屯月 */
|
||||
/* 五中 穸燮 */
|
||||
if( curZorder > ENCOUNT_getZorderFromArray(index)) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及巨件市它件玄割 毛譬屯月[
|
||||
* 娄醒
|
||||
* floor int 白夫失ID
|
||||
* x int x甄
|
||||
* y int y甄
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓及割
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getEncountPercentMin( int charaindex, int floor , int x, int y )
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ENCOUNT_getEncountAreaArray( floor, x, y);
|
||||
if( ret != -1 ) {
|
||||
ret = ENCOUNT_table[ret].encountprob_min;
|
||||
/* 玄目夫旦躲绊毛勾仃月 */
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORK_TOHELOS_COUNT) > 0 ) {
|
||||
ret = ceil( ret *
|
||||
((100 + CHAR_getWorkInt( charaindex, CHAR_WORK_TOHELOS_CUTRATE))
|
||||
/ 100.0));
|
||||
}
|
||||
if( ret < 0 ) ret = 0;
|
||||
if( ret > 100 ) ret = 100;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及巨件市它件玄割 毛譬屯月[
|
||||
* 娄醒
|
||||
* floor int 白夫失ID
|
||||
* x int x甄
|
||||
* y int y甄
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓及割
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getEncountPercentMax( int charaindex, int floor , int x, int y )
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ENCOUNT_getEncountAreaArray( floor, x, y);
|
||||
if( ret != -1 ) {
|
||||
ret = ENCOUNT_table[ret].encountprob_max;
|
||||
/* 玄目夫旦躲绊毛勾仃月 */
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORK_TOHELOS_COUNT) > 0 ) {
|
||||
ret = ceil( ret *
|
||||
((100 + CHAR_getWorkInt( charaindex, CHAR_WORK_TOHELOS_CUTRATE))
|
||||
/ 100.0));
|
||||
}
|
||||
if( ret < 0 ) ret = 0;
|
||||
if( ret > 100 ) ret = 100;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及衬戏岳MAX醒毛譬屯月[
|
||||
* 娄醒
|
||||
* floor int 白夫失ID
|
||||
* x int x甄
|
||||
* y int y甄
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓及割
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getCreateEnemyMaxNum( int floor , int x, int y )
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ENCOUNT_getEncountAreaArray( floor, x, y);
|
||||
if( ret != -1 ) {
|
||||
ret = ENCOUNT_table[ret].enemymaxnum;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及巨件市它件玄白奴□伙玉及index毛譬屯月[
|
||||
* 娄醒
|
||||
* floor int 白夫失ID
|
||||
* x int x甄
|
||||
* y int y甄
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getEncountIndex( int floor , int x, int y )
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ENCOUNT_getEncountAreaArray( floor, x, y);
|
||||
if( ret != -1 ) {
|
||||
ret = ENCOUNT_table[ret].index;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及巨件市它件玄白奴□伙玉及index毛譬屯月[
|
||||
* 娄醒
|
||||
* array int ENCOUNTTABLE及骄侬
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getEncountIndexFromArray( int array )
|
||||
{
|
||||
if( !ENCOUNT_CHECKENCOUNTTABLEARRAY( array)) return -1;
|
||||
return ENCOUNT_table[array].index;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及巨件市它件玄割 毛譬屯月[
|
||||
* 娄醒
|
||||
* array int ENCOUNTTABLE及骄侬
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getEncountPercentFromArray( int array )
|
||||
{
|
||||
if( !ENCOUNT_CHECKENCOUNTTABLEARRAY( array)) return -1;
|
||||
return ENCOUNT_table[array].encountprob_min;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶甄 及衬戏岳MAX醒毛譬屯月[
|
||||
* 娄醒
|
||||
* array int ENCOUNTTABLE及骄侬
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getCreateEnemyMaxNumFromArray( int array )
|
||||
{
|
||||
if( !ENCOUNT_CHECKENCOUNTTABLEARRAY( array)) return -1;
|
||||
return ENCOUNT_table[array].enemymaxnum;
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶骄侬及弘伙□皿 寞毛譬屯月[
|
||||
* 娄醒
|
||||
* array int ENCOUNTTABLE及骄侬
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getGroupIdFromArray( int array, int grouparray )
|
||||
{
|
||||
if( !ENCOUNT_CHECKENCOUNTTABLEARRAY( array)) return -1;
|
||||
return ENCOUNT_table[array].groupid[grouparray];
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶骄侬及弘伙□皿及请蜇 毛譬屯月[
|
||||
* 娄醒
|
||||
* array int ENCOUNTTABLE及骄侬
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getGroupProbFromArray( int array, int grouparray )
|
||||
{
|
||||
if( !ENCOUNT_CHECKENCOUNTTABLEARRAY( array)) return -1;
|
||||
return ENCOUNT_table[array].createprob[grouparray];
|
||||
}
|
||||
/*------------------------------------------------------------
|
||||
* 隙烂今木凶骄侬及穸燮赐匏毛譬屯月[
|
||||
* 娄醒
|
||||
* array int ENCOUNTTABLE及骄侬
|
||||
* 忒曰袄
|
||||
* 恳橘 ㄟ动晓
|
||||
* 潸 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int ENCOUNT_getZorderFromArray( int array )
|
||||
{
|
||||
if( !ENCOUNT_CHECKENCOUNTTABLEARRAY( array)) return -1;
|
||||
return ENCOUNT_table[array].zorder;
|
||||
}
|
2567
gmsv/char/enemy.c
Normal file
2567
gmsv/char/enemy.c
Normal file
File diff suppressed because it is too large
Load Diff
100
gmsv/char/event.c
Normal file
100
gmsv/char/event.c
Normal file
@ -0,0 +1,100 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include "object.h"
|
||||
#include "char_base.h"
|
||||
#include "char.h"
|
||||
#include "readmap.h"
|
||||
#include "map_warppoint.h"
|
||||
#include "event.h"
|
||||
#include "npc_warp.h"
|
||||
#include "npc_npcenemy.h"
|
||||
|
||||
|
||||
static int EVENT_onWarpNPC( int charaindex,int echaraindex,int fl,int x, int y );
|
||||
static int EVENY_npcEncount( int charaindex,int echaraindex,int fl,int x, int y );
|
||||
|
||||
|
||||
typedef int (*FUNC)( int charaindex,int echaraindex,int fl,int x, int y );
|
||||
static FUNC functbl[] = {
|
||||
NULL,
|
||||
NULL, /* 裔烂NPC */
|
||||
EVENY_npcEncount, /* 裔烂衬巨件市它件玄 */
|
||||
EVENT_onWarpNPC, /* warp*/
|
||||
NULL, /* 裔烂NPC */
|
||||
NULL, /* 裔烂NPC */
|
||||
EVENT_onWarpNPC, /* warp*/
|
||||
EVENT_onWarpNPC, /* warp*/
|
||||
EVENT_onWarpNPC, /* warp*/
|
||||
};
|
||||
|
||||
INLINE BOOL EVENT_CHECKEVENTINDEX( int event)
|
||||
{
|
||||
if( event < 0 || event >= CHAR_EVENTNUM) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int EVENT_main( int charaindex,int event, int x, int y)
|
||||
{
|
||||
OBJECT object;
|
||||
BOOL found = FALSE;
|
||||
int rc = FALSE;
|
||||
int fl = CHAR_getInt( charaindex, CHAR_FLOOR);
|
||||
if( !EVENT_CHECKEVENTINDEX( event)) return FALSE;
|
||||
|
||||
for( object = MAP_getTopObj(fl,x,y) ; object ;
|
||||
object = NEXT_OBJECT(object) ){
|
||||
int o = GET_OBJINDEX(object);
|
||||
if( OBJECT_getType(o) == OBJTYPE_CHARA ){
|
||||
int etype;
|
||||
int echaraindex=OBJECT_getIndex(o);
|
||||
if( !CHAR_CHECKINDEX(echaraindex) )continue;
|
||||
if( CHAR_getInt( echaraindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER) continue;
|
||||
etype = CHAR_getWorkInt( echaraindex, CHAR_WORKEVENTTYPE);
|
||||
if( etype != CHAR_EVENT_NONE ) {
|
||||
if( etype == event) {
|
||||
if( functbl[event] != NULL ) {
|
||||
rc = functbl[event]( charaindex, echaraindex, fl,x,y);
|
||||
}
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef _MAP_WARPPOINT
|
||||
else if( OBJECT_getType(o) == OBJTYPE_WARPPOINT){
|
||||
if( !MAPPOINT_CHECKINDEX( OBJECT_getIndex( o)) ) continue;
|
||||
if( OBJECT_getchartype( o) != event ) continue;
|
||||
MAPPOINT_MapWarpHandle( charaindex, OBJECT_getIndex( o), fl, x, y );
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if( !found ) {
|
||||
print( "not found eventobject : cind [%d] event [%d] fl[%d] x[%d] y[%d]\n",
|
||||
charaindex, event, fl,x,y);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int EVENT_onWarpNPC( int charaindex,int echaraindex,int fl,int x, int y )
|
||||
{
|
||||
NPC_WarpWarpCharacter( echaraindex, charaindex);
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKPARTYMODE ) == CHAR_PARTY_LEADER ) {
|
||||
int i;
|
||||
for( i = 1; i < CHAR_PARTYMAX; i ++ ) {
|
||||
int index = CHAR_getWorkInt( charaindex, i + CHAR_WORKPARTYINDEX1);
|
||||
if( CHAR_CHECKINDEX(index) ) {
|
||||
NPC_WarpWarpCharacter( echaraindex, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
static int EVENY_npcEncount( int charaindex,int echaraindex,int fl,int x, int y )
|
||||
{
|
||||
return NPC_NPCEnemy_Encount( echaraindex, charaindex, 0);
|
||||
}
|
||||
|
3012
gmsv/char/family.c
Normal file
3012
gmsv/char/family.c
Normal file
File diff suppressed because it is too large
Load Diff
3048
gmsv/char/family.c.bak
Normal file
3048
gmsv/char/family.c.bak
Normal file
File diff suppressed because it is too large
Load Diff
13
gmsv/char/ls2data.h
Normal file
13
gmsv/char/ls2data.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef LS2DATA_DAT
|
||||
#define LS2DATA_DAT
|
||||
|
||||
typedef struct {
|
||||
int hash;
|
||||
char *name;
|
||||
int graphicnumber;
|
||||
} CconvertStringNumber;
|
||||
|
||||
CconvertStringNumber *convertStringNumber;
|
||||
int cconvertStringNumber;
|
||||
|
||||
#endif // LS2DATA_DAT ///:~
|
1043
gmsv/char/makefile
Normal file
1043
gmsv/char/makefile
Normal file
File diff suppressed because it is too large
Load Diff
727
gmsv/char/makefile.bak
Normal file
727
gmsv/char/makefile.bak
Normal file
@ -0,0 +1,727 @@
|
||||
INCFLAGS=-I.. -I../include
|
||||
|
||||
|
||||
CFLAGS=-w -O3 $(INCFLAGS)
|
||||
|
||||
PROG=libchar.a
|
||||
|
||||
SRC=char_base.c char.c char_event.c char_data.c skill.c title.c\
|
||||
addressbook.c chatmagic.c event.c char_walk.c encount.c pet.c \
|
||||
enemy.c pet_event.c char_talk.c char_party.c char_item.c deathcontend.c \
|
||||
chatroom.c petmail.c trade.c family.c defend.c char_angel.c
|
||||
|
||||
OBJ=$(SRC:.c=.o)
|
||||
|
||||
ifeq (0,$(MAKELEVEL))
|
||||
CC=gcc
|
||||
RM=rm -f
|
||||
AR=ar cr
|
||||
MV=mv
|
||||
RANLIB=ranlib
|
||||
SED=sed
|
||||
SHELL=/bin/sh
|
||||
endif
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
$(PROG): $(OBJ)
|
||||
$(RM) $(PROG)
|
||||
$(AR) $(PROG) $(OBJ)
|
||||
$(RANLIB) $(PROG)
|
||||
|
||||
depend:
|
||||
$(MV) makefile makefile.bak
|
||||
$(SED) -ne '1,/^# DO NOT DELETE THIS LINE/p' makefile.bak>makefile
|
||||
$(CC) $(INCFLAGS) -M $(SRC) >> makefile
|
||||
|
||||
clean:
|
||||
$(RM) $(PROG)
|
||||
$(RM) $(OBJ)
|
||||
$(RM) *~
|
||||
|
||||
distclean:
|
||||
$(RM) $(PROG)
|
||||
$(RM) $(OBJ)
|
||||
$(RM) *~
|
||||
$(MV) makefile makefile.bak
|
||||
$(SED) -ne '1,/^# DO NOT DELETE THIS LINE/p' makefile.bak>makefile
|
||||
$(RM) makefile.bak
|
||||
|
||||
# DO NOT DELETE THIS LINE
|
||||
char_base.o: char_base.c /usr/include/string.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
../include/char_base.h ../include/skill.h ../include/common.h \
|
||||
/usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/char.h ../include/buf.h ../include/magic.h \
|
||||
../include/function.h ../include/npccreate.h ../include/configfile.h \
|
||||
../include/pet.h ../include/pet_skill.h
|
||||
char.o: char.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h /usr/include/string.h /usr/include/ctype.h \
|
||||
/usr/include/sys/time.h /usr/include/bits/time.h ../include/common.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
../include/title.h ../include/addressbook.h ../include/net.h \
|
||||
/usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/char.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/strings.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h \
|
||||
../include/item_event.h ../include/buf.h ../include/object.h \
|
||||
../include/map_deal.h ../include/saacproto_cli.h ../include/map_warppoint.h \
|
||||
../include/saacproto_util.h ../include/readmap.h \
|
||||
../include/handletime.h ../include/char_event.h \
|
||||
../include/npccreate.h ../include/magic_base.h ../include/magic.h \
|
||||
../include/chatmagic.h ../include/configfile.h ../include/log.h \
|
||||
../include/anim_tbl.h ../include/encount.h ../include/battle.h \
|
||||
../include/pet_skill.h ../include/enemy.h ../include/npcutil.h \
|
||||
../include/pet.h ../include/family.h
|
||||
char_event.o: char_event.c /usr/include/ctype.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h /usr/include/bits/types.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h ../include/common.h \
|
||||
/usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h \
|
||||
/usr/include/bits/stdio_lim.h ../include/char.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/item_event.h ../include/object.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/string.h /usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/readmap.h ../include/map_deal.h \
|
||||
../include/saacproto_cli.h ../include/saacproto_util.h \
|
||||
../include/npccreate.h ../include/handletime.h ../include/anim_tbl.h
|
||||
char_data.o: char_data.c /usr/include/string.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/include/math.h /usr/include/bits/huge_val.h \
|
||||
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/float.h \
|
||||
../include/readmap.h ../include/common.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/anim_tbl.h ../include/char.h \
|
||||
../include/char_base.h ../include/skill.h ../include/title.h \
|
||||
../include/addressbook.h ../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/buf.h defaultPlayer.h defaultGroundEnemy.h ls2data.h
|
||||
skill.o: skill.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h /usr/include/string.h ../include/skill.h \
|
||||
../include/common.h ../include/util.h /usr/include/sys/time.h \
|
||||
/usr/include/bits/time.h ../include/char.h ../include/char_base.h \
|
||||
../include/title.h ../include/addressbook.h ../include/net.h \
|
||||
/usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h
|
||||
title.o: title.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h /usr/include/string.h /usr/include/ctype.h \
|
||||
../include/title.h ../include/common.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/bits/time.h ../include/char.h \
|
||||
../include/char_base.h ../include/skill.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/buf.h ../include/configfile.h
|
||||
addressbook.o: addressbook.c /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h /usr/include/string.h /usr/include/strings.h \
|
||||
../include/addressbook.h ../include/common.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/bits/time.h ../include/net.h \
|
||||
/usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_base.h \
|
||||
../include/skill.h ../include/title.h ../include/char_data.h \
|
||||
../include/item.h ../include/handletime.h ../include/buf.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h \
|
||||
../include/saacproto_cli.h ../include/saacproto_util.h \
|
||||
../include/object.h ../include/battle.h ../include/configfile.h \
|
||||
../include/npcutil.h ../include/pet.h ../include/petmail.h \
|
||||
../include/log.h
|
||||
chatmagic.o: chatmagic.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/time.h /usr/include/bits/time.h /usr/include/string.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
../include/common.h ../include/char.h ../include/char_base.h \
|
||||
../include/skill.h ../include/util.h /usr/include/sys/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/buf.h ../include/npcutil.h ../include/object.h \
|
||||
../include/handletime.h ../include/chatmagic.h \
|
||||
../include/configfile.h ../include/readmap.h ../include/map_deal.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/log.h ../include/battle.h \
|
||||
../include/pet.h ../include/enemy.h ../include/encount.h \
|
||||
../include/magic_base.h ../include/magic.h ../include/pet_skill.h \
|
||||
../include/item_gen.h
|
||||
event.o: event.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/object.h ../include/common.h ../include/char_base.h \
|
||||
../include/skill.h ../include/util.h /usr/include/sys/time.h \
|
||||
/usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/map_warppoint.h \
|
||||
../include/item.h ../include/readmap.h ../include/event.h \
|
||||
../include/npc_warp.h ../include/npc_npcenemy.h
|
||||
char_walk.o: char_walk.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
../include/common.h ../include/handletime.h /usr/include/sys/time.h \
|
||||
/usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h ../include/object.h ../include/char_base.h \
|
||||
../include/skill.h ../include/util.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/char_event.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/string.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/readmap.h ../include/map_deal.h \
|
||||
../include/npccreate.h ../include/encount.h ../include/npcutil.h \
|
||||
../include/battle.h
|
||||
encount.o: encount.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/string.h /usr/include/math.h \
|
||||
/usr/include/bits/huge_val.h /usr/include/bits/mathdef.h \
|
||||
/usr/include/bits/mathcalls.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/float.h \
|
||||
../include/common.h ../include/util.h /usr/include/sys/time.h \
|
||||
/usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/buf.h ../include/char_base.h \
|
||||
../include/skill.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/configfile.h ../include/encount.h \
|
||||
../include/enemy.h
|
||||
pet.o: pet.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/char_base.h ../include/skill.h ../include/common.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/object.h ../include/readmap.h \
|
||||
../include/map_deal.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/string.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/handletime.h ../include/pet.h \
|
||||
../include/battle.h ../include/petmail.h ../include/log.h
|
||||
enemy.o: enemy.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/string.h ../include/common.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/buf.h ../include/char_base.h \
|
||||
../include/skill.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/configfile.h ../include/encount.h \
|
||||
../include/enemy.h ../include/pet.h ../include/enemyexptbl.h \
|
||||
../include/petmail.h ../include/battle.h ../include/pet_skillinfo.h \
|
||||
../include/anim_tbl.h
|
||||
pet_event.o: pet_event.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/common.h ../include/object.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/bits/time.h ../include/title.h \
|
||||
../include/addressbook.h ../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/configfile.h ../include/handletime.h \
|
||||
../include/pet_event.h ../include/npcutil.h ../include/log.h
|
||||
char_talk.o: char_talk.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/string.h ../include/readmap.h ../include/common.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
|
||||
../include/object.h ../include/char.h ../include/char_base.h \
|
||||
../include/skill.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/chatmagic.h ../include/battle.h ../include/log.h \
|
||||
../include/configfile.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/strings.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h \
|
||||
../include/family.h
|
||||
char_party.o: char_party.c /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/readmap.h ../include/common.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/object.h ../include/char.h \
|
||||
../include/char_base.h ../include/skill.h ../include/title.h \
|
||||
../include/addressbook.h ../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/battle.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/string.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/npcutil.h ../include/npc_bus.h \
|
||||
../include/init.h
|
||||
char_item.o: char_item.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/readmap.h ../include/common.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/map_deal.h ../include/object.h \
|
||||
../include/char.h ../include/char_base.h ../include/skill.h \
|
||||
../include/title.h ../include/addressbook.h ../include/net.h \
|
||||
/usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/string.h /usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/handletime.h ../include/log.h \
|
||||
../include/item_event.h ../include/battle.h
|
||||
petmail.o: petmail.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
../include/configfile.h ../include/common.h ../include/buf.h \
|
||||
../include/char_base.h ../include/skill.h ../include/util.h \
|
||||
/usr/include/sys/time.h /usr/include/time.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/stdlib.h \
|
||||
/usr/include/sys/types.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/alloca.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char.h ../include/char_data.h \
|
||||
../include/item.h ../include/battle.h ../include/handletime.h \
|
||||
../include/map_deal.h ../include/lssproto_serv.h \
|
||||
../include/lssproto_util.h /usr/include/string.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/pet.h ../include/petmail.h \
|
||||
../include/npcutil.h ../include/log.h
|
||||
trade.o: trade.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/string.h /usr/include/ctype.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h ../include/readmap.h ../include/common.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
|
||||
../include/object.h ../include/char.h ../include/char_base.h \
|
||||
../include/skill.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/npcutil.h ../include/trade.h \
|
||||
../include/log.h ../include/handletime.h ../include/buf.h \
|
||||
../include/battle.h ../include/npc_bus.h ../include/char_talk.h
|
||||
family.o: family.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h \
|
||||
/usr/include/bits/types.h /usr/include/libio.h \
|
||||
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
|
||||
/usr/include/string.h /usr/include/ctype.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h ../include/readmap.h ../include/common.h \
|
||||
../include/util.h /usr/include/sys/time.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/stdlib.h /usr/include/sys/types.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/alloca.h \
|
||||
../include/object.h ../include/char.h ../include/char_base.h \
|
||||
../include/skill.h ../include/title.h ../include/addressbook.h \
|
||||
../include/net.h /usr/include/netinet/in.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h \
|
||||
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/signal.h \
|
||||
/usr/include/bits/signum.h /usr/include/bits/siginfo.h \
|
||||
/usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h \
|
||||
/usr/include/asm/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
../include/link.h ../include/char_data.h ../include/item.h \
|
||||
../include/lssproto_serv.h ../include/lssproto_util.h \
|
||||
/usr/include/strings.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h ../include/saacproto_cli.h \
|
||||
../include/saacproto_util.h ../include/npcutil.h ../include/family.h \
|
||||
../include/log.h ../include/handletime.h ../include/buf.h \
|
||||
../include/battle.h ../include/npc_bus.h ../include/char_talk.h
|
627
gmsv/char/pet.c
Normal file
627
gmsv/char/pet.c
Normal file
@ -0,0 +1,627 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include "char_base.h"
|
||||
#include "char.h"
|
||||
#include "object.h"
|
||||
#include "readmap.h"
|
||||
#include "map_deal.h"
|
||||
#include "lssproto_serv.h"
|
||||
#include "handletime.h"
|
||||
#include "pet.h"
|
||||
#include "battle.h"
|
||||
#include "petmail.h"
|
||||
#include "log.h"
|
||||
#ifdef _MARKET_TRADE
|
||||
#include "item_trade.h"
|
||||
#endif
|
||||
#include "function.h"
|
||||
/*
|
||||
* 矢永玄质 卞楮允月末□旦
|
||||
*/
|
||||
/*------------------------------------------------------------------------
|
||||
* 矢永玄毛ㄠ勾喃曰癫化月[犯田永弘迕[
|
||||
* CHAR厌瞻 卞及心综岳今木月[
|
||||
* 曰袄“综岳今木凶平乓仿index 撩 “-1
|
||||
*-----------------------------------------------------------------------*/
|
||||
int PET_DEBUG_initPetOne( int charaindex)
|
||||
{
|
||||
Char ch;
|
||||
int havepetindex;
|
||||
int index;
|
||||
/* 矢永玄毛 化月井譬屯月 */
|
||||
havepetindex = CHAR_getCharPetElement( charaindex) ;
|
||||
|
||||
memset( &ch, 0, sizeof( ch));
|
||||
if( !CHAR_getDefaultChar( &ch,31010 ) )return -1;
|
||||
|
||||
/* 飓 寞 */
|
||||
ch.data[CHAR_BASEBASEIMAGENUMBER]
|
||||
= ch.data[CHAR_BASEIMAGENUMBER] = 30008;
|
||||
ch.data[CHAR_WHICHTYPE] = CHAR_TYPEPET;
|
||||
/* 猾 */
|
||||
ch.workint[CHAR_WORKATTACKPOWER] = 100;
|
||||
/* 潮 */
|
||||
ch.workint[CHAR_WORKDEFENCEPOWER] = 50;
|
||||
/* HP */
|
||||
ch.data[CHAR_HP] = 100;
|
||||
/* 蟆 */
|
||||
strcpysafe( ch.string[CHAR_NAME].string, 32, "宠物1" );
|
||||
|
||||
/* CHAR卞喃曰癫化月 */
|
||||
index = PET_initCharOneArray( &ch);
|
||||
|
||||
if( index < 0 ) return -1;
|
||||
|
||||
/* 仍潜谛本永玄 */
|
||||
CHAR_setWorkInt( index, CHAR_WORKPLAYERINDEX, charaindex);
|
||||
CHAR_setWorkInt( index,CHAR_WORKOBJINDEX,-1);
|
||||
CHAR_setCharPet( charaindex, havepetindex, index);
|
||||
CHAR_setInt( index, CHAR_SLOT, 2);
|
||||
return havepetindex;
|
||||
}
|
||||
|
||||
static int _PET_dropPet( int charaindex, int havepetindex, int tofl, int tox, int toy)
|
||||
{
|
||||
char szPet[128];
|
||||
int dirx[9],diry[9];
|
||||
int i, j;
|
||||
int objindex=-1;
|
||||
int floor,x,y;
|
||||
int petindex;
|
||||
int count_chara =0, count_item =0;
|
||||
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE)
|
||||
!= BATTLE_CHARMODE_NONE) return FALSE;
|
||||
petindex = CHAR_getCharPet(charaindex,havepetindex);
|
||||
if( !CHAR_CHECKINDEX( petindex )) return FALSE;
|
||||
if( !CHAR_CHECKINDEX( charaindex ) )return FALSE;
|
||||
if( CHAR_CHECKINDEX( petindex) == FALSE ) return FALSE;
|
||||
|
||||
#ifdef _AVID_TRADETRYBUG //丢出宠物
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKTRADEMODE) == CHAR_TRADE_TRADING ){
|
||||
CHAR_talkToCli( charaindex, -1, "交易状态中无法丢出宠物。", CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
// CoolFish: Family 2001/6/13
|
||||
if (CHAR_getInt(petindex, CHAR_PETFAMILY) == 1){
|
||||
CHAR_talkToCli(charaindex, -1, "家族守护兽无法丢出!", CHAR_COLORYELLOW);
|
||||
return FALSE;
|
||||
}
|
||||
if (CHAR_getInt(charaindex, CHAR_RIDEPET) == havepetindex ){
|
||||
CHAR_talkToCli(charaindex, -1, "骑乘中的宠物无法丢出!", CHAR_COLORYELLOW);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef _DROPCHECK2
|
||||
|
||||
floor = CHAR_getInt( charaindex, CHAR_FLOOR);
|
||||
x = CHAR_getInt( charaindex, CHAR_X);
|
||||
y = CHAR_getInt( charaindex, CHAR_Y);
|
||||
|
||||
for( i = x-CHAR_DEFAULTSEESIZ/2 ; i <= x+CHAR_DEFAULTSEESIZ/2 ; i++ ){
|
||||
for( j = y-CHAR_DEFAULTSEESIZ/2 ; j <= y+CHAR_DEFAULTSEESIZ/2 ; j ++ ){
|
||||
OBJECT object;
|
||||
for( object = MAP_getTopObj(floor,i,j); object ; object = NEXT_OBJECT(object ) ) {
|
||||
int objindex = GET_OBJINDEX(object);
|
||||
if( OBJECT_getType(objindex) == OBJTYPE_NOUSE ) continue;
|
||||
|
||||
if( OBJECT_getType(objindex) == OBJTYPE_CHARA ) {
|
||||
count_chara++;
|
||||
}
|
||||
if( OBJECT_getType(objindex) == OBJTYPE_ITEM || OBJECT_getType(objindex) == OBJTYPE_GOLD ) {
|
||||
count_item++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( count_item > 80 || count_chara > 80 ) {
|
||||
CHAR_talkToCli( charaindex, -1, "这里已经太拥挤了,不能再丢了。", CHAR_COLORYELLOW );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
if( tofl == -1 ) {
|
||||
for( i = 0 ; i < 7 ; i ++ ){
|
||||
dirx[i+2] = CHAR_getDX(CHAR_getInt(charaindex,CHAR_DIR) + i+1);
|
||||
diry[i+2] = CHAR_getDY(CHAR_getInt(charaindex,CHAR_DIR) + i+1);
|
||||
}
|
||||
dirx[0] = CHAR_getDX(CHAR_getInt(charaindex,CHAR_DIR));
|
||||
diry[0] = CHAR_getDY(CHAR_getInt(charaindex,CHAR_DIR));
|
||||
dirx[1] = 0;
|
||||
diry[1] = 0;
|
||||
floor = CHAR_getInt( charaindex,CHAR_FLOOR );
|
||||
for( i = 0 ; i < 9 ; i ++ ){
|
||||
int x=CHAR_getInt(charaindex,CHAR_X)+dirx[i];
|
||||
int y=CHAR_getInt(charaindex,CHAR_Y)+diry[i];
|
||||
if( PET_isPutPoint( floor, x, y ) == TRUE ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i == 9 ) i = 1;
|
||||
x=CHAR_getInt(charaindex,CHAR_X)+dirx[i];
|
||||
y=CHAR_getInt(charaindex,CHAR_Y)+diry[i];
|
||||
}else {
|
||||
if( MAP_walkAbleFromPoint( tofl,tox,toy, FALSE ) == FALSE ) {
|
||||
print( "map walkable err %s:%d\n", __FILE__,__LINE__);
|
||||
return FALSE;
|
||||
}
|
||||
floor = tofl;
|
||||
x = tox;
|
||||
y = toy;
|
||||
}
|
||||
#ifdef _MARKET_TRADE
|
||||
if( MAP_TRADEPETDROP( charaindex, petindex, floor, x, y) == TRUE )
|
||||
return TRUE;
|
||||
#endif
|
||||
objindex = PET_dropPetAbsolute( petindex,floor,x,y, FALSE );
|
||||
if( objindex == -1 ) return FALSE;
|
||||
|
||||
CHAR_setWorkInt( petindex,CHAR_WORKOBJINDEX,objindex );
|
||||
CHAR_setCharPet( charaindex, havepetindex, -1);
|
||||
CHAR_setInt( petindex, CHAR_FLOOR, floor);
|
||||
CHAR_setInt( petindex, CHAR_X, x);
|
||||
CHAR_setInt( petindex, CHAR_Y, y);
|
||||
CHAR_setInt( petindex, CHAR_PUTPETTIME, NowTime.tv_sec);
|
||||
if( havepetindex == CHAR_getInt( charaindex, CHAR_DEFAULTPET)) {
|
||||
int fd;
|
||||
CHAR_setInt( charaindex, CHAR_DEFAULTPET, -1);
|
||||
fd = getfdFromCharaIndex( charaindex);
|
||||
lssproto_KS_send( fd, havepetindex, 0);
|
||||
|
||||
}
|
||||
CHAR_sendCToArroundCharacter( objindex);
|
||||
|
||||
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER) {
|
||||
snprintf( szPet, sizeof( szPet ), "K%d", havepetindex );
|
||||
CHAR_sendStatusString( charaindex, szPet );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 泫 矢永玄毛 仁
|
||||
* 娄醒
|
||||
* itemindex int 失奶 丞奶件犯永弁旦
|
||||
* floor int 白夫失ID
|
||||
* x int x甄
|
||||
* y int y甄
|
||||
* net BOOL 生永玄伐□弁及仇午毛允月井升丹井
|
||||
* 忒曰袄
|
||||
* 岳 objindex
|
||||
* 撩 -1
|
||||
------------------------------------------------------------*/
|
||||
int PET_dropPetAbsolute( int petindex, int floor, int x, int y,BOOL net)
|
||||
{
|
||||
Object object;
|
||||
int objindex;
|
||||
|
||||
if( !CHAR_CHECKINDEX(petindex) )return FALSE;
|
||||
|
||||
object.type = OBJTYPE_CHARA;
|
||||
object.index = petindex;
|
||||
object.x = x;
|
||||
object.y = y;
|
||||
object.floor = floor;
|
||||
|
||||
/* 左皮斥尼弁玄瓒 允月 */
|
||||
objindex = initObjectOne( &object );
|
||||
|
||||
/* 生永玄伐□弁白仿弘互凶匀化中月午五反允月 by ringo*/
|
||||
if( net )
|
||||
CHAR_sendWatchEvent( objindex,CHAR_ACTSTAND,NULL,0,TRUE);
|
||||
|
||||
return objindex;
|
||||
}
|
||||
|
||||
BOOL PET_isPutPoint( int fl,int x, int y)
|
||||
{
|
||||
OBJECT object;
|
||||
if( MAP_walkAbleFromPoint( fl,x,y, FALSE ) == FALSE )
|
||||
return FALSE;
|
||||
for( object=MAP_getTopObj(fl,x,y) ;
|
||||
object ;
|
||||
object = NEXT_OBJECT(object ) )
|
||||
{
|
||||
int objindex = GET_OBJINDEX(object);
|
||||
switch( OBJECT_getType(objindex) ){
|
||||
case OBJTYPE_NOUSE:
|
||||
break;
|
||||
case OBJTYPE_ITEM:
|
||||
case OBJTYPE_GOLD:
|
||||
case OBJTYPE_CHARA:
|
||||
return FALSE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int PET_dropPet( int charaindex, int havepetindex)
|
||||
{
|
||||
int petindex;
|
||||
petindex = CHAR_getCharPet(charaindex,havepetindex);
|
||||
if( !CHAR_CHECKINDEX( petindex )) return FALSE;
|
||||
|
||||
if( _PET_dropPet( charaindex, havepetindex, -1,-1,-1) == TRUE ){
|
||||
LogPet(
|
||||
CHAR_getChar( charaindex, CHAR_NAME ), /* 平乓仿 */
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY ),
|
||||
CHAR_getChar( petindex, CHAR_NAME),
|
||||
CHAR_getInt( petindex, CHAR_LV),
|
||||
"Drop(丢宠)",
|
||||
CHAR_getInt( charaindex,CHAR_FLOOR),
|
||||
CHAR_getInt( charaindex,CHAR_X ),
|
||||
CHAR_getInt( charaindex,CHAR_Y ),
|
||||
CHAR_getChar( petindex, CHAR_UNIQUECODE) // shan 2001/12/14
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int PET_dropPetFLXY( int charaindex, int havepetindex, int fl, int x, int y)
|
||||
{
|
||||
return _PET_dropPet( charaindex, havepetindex, fl,x,y);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 矢永玄迕及奶矛件玄楮醒毛本永玄仄化支月
|
||||
------------------------------------------------------------*/
|
||||
int PET_initCharOneArray( Char *ch)
|
||||
{
|
||||
int i;
|
||||
char *tmp[CHAR_FUNCTABLENUM] = {
|
||||
"", /* CHAR_INITFUNC */
|
||||
"", /* CHAR_WALKPREFUNC */
|
||||
"", /* CHAR_WALKPOSTFUNC */
|
||||
"", /* CHAR_PREOVERFUNC */
|
||||
"", /* CHAR_PREOVERFUNC */
|
||||
"core_PetWatch", /* CHAR_WATCHFUNC */
|
||||
"", /* CHAR_LOOPFUNC */
|
||||
"", /* CHAR_DYINGFUNC */
|
||||
"core_PetTalk", /* CHAR_TALKEDFUNC */
|
||||
"", /* CHAR_PREATTACKEDFUNC */
|
||||
"", /* CHAR_POSTATTACKEDFUNC */
|
||||
"", /* CHAR_OFFFUNC */
|
||||
"", /* CHAR_LOOKEDFUNC */
|
||||
"", /* CHAR_ITEMPUTFUNC */
|
||||
"", /* CHAR_SPECIALTALKEDFUNC */
|
||||
"", /* CHAR_WINDOWTALKEDFUNC */
|
||||
#ifdef _USER_CHARLOOPS
|
||||
"", // CHAR_LOOPFUNCTEMP1,
|
||||
"", // CHAR_LOOPFUNCTEMP2,
|
||||
"", //CHAR_BATTLEPROPERTY,
|
||||
#endif
|
||||
};
|
||||
for( i = 0; i < CHAR_FUNCTABLENUM; i ++ ) {
|
||||
strcpysafe( ch->charfunctable[i].string,
|
||||
sizeof( ch->charfunctable[i]),
|
||||
tmp[i]);
|
||||
}
|
||||
if( ch->data[CHAR_MAILMODE] != CHAR_PETMAIL_NONE ) {
|
||||
strcpysafe( ch->charfunctable[CHAR_LOOPFUNC].string,
|
||||
sizeof( ch->charfunctable[CHAR_LOOPFUNC]), "PETMAIL_Loop");
|
||||
|
||||
}
|
||||
#ifdef _USER_CHARLOOPS
|
||||
if( ch->data[CHAR_FUSIONBEIT] == 1 &&
|
||||
ch->data[CHAR_FUSIONRAISE] > 0 ) {
|
||||
//andy_log
|
||||
// print("init CHAR_LOOPFUNCTEMP1:%s \n", "PET_CheckIncubateLoop");
|
||||
|
||||
strcpysafe( ch->charfunctable[CHAR_LOOPFUNCTEMP1].string,
|
||||
sizeof( ch->charfunctable[CHAR_LOOPFUNCTEMP1]), "PET_CheckIncubateLoop");
|
||||
ch->data[CHAR_LOOPINTERVAL] = 60000;
|
||||
|
||||
ch->functable[CHAR_LOOPFUNCTEMP1]
|
||||
= getFunctionPointerFromName( "PET_CheckIncubateLoop");
|
||||
|
||||
// CHAR_constructFunctable( petindex);
|
||||
}
|
||||
#endif
|
||||
return( CHAR_initCharOneArray( ch));
|
||||
}
|
||||
|
||||
int PET_createPetFromCharaIndex( int charaindex, int enemyindex)
|
||||
{
|
||||
Char CharNew;
|
||||
int newindex;
|
||||
int havepetelement;
|
||||
char szPet[128];
|
||||
int i;
|
||||
|
||||
havepetelement = CHAR_getCharPetElement( charaindex);
|
||||
if( havepetelement < 0 ) return -1;
|
||||
memset( &CharNew, 0, sizeof( Char ) );
|
||||
if( !CHAR_getDefaultChar( &CharNew,31010 ) )return -1;
|
||||
CharNew.data[CHAR_BASEBASEIMAGENUMBER]
|
||||
= CharNew.data[CHAR_BASEIMAGENUMBER] = CHAR_getInt(enemyindex,CHAR_BASEIMAGENUMBER);
|
||||
CharNew.data[CHAR_WHICHTYPE] = CHAR_TYPEPET;
|
||||
CharNew.data[CHAR_HP] = CHAR_getInt(enemyindex, CHAR_HP);
|
||||
CharNew.data[CHAR_MP] = CHAR_getInt(enemyindex, CHAR_MP);
|
||||
CharNew.data[CHAR_MAXMP] = CHAR_getInt(enemyindex, CHAR_MAXMP);
|
||||
CharNew.data[CHAR_VITAL] = CHAR_getInt(enemyindex, CHAR_VITAL);
|
||||
CharNew.data[CHAR_STR] = CHAR_getInt(enemyindex, CHAR_STR);
|
||||
CharNew.data[CHAR_TOUGH] = CHAR_getInt(enemyindex, CHAR_TOUGH);
|
||||
CharNew.data[CHAR_DEX] = CHAR_getInt(enemyindex, CHAR_DEX);
|
||||
CharNew.data[CHAR_LUCK] = CHAR_getInt(enemyindex, CHAR_LUCK);
|
||||
CharNew.data[CHAR_FIREAT] = CHAR_getInt(enemyindex, CHAR_FIREAT);
|
||||
CharNew.data[CHAR_WATERAT] = CHAR_getInt(enemyindex, CHAR_WATERAT);
|
||||
CharNew.data[CHAR_EARTHAT] = CHAR_getInt(enemyindex, CHAR_EARTHAT);
|
||||
CharNew.data[CHAR_WINDAT] = CHAR_getInt(enemyindex, CHAR_WINDAT);
|
||||
//CharNew.data[CHAR_EXP] = CHAR_getInt(enemyindex, CHAR_EXP);
|
||||
|
||||
CharNew.data[CHAR_SLOT] = CHAR_getInt(enemyindex, CHAR_SLOT);
|
||||
CharNew.data[CHAR_MODAI] = CHAR_getInt(enemyindex, CHAR_MODAI);
|
||||
CharNew.data[CHAR_LV] = CHAR_getInt(enemyindex, CHAR_LV);
|
||||
CharNew.data[CHAR_POISON] = CHAR_getInt(enemyindex, CHAR_POISON);
|
||||
CharNew.data[CHAR_PARALYSIS]= CHAR_getInt(enemyindex, CHAR_PARALYSIS);
|
||||
CharNew.data[CHAR_SLEEP] = CHAR_getInt(enemyindex, CHAR_SLEEP);
|
||||
CharNew.data[CHAR_STONE] = CHAR_getInt(enemyindex, CHAR_STONE);
|
||||
CharNew.data[CHAR_DRUNK] = CHAR_getInt(enemyindex, CHAR_DRUNK);
|
||||
CharNew.data[CHAR_CONFUSION]= CHAR_getInt(enemyindex, CHAR_CONFUSION);
|
||||
CharNew.data[CHAR_RARE] = CHAR_getInt(enemyindex, CHAR_RARE);
|
||||
CharNew.data[CHAR_PETRANK] = CHAR_getInt(enemyindex, CHAR_PETRANK);
|
||||
CharNew.data[CHAR_PETID] = CHAR_getInt(enemyindex, CHAR_PETID);
|
||||
CharNew.data[CHAR_CRITIAL] = CHAR_getInt(enemyindex, CHAR_CRITIAL);
|
||||
CharNew.data[CHAR_COUNTER] = CHAR_getInt(enemyindex, CHAR_COUNTER);
|
||||
CharNew.data[CHAR_PETMAILEFFECT] = RAND(0, PETMAIL_EFFECTMAX);
|
||||
|
||||
for( i = 0; i < CHAR_MAXPETSKILLHAVE; i ++ ) {
|
||||
CharNew.unionTable.indexOfPetskill[i] = CHAR_getPetSkill( enemyindex, i);
|
||||
}
|
||||
CharNew.data[CHAR_ALLOCPOINT] = CHAR_getInt(enemyindex, CHAR_ALLOCPOINT);
|
||||
strcpysafe( CharNew.string[CHAR_NAME].string,
|
||||
sizeof(CharNew.string[CHAR_NAME].string),
|
||||
CHAR_getChar( enemyindex, CHAR_NAME) );
|
||||
newindex = PET_initCharOneArray( &CharNew );
|
||||
if( newindex < 0 ){
|
||||
return -1;
|
||||
}
|
||||
|
||||
CHAR_setMaxExpFromLevel( newindex, CHAR_getInt( enemyindex, CHAR_LV ));
|
||||
CHAR_complianceParameter( newindex );
|
||||
CHAR_setWorkInt( newindex, CHAR_WORKPLAYERINDEX, charaindex);
|
||||
CHAR_setCharPet( charaindex, havepetelement, newindex);
|
||||
CHAR_setChar( newindex, CHAR_OWNERCDKEY,
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY));
|
||||
CHAR_setChar( newindex, CHAR_OWNERCHARANAME,
|
||||
CHAR_getChar( charaindex, CHAR_NAME));
|
||||
snprintf( szPet, sizeof( szPet ), "K%d", havepetelement );
|
||||
CHAR_sendStatusString( charaindex, szPet );
|
||||
snprintf( szPet, sizeof( szPet ), "W%d", havepetelement );
|
||||
CHAR_sendStatusString( charaindex, szPet );
|
||||
|
||||
return newindex;
|
||||
|
||||
}
|
||||
BOOL PET_SelectBattleEntryPet( int charaindex, int petarray)
|
||||
{
|
||||
int pindex;
|
||||
/* 爵 反轮仁 仿弘匹仇木卞娄匀井井月第 岭丐曰 */
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE)
|
||||
!= BATTLE_CHARMODE_NONE) return FALSE;
|
||||
/* -1及桦宁反]-1卞仄化本永玄仄化蔽歹曰[*/
|
||||
if( petarray == -1 ) {
|
||||
CHAR_setInt( charaindex, CHAR_DEFAULTPET, -1 );
|
||||
return TRUE;
|
||||
}
|
||||
if( !CHAR_CHECKPETINDEX( petarray)) return FALSE;
|
||||
pindex = CHAR_getCharPet( charaindex, petarray );
|
||||
if( !CHAR_CHECKINDEX( pindex)) return FALSE;
|
||||
|
||||
if( CHAR_getFlg( pindex, CHAR_ISDIE )) return FALSE;
|
||||
|
||||
CHAR_setInt( charaindex, CHAR_DEFAULTPET, petarray );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Robin 0707 petFollow <charaindex>
|
||||
#if 1
|
||||
int PET_dropPetFollow( int charaindex, int havepetindex, int tofl, int tox, int toy)
|
||||
{
|
||||
char szPet[128];
|
||||
int dirx[9],diry[9];
|
||||
int i;
|
||||
int objindex=-1;
|
||||
int floor,x,y;
|
||||
int petindex;
|
||||
|
||||
if( CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE)
|
||||
!= BATTLE_CHARMODE_NONE) return FALSE;
|
||||
petindex = CHAR_getCharPet(charaindex,havepetindex);
|
||||
if( petindex == -1 ) return FALSE;
|
||||
if( !CHAR_CHECKINDEX( charaindex ) )return FALSE;
|
||||
if( CHAR_CHECKINDEX( petindex) == FALSE ) return FALSE;
|
||||
|
||||
if (CHAR_getInt(petindex, CHAR_PETFAMILY) == 1){
|
||||
CHAR_talkToCli(charaindex, -1, "家族守护兽无法丢出!", CHAR_COLORYELLOW);
|
||||
return FALSE;
|
||||
}
|
||||
if (CHAR_getInt(charaindex, CHAR_RIDEPET) == havepetindex){
|
||||
CHAR_talkToCli(charaindex, -1, "骑乘中的宠物无法跟随!", CHAR_COLORYELLOW);
|
||||
return FALSE;
|
||||
}
|
||||
if( tofl == -1 ) {
|
||||
for( i = 0 ; i < 7 ; i ++ ){
|
||||
dirx[i+2] = CHAR_getDX(CHAR_getInt(charaindex,CHAR_DIR) + i+1);
|
||||
diry[i+2] = CHAR_getDY(CHAR_getInt(charaindex,CHAR_DIR) + i+1);
|
||||
}
|
||||
dirx[0] = CHAR_getDX(CHAR_getInt(charaindex,CHAR_DIR));
|
||||
diry[0] = CHAR_getDY(CHAR_getInt(charaindex,CHAR_DIR));
|
||||
dirx[1] = 0;
|
||||
diry[1] = 0;
|
||||
|
||||
floor = CHAR_getInt( charaindex,CHAR_FLOOR );
|
||||
for( i = 0 ; i < 9 ; i ++ ){
|
||||
int x=CHAR_getInt(charaindex,CHAR_X)+dirx[i];
|
||||
int y=CHAR_getInt(charaindex,CHAR_Y)+diry[i];
|
||||
if( PET_isPutPoint( floor, x, y ) == TRUE ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i == 9 ) i = 1;
|
||||
|
||||
x=CHAR_getInt(charaindex,CHAR_X)+dirx[i];
|
||||
y=CHAR_getInt(charaindex,CHAR_Y)+diry[i];
|
||||
}
|
||||
else {
|
||||
if( MAP_walkAbleFromPoint( tofl,tox,toy, FALSE ) == FALSE ) {
|
||||
print( "map walkable err %s:%d\n", __FILE__,__LINE__);
|
||||
return FALSE;
|
||||
}
|
||||
floor = tofl;
|
||||
x = tox;
|
||||
y = toy;
|
||||
}
|
||||
|
||||
objindex = PET_dropPetAbsolute( petindex,floor,x,y, FALSE );
|
||||
if( objindex == -1 ) return FALSE;
|
||||
|
||||
CHAR_setWorkInt( petindex,CHAR_WORKOBJINDEX,objindex );
|
||||
CHAR_setCharPet( charaindex, havepetindex, -1);
|
||||
CHAR_setInt( petindex, CHAR_FLOOR, floor);
|
||||
CHAR_setInt( petindex, CHAR_X, x);
|
||||
CHAR_setInt( petindex, CHAR_Y, y);
|
||||
CHAR_setInt( petindex, CHAR_PUTPETTIME, NowTime.tv_sec);
|
||||
if( havepetindex == CHAR_getInt( charaindex, CHAR_DEFAULTPET)) {
|
||||
int fd;
|
||||
CHAR_setInt( charaindex, CHAR_DEFAULTPET, -1);
|
||||
fd = getfdFromCharaIndex( charaindex);
|
||||
lssproto_KS_send( fd, havepetindex, 0);
|
||||
|
||||
}
|
||||
CHAR_sendCToArroundCharacter( objindex);
|
||||
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER) {
|
||||
snprintf( szPet, sizeof( szPet ), "K%d", havepetindex );
|
||||
CHAR_sendStatusString( charaindex, szPet );
|
||||
}
|
||||
|
||||
CHAR_setWorkInt( charaindex, CHAR_WORKPETFOLLOW, petindex);
|
||||
CHAR_setWorkInt( petindex, CHAR_WORKPETFOLLOWMODE, CHAR_PETFOLLOW_NOW);
|
||||
CHAR_setWorkInt( petindex, CHAR_WORKPETFOLLOWCOUNT, 0);
|
||||
CHAR_setInt( petindex, CHAR_PUTPETTIME, (int)(NowTime.tv_sec));
|
||||
CHAR_setInt( petindex, CHAR_WORKPLAYERINDEX, charaindex);
|
||||
LogPet(
|
||||
CHAR_getChar( charaindex, CHAR_NAME ),
|
||||
CHAR_getChar( charaindex, CHAR_CDKEY ),
|
||||
CHAR_getChar( petindex, CHAR_NAME),
|
||||
CHAR_getInt( petindex, CHAR_LV),
|
||||
"Follow(溜宠)",
|
||||
CHAR_getInt( charaindex,CHAR_FLOOR),
|
||||
CHAR_getInt( charaindex,CHAR_X ),
|
||||
CHAR_getInt( charaindex,CHAR_Y ),
|
||||
CHAR_getChar( petindex, CHAR_UNIQUECODE)
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL PET_getBaseForAllocpoint( int toindex, int *work)
|
||||
{
|
||||
int LevelUpPoint=0;
|
||||
if( CHAR_getInt( toindex, CHAR_WHICHTYPE) != CHAR_TYPEPET)
|
||||
return FALSE;
|
||||
LevelUpPoint = CHAR_getInt( toindex, CHAR_ALLOCPOINT );
|
||||
work[3] =(( LevelUpPoint >> 24 ) & 0xFF);
|
||||
work[0] = (( LevelUpPoint >> 16 ) & 0xFF);
|
||||
work[1] = (( LevelUpPoint >> 8 ) & 0xFF);
|
||||
work[2] = (( LevelUpPoint >> 0 ) & 0xFF);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void PET_showEditBaseMsg( int charaindex, int toindex, int itemindex, int *work)
|
||||
{
|
||||
int i, maxnums = 6000;
|
||||
char buf1[256];
|
||||
char buf2[][32]={"腕力成长率","耐久力成长率","速度成长率","体力成长率","能力"};
|
||||
char buf3[][32]={"大幅提高","略为提高","略为减少"};
|
||||
|
||||
if( CHAR_getInt( toindex, CHAR_WHICHTYPE) != CHAR_TYPEPET)
|
||||
return;
|
||||
memset( buf1, 0, sizeof( buf1));
|
||||
|
||||
for( i=0; i<4; i++) {
|
||||
int type = ITEM_getInt( itemindex, (ITEM_MODIFYATTACK + i));
|
||||
print(" [%d]%d+%d ", i, work[i], type);
|
||||
work[i] += type;
|
||||
strcpy( buf1,"\0");
|
||||
if( work[i] > maxnums ) {
|
||||
sprintf(buf1,"%s 已经达到最高了。", buf2[i]);
|
||||
work[i] = maxnums;
|
||||
}else if( work[i] < 0 ) {
|
||||
sprintf(buf1,"%s 已经为零了。", buf2[i]);
|
||||
work[i] = 0;
|
||||
}else {
|
||||
if( type > 0 ) {
|
||||
if( type > 2 ) {
|
||||
sprintf(buf1,"%s %s %s", buf2[i], buf3[0], "。");
|
||||
}else {
|
||||
sprintf(buf1,"%s %s %s", buf2[i], buf3[1], "。");
|
||||
}
|
||||
}else if( type < 0 ){
|
||||
sprintf(buf1,"%s %s %s", buf2[i], buf3[2], "。");
|
||||
}
|
||||
}
|
||||
if( strcmp( buf1, "\0")) {
|
||||
CHAR_talkToCli( charaindex, toindex, buf1, CHAR_COLORYELLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _PET_EVOLUTION
|
||||
BOOL PET_getBaseAndSkill( int charaindex, int baseindex, int *base, int *skill, int flg)
|
||||
{
|
||||
int i;
|
||||
if( !CHAR_CHECKINDEX( baseindex)) return FALSE;
|
||||
if( base != NULL ) {
|
||||
int levelup = CHAR_getInt( baseindex, CHAR_ALLOCPOINT);
|
||||
base[0] = ((levelup>>24) & 0xFF);
|
||||
base[1] = ((levelup>>16) & 0xFF);
|
||||
base[2] = ((levelup>> 8) & 0xFF);
|
||||
base[3] = ((levelup>> 0) & 0xFF);
|
||||
}
|
||||
|
||||
if( skill != NULL ) {
|
||||
for( i=0; i<CHAR_MAXPETSKILLHAVE; i++) {
|
||||
skill[i] = CHAR_getPetSkill( baseindex, i);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
BOOL CHAR_DelPetForIndex( int charaindex, int petindex)
|
||||
{
|
||||
int i;
|
||||
for( i=0; i<CHAR_MAXPETHAVE; i++) {
|
||||
int pindex = CHAR_getCharPet( charaindex, i);
|
||||
if( !CHAR_CHECKINDEX( pindex) ) continue;
|
||||
if( pindex == petindex )
|
||||
break;
|
||||
}
|
||||
|
||||
if( i >= CHAR_MAXPETHAVE){
|
||||
return FALSE;
|
||||
}else {
|
||||
char szPet[256];
|
||||
char msgbuf[256];
|
||||
CHAR_setCharPet( charaindex, i, -1);
|
||||
snprintf( szPet, sizeof( szPet ), "K%d", i);
|
||||
CHAR_sendStatusString( charaindex, szPet );
|
||||
|
||||
snprintf( msgbuf,sizeof( msgbuf), "交出%s。", CHAR_getChar( petindex, CHAR_NAME));
|
||||
CHAR_talkToCli( charaindex, -1, msgbuf, CHAR_COLORYELLOW);
|
||||
CHAR_endCharOneArray( petindex );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
938
gmsv/char/pet_event.c
Normal file
938
gmsv/char/pet_event.c
Normal file
@ -0,0 +1,938 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "object.h"
|
||||
#include "char_base.h"
|
||||
#include "char.h"
|
||||
#include "configfile.h"
|
||||
#include "handletime.h"
|
||||
#include "pet_event.h"
|
||||
#include "npcutil.h"
|
||||
#include "log.h"
|
||||
#include "lssproto_serv.h"
|
||||
// Arminius 8.14 pet talk
|
||||
#include <string.h>
|
||||
#include "npc_exchangeman.h"
|
||||
#include "npc_eventaction.h"
|
||||
|
||||
#ifdef _MARKET_TRADE
|
||||
#include "item_trade.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef _PET_TALK
|
||||
//BOOL PetTalk_CheckFree( int meindex, int toindex, char *buf);
|
||||
BOOL PetTalk_CheckFree( int meindex, int talker, char *buf);
|
||||
|
||||
BOOL PetTalk_BSCheck(int meindex,int talker,char* buf);
|
||||
BOOL PetTalk_FreeIfCheck(int meindex,int talker,char* buf,int kosuu,int flg, int temp);
|
||||
BOOL PetTalk_WarpManReduce(int meindex,int talker,char *buf);
|
||||
BOOL PetTalk_BigSmallLastCheck(int point1,int mypoint,int flg);
|
||||
BOOL PetTalk_CheckTrans(int meindex,int talker,int trans,int flg);
|
||||
BOOL PetTalk_LevelCheck(int meindex,int talker,int level,int flg);
|
||||
BOOL PetTalk_CheckMyPet( int meindex, int talker, int petLv, int flg, int petid);
|
||||
BOOL PetTalk_ItemCheck(int meindex,int talker,int itemNo,int flg);
|
||||
BOOL PetTalk_CheckMyType( int meindex, int toindex, int kosuu, int flg, int Type );
|
||||
BOOL PetTalk_CheckPetEvent( int meindex, int toindex, char *buf);
|
||||
void PetTalk_RequestMain(int meindex,int talker,char *buf);
|
||||
BOOL PetTalk_AddItem(int meindex, int talker, char *buf);
|
||||
BOOL PetTalk_DelItem(int meindex,int talker,char *buf);
|
||||
BOOL PetTalk_RunEvent( int meindex, int talker, char *buf);
|
||||
BOOL PetTalk_CheckMyFloor( int meindex, int talker, char *buf, int flg);
|
||||
#ifdef _PET_TALKBBI
|
||||
BOOL PET_CheckPlayerBBI( int meindex, int charindex, int BBI, int flg);
|
||||
#endif
|
||||
#ifdef _PET_TALKPRO
|
||||
#else
|
||||
char *Pet_TalkGetFunStr( char *temp , char *buf, int len)
|
||||
{
|
||||
char filename[56];
|
||||
char pathfile[128];
|
||||
char talkfun[ 10240];
|
||||
char buf1[256],buf2[256],buf3[256];
|
||||
FILE *petarg;
|
||||
char *cStr=NULL;
|
||||
int talkNo=1,mark=1;
|
||||
char line[4096];
|
||||
BOOL find=FALSE;
|
||||
talkfun[0] ='\0';
|
||||
|
||||
while( getStringFromIndexWithDelim( pettalktext,"&",talkNo, buf1, sizeof( buf1) ) != FALSE){
|
||||
talkNo++;
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf1, "PETTEMPNO", buf2, sizeof( buf2)) == NULL )
|
||||
continue;
|
||||
mark=2;
|
||||
strcpy( filename,"\0");
|
||||
while( getStringFromIndexWithDelim( buf2,",", mark,buf3,sizeof( buf3)) != FALSE ) {
|
||||
mark ++;
|
||||
if( !strcmp( buf3, temp)) {
|
||||
print("\n buf2=%s",buf2);
|
||||
if( getStringFromIndexWithDelim( buf2,",", 1,filename,sizeof( filename)) == FALSE )
|
||||
return NULL;
|
||||
find = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( find == TRUE )
|
||||
break;
|
||||
}
|
||||
if( !strcmp( filename, "\0") )
|
||||
return NULL;
|
||||
|
||||
sprintf( pathfile, "%s/pettalk/%s", getNpcdir(), filename);
|
||||
petarg = fopen( pathfile , "r" );
|
||||
if( petarg != NULL ) {
|
||||
while( fgets( line, sizeof( line), petarg ) ) {
|
||||
if( strlen( talkfun) != 0 ) {
|
||||
if( talkfun[strlen( talkfun) -1] != '|' ) {
|
||||
strcatsafe( talkfun, sizeof( talkfun), "|");
|
||||
}
|
||||
}
|
||||
chompex( line);
|
||||
strcatsafe( talkfun, sizeof( talkfun ), line);
|
||||
}
|
||||
fclose( petarg);
|
||||
}else {
|
||||
return NULL;
|
||||
}
|
||||
talkNo = 1;
|
||||
while( getStringFromIndexWithDelim( talkfun,"}",talkNo, buf, len) != FALSE) {
|
||||
talkNo++;
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf, "PETTEMPNO", buf2, sizeof( buf2)) == NULL )
|
||||
continue;
|
||||
if( !strcmp( temp, buf2) ) {
|
||||
cStr = buf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return( cStr);
|
||||
}
|
||||
#endif
|
||||
void PET_Talkfunc( int meindex, int talkerindex, char *msg, int color)
|
||||
{
|
||||
char buf2[1024], buf3[256];
|
||||
|
||||
char TalkType[][16]={"TALKRUN","EVENTRUN","BOTH"};
|
||||
char AllTalk[PETTALK_MAXID][1024];
|
||||
int Type=0,j,i;
|
||||
int talkNo=0;
|
||||
BOOL FREEs=FALSE;
|
||||
int buttontype = 0;
|
||||
int windowtype = 0;
|
||||
#ifdef _PET_TALKPRO
|
||||
int tPage=-1;
|
||||
#else
|
||||
int petid=-1;
|
||||
char tempNo[32], buf1[10240];
|
||||
#endif
|
||||
|
||||
int fd = getfdFromCharaIndex( talkerindex);
|
||||
#define RAND(x,y) ((x-1)+1+ (int)( (double)(y-(x-1))*rand()/(RAND_MAX+1.0)) )
|
||||
windowtype = WINDOW_MESSAGETYPE_MESSAGE;
|
||||
buttontype = WINDOW_BUTTONTYPE_OK;
|
||||
|
||||
if( NPC_Util_isFaceToFace( meindex ,talkerindex , 2) == FALSE) {
|
||||
if( NPC_Util_isFaceToChara( talkerindex, meindex, 1) == FALSE)
|
||||
return;
|
||||
}
|
||||
for( i = 0 ; i < 5 ; i++ ) {
|
||||
strcpy( AllTalk[i], "\0" );
|
||||
}
|
||||
|
||||
#ifdef _PET_TALKPRO
|
||||
for( i=0;i<PETTALK_MAXID;i++) {
|
||||
if( pettalktext[i].ID >=0 && pettalktext[i].ID == CHAR_getInt(meindex, CHAR_PETID) ) {
|
||||
if( strcmp( pettalktext[i].DATA, "\0") && strlen( pettalktext[i].DATA) > 0 ) {
|
||||
//snprintf( buf1, sizeof(buf1), pettalktext[i].DATA);
|
||||
tPage=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( i == PETTALK_MAXID )
|
||||
return;
|
||||
#else
|
||||
sprintf(tempNo,"%d", CHAR_getInt(meindex, CHAR_PETID));
|
||||
petid = CHAR_getInt(meindex, CHAR_PETID);
|
||||
if( Pet_TalkGetFunStr( tempNo , buf1 , sizeof( buf1) ) == NULL ) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if( CHAR_getInt( meindex, CHAR_LV ) >= CHAR_getInt( meindex, CHAR_LIMITLEVEL) ) {
|
||||
Type = 1;
|
||||
}
|
||||
//设定为非主人不得与PET互动
|
||||
if( strcmp( CHAR_getChar( meindex, CHAR_OWNERCDKEY), CHAR_getChar( talkerindex, CHAR_CDKEY) ) ||
|
||||
strcmp( CHAR_getChar( meindex, CHAR_OWNERCHARANAME), CHAR_getChar( talkerindex, CHAR_NAME) )){
|
||||
#ifdef _PET_TALKPRO
|
||||
if( NPC_Util_GetStrFromStrWithDelim( pettalktext[tPage].DATA, "NoPlayerMsg", buf3, sizeof( buf3)) != NULL ) {
|
||||
#else
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf1, "NoPlayerMsg", buf3, sizeof( buf3)) != NULL ) {
|
||||
#endif
|
||||
}else {
|
||||
sprintf(buf3,"陌生人?我不认识你呀!你是坏人!");
|
||||
}
|
||||
CHAR_talkToCli( talkerindex, meindex, buf3, color);
|
||||
return;
|
||||
}
|
||||
j=0;
|
||||
|
||||
#ifdef _PET_TALKPRO
|
||||
while( getStringFromIndexWithDelim( pettalktext[tPage].DATA,"OVER",talkNo, buf2, sizeof( buf2) ) != FALSE){
|
||||
#else
|
||||
while( getStringFromIndexWithDelim( buf1,"OVER",talkNo, buf2, sizeof( buf2) ) != FALSE){
|
||||
#endif
|
||||
talkNo++;
|
||||
if( ( strstr( buf2, TalkType[Type]) == NULL ) && ( strstr( buf2, TalkType[2]) == NULL ) )continue;
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf2, "FLOOR", buf3, sizeof( buf3)) != NULL ) {//判断房间号
|
||||
if( PetTalk_CheckMyFloor( meindex, talkerindex, buf3, 0) == FALSE )continue;
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf2, "PET", buf3, sizeof( buf3)) != NULL ) {//判断宠物FREE条件
|
||||
if( PetTalk_CheckFree( meindex, meindex, buf3) != TRUE ) continue;
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf2, "FREE", buf3, sizeof( buf3) ) == NULL)continue;
|
||||
if( NPC_ActionPassCheck( meindex, talkerindex, buf3) == FALSE ) continue;//判断玩家FREE条件
|
||||
|
||||
// if( ActionNpc_CheckFree( meindex, talkerindex, buf2, 0) == FALSE ) continue;
|
||||
|
||||
if( PetTalk_CheckPetEvent( meindex, talkerindex, buf2) == FALSE )continue;
|
||||
FREEs = TRUE; //条件成立
|
||||
strcpy( AllTalk[j++], buf2 );
|
||||
if( j > PETTALK_MAXID-1 ) break;
|
||||
}
|
||||
talkNo = 0;
|
||||
|
||||
if( FREEs == FALSE) { //如果全部条件都不成立
|
||||
j=0;
|
||||
#ifdef _PET_TALKPRO
|
||||
while( getStringFromIndexWithDelim( pettalktext[tPage].DATA,"OVER",talkNo, buf2, sizeof( buf2) ) != FALSE ){
|
||||
#else
|
||||
while( getStringFromIndexWithDelim( buf1,"OVER",talkNo, buf2, sizeof( buf2) ) != FALSE ){
|
||||
#endif
|
||||
talkNo ++;
|
||||
if( strstr( buf2, "OTHER") == NULL ) continue;
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf2, "TalkMsg", buf3, sizeof( buf3)) == NULL) continue;
|
||||
while( getStringFromIndexWithDelim( buf3,",",j+1, AllTalk[j], sizeof( AllTalk[j]) ) != FALSE ){
|
||||
j++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( j > 0 ) {
|
||||
strcpy( buf2, AllTalk[ RAND( 0, (j-1) ) ] );
|
||||
if( PetTalk_RunEvent( meindex, talkerindex, buf2) == FALSE ) {
|
||||
sprintf( buf3,"....!");
|
||||
CHAR_talkToCli( talkerindex, meindex, buf3, color);
|
||||
return;
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf2, "TalkMsg", buf3, sizeof( buf3)) == NULL) {
|
||||
//sprintf( buf3,"主人,我们去逛逛吧!");
|
||||
strcpy( buf3, buf2);
|
||||
}
|
||||
|
||||
lssproto_WN_send( fd, windowtype, buttontype, 0,
|
||||
CHAR_getWorkInt( meindex, CHAR_WORKOBJINDEX), buf3 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOL PetTalk_CheckMyFloor( int meindex, int talker, char *buf, int flg) {
|
||||
char buf1[16];
|
||||
int Myfloor=-1;
|
||||
Myfloor = CHAR_getInt( talker, CHAR_FLOOR);
|
||||
if( strstr( buf, "!") != NULL ) {
|
||||
getStringFromIndexWithDelim( buf,"!", 2, buf1, sizeof( buf1) );
|
||||
if( Myfloor == atoi( buf1) ) {
|
||||
return FALSE;
|
||||
}
|
||||
}else {
|
||||
if( Myfloor != atoi( buf) ) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_RunEvent( int meindex, int talker, char *buf)
|
||||
{
|
||||
char buf1[256];
|
||||
int LimitLevel = -1;
|
||||
|
||||
if( Action_RunDoEventAction( meindex, talker, buf) == FALSE )
|
||||
return FALSE;
|
||||
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf, "RandItem", buf1, sizeof( buf1)) != NULL ){
|
||||
if( RAND( 0, 10) > 9 ) {
|
||||
PetTalk_AddItem( meindex, talker, buf1);
|
||||
}else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf, "LimitLevel", buf1, sizeof( buf1)) != NULL ){
|
||||
LimitLevel = atoi( buf1);
|
||||
CHAR_setInt( meindex, CHAR_LIMITLEVEL, LimitLevel);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
BOOL PetTalk_DelItem(int meindex,int talker,char *buf)
|
||||
{
|
||||
|
||||
int i = 1, j = 1,k = 1;
|
||||
char buff3[128];
|
||||
char buf2[32];
|
||||
int itemindex;
|
||||
|
||||
while( getStringFromIndexWithDelim(buf , "," , k, buff3, sizeof(buff3)) !=FALSE ) {
|
||||
k++;
|
||||
if(strstr(buff3,"*")!=NULL){
|
||||
int itemno;
|
||||
int kosuu;
|
||||
int id;
|
||||
int cnt=0;
|
||||
|
||||
getStringFromIndexWithDelim(buff3,"*",1,buf2,sizeof(buf2));
|
||||
itemno = atoi(buf2);
|
||||
getStringFromIndexWithDelim(buff3,"*",2,buf2,sizeof(buf2));
|
||||
kosuu = atoi(buf2);
|
||||
|
||||
for( i =0 ; i < CHAR_MAXITEMHAVE ; i++ ){
|
||||
itemindex=CHAR_getItemIndex( talker , i );
|
||||
if( ITEM_CHECKINDEX(itemindex) ){
|
||||
id=ITEM_getInt(itemindex ,ITEM_ID );
|
||||
if(itemno==id){
|
||||
cnt++;
|
||||
|
||||
LogItem(
|
||||
CHAR_getChar( talker, CHAR_NAME ), /* 平乓仿 */
|
||||
CHAR_getChar( talker, CHAR_CDKEY ),
|
||||
#ifdef _add_item_log_name // WON ADD 在item的log中增加item名称
|
||||
itemindex,
|
||||
#else
|
||||
ITEM_getInt( itemindex, ITEM_ID), /* 失奶 丞 寞 */
|
||||
#endif
|
||||
"WarpManDelItem(NPC收道具後传至某点)",
|
||||
CHAR_getInt( talker, CHAR_FLOOR),
|
||||
CHAR_getInt( talker, CHAR_X ),
|
||||
CHAR_getInt( talker, CHAR_Y ),
|
||||
ITEM_getChar( itemindex, ITEM_UNIQUECODE),
|
||||
ITEM_getChar( itemindex, ITEM_NAME),
|
||||
ITEM_getInt( itemindex, ITEM_ID)
|
||||
|
||||
);
|
||||
|
||||
CHAR_DelItem( talker, i);
|
||||
if(cnt == kosuu){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
/*--蓟氏分 寞及失奶 丞毛蓟请---*/
|
||||
for( j = 0 ; j < CHAR_MAXITEMHAVE ; j++){
|
||||
itemindex = CHAR_getItemIndex( talker ,j);
|
||||
|
||||
if( ITEM_CHECKINDEX(itemindex) ){
|
||||
if( atoi( buff3) == ITEM_getInt(itemindex,ITEM_ID)){
|
||||
LogItem(
|
||||
CHAR_getChar( talker, CHAR_NAME ), /* 平乓仿 */
|
||||
CHAR_getChar( talker, CHAR_CDKEY ),
|
||||
#ifdef _add_item_log_name // WON ADD 在item的log中增加item名称
|
||||
itemindex,
|
||||
#else
|
||||
ITEM_getInt( itemindex, ITEM_ID), /* 失奶 丞 寞 */
|
||||
#endif
|
||||
"WarpManDelItem(NPC收道具後传至某点)",
|
||||
CHAR_getInt( talker,CHAR_FLOOR),
|
||||
CHAR_getInt( talker,CHAR_X ),
|
||||
CHAR_getInt( talker,CHAR_Y ),
|
||||
ITEM_getChar( itemindex, ITEM_UNIQUECODE),
|
||||
ITEM_getChar( itemindex, ITEM_NAME),
|
||||
ITEM_getInt( itemindex, ITEM_ID)
|
||||
);
|
||||
CHAR_DelItem( talker, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_AddItem(int meindex, int talker, char *buf)
|
||||
{
|
||||
int itemID,k=1,itemindex=-1;
|
||||
int spaceNum=5,i;
|
||||
char buff3[256], msgbuf[64], token[256];
|
||||
int ret;
|
||||
|
||||
while( getStringFromIndexWithDelim(buf , "," , k, buff3, sizeof(buff3)) !=FALSE ){
|
||||
k++;
|
||||
for( i = spaceNum ; i < CHAR_MAXITEMHAVE ; i++ ){
|
||||
itemindex=CHAR_getItemIndex( talker , i );
|
||||
if( itemindex == -1 ) {
|
||||
spaceNum = i+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i == CHAR_MAXITEMHAVE ) {
|
||||
snprintf( msgbuf,sizeof( msgbuf), "主人,你的物品栏已经满了!!");
|
||||
CHAR_talkToCli( talker, meindex, msgbuf, CHAR_COLORWHITE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
k=1;
|
||||
while( getStringFromIndexWithDelim(buf , "," , k, buff3, sizeof(buff3)) !=FALSE ){
|
||||
k++;
|
||||
itemID = atoi( buff3);
|
||||
if( itemID )
|
||||
itemindex = ITEM_makeItemAndRegist( itemID);
|
||||
if(itemindex == -1)
|
||||
continue;
|
||||
ret = CHAR_addItemSpecificItemIndex( talker, itemindex);
|
||||
if( ret < 0 || ret >= CHAR_MAXITEMHAVE ) {
|
||||
ITEM_endExistItemsOne( itemindex);
|
||||
print ("\n ret error!!");
|
||||
return FALSE;
|
||||
}
|
||||
sprintf( token,"拿到%s",ITEM_getChar( itemindex, ITEM_NAME));
|
||||
CHAR_talkToCli( talker, -1,token,CHAR_COLORWHITE);
|
||||
|
||||
CHAR_sendItemDataOne( talker, ret);
|
||||
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_CheckPetEvent( int meindex, int toindex, char *buf)
|
||||
{
|
||||
char buf1[256],buf2[256];
|
||||
int k = 0;
|
||||
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf, "EndSetFlg", buf1,sizeof( buf1) ) != NULL ) {
|
||||
k=1;
|
||||
while( getStringFromIndexWithDelim(buf1 , "," ,k, buf2, sizeof(buf2) ) != FALSE ){
|
||||
k++;
|
||||
NPC_EventSetFlg( toindex, atoi( buf2));
|
||||
}
|
||||
}
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf, "NowSetFlg", buf1, sizeof( buf1)) != NULL) {
|
||||
k=1 ;
|
||||
while(getStringFromIndexWithDelim(buf1 , "," , k, buf2, sizeof(buf2))!= FALSE ){
|
||||
k++;
|
||||
NPC_NowEventSetFlg( toindex, atoi( buf2));
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void PetTalk_RequestMain(int meindex,int talker,char *buf)
|
||||
{
|
||||
int shiftbit;
|
||||
char buf2[128];
|
||||
if( NPC_Util_GetStrFromStrWithDelim( buf,"EventNo", buf2,sizeof( buf2) ) == NULL ) {
|
||||
print("\n pet_event.c err:NOT FIND [EventNo] !!");
|
||||
return;
|
||||
}
|
||||
shiftbit = atoi( buf2);
|
||||
if( NPC_NowEventCheckFlg( talker, shiftbit) != TRUE ) {
|
||||
NPC_NowEventSetFlg( talker, shiftbit);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL PetTalk_CheckFree( int meindex, int talker, char *buf)
|
||||
{
|
||||
char buff2[256];
|
||||
char buff3[128];
|
||||
int i=1,j=1;
|
||||
int loop=0;
|
||||
while( getStringFromIndexWithDelim(buf,",",i,buff2,sizeof(buff2)) !=FALSE ) {
|
||||
i++;
|
||||
if(strstr(buff2,"&")!=NULL){
|
||||
j=1;
|
||||
loop=0;
|
||||
while( getStringFromIndexWithDelim(buff2,"&",j,buff3,sizeof(buff3)) !=FALSE ) {
|
||||
j++;
|
||||
if(PetTalk_BSCheck(meindex,talker,buff3)==FALSE) {
|
||||
loop=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(loop==0) {
|
||||
CHAR_setWorkInt( talker, CHAR_WORKWARPCHECK, TRUE );
|
||||
return TRUE;
|
||||
}
|
||||
}else{
|
||||
if( PetTalk_BSCheck( meindex, talker, buff2) == TRUE ){
|
||||
CHAR_setWorkInt( talker, CHAR_WORKWARPCHECK, TRUE );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
CHAR_setWorkInt( talker, CHAR_WORKWARPCHECK, FALSE );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_BSCheck(int meindex,int talker,char* buf)
|
||||
{
|
||||
char buff2[128];
|
||||
int kosuu,temp=-1,flg=0;
|
||||
char buff1[128],buff3[128];
|
||||
if(strstr( buf, "-") != NULL) {
|
||||
//buff3为抓宠物ID
|
||||
getStringFromIndexWithDelim( buf, "-", 2, buff3, sizeof(buff3));
|
||||
temp = atoi( buff3);
|
||||
getStringFromIndexWithDelim( buf, "-", 1, buff1, sizeof(buff1));
|
||||
strcpy( buf, buff1);
|
||||
}
|
||||
if(strstr( buf, "<") != NULL){
|
||||
getStringFromIndexWithDelim( buf, "<", 2, buff2, sizeof(buff2));
|
||||
kosuu = atoi( buff2);
|
||||
getStringFromIndexWithDelim( buf, "<", 1, buff2, sizeof(buff2));
|
||||
|
||||
if(PetTalk_FreeIfCheck( meindex, talker, buff2, kosuu, 1, temp)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}else if(strstr( buf, ">") != NULL){
|
||||
getStringFromIndexWithDelim( buf, ">", 2, buff2, sizeof(buff2));
|
||||
kosuu = atoi(buff2);
|
||||
getStringFromIndexWithDelim( buf, ">" ,1, buff2, sizeof(buff2));
|
||||
|
||||
if(PetTalk_FreeIfCheck( meindex, talker, buff2, kosuu, 2, temp)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}else if(strstr( buf, "!" ) != NULL){
|
||||
getStringFromIndexWithDelim( buf, "!=", 2, buff2, sizeof(buff2));
|
||||
kosuu = atoi( buff2);
|
||||
getStringFromIndexWithDelim( buf, "!=", 1, buff2, sizeof(buff2));
|
||||
if(PetTalk_FreeIfCheck( meindex, talker, buff2, kosuu, 0, temp) == TRUE){
|
||||
return FALSE;
|
||||
}else{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}else if(strstr( buf, "=") != NULL){
|
||||
getStringFromIndexWithDelim( buf, "=", 2, buff2, sizeof(buff2));
|
||||
kosuu = atoi( buff2);
|
||||
getStringFromIndexWithDelim( buf, "=", 1, buff2, sizeof(buff2));
|
||||
|
||||
if( strstr( buf, "PET")) {
|
||||
flg = 3;
|
||||
}
|
||||
if(strstr( buf, "*") != NULL){
|
||||
if( PetTalk_WarpManReduce( meindex, talker, buf)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}else if(PetTalk_FreeIfCheck( meindex, talker, buff2, kosuu, flg, temp)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_FreeIfCheck(int meindex,int talker,char* buf,int kosuu,int flg, int temp)
|
||||
{
|
||||
int Type = -1;
|
||||
if(strcmp(buf,"LV")==0){
|
||||
if(PetTalk_LevelCheck(meindex,talker,kosuu,flg)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if( strcmp( buf, "TRANS") == 0 ) {
|
||||
if( PetTalk_CheckTrans( meindex, talker, kosuu, flg) == TRUE )
|
||||
return TRUE;
|
||||
}
|
||||
if( strcmp( buf, "PET") == 0 ) {
|
||||
if( temp > 0 ) {
|
||||
if( PetTalk_CheckMyPet( meindex, talker, kosuu, flg, temp) == TRUE )
|
||||
return TRUE;
|
||||
}else
|
||||
return FALSE;
|
||||
}
|
||||
if(strcmp( buf, "ITEM")==0){
|
||||
if(PetTalk_ItemCheck(meindex,talker,kosuu,flg)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if(strcmp( buf, "ENDEV")==0){
|
||||
if(NPC_EventCheckFlg( talker, kosuu)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if(strcmp( buf, "NOWEV")==0){
|
||||
if(NPC_NowEventCheckFlg( talker, kosuu)==TRUE){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if(strcmp( buf, "HP" ) == 0 ) {
|
||||
Type = 0;
|
||||
if( PetTalk_CheckMyType( meindex, talker, kosuu, flg, Type ) == TRUE ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#ifdef _PET_TALKBBI
|
||||
if(strcmp( buf, "BBI" ) == 0 ) {
|
||||
if( PET_CheckPlayerBBI( meindex, talker, kosuu, flg)== TRUE) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
BOOL PetTalk_CheckMyType( int meindex, int toindex, int kosuu, int flg, int Type ) {
|
||||
int MyType=0,MyMaxType=0;
|
||||
switch( Type ) {
|
||||
case 0: //HP
|
||||
MyType = CHAR_getInt( toindex, CHAR_HP);
|
||||
MyMaxType = CHAR_getWorkInt( toindex, CHAR_WORKMAXHP);
|
||||
MyMaxType = (MyMaxType * kosuu )/ 100;
|
||||
if( PetTalk_BigSmallLastCheck( MyMaxType, MyType , flg ) == TRUE ) {
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_WarpManReduce(int meindex,int talker,char *buf)
|
||||
{
|
||||
char buf2[512];
|
||||
char buf3[256];
|
||||
int id=0;
|
||||
int i;
|
||||
int itemindex;
|
||||
int itemno;
|
||||
int kosuu;
|
||||
int cnt=0;
|
||||
|
||||
getStringFromIndexWithDelim(buf,"=",2,buf2,sizeof(buf2));
|
||||
getStringFromIndexWithDelim(buf2,"*",1,buf3,sizeof(buf3));
|
||||
itemno = atoi(buf3);
|
||||
getStringFromIndexWithDelim(buf2,"*",2,buf3,sizeof(buf3));
|
||||
kosuu = atoi(buf3);
|
||||
for( i=0 ; i < CHAR_MAXITEMHAVE;i++ ){
|
||||
itemindex=CHAR_getItemIndex( talker , i );
|
||||
if( ITEM_CHECKINDEX(itemindex) ){
|
||||
id=ITEM_getInt(itemindex ,ITEM_ID );
|
||||
if(itemno==id){
|
||||
cnt++;
|
||||
if(cnt==kosuu){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_LevelCheck(int meindex,int talker,int level,int flg)
|
||||
{
|
||||
int mylevel;
|
||||
mylevel=CHAR_getInt(talker,CHAR_LV);
|
||||
if(PetTalk_BigSmallLastCheck(level,mylevel,flg)==TRUE) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_CheckTrans(int meindex,int talker,int trans,int flg)
|
||||
{
|
||||
int myTrans;
|
||||
myTrans=CHAR_getInt(talker, CHAR_TRANSMIGRATION);
|
||||
if( PetTalk_BigSmallLastCheck( trans, myTrans, flg ) == TRUE ) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_CheckMyPet( int meindex, int talker, int petLv, int flg, int petid)
|
||||
{
|
||||
int petsel,petindex=-1;
|
||||
|
||||
for(petsel=0 ; petsel < CHAR_MAXPETHAVE ; petsel++) {
|
||||
petindex = CHAR_getCharPet( talker, petsel);
|
||||
if( petindex == -1 )
|
||||
continue;
|
||||
if(CHAR_getInt( petindex, CHAR_PETID) != petid )
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if( petsel == CHAR_MAXPETHAVE ) {
|
||||
return FALSE;
|
||||
}else { //找到条件宠
|
||||
if( PetTalk_BigSmallLastCheck( petLv, CHAR_getInt( petindex, CHAR_LV), flg ) == TRUE )
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_ItemCheck(int meindex,int talker,int itemNo,int flg)
|
||||
{
|
||||
int i;
|
||||
int itemindex=-1;
|
||||
int id;
|
||||
for( i=0;i<CHAR_MAXITEMHAVE;i++ ){
|
||||
itemindex = CHAR_getItemIndex( talker , i );
|
||||
if( ITEM_CHECKINDEX( itemindex) ) {
|
||||
id=ITEM_getInt(itemindex ,ITEM_ID );
|
||||
if( PetTalk_BigSmallLastCheck(itemNo,id,flg) == TRUE )
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PetTalk_BigSmallLastCheck(int point1,int mypoint,int flg)
|
||||
{
|
||||
if(flg==0){
|
||||
if(point1==mypoint) {
|
||||
return TRUE;
|
||||
}
|
||||
}else if(flg==1){
|
||||
if(mypoint < point1) {
|
||||
return TRUE;
|
||||
}
|
||||
}else if(flg==2){
|
||||
if(mypoint > point1) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
void PET_Talkfunc( int meindex, int talkerindex, char *msg, int color)
|
||||
{
|
||||
print("\n PET_Talkfunc(...) return; ");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
void PET_CleanFreePetAll()
|
||||
{
|
||||
int objindex;
|
||||
int objmaxnum = OBJECT_getNum();
|
||||
|
||||
for( objindex=0; objindex<objmaxnum; objindex++) {
|
||||
if( CHECKOBJECT( objindex ) == FALSE ) continue;
|
||||
PET_CleanPetdeletetime( objindex);
|
||||
}
|
||||
}
|
||||
|
||||
int PET_CleanPetdeletetime( int objmeindex)
|
||||
{
|
||||
int pindex;
|
||||
|
||||
if( OBJECT_getType(objmeindex) != OBJTYPE_CHARA ) return 0;
|
||||
pindex = OBJECT_getIndex( objmeindex);
|
||||
if( CHAR_getInt( pindex, CHAR_WHICHTYPE) != CHAR_TYPEPET) return 0;
|
||||
#ifdef _MARKET_TRADE
|
||||
if( CHAR_getWorkInt( pindex, CHAR_WORKTRADETYP) == TRADETYPE_SELL) return 0;
|
||||
#endif
|
||||
if( CHAR_getInt( pindex, CHAR_MAILMODE) != CHAR_PETMAIL_NONE) {
|
||||
}else if( CHAR_getWorkInt( pindex, CHAR_WORKPETFOLLOWMODE) == CHAR_PETFOLLOW_NOW ){
|
||||
}else {
|
||||
#ifdef _PET_LOSTPET
|
||||
// CHAR_CharSaveLostPet( pindex, 0);
|
||||
#endif
|
||||
LogPet(
|
||||
"系统",
|
||||
"Watchfunc",
|
||||
CHAR_getChar( pindex, CHAR_NAME),
|
||||
CHAR_getInt( pindex, CHAR_LV),
|
||||
"timeout_lost(系统清除-地上自由宠)",
|
||||
CHAR_getInt( pindex, CHAR_FLOOR),
|
||||
CHAR_getInt( pindex,CHAR_X ),
|
||||
CHAR_getInt( pindex,CHAR_Y ),
|
||||
CHAR_getChar( pindex, CHAR_UNIQUECODE) // shan 2001/12/14
|
||||
);
|
||||
CHAR_CharaDelete(pindex);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PET_CHECKFreePetIsIt( int petindex)
|
||||
{
|
||||
int petputtime, defmaxtime;
|
||||
defmaxtime = getPetdeletetime();
|
||||
petputtime = CHAR_getInt( petindex, CHAR_PUTPETTIME);
|
||||
|
||||
if( NowTime.tv_sec < ( petputtime + getPetdeletetime() ) ) return;
|
||||
|
||||
#ifdef _PET_LOSTPET
|
||||
// CHAR_CharSaveLostPet( petindex, 0);
|
||||
#endif
|
||||
|
||||
LogPet(
|
||||
"系统",
|
||||
"Watchfunc",
|
||||
CHAR_getChar( petindex, CHAR_NAME),
|
||||
CHAR_getInt( petindex, CHAR_LV),
|
||||
"timeout_lost(系统清除-地上自由宠)",
|
||||
CHAR_getInt( petindex, CHAR_FLOOR),
|
||||
CHAR_getInt( petindex,CHAR_X ),
|
||||
CHAR_getInt( petindex,CHAR_Y ),
|
||||
CHAR_getChar( petindex, CHAR_UNIQUECODE) // shan 2001/12/14
|
||||
);
|
||||
|
||||
CHAR_CharaDelete(petindex);
|
||||
}
|
||||
|
||||
#define PETFOLLOW_TIME 60*60
|
||||
void PET_Watchfunc( int objmeindex, int objmoveindex, CHAR_ACTION act, int x, int y, int dir,
|
||||
int* opt, int optlen )
|
||||
{
|
||||
int pindex;
|
||||
int petindex;
|
||||
int petputtime;
|
||||
|
||||
if( OBJECT_getType(objmoveindex) != OBJTYPE_CHARA ) return;
|
||||
pindex = OBJECT_getIndex( objmoveindex);
|
||||
if( CHAR_getInt( pindex, CHAR_WHICHTYPE ) != CHAR_TYPEPLAYER ) return;
|
||||
petindex = OBJECT_getIndex( objmeindex);
|
||||
petputtime = CHAR_getInt( petindex, CHAR_PUTPETTIME);
|
||||
|
||||
#ifdef _MARKET_TRADE
|
||||
if( CHAR_getWorkInt( petindex, CHAR_WORKTRADETYP) != TRADETYPE_SELL) {
|
||||
#endif
|
||||
if( CHAR_getInt( petindex, CHAR_MAILMODE) != CHAR_PETMAIL_NONE) {
|
||||
//宠邮不处理
|
||||
}else if( CHAR_getWorkInt( petindex, CHAR_WORKPETFOLLOWMODE) == CHAR_PETFOLLOW_NOW ){
|
||||
if( NowTime.tv_sec >= (petputtime + 60*60) ) {
|
||||
int ownerindex = CHAR_getWorkInt( petindex, CHAR_WORKPLAYERINDEX);
|
||||
if( CHAR_CHECKINDEX( ownerindex) ){
|
||||
if( CHAR_pickupFollowPet( ownerindex, petindex ) ) {
|
||||
return;
|
||||
}
|
||||
CHAR_talkToCli( ownerindex, -1, "溜宠太久,宠物走失了!!", CHAR_COLORYELLOW );
|
||||
}
|
||||
#ifdef _PET_LOSTPET
|
||||
CHAR_CharSaveLostPet( petindex, 1);
|
||||
LogPet(
|
||||
"系统",
|
||||
"Watchfunc",
|
||||
CHAR_getChar( petindex, CHAR_NAME),
|
||||
CHAR_getInt( petindex, CHAR_LV),
|
||||
"timeout_lost(系统扣留-溜宠自由宠)",
|
||||
CHAR_getInt( petindex, CHAR_FLOOR),
|
||||
CHAR_getInt( petindex,CHAR_X ),
|
||||
CHAR_getInt( petindex,CHAR_Y ),
|
||||
CHAR_getChar( petindex, CHAR_UNIQUECODE) // shan 2001/12/14
|
||||
);
|
||||
print("系统扣留-溜宠自由宠:%s\n", CHAR_getUseName( petindex));
|
||||
CHAR_CharaDelete( petindex);
|
||||
#else
|
||||
CHAR_setInt( petindex, CHAR_PUTPETTIME, NowTime.tv_sec);
|
||||
CHAR_setWorkInt( petindex, CHAR_WORKPETFOLLOWMODE, CHAR_PETFOLLOW_NONE);
|
||||
LogPet(
|
||||
CHAR_getChar( pindex, CHAR_NAME ),
|
||||
CHAR_getChar( pindex, CHAR_CDKEY ),
|
||||
CHAR_getChar( petindex, CHAR_NAME),
|
||||
CHAR_getInt( petindex, CHAR_LV),
|
||||
"timeout_lost(溜宠太久,宠物走失))",
|
||||
CHAR_getInt( pindex,CHAR_FLOOR),
|
||||
CHAR_getInt( pindex,CHAR_X ),
|
||||
CHAR_getInt( pindex,CHAR_Y ),
|
||||
CHAR_getChar( petindex, CHAR_UNIQUECODE) // shan 2001/12/14
|
||||
|
||||
);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
}else{
|
||||
PET_CHECKFreePetIsIt( petindex);
|
||||
}
|
||||
#ifdef _MARKET_TRADE
|
||||
}
|
||||
#endif
|
||||
if( CHAR_getInt( petindex, CHAR_MAILMODE) == CHAR_PETMAIL_IDLE3 ||
|
||||
CHAR_getInt( petindex, CHAR_MAILMODE) == CHAR_PETMAIL_IDLE2){
|
||||
if( act == CHAR_ACTATTACK) {
|
||||
if( NPC_Util_isFaceToChara( pindex,petindex,1 ) == TRUE ) {
|
||||
int action[2] = { CHAR_ACTDAMAGE, CHAR_ACTGUARD};
|
||||
CHAR_sendWatchEvent( objmeindex, action[RAND(0,1)], NULL,0,FALSE);
|
||||
CHAR_setWorkInt( petindex, CHAR_WORKACTION, act);
|
||||
}
|
||||
}
|
||||
}else if( CHAR_getInt( petindex, CHAR_MAILMODE) != CHAR_PETMAIL_NONE) {
|
||||
;
|
||||
}else if( CHAR_getWorkInt( petindex, CHAR_WORKFIXAI) >= 100 ) {
|
||||
int workpindex = CHAR_getWorkInt( petindex, CHAR_WORKPLAYERINDEX);
|
||||
if( act == CHAR_ACTWALK && CHAR_CHECKINDEX( workpindex) && workpindex == pindex ){
|
||||
dir = NPC_Util_GetDirCharToChar( petindex, pindex, 0);
|
||||
if( dir != -1 ) {
|
||||
if( CHAR_getInt( petindex, CHAR_DIR) != dir ) {
|
||||
CHAR_setInt( petindex, CHAR_DIR, dir);
|
||||
CHAR_sendWatchEvent( CHAR_getWorkInt( petindex, CHAR_WORKOBJINDEX),
|
||||
CHAR_ACTTURN,NULL,0,TRUE);
|
||||
}
|
||||
}
|
||||
}else if( NPC_Util_isFaceToFace( petindex, pindex, 2 ) == TRUE ) {
|
||||
switch( act) {
|
||||
case CHAR_ACTATTACK:
|
||||
case CHAR_ACTDAMAGE:
|
||||
case CHAR_ACTDOWN:
|
||||
case CHAR_ACTSTAND:
|
||||
case CHAR_ACTACTIONWALK:
|
||||
case CHAR_ACTGUARD:
|
||||
case CHAR_ACTACTIONSTAND:
|
||||
CHAR_sendWatchEvent( objmeindex, act, NULL,0,FALSE);
|
||||
CHAR_setWorkInt( petindex, CHAR_WORKACTION, act);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
/*
|
||||
#ifdef _MARKET_TRADE
|
||||
if( CHAR_getWorkInt( petindex, CHAR_WORKTRADETYP) != TRADETYPE_SELL) {
|
||||
#endif
|
||||
if( CHAR_getWorkInt( petindex, CHAR_WORKPETFOLLOWMODE) != CHAR_PETFOLLOW_NOW ){
|
||||
if( RAND(0,30) == 1 ) {
|
||||
CHAR_walk( petindex,RAND( 0,7),0);
|
||||
}
|
||||
}
|
||||
#ifdef _MARKET_TRADE
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _PET_TALKBBI
|
||||
BOOL PET_CheckPlayerBBI( int meindex, int charindex, int BBI, int flg)
|
||||
{
|
||||
int MyBBI;
|
||||
if( !CHAR_CHECKINDEX( charindex))
|
||||
return FALSE;
|
||||
if( BBI < 0 )
|
||||
return FALSE;
|
||||
MyBBI = CHAR_getInt( charindex, CHAR_BASEIMAGENUMBER);
|
||||
|
||||
if(flg==0){
|
||||
if(BBI==MyBBI)
|
||||
return TRUE;
|
||||
}else if(flg==1){
|
||||
if(BBI < MyBBI)
|
||||
return TRUE;
|
||||
}else if(flg==2){
|
||||
if(BBI > MyBBI)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
1125
gmsv/char/petmail.c
Normal file
1125
gmsv/char/petmail.c
Normal file
File diff suppressed because it is too large
Load Diff
645
gmsv/char/skill.c
Normal file
645
gmsv/char/skill.c
Normal file
@ -0,0 +1,645 @@
|
||||
#include "version.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "skill.h"
|
||||
#include "util.h"
|
||||
#include "char.h"
|
||||
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物职业
|
||||
#include "battle.h"
|
||||
#include "profession_skill.h"
|
||||
#endif
|
||||
|
||||
|
||||
static SKILL_intDataSetting SKILL_setint[SKILL_DATAINTNUM]={
|
||||
{"lv"}, /* SKILL_LEVEL */
|
||||
{"id"}, /* SKILL_ID */
|
||||
};
|
||||
|
||||
static SKILL_charDataSetting SKILL_setchar[SKILL_DATACHARNUM]={
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
static char SKILL_dataString[STRINGBUFSIZ];
|
||||
|
||||
char* SKILL_makeStringFromSkillData( Skill* sk )
|
||||
{
|
||||
int i;
|
||||
int strlength=0;
|
||||
|
||||
for( i = 0 ; i < SKILL_DATAINTNUM ; i ++ ){
|
||||
char linedata[128];
|
||||
snprintf( linedata , sizeof(linedata),
|
||||
"%s=%d" NONCHAR_DELIMITER,
|
||||
SKILL_setint[i].dumpskill, sk->data[i] );
|
||||
|
||||
strcpysafe( &SKILL_dataString[strlength],
|
||||
sizeof( SKILL_dataString ) - strlength,
|
||||
linedata );
|
||||
strlength += strlen( linedata );
|
||||
if( strlength > sizeof( SKILL_dataString ) )goto RETURN;
|
||||
}
|
||||
|
||||
for( i = 0 ; i < SKILL_DATACHARNUM ; i ++ ){
|
||||
char linedata[128];
|
||||
char escapebuffer[128];
|
||||
snprintf( linedata, sizeof(linedata),
|
||||
"%s=%s" NONCHAR_DELIMITER,
|
||||
SKILL_setchar[i].dumpskill,
|
||||
makeEscapeString(sk->string[i].string,escapebuffer,
|
||||
sizeof(escapebuffer)));
|
||||
|
||||
strcpysafe( &SKILL_dataString[strlength],
|
||||
sizeof( SKILL_dataString ) - strlength,
|
||||
linedata );
|
||||
strlength += strlen( linedata );
|
||||
if( strlength > sizeof( SKILL_dataString ) )goto RETURN;
|
||||
}
|
||||
|
||||
RETURN:
|
||||
dchop( SKILL_dataString , NONCHAR_DELIMITER );
|
||||
|
||||
return SKILL_dataString;
|
||||
}
|
||||
|
||||
|
||||
BOOL SKILL_makeSkillFromStringToArg( char* src, Skill* sk )
|
||||
{
|
||||
int readindex=1;
|
||||
while( 1 ){
|
||||
BOOL ret;
|
||||
char linebuf[512];
|
||||
char first[256];
|
||||
char second[256];
|
||||
int i;
|
||||
|
||||
|
||||
ret = getStringFromIndexWithDelim( src ,NONCHAR_DELIMITER ,
|
||||
readindex,
|
||||
linebuf, sizeof( linebuf ) );
|
||||
if( ret == FALSE )
|
||||
break;
|
||||
|
||||
ret = getStringFromIndexWithDelim( linebuf ,"=", 1,
|
||||
first, sizeof( first ) );
|
||||
if( ret == FALSE ) return FALSE;
|
||||
strcpysafe( second , sizeof( second ),
|
||||
linebuf + strlen(first) + strlen("=") );
|
||||
|
||||
for( i = 0 ; i < SKILL_DATAINTNUM ; i ++ ){
|
||||
if( strcmp(first ,SKILL_setint[i].dumpskill) == 0 ){
|
||||
sk->data[i] = atoi( second );
|
||||
goto NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
for( i = 0 ; i < SKILL_DATACHARNUM ; i ++ ){
|
||||
if( strcmp(first ,SKILL_setchar[i].dumpskill) == 0 ){
|
||||
strcpysafe( sk->string[i].string,
|
||||
sizeof(sk->string[i].string),
|
||||
makeStringFromEscaped(second) );
|
||||
goto NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
fprint( "??? : %s[%s]\n" , linebuf, first );
|
||||
|
||||
NEXT:
|
||||
readindex++;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物职业
|
||||
INLINE int SKILL_getRealInt( Skill* skill, int element)
|
||||
{
|
||||
return skill->data[element];
|
||||
}
|
||||
#endif
|
||||
|
||||
INLINE int SKILL_getInt( Skill* skill, int element)
|
||||
{
|
||||
int value = skill->data[element];
|
||||
|
||||
if( element == SKILL_LEVEL ) value /= 100;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
INLINE int SKILL_setInt( Skill* skill, int element, int new)
|
||||
{
|
||||
int buf = SKILL_getInt( skill, element );
|
||||
skill->data[element] = new;
|
||||
return buf;
|
||||
}
|
||||
|
||||
#ifndef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
static void SKILL_setitemlimit( int charaindex, Skill* sk );
|
||||
static void SKILL_setmerchant( int charaindex, Skill* sk );
|
||||
static void SKILL_setlevel( int charaindex, Skill* sk );
|
||||
#endif
|
||||
|
||||
static SKILL_table SKILL_tbl[]={
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
{ 100, NULL}, // 1
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL},
|
||||
{ 100, NULL}, // 16
|
||||
#else
|
||||
{8,SKILL_setlevel}, /* SKILL_FIRE */
|
||||
{4,NULL}, /* SKILL_MAGICIAN */
|
||||
{4,NULL}, /* SKILL_PREIST */
|
||||
{8,SKILL_setitemlimit}, /* SKILL_ALOTOFTHINGS */
|
||||
{8,NULL}, /* SKILL_AVOIDRATEUP */
|
||||
{4,SKILL_setlevel}, /* SKILL_DETERMINEITEM */
|
||||
{5,SKILL_setlevel}, /* SKILL_DETERMINEOTHERS */
|
||||
{8,SKILL_setmerchant}, /* SKILL_MERCHANT */
|
||||
{8,SKILL_setlevel}, /* SKILL_HEALER */
|
||||
{8,SKILL_setlevel}, /* SKILL_LARGEVOICE */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#ifndef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
static void SKILL_setitemlimit( int charaindex, Skill* sk )
|
||||
{
|
||||
static int itemlimit[9]={
|
||||
7 + 8 + 4*0,
|
||||
7 + 8 + 4*1,
|
||||
7 + 8 + 4*2,
|
||||
7 + 8 + 4*3,
|
||||
7 + 8 + 4*4,
|
||||
7 + 8 + 4*5,
|
||||
7 + 8 + 4*6,
|
||||
7 + 8 + 4*7,
|
||||
7 + 8 + 4*8,
|
||||
};
|
||||
int level;
|
||||
if( !CHAR_CHECKINDEX(charaindex) )return;
|
||||
if( sk->data[SKILL_IDENTITY] != SKILL_ALOTOFTHINGS )return;
|
||||
level = sk->data[SKILL_LEVEL];
|
||||
if( level < 0 )level = 0;
|
||||
if( level>=arraysizeof(itemlimit) ) level=arraysizeof(itemlimit) - 1;
|
||||
}
|
||||
|
||||
|
||||
static void SKILL_setmerchant( int charaindex, Skill* sk )
|
||||
{
|
||||
int level;
|
||||
int merchantlevel=0;
|
||||
|
||||
if( !CHAR_CHECKINDEX(charaindex) )return;
|
||||
if( sk->data[SKILL_IDENTITY] != SKILL_MERCHANT )return;
|
||||
|
||||
level = sk->data[SKILL_LEVEL];
|
||||
if( level < 0 )level = 0;
|
||||
if( level >= SKILL_tbl[sk->data[SKILL_IDENTITY]].maxlevel )
|
||||
level = SKILL_tbl[sk->data[SKILL_IDENTITY]].maxlevel;
|
||||
|
||||
SETHIGHVALUE(merchantlevel,(100 - level*5));
|
||||
SETLOWVALUE(merchantlevel,(20 + level*5));
|
||||
|
||||
CHAR_setInt( charaindex,CHAR_MERCHANTLEVEL,merchantlevel );
|
||||
}
|
||||
|
||||
|
||||
static void SKILL_setlevel( int charaindex, Skill* sk )
|
||||
{
|
||||
static struct skillvalset
|
||||
{
|
||||
SKILL_ID id;
|
||||
CHAR_DATAINT charadataindex;
|
||||
} skvalset[] = {
|
||||
{ SKILL_DETERMINEITEM, CHAR_DETERMINEITEM },
|
||||
{ SKILL_DETERMINEOTHERS, CHAR_RADARSTRENGTH },
|
||||
{ SKILL_HEALER, CHAR_HEALERLEVEL },
|
||||
{ SKILL_LARGEVOICE, CHAR_CHATVOLUME },
|
||||
};
|
||||
int id;
|
||||
int i;
|
||||
int index=-1;
|
||||
int level;
|
||||
|
||||
if( !CHAR_CHECKINDEX(charaindex) )return;
|
||||
id = sk->data[SKILL_IDENTITY];
|
||||
for( i=0 ; i<arraysizeof(skvalset) ; i ++ )
|
||||
if( skvalset[i].id == id )
|
||||
index = i;
|
||||
|
||||
if( index == -1 )return;
|
||||
|
||||
level = sk->data[SKILL_LEVEL];
|
||||
if( level < 0 )level = 0;
|
||||
if( level >= SKILL_tbl[id].maxlevel )
|
||||
level = SKILL_tbl[id].maxlevel;
|
||||
|
||||
CHAR_setInt(charaindex,skvalset[index].charadataindex,level );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SKILLSTRINGBUFSIZ 256
|
||||
|
||||
static char ITEM_statusStringBuffer[SKILLSTRINGBUFSIZ];
|
||||
|
||||
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物职业
|
||||
char* SKILL_makeSkillStatusString( Skill* skill, int charaindex, int skill_num )
|
||||
{
|
||||
int skillindex=SKILL_getInt( skill,SKILL_IDENTITY);
|
||||
int Pskill=PROFESSION_SKILL_getskillArray( skillindex);
|
||||
int skill_level=0, cost_mp=0;
|
||||
|
||||
// 人物技能等级
|
||||
skill_level = SKILL_getInt( skill, SKILL_LEVEL);
|
||||
|
||||
// 耗费MP
|
||||
if( (cost_mp = PROFESSION_MAGIC_COST_MP( charaindex, skill_num )) == -1 )
|
||||
cost_mp = PROFESSION_SKILL_getInt( Pskill, PROFESSION_SKILL_COST_MP);
|
||||
|
||||
snprintf( ITEM_statusStringBuffer, sizeof( ITEM_statusStringBuffer ),
|
||||
"%d|%d|%d|%d|%d|%d|%d|%s|%s",
|
||||
PROFESSION_SKILL_getInt( Pskill, PROFESSION_SKILL_USE_FLAG),
|
||||
SKILL_getInt(skill,SKILL_IDENTITY),
|
||||
PROFESSION_SKILL_getInt( Pskill, PROFESSION_SKILL_TARGET),
|
||||
PROFESSION_SKILL_getInt( Pskill, PROFESSION_SKILL_KIND),
|
||||
PROFESSION_SKILL_getInt( Pskill, PROFESSION_SKILL_ICON),
|
||||
cost_mp,
|
||||
skill_level,
|
||||
PROFESSION_SKILL_getChar( Pskill, PROFESSION_SKILL_NAME),
|
||||
PROFESSION_SKILL_getChar( Pskill, PROFESSION_SKILL_TXT) );
|
||||
|
||||
|
||||
return ITEM_statusStringBuffer;
|
||||
}
|
||||
#else
|
||||
char* SKILL_makeSkillStatusString( Skill* skill )
|
||||
{
|
||||
snprintf( ITEM_statusStringBuffer,
|
||||
sizeof( ITEM_statusStringBuffer ),
|
||||
"%d|%d",
|
||||
SKILL_getInt(skill,SKILL_IDENTITY),
|
||||
SKILL_getInt(skill,SKILL_LEVEL) );
|
||||
|
||||
|
||||
return ITEM_statusStringBuffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
char* SKILL_makeSkillFalseString( void )
|
||||
{
|
||||
snprintf( ITEM_statusStringBuffer,
|
||||
sizeof( ITEM_statusStringBuffer ),
|
||||
"|" );
|
||||
return ITEM_statusStringBuffer;
|
||||
}
|
||||
|
||||
|
||||
BOOL SKILL_CHECKID( int skillid )
|
||||
{
|
||||
if( SKILL_NUM <= skillid && skillid > 0 )return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL SKILL_makeSkillData( Skill* sk ,int skid, int lev )
|
||||
{
|
||||
sk->data[SKILL_LEVEL] = lev;
|
||||
sk->data[SKILL_IDENTITY] = skid;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int SKILL_levelup( Skill* sk )
|
||||
{
|
||||
int id = sk->data[SKILL_IDENTITY];
|
||||
if( !SKILL_CHECKID(id) )return -1;
|
||||
sk->data[SKILL_LEVEL] ++;
|
||||
sk->data[SKILL_LEVEL] = min( sk->data[SKILL_LEVEL],
|
||||
SKILL_tbl[id].maxlevel );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int SKILL_getLevelFromSkillID( int charaindex, SKILL_ID id )
|
||||
{
|
||||
int i;
|
||||
if( !CHAR_CHECKINDEX(charaindex) )return -1;
|
||||
for( i=0 ; i<CHAR_SKILLMAXHAVE ; i++ ){
|
||||
CHAR_HaveSkill* sk;
|
||||
sk = CHAR_getCharHaveSkill(charaindex,i);
|
||||
if( sk && sk->use && sk->skill.data[SKILL_IDENTITY] == id )
|
||||
return sk->skill.data[SKILL_LEVEL];
|
||||
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
BOOL SKILL_getUpableSkillID( int charaindex,char* buf, int buflen )
|
||||
{
|
||||
int i;
|
||||
if( !CHAR_CHECKINDEX(charaindex)) return FALSE;
|
||||
if( buflen <= 0 )return FALSE;
|
||||
buf[0] = '\0';
|
||||
for( i=0 ; i<CHAR_SKILLMAXHAVE ; i++ ){
|
||||
CHAR_HaveSkill* chsk;
|
||||
chsk = CHAR_getCharHaveSkill(charaindex,i);
|
||||
if( chsk && chsk->use
|
||||
&& SKILL_CHECKID(chsk->skill.data[SKILL_IDENTITY])
|
||||
&& chsk->skill.data[SKILL_LEVEL]
|
||||
< SKILL_tbl[chsk->skill.data[SKILL_IDENTITY]].maxlevel ){
|
||||
char tmpbuf[512];
|
||||
snprintf( tmpbuf,sizeof(tmpbuf),"%d|",
|
||||
chsk->skill.data[SKILL_IDENTITY] );
|
||||
strcatsafe( buf, buflen,tmpbuf );
|
||||
}
|
||||
}
|
||||
dchop(buf,"|");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void SKILL_skillEffect( int charaindex )
|
||||
{
|
||||
int i;
|
||||
if( !CHAR_CHECKINDEX(charaindex) )return;
|
||||
|
||||
if( CHAR_getInt(charaindex,CHAR_WHICHTYPE) != CHAR_TYPEPLAYER)
|
||||
return;
|
||||
|
||||
for( i=0 ; i<CHAR_SKILLMAXHAVE ; i ++ ){
|
||||
typedef void (*SKILLEFFECTFUNC)(int,Skill*);
|
||||
SKILLEFFECTFUNC skfunc;
|
||||
CHAR_HaveSkill* cskill;
|
||||
Skill* skill;
|
||||
int id;
|
||||
|
||||
cskill = CHAR_getCharHaveSkill(charaindex,i);
|
||||
if( cskill == NULL || cskill->use == FALSE )continue;
|
||||
|
||||
skill = &cskill->skill;
|
||||
id = skill->data[SKILL_IDENTITY];
|
||||
if( !SKILL_CHECKID(id) )continue;
|
||||
|
||||
skfunc = (SKILLEFFECTFUNC)SKILL_tbl[id].effectfunc;
|
||||
if( skfunc )skfunc(charaindex,skill);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物职业
|
||||
// 取使用魔法耗费MP
|
||||
int PROFESSION_MAGIC_COST_MP( int charaindex, int skill_num )
|
||||
{
|
||||
int skill_level=0, dec_mp=0;
|
||||
int Pskillid, skillid;
|
||||
char *skill_name;
|
||||
CHAR_HaveSkill* hskill;
|
||||
|
||||
// 人物技能
|
||||
skillid = CHAR_getCharSkill( charaindex, skill_num);
|
||||
Pskillid = PROFESSION_SKILL_getskillArray( skillid);
|
||||
if( Pskillid == -1 ) return FALSE;
|
||||
|
||||
// 技能名称
|
||||
skill_name = PROFESSION_SKILL_getChar( Pskillid, PROFESSION_SKILL_FUNCNAME);
|
||||
|
||||
// 技能等级
|
||||
hskill = CHAR_getCharHaveSkill( charaindex, skill_num );
|
||||
skill_level = SKILL_getInt( &hskill->skill, SKILL_LEVEL);
|
||||
skill_level = PROFESSION_CHANGE_SKILL_LEVEL_M( skill_level );
|
||||
|
||||
if( (strcmp( skill_name, "PROFESSION_VOLCANO_SPRINGS" )) == 0 ){ // 火山泉
|
||||
if( skill_level >= 10 ) dec_mp = 35;
|
||||
else if( skill_level >= 7 ) dec_mp = 30;
|
||||
else if( skill_level >= 5 ) dec_mp = 20;
|
||||
else if( skill_level >= 3 ) dec_mp = 15;
|
||||
else dec_mp = 10;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_FIRE_BALL" )) == 0 ){ // 火星球
|
||||
if( skill_level >= 9 ) dec_mp = 50;
|
||||
else if( skill_level >= 7 ) dec_mp = 45;
|
||||
else if( skill_level >= 5 ) dec_mp = 40;
|
||||
else if( skill_level >= 3 ) dec_mp = 35;
|
||||
else dec_mp = 30;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_SUMMON_THUNDER" )) == 0 ){ // 召雷术
|
||||
if( skill_level >= 8 ) dec_mp = 30;
|
||||
else if( skill_level >= 5 ) dec_mp = 25;
|
||||
else if( skill_level >= 3) dec_mp = 20;
|
||||
else dec_mp = 10;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_CURRENT" )) == 0 ){ // 电流术
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
if( skill_level >= 10 ) dec_mp = 100;
|
||||
else if( skill_level > 9 ) dec_mp = 90;
|
||||
else if( skill_level > 8 ) dec_mp = 80;
|
||||
else if( skill_level > 7 ) dec_mp = 70;
|
||||
else if( skill_level > 6 ) dec_mp = 60;
|
||||
else if( skill_level > 4 ) dec_mp = 50;
|
||||
else if( skill_level > 2 ) dec_mp = 40;
|
||||
else dec_mp = 30;
|
||||
#else
|
||||
if( skill_level >= 9 ) dec_mp = 80;
|
||||
else if( skill_level >= 7 ) dec_mp = 60;
|
||||
else if( skill_level >= 5 ) dec_mp = 50;
|
||||
else if( skill_level >= 3 ) dec_mp = 40;
|
||||
else dec_mp = 30;
|
||||
#endif
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_STORM" )) == 0 ){ // 暴风雨
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
if( skill_level > 8 ) dec_mp = 50;
|
||||
else if( skill_level > 6 ) dec_mp = 45;
|
||||
else if( skill_level > 4 ) dec_mp = 40;
|
||||
else if( skill_level > 2 ) dec_mp = 35;
|
||||
else dec_mp = 30;
|
||||
#else
|
||||
if( skill_level >= 10 ) dec_mp = 80;
|
||||
else if( skill_level >= 6 ) dec_mp = 70;
|
||||
else if( skill_level >= 5 ) dec_mp = 60;
|
||||
else dec_mp = 50;
|
||||
#endif
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_ICE_ARROW" )) == 0 ){ // 冰箭术
|
||||
if( skill_level >= 8) dec_mp = 20;
|
||||
else if( skill_level >= 4 ) dec_mp = 15;
|
||||
else dec_mp = 10;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_ICE_CRACK" )) == 0 ){ // 冰爆术
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
if( skill_level >= 10 ) dec_mp = 80;
|
||||
else if( skill_level > 8 ) dec_mp = 70;
|
||||
else if( skill_level > 6 ) dec_mp = 60;
|
||||
else if( skill_level > 4 ) dec_mp = 50;
|
||||
else if( skill_level > 2 ) dec_mp = 40;
|
||||
else dec_mp = 30;
|
||||
#else
|
||||
if( skill_level >= 9 ) dec_mp = 70;
|
||||
else if( skill_level >= 7 ) dec_mp = 60;
|
||||
else if( skill_level >= 5 ) dec_mp = 50;
|
||||
else if( skill_level >= 3 ) dec_mp = 40;
|
||||
else dec_mp = 30;
|
||||
#endif
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_DOOM" )) == 0 ){ // 世界末日
|
||||
if( skill_level > 8 ) dec_mp = 150;
|
||||
else if( skill_level > 4 ) dec_mp = 100;
|
||||
else dec_mp = 50;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_FIRE_SPEAR" )) == 0 ){ // 火龙枪
|
||||
if( skill_level > 8 ) dec_mp = 80;
|
||||
else if( skill_level > 6 ) dec_mp = 70;
|
||||
else if( skill_level > 4 ) dec_mp = 60;
|
||||
else if( skill_level > 2 ) dec_mp = 40;
|
||||
else dec_mp = 30;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_BLOOD_WORMS" )) == 0 ){ // 嗜血蛊
|
||||
if( skill_level >= 10 ) dec_mp = 15;
|
||||
else if( skill_level >= 5 ) dec_mp = 10;
|
||||
else dec_mp = 5;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_SIGN" )) == 0 ){ // 一针见血
|
||||
|
||||
if( skill_level >= 8 ) dec_mp = 10;
|
||||
else dec_mp = 5;
|
||||
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_ENCLOSE" )) == 0 ){ // 附身术
|
||||
if( skill_level >= 10 ) dec_mp = 80;
|
||||
else if( skill_level >= 8 ) dec_mp = 70;
|
||||
else if( skill_level >= 5) dec_mp = 60;
|
||||
else dec_mp = 50;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_ICE_MIRROR" )) == 0 ){ // 冰镜术
|
||||
if( skill_level >= 9 ) dec_mp = 40;
|
||||
else if( skill_level >= 7 ) dec_mp = 35;
|
||||
else if( skill_level >= 5 ) dec_mp = 30;
|
||||
else if( skill_level >= 3 ) dec_mp = 25;
|
||||
else dec_mp = 20;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_FIRE_ENCLOSE" )) == 0 ){ // 火附体
|
||||
if( skill_level >= 10 ) dec_mp = 50;
|
||||
else if( skill_level >= 7 ) dec_mp = 40;
|
||||
else if( skill_level >= 4 ) dec_mp = 30;
|
||||
else dec_mp = 20;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_ICE_ENCLOSE" )) == 0 ){ // 冰附体
|
||||
if( skill_level >= 10 ) dec_mp = 50;
|
||||
else if( skill_level >= 7 ) dec_mp = 40;
|
||||
else if( skill_level >= 4 ) dec_mp = 30;
|
||||
else dec_mp = 20;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_THUNDER_ENCLOSE" )) == 0 ){ // 雷附体
|
||||
if( skill_level >= 10 ) dec_mp = 50;
|
||||
else if( skill_level >= 7 ) dec_mp = 40;
|
||||
else if( skill_level >= 4 ) dec_mp = 30;
|
||||
else dec_mp = 20;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_TRANSPOSE" )) == 0 ){ // 移形换位
|
||||
if( skill_level >= 10 ) dec_mp = 50;
|
||||
else if( skill_level >= 9 ) dec_mp = 40;
|
||||
else if( skill_level >= 7 ) dec_mp = 30;
|
||||
else if( skill_level >= 4 ) dec_mp = 20;
|
||||
else dec_mp = 10;
|
||||
}else
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
if( (strcmp( skill_name, "PROFESSION_RESIST_F_I_T" )) == 0 ){ // 自然威能
|
||||
if( skill_level >= 10 ) dec_mp = 20;
|
||||
else if( skill_level >= 9 ) dec_mp = 15;
|
||||
else if( skill_level >= 6 ) dec_mp = 10;
|
||||
else dec_mp = 5;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_CALL_NATURE" )) == 0 ){ // 号召自然
|
||||
|
||||
/*skill_level = SKILL_getInt( &hskill->skill, SKILL_LEVEL);
|
||||
if( skill_level >= 100 ) dec_mp = 50;
|
||||
else if( skill_level > 95 ) dec_mp = 50;
|
||||
else if( skill_level > 90 ) dec_mp = 50;
|
||||
else if( skill_level > 85 ) dec_mp = 50;
|
||||
else if( skill_level > 80 ) dec_mp = 50;
|
||||
else if( skill_level > 60 ) dec_mp = 50;
|
||||
else if( skill_level > 40 ) dec_mp = 50;
|
||||
else if( skill_level > 20 ) dec_mp = 50;
|
||||
else dec_mp = 50;*/
|
||||
dec_mp = 50;
|
||||
}else
|
||||
if( (strcmp( skill_name, "PROFESSION_BOUNDARY" )) == 0 ){ // 四属性结界
|
||||
char *pszP=NULL;
|
||||
if( skill_level > 9 ) dec_mp = 20;
|
||||
else if( skill_level > 6 ) dec_mp = 15;
|
||||
else dec_mp = 10;
|
||||
//破除结界耗损mp与其他结界不同
|
||||
if( (pszP = strstr( PROFESSION_SKILL_getChar( Pskillid, PROFESSION_SKILL_OPTION), "破结界" ) ) != NULL ){// 技能的参数
|
||||
if( skill_level >= 9 ) dec_mp = 20;
|
||||
else if( skill_level > 4 ) dec_mp = 15;
|
||||
else if( skill_level > 2 ) dec_mp = 10;
|
||||
else dec_mp = 5;
|
||||
}
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return dec_mp;
|
||||
}
|
||||
|
||||
|
||||
INLINE int PROFESSION_CHANGE_SKILL_LEVEL_M( int skill_level )
|
||||
{
|
||||
if( skill_level > 90 )skill_level = 10;
|
||||
else if( skill_level > 80 ) skill_level = 9;
|
||||
else if( skill_level > 70 ) skill_level = 8;
|
||||
else if( skill_level > 60 ) skill_level = 7;
|
||||
else if( skill_level > 50 ) skill_level = 6;
|
||||
else if( skill_level > 40 ) skill_level = 5;
|
||||
else if( skill_level > 30 ) skill_level = 4;
|
||||
else if( skill_level > 20 ) skill_level = 3;
|
||||
else if( skill_level > 10 ) skill_level = 2;
|
||||
else skill_level = 1;
|
||||
|
||||
return skill_level;
|
||||
}
|
||||
|
||||
|
||||
INLINE int PROFESSION_CHANGE_SKILL_LEVEL_A( int skill_level )
|
||||
{
|
||||
if( skill_level >= 100 ) skill_level = 10;
|
||||
else if( skill_level > 90 ) skill_level = 9;
|
||||
else if( skill_level > 80 ) skill_level = 8;
|
||||
else if( skill_level > 70 ) skill_level = 7;
|
||||
else if( skill_level > 60 ) skill_level = 6;
|
||||
else if( skill_level > 50 ) skill_level = 5;
|
||||
else if( skill_level > 40 ) skill_level = 4;
|
||||
else if( skill_level > 30 ) skill_level = 3;
|
||||
else if( skill_level > 20 ) skill_level = 2;
|
||||
else if( skill_level > 10 ) skill_level = 1;
|
||||
else skill_level = 0;
|
||||
|
||||
return skill_level;
|
||||
}
|
||||
#endif
|
||||
|
1083
gmsv/char/title.c
Normal file
1083
gmsv/char/title.c
Normal file
File diff suppressed because it is too large
Load Diff
1942
gmsv/char/trade.c
Normal file
1942
gmsv/char/trade.c
Normal file
File diff suppressed because it is too large
Load Diff
2676
gmsv/configfile.c
Normal file
2676
gmsv/configfile.c
Normal file
File diff suppressed because it is too large
Load Diff
793
gmsv/function.c
Normal file
793
gmsv/function.c
Normal file
@ -0,0 +1,793 @@
|
||||
#include "version.h"
|
||||
#include <string.h>
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "char_event.h"
|
||||
#include "char.h"
|
||||
#include "item_event.h"
|
||||
#include "magic.h"
|
||||
#include "pet_event.h"
|
||||
#include "npc_townpeople.h"
|
||||
#include "npc_Dengon.h"
|
||||
#include "npc_door.h"
|
||||
#include "npc_healer.h"
|
||||
#include "npc_oldman.h"
|
||||
#include "npc_warp.h"
|
||||
#include "npc_storyteller.h"
|
||||
#include "npc_msg.h"
|
||||
#include "npc_npcenemy.h"
|
||||
#include "npc_action.h"
|
||||
#include "npc_windowman.h"
|
||||
#include "npc_savepoint.h"
|
||||
#include "npc_windowhealer.h"
|
||||
#include "npc_itemshop.h"
|
||||
#include "npc_sysinfo.h"
|
||||
#include "npc_duelranking.h"
|
||||
#include "npc_petskillshop.h"
|
||||
#include "npc_petshop.h"
|
||||
#include "npc_signboard.h"
|
||||
#include "npc_warpman.h"
|
||||
#include "npc_exchangeman.h"
|
||||
#include "petmail.h"
|
||||
#include "npc_timeman.h"
|
||||
#include "npc_bodylan.h"
|
||||
#include "npc_mic.h"
|
||||
#include "npc_luckyman.h"
|
||||
#include "npc_bus.h"
|
||||
#include "npc_charm.h"
|
||||
#include "npc_poolitemshop.h"
|
||||
#include "npc_quiz.h"
|
||||
#include "npc_checkman.h"
|
||||
#include "npc_janken.h"
|
||||
#include "npc_transmigration.h"
|
||||
#include "battle_event.h"
|
||||
#include "enemy.h"
|
||||
// Robin 0517
|
||||
#include "npc_familyman.h"
|
||||
#include "npc_bankman.h"
|
||||
// add code by shan
|
||||
#include "npc_fmdengon.h"
|
||||
#include "npc_fmhealer.h"
|
||||
#include "npc_petmaker.h"
|
||||
|
||||
// CoolFish: Family 2001/6/4
|
||||
#include "npc_fmwarpman.h"
|
||||
#include "npc_fmpkman.h"
|
||||
#include "npc_fmpkcallman.h"
|
||||
|
||||
// Arminius 7.7 Airplane
|
||||
#include "npc_airplane.h"
|
||||
|
||||
// Arminius 7.13 Scheduleman
|
||||
#include "npc_scheduleman.h"
|
||||
|
||||
// Arminius 7.24 manor scheduleman
|
||||
#include "npc_manorsman.h"
|
||||
|
||||
// Robin 0725
|
||||
#include "npc_riderman.h"
|
||||
#include "npc_fmletter.h"
|
||||
|
||||
#ifdef _SERVICE
|
||||
// Terry 2001/09/01
|
||||
#include "npc_stoneserviceman.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_SELLSTH
|
||||
#include "npc_sellsthman.h"
|
||||
#endif
|
||||
|
||||
//andy
|
||||
#ifdef _GAMBLE_BANK
|
||||
#include "npc_gamblebank.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NEW_WARPMAN
|
||||
#include "npc_newnpcman.h"
|
||||
#endif
|
||||
|
||||
#ifdef _MARKET_TRADE
|
||||
#include "npc_mtradenpcman.h"
|
||||
#endif
|
||||
|
||||
#ifdef _GAMBLE_ROULETTE
|
||||
#include "npc_gambleroulette.h"
|
||||
#include "npc_gamblemaster.h"
|
||||
#endif
|
||||
|
||||
#ifdef _TRANSER_MAN
|
||||
#include "npc_transerman.h"
|
||||
#endif
|
||||
|
||||
#ifdef _PAUCTION_MAN
|
||||
#include "npc_pauctionman.h"
|
||||
#endif
|
||||
|
||||
#ifdef _CFREE_petskill
|
||||
#include "npc_freepetskillshop.h"
|
||||
#endif
|
||||
|
||||
#ifdef _PETRACE
|
||||
#include "npc_petracemaster.h"
|
||||
#include "npc_petracepet.h"
|
||||
#endif
|
||||
|
||||
#ifdef _AUCTIONEER
|
||||
#include "npc_auctioneer.h"
|
||||
#endif
|
||||
|
||||
#ifdef _BLACK_MARKET
|
||||
#include "npc_blackmarket.h"
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_NPCCHANGE
|
||||
#include "npc_itemchange.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_MAKEPAIR
|
||||
#include "npc_makepair.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_FUSION
|
||||
#include "npc_petfusion.h"
|
||||
#endif
|
||||
|
||||
#ifdef _ALLDOMAN // (不可开) Syu ADD 排行榜NPC
|
||||
#include "npc_alldoman.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_WELFARE
|
||||
#include "npc_welfare.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_WELFARE_2 // WON ADD 职业NPC-2
|
||||
#include "npc_welfare2.h"
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_VERYWELFARE
|
||||
#include "npc_verywelfare.h"
|
||||
#endif
|
||||
|
||||
#ifdef _RACEMAN
|
||||
#include "npc_raceman.h"
|
||||
#endif
|
||||
|
||||
#define DEBUG
|
||||
|
||||
typedef struct tagCorrespondStringAndFunctionTable
|
||||
{
|
||||
STRING32 functionName;
|
||||
void* functionPointer;
|
||||
int hashcode;
|
||||
}CorrespondStringAndFunctionTable;
|
||||
|
||||
static CorrespondStringAndFunctionTable
|
||||
correspondStringAndFunctionTable[]=
|
||||
{
|
||||
/* 动票反扔□田□ 戊□玉匹烂聒今木化中月楮醒分[NPC手仇木
|
||||
毛勾井丹午五互丐月*/
|
||||
{ {"core_PreWalk"}, CHAR_allprewalk, 0 },
|
||||
{ {"core_PostWalk"}, CHAR_allpostwalk, 0 },
|
||||
{ {"core_Loop"}, CHAR_loopFunc, 0 },
|
||||
{ {"core_Dying"}, CHAR_die, 0 },
|
||||
{ {"core_PlayerWatch"}, CHAR_playerWatchfunc, 0 },
|
||||
{ {"core_PlayerTalked"}, CHAR_playerTalkedfunc, 0 },
|
||||
|
||||
|
||||
/* 动票反失奶 丞毛银丹午五迕及楮醒分[ */
|
||||
{ {"MedicineInit"}, ITEM_MedicineInit, 0 },
|
||||
{ {"MedicineUsed"}, ITEM_MedicineUsed, 0 },
|
||||
{ {"SandClockDetach"}, ITEM_SandClockDetach, 0 },
|
||||
{ {"addTitleAttach"}, ITEM_addTitleAttach, 0 },
|
||||
{ {"delTitleDetach"}, ITEM_delTitleDetach, 0 },
|
||||
{ {"ITEM_DeleteByWatched"}, ITEM_DeleteByWatched, 0 },
|
||||
{ {"ITEM_DeleteTimeWatched"}, ITEM_DeleteTimeWatched, 0 },
|
||||
{ {"ITEM_useEffectTohelos"}, ITEM_useEffectTohelos, 0 },
|
||||
|
||||
// { {"ITEM_useHpRecovery"}, ITEM_useHpRecovery, 0 },
|
||||
{ {"ITEM_useRecovery"}, ITEM_useRecovery, 0 },
|
||||
#ifdef _ITEM_MAGICRECOVERY
|
||||
{ {"ITEM_useMRecovery"}, ITEM_useMRecovery, 0 },
|
||||
#endif
|
||||
#ifdef _ITEM_USEMAGIC
|
||||
{ {"ITEM_useMagic"}, ITEM_useMagic, 0 },
|
||||
#endif
|
||||
{ {"ITEM_useStatusChange"}, ITEM_useStatusChange, 0 },
|
||||
{ {"ITEM_useStatusRecovery"}, ITEM_useStatusRecovery, 0 },
|
||||
{ {"ITEM_useMagicDef"}, ITEM_useMagicDef, 0 },
|
||||
{ {"ITEM_useParamChange"}, ITEM_useParamChange, 0 },
|
||||
{ {"ITEM_useFieldChange"}, ITEM_useFieldChange, 0 },
|
||||
{ {"ITEM_useAttReverse"}, ITEM_useAttReverse, 0 },
|
||||
{ {"ITEM_useRessurect"}, ITEM_useRessurect, 0 },
|
||||
{ {"ITEM_useMic"}, ITEM_useMic, 0 },
|
||||
{ {"ITEM_dropMic"}, ITEM_dropMic, 0 },
|
||||
{ {"ITEM_useCaptureUp"}, ITEM_useCaptureUp, 0 },
|
||||
{ {"ITEM_useRenameItem"}, ITEM_useRenameItem, 0 },
|
||||
{ {"ITEM_pickupDice"}, ITEM_pickupDice, 0 },
|
||||
{ {"ITEM_dropDice"}, ITEM_dropDice, 0 },
|
||||
{ {"ITEM_initLottery"}, ITEM_initLottery, 0 },
|
||||
{ {"ITEM_useLottery"}, ITEM_useLottery, 0 },
|
||||
{ {"ITEM_useWarp"}, ITEM_useWarp, 0 },
|
||||
{ {"ITEM_petFollow"}, ITEM_petFollow, 0 },
|
||||
{ {"ITEM_useSkup"}, ITEM_useSkup, 0 }, // Nuke 0624: Hero's bless
|
||||
{ {"ITEM_useNoenemy"}, ITEM_useNoenemy, 0 }, // Nuke 0626: Dragon's help
|
||||
{ {"ITEM_equipNoenemy"},ITEM_equipNoenemy, 0 }, // Arminius 7.2 Ra's amulet
|
||||
{ {"ITEM_remNoenemy"}, ITEM_remNoenemy, 0 }, // Arminius 7.2 Ra's amulet
|
||||
{ {"ITEM_useEncounter"}, ITEM_useEncounter, 0}, // Arminius 7.31 cursed stone
|
||||
|
||||
{ {"ITEM_AddPRSkillPoint"}, ITEM_AddPRSkillPoint, 0},
|
||||
{ {"ITEM_AddPRSkillPercent"}, ITEM_AddPRSkillPercent, 0},
|
||||
|
||||
#ifdef _ITEM_METAMO
|
||||
{ {"ITEM_metamo"}, ITEM_metamo, 0 },
|
||||
{ {"ITEM_ColorMetamo"}, ITEM_ColorMetamo, 0 },
|
||||
{ {"ITEM_CharaMetamo"}, ITEM_CharaMetamo, 0 },
|
||||
{ {"ITEM_SexMetamo"}, ITEM_SexMetamo, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _USEWARP_FORNUM
|
||||
{ {"ITEM_useWarpForNum"}, ITEM_useWarpForNum, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _IMPRECATE_ITEM
|
||||
{ {"ITEM_useImprecate"}, ITEM_useImprecate, 0 },
|
||||
#endif
|
||||
#ifdef _ITEM_FIRECRACKER //Terry add 2001/12/21
|
||||
{ {"ITEM_firecracker"}, ITEM_firecracker, 0 },
|
||||
#endif
|
||||
#ifdef _ITEM_CRACKER //vincent 拉炮
|
||||
{ {"ITEM_Cracker"}, ITEM_Cracker, 0 },
|
||||
#endif
|
||||
#ifdef _ITEM_ADDEXP //vincent 经验提升
|
||||
{ {"ITEM_Addexp"}, ITEM_Addexp, 0 },
|
||||
#endif
|
||||
#ifdef _ITEM_REFRESH //vincent 解除异常状态道具
|
||||
{ {"ITEM_Refresh"}, ITEM_Refresh, 0 },
|
||||
#endif
|
||||
|
||||
{ {"ITEM_WearEquip"}, ITEM_WearEquip, 0 },
|
||||
{ {"ITEM_ReWearEquip"}, ITEM_ReWearEquip, 0 },
|
||||
|
||||
#ifdef _ITEM_CONSTITUTION
|
||||
{ {"ITEM_Constitution"}, ITEM_Constitution, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _Item_ReLifeAct
|
||||
{ {"ITEM_DIErelife"}, ITEM_DIErelife, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_ORNAMENTS
|
||||
{ {"ITEM_PutOrnaments"}, ITEM_PutOrnaments, 0},
|
||||
#endif
|
||||
#ifdef _CHIKULA_STONE
|
||||
{ {"ITEM_ChikulaStone"}, ITEM_ChikulaStone, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _THROWITEM_ITEMS
|
||||
{ {"ITEM_ThrowItemBox"}, ITEM_ThrowItemBox, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_WATERWORDSTATUS
|
||||
{ {"ITEM_WaterWordStatus"}, ITEM_WaterWordStatus, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_LOVERPARTY
|
||||
{ {"ITEM_LoverSelectUser"}, ITEM_LoverSelectUser, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _Item_MoonAct
|
||||
{ {"ITEM_randEnemyEquipOne"}, ITEM_randEnemyEquipOne, 0 },
|
||||
|
||||
{ {"ITEM_randEnemyEquip"}, ITEM_randEnemyEquip, 0 },
|
||||
{ {"ITEM_RerandEnemyEquip"}, ITEM_RerandEnemyEquip, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _SUIT_ITEM
|
||||
{ {"ITEM_suitEquip"}, ITEM_suitEquip, 0 },
|
||||
{ {"ITEM_ResuitEquip"}, ITEM_ResuitEquip, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _Item_DeathAct
|
||||
{ {"ITEM_useDeathcounter"}, ITEM_UseDeathCounter, 0 },
|
||||
#endif
|
||||
#ifdef _DEATH_CONTENDWATCH
|
||||
{ {"ITEM_useWatchBattle"}, ITEM_useWatchBattle, 0 },
|
||||
#endif
|
||||
#ifdef _FEV_ADD_NEW_ITEM // FEV ADD 增加复活守精
|
||||
{ {"ITEM_ResAndDef"} , ITEM_ResAndDef, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _CHRISTMAS_REDSOCKS
|
||||
{ {"ITEM_useMaxRedSocks"}, ITEM_useMaxRedSocks, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _CHRISTMAS_REDSOCKS_NEW
|
||||
{ {"ITEM_useMaxRedSocksNew"}, ITEM_useMaxRedSocksNew, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_CANNEDFOOD
|
||||
{ {"ITEM_useSkillCanned"}, ITEM_useSkillCanned, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _NEW_RIDEPETS
|
||||
{ {"ITEM_useLearnRideCode"}, ITEM_useLearnRideCode, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _EQUIT_DEFMAGIC
|
||||
{ {"ITEM_MagicEquitWear"}, ITEM_MagicEquitWear, 0 },
|
||||
{ {"ITEM_MagicEquitReWear"}, ITEM_MagicEquitReWear, 0 },
|
||||
#endif
|
||||
#ifdef _EQUIT_RESIST
|
||||
{ {"ITEM_MagicResist"}, ITEM_MagicResist, 0 },
|
||||
{ {"ITEM_MagicReResist"}, ITEM_MagicReResist, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _MAGIC_RESIST_EQUIT // WON ADD 职业抗性装备
|
||||
{ {"ITEM_P_MagicEquitWear"}, ITEM_P_MagicEquitWear, 0 },
|
||||
{ {"ITEM_P_MagicEquitReWear"}, ITEM_P_MagicEquitReWear, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
{ {"ITEM_AngelToken"}, ITEM_AngelToken, 0 },
|
||||
{ {"ITEM_HeroToken"}, ITEM_HeroToken, 0 },
|
||||
#endif
|
||||
#ifdef _HALLOWEEN_EFFECT
|
||||
{ {"ITEM_MapEffect"}, ITEM_MapEffect, 0 },
|
||||
#endif
|
||||
|
||||
{ {"ITEM_changePetOwner"}, ITEM_changePetOwner, 0 },
|
||||
|
||||
{ {"core_PetWatch"}, PET_Watchfunc, 0 },
|
||||
{ {"PETMAIL_Loop"}, PETMAIL_Loopfunc, 0 },
|
||||
#ifdef _USER_CHARLOOPS
|
||||
{ {"CHAR_BattleStayLoop"}, CHAR_BattleStayLoop, 0 },
|
||||
{ {"PET_CheckIncubateLoop"}, PET_CheckIncubate, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_PROPERTY
|
||||
{ {"PET_PetskillPropertyEvent"}, PET_PetskillPropertyEvent, 0 },
|
||||
#endif
|
||||
{ {"core_PetTalk"}, PET_Talkfunc, 0}, // Arminius 8.14 pet talk
|
||||
|
||||
|
||||
/* warp */
|
||||
{ {"WarpInit"}, NPC_WarpInit, 0 },
|
||||
{ {"WarpPostOver"}, NPC_WarpPostOver, 0 },
|
||||
{ {"WarpWatch"}, NPC_WarpWatch, 0 },
|
||||
|
||||
/* Dengon */
|
||||
{ {"DengonInit"}, NPC_DengonInit, 0 },
|
||||
{ {"DengonWindowTalked"}, NPC_DengonWindowTalked, 0 },
|
||||
{ {"DengonLooked"}, NPC_DengonLooked, 0 },
|
||||
|
||||
/* FmDengon add code by shan */
|
||||
{ {"FmDengonInit"}, NPC_FmDengonInit, 0 },
|
||||
{ {"FmDengonWindowTalked"}, NPC_FmDengonWindowTalked, 0 },
|
||||
{ {"FmDengonLooked"}, NPC_FmDengonLooked, 0 },
|
||||
|
||||
/* Healer */
|
||||
{ {"HealerInit"} , NPC_HealerInit, 0 },
|
||||
{ {"HealerTalked"} , NPC_HealerTalked , 0 },
|
||||
|
||||
/* FMHealer add code by shan */
|
||||
{ {"FmHealerInit"} , NPC_FmHealerInit, 0 },
|
||||
{ {"FmHealerTalked"} , NPC_FmHealerTalked , 0 },
|
||||
|
||||
/* petmaker add code by shan */
|
||||
{ {"PetMakerInit"} , NPC_PetMakerInit, 0 },
|
||||
{ {"PetMakerTalked"} , NPC_PetMakerTalked , 0 },
|
||||
|
||||
/* TownPeople */
|
||||
{ {"TownPeopleTalked"}, NPC_TownPeopleTalked, 0 },
|
||||
{ {"TownPeopleInit"}, NPC_TownPeopleInit, 0 },
|
||||
|
||||
/* TownPeople */
|
||||
{ {"MsgLooked"}, NPC_MsgLooked , 0 },
|
||||
{ {"MsgInit"}, NPC_MsgInit, 0 },
|
||||
|
||||
/* Oldman */
|
||||
{ {"OldmanInit"} , NPC_OldmanInit , 0 },
|
||||
{ {"OldmanTalked"} , NPC_OldmanTalked , 0 },
|
||||
|
||||
/* SavePOint */
|
||||
{ {"SavePointInit"} , NPC_SavePointInit , 0 },
|
||||
{ {"SavePointTalked"} , NPC_SavePointTalked , 0 },
|
||||
{ {"SavePointWindowTalked"}, NPC_SavePointWindowTalked, 0 },
|
||||
|
||||
/* StoryTeller */
|
||||
{ {"StoryTellerInit"} , NPC_StoryTellerInit , 0 },
|
||||
{ {"StoryTellerTalked"} , NPC_StoryTellerTalked , 0 },
|
||||
|
||||
/* NPCEnemy */
|
||||
{ {"NPCEnemyInit"} , NPC_NPCEnemyInit , 0 },
|
||||
{ {"NPCEnemyTalked"} , NPC_NPCEnemyTalked , 0 },
|
||||
{ {"NPCEnemyWatch"} , NPC_NPCEnemyWatch , 0 },
|
||||
{ {"NPCEnemyLoop"}, NPC_NPCEnemyLoop, 0 },
|
||||
{ {"NPCEnemyWindowTalked"}, NPC_NPCEnemyWindowTalked, 0 },
|
||||
|
||||
/* 失弁扑亦件楝 */
|
||||
{ {"ActionInit"} , NPC_ActionInit , 0 },
|
||||
{ {"ActionTalked"} , NPC_ActionTalked , 0 },
|
||||
{ {"ActionWatch"} , NPC_ActionWatch , 0 },
|
||||
|
||||
/* 它奴件玉它楝 */
|
||||
{ {"WindowmanInit"} , NPC_WindowmanInit , 0 },
|
||||
{ {"WindowmanTalked"} , NPC_WindowmanTalked , 0 },
|
||||
{ {"WindowmanLooked"}, NPC_WindowmanLooked, 0 },
|
||||
{ {"WindowmanWindowTalked"}, NPC_WindowmanWindowTalked, 0 },
|
||||
|
||||
/* 它奴件玉它甲□仿□ */
|
||||
{ {"WindowHealerInit"} , NPC_WindowHealerInit , 0 },
|
||||
{ {"WindowHealerTalked"} , NPC_WindowHealerTalked, 0 },
|
||||
{ {"WindowHealerLooked"} , NPC_WindowHealerLooked, 0 },
|
||||
{ {"WindowHealerWindowTalked"}, NPC_WindowHealerWindowTalked, 0 },
|
||||
|
||||
/* 失奶 丞盒 */
|
||||
{ {"ItemShopInit"} , NPC_ItemShopInit , 0 },
|
||||
{ {"ItemShopTalked"} , NPC_ItemShopTalked , 0 },
|
||||
{ {"ItemShopWindowTalked"}, NPC_ItemShopWindowTalked, 0 },
|
||||
|
||||
/* Sysinfo */
|
||||
{ {"SysinfoInit"}, NPC_SysinfoInit, 0 },
|
||||
{ {"SysinfoLoop"}, NPC_SysinfoLoop, 0 },
|
||||
{ {"SysinfoTalked"} , NPC_SysinfoTalked , 0 },
|
||||
|
||||
/* Duel仿件平件弘 憎NPC */
|
||||
{ {"DuelrankingInit"} , NPC_DuelrankingInit , 0 },
|
||||
{ {"DuelrankingLooked"}, NPC_DuelrankingLooked, 0 },
|
||||
{ {"DuelrankingWindowTalked"}, NPC_DuelrankingWindowTalked, 0 },
|
||||
#ifdef _DEATH_CONTEND
|
||||
{ {"Duelrankingloop"}, NPC_Duelrankingloop, 0 },
|
||||
#endif
|
||||
/* 它奴件玉它矢永玄及 盒 */
|
||||
{ {"PetSkillShopInit"} , NPC_PetSkillShopInit , 0 },
|
||||
{ {"PetSkillShopTalked"} , NPC_PetSkillShopTalked, 0 },
|
||||
{ {"PetSkillShopLooked"} , NPC_PetSkillShopLooked, 0 },
|
||||
{ {"PetSkillShopWindowTalked"}, NPC_PetSkillShopWindowTalked, 0 },
|
||||
|
||||
/* 它奴件玉它矢永玄 中潸曰盒 */
|
||||
{ {"PetShopInit"} , NPC_PetShopInit, 0 },
|
||||
{ {"PetShopTalked"} , NPC_PetShopTalked, 0 },
|
||||
{ {"PetShopLooked"} , NPC_PetShopLooked, 0 },
|
||||
{ {"PetShopWindowTalked"}, NPC_PetShopWindowTalked,0 },
|
||||
|
||||
/* 枣 */
|
||||
{ {"SignBoardInit"} , NPC_SignBoardInit, 0 },
|
||||
{ {"SignBoardLooked"} , NPC_SignBoardLooked, 0 },
|
||||
{ {"SignBoardWindowTalked"}, NPC_SignBoardWindowTalked, 0 },
|
||||
|
||||
/*伐□皿穴件 */
|
||||
{ {"WarpManInit"}, NPC_WarpManInit, 0 },
|
||||
{ {"WarpManTalked"}, NPC_WarpManTalked, 0 },
|
||||
{ {"WarpManWatch"}, NPC_WarpManWatch, 0 },
|
||||
{ {"WarpManLoop"} , NPC_WarpManLoop, 0 },
|
||||
{ {"WarpManWindowTalked"}, NPC_WarpManWindowTalked,0 },
|
||||
|
||||
|
||||
/*奶矛件玄楝 exchangeman) */
|
||||
{ {"ExChangeManInit"}, NPC_ExChangeManInit, 0 },
|
||||
{ {"ExChangeManTalked"}, NPC_ExChangeManTalked, 0 },
|
||||
{ {"ExChangeManWindowTalked"}, NPC_ExChangeManWindowTalked,0 },
|
||||
|
||||
/*正奶丞穴件 */
|
||||
{ {"TimeManInit"}, NPC_TimeManInit, 0 },
|
||||
{ {"TimeManTalked"}, NPC_TimeManTalked, 0 },
|
||||
{ {"TimeManWatch"} , NPC_TimeManWatch , 0 },
|
||||
|
||||
/* 示犯奴仿件必□斥 */
|
||||
{ {"BodyLanInit"}, NPC_BodyLanInit, 0 },
|
||||
{ {"BodyLanTalked"}, NPC_BodyLanTalked, 0 },
|
||||
{ {"BodyLanWatch"} , NPC_BodyLanWatch , 0 },
|
||||
{ {"BodyLanWindowTalked"} , NPC_BodyLanWindowTalked,0 },
|
||||
|
||||
/* 穴奶弁 */
|
||||
{ {"MicInit"}, NPC_MicInit, 0 },
|
||||
{ {"MicTalked"}, NPC_MicTalked, 0 },
|
||||
|
||||
/* 仿永平□穴件 */
|
||||
{ {"LuckyManInit"} , NPC_LuckyManInit , 0 },
|
||||
{ {"LuckyManTalked"} , NPC_LuckyManTalked, 0 },
|
||||
{ {"LuckyManWindowTalked"}, NPC_LuckyManWindowTalked, 0 },
|
||||
|
||||
/* 楝 */
|
||||
{ {"BusInit"} , NPC_BusInit , 0 },
|
||||
{ {"BusTalked"} , NPC_BusTalked , 0 },
|
||||
{ {"BusLoop"} , NPC_BusLoop , 0 },
|
||||
|
||||
/* 加美航空 */ // Arminius 7.7 Airplane
|
||||
{ {"AirInit"} , NPC_AirInit , 0 },
|
||||
{ {"AirTalked"} , NPC_AirTalked , 0 },
|
||||
{ {"AirLoop"} , NPC_AirLoop , 0 },
|
||||
|
||||
/* 楝 */
|
||||
{ {"CharmInit"} , NPC_CharmInit , 0 },
|
||||
{ {"CharmTalked"} , NPC_CharmTalked, 0 },
|
||||
{ {"CharmWindowTalked"}, NPC_CharmWindowTalked, 0 },
|
||||
|
||||
{ {"PoolItemShopInit"} , NPC_PoolItemShopInit , 0 },
|
||||
{ {"PoolItemShopLoop"} , NPC_PoolItemShopLoop , 0 },
|
||||
{ {"PoolItemShopTalked"} , NPC_PoolItemShopTalked , 0 },
|
||||
{ {"PoolItemShopWindowTalked"}, NPC_PoolItemShopWindowTalked, 0 },
|
||||
|
||||
{ {"QuizInit"} , NPC_QuizInit , 0 },
|
||||
{ {"QuizTalked"} , NPC_QuizTalked, 0 },
|
||||
{ {"QuizWindowTalked"}, NPC_QuizWindowTalked, 0 },
|
||||
|
||||
|
||||
/* 切之匀仁引氏 */
|
||||
{ {"CheckManInit"} , NPC_CheckManInit , 0 },
|
||||
{ {"CheckManTalked"} , NPC_CheckManTalked, 0 },
|
||||
{ {"CheckManWindowTalked"}, NPC_CheckManWindowTalked, 0 },
|
||||
|
||||
/* 元扎氏仃氏楝 */
|
||||
{ {"JankenInit"} , NPC_JankenInit , 0 },
|
||||
{ {"JankenTalked"} , NPC_JankenTalked, 0 },
|
||||
{ {"JankenWindowTalked"}, NPC_JankenWindowTalked, 0 },
|
||||
|
||||
/* 鳖戏谛 */
|
||||
{ {"TransmigrationInit"} , NPC_TransmigrationInit , 0 },
|
||||
{ {"TransmigrationTalked"} , NPC_TransmigrationTalked, 0 },
|
||||
{ {"TransmigrationWindowTalked"}, NPC_TransmigrationWindowTalked, 0 },
|
||||
|
||||
/* Family man */
|
||||
{ {"FamilymanInit"} , NPC_FamilymanInit , 0 },
|
||||
{ {"FamilymanTalked"} , NPC_FamilymanTalked, 0 },
|
||||
{ {"FamilymanLooked"}, NPC_FamilymanLooked,0 },
|
||||
{ {"FamilymanWindowTalked"}, NPC_FamilymanWindowTalked, 0 },
|
||||
|
||||
/* CoolFish: Family WarpMan 2001/6/6 */
|
||||
{ {"FMWarpManInit"}, NPC_FMWarpManInit, 0 },
|
||||
{ {"FMWarpManTalked"}, NPC_FMWarpManTalked, 0 },
|
||||
{ {"FMWarpManLoop"} , NPC_FMWarpManLoop, 0 },
|
||||
{ {"FMWarpManWindowTalked"}, NPC_FMWarpManWindowTalked, 0 },
|
||||
|
||||
/* CoolFish: Family PKMan 2001/7/4 */
|
||||
{ {"FMPKManInit"}, NPC_FMPKManInit, 0 },
|
||||
{ {"FMPKManTalked"}, NPC_FMPKManTalked, 0 },
|
||||
{ {"FMPKManWindowTalked"}, NPC_FMPKManWindowTalked, 0 },
|
||||
|
||||
/* CoolFish: Family PKCallMan 2001/7/13 */
|
||||
{ {"FMPKCallManInit"}, NPC_FMPKCallManInit, 0 },
|
||||
{ {"FMPKCallManTalked"}, NPC_FMPKCallManTalked, 0 },
|
||||
{ {"FMPKCallManWindowTalked"}, NPC_FMPKCallManWindowTalked, 0 },
|
||||
|
||||
/* Bank man */
|
||||
{ {"BankmanInit"} , NPC_BankmanInit , 0 },
|
||||
{ {"BankmanTalked"} , NPC_BankmanTalked, 0 },
|
||||
{ {"BankmanLooked"}, NPC_BankmanLooked,0 },
|
||||
{ {"BankmanWindowTalked"}, NPC_BankmanWindowTalked, 0 },
|
||||
|
||||
/* Arminius 7.13 scheduleman */
|
||||
{ {"SchedulemanInit"}, NPC_SchedulemanInit, 0},
|
||||
{ {"SchedulemanTalked"}, NPC_SchedulemanTalked, 0},
|
||||
{ {"SchedulemanWindowTalked"}, NPC_SchedulemanWindowTalked, 0},
|
||||
{ {"SchedulemanLoop"}, NPC_SchedulemanLoop, 0},
|
||||
|
||||
/* Arminius 7.24 manor scheduleman */
|
||||
{ {"ManorSmanInit"}, NPC_ManorSmanInit, 0},
|
||||
{ {"ManorSmanTalked"}, NPC_ManorSmanTalked, 0},
|
||||
{ {"ManorSmanWindowTalked"}, NPC_ManorSmanWindowTalked, 0},
|
||||
{ {"ManorSmanLoop"}, NPC_ManorSmanLoop, 0},
|
||||
|
||||
/* Rider man */
|
||||
{ {"RidermanInit"} , NPC_RidermanInit , 0 },
|
||||
{ {"RidermanTalked"} , NPC_RidermanTalked, 0 },
|
||||
{ {"RidermanLooked"}, NPC_RidermanLooked,0 },
|
||||
{ {"RidermanWindowTalked"}, NPC_RidermanWindowTalked, 0 },
|
||||
|
||||
/* FmLetter man */
|
||||
{ {"FmLetterInit"} , NPC_FmLetterInit , 0 },
|
||||
{ {"FmLetterTalked"} , NPC_FmLetterTalked, 0 },
|
||||
{ {"FmLetterLooked"}, NPC_FmLetterLooked,0 },
|
||||
{ {"FmLetterWindowTalked"}, NPC_FmLetterWindowTalked, 0 },
|
||||
#ifdef _SERVICE
|
||||
// Terry 2001/08/31
|
||||
// 石器服务员 StoneServiceMan
|
||||
{ {"StoneServiceManInit"}, NPC_StoneServiceManInit,0},
|
||||
{ {"StoneServiceManLoop"}, NPC_StoneServiceManLoop,0},
|
||||
{ {"StoneServiceManTalked"}, NPC_StoneServiceManTalked,0},
|
||||
{ {"StoneServiceManWindowTalked"}, NPC_StoneServiceManWindowTalked,0},
|
||||
#endif
|
||||
|
||||
#ifdef _GAMBLE_BANK //银行
|
||||
{ {"GambleBankInit"}, NPC_GambleBankInit, 0},
|
||||
{ {"GambleBankLoop"}, NPC_GambleBankLoop,0},
|
||||
{ {"GambleBankTalked"}, NPC_GambleBankTalked,0},
|
||||
{ {"GambleBankWindowTalked"}, NPC_GambleBankWindowTalked,0},
|
||||
#endif
|
||||
|
||||
#ifdef _PET_LIMITLEVEL
|
||||
{ {"ITEM_useOtherEditBase"}, ITEM_useOtherEditBase, 0},
|
||||
#endif
|
||||
#ifdef _ITEM_EDITBASES
|
||||
{ {"ITEM_useFusionEditBase"}, ITEM_useFusionEditBase, 0},
|
||||
#endif
|
||||
#ifdef _GAMBLE_ROULETTE //赌场轮盘
|
||||
{ {"GambleRouletteInit"}, NPC_Gamble_RouletteInit, 0},
|
||||
{ {"GambleRouletteLoop"}, NPC_Gamble_RouletteLoop, 0},
|
||||
{ {"GambleRouletteTalked"}, NPC_Gamble_RouletteTalked, 0},
|
||||
{ {"GambleRouletteWindowTalked"}, NPC_Gamble_RouletteWindowTalked, 0},
|
||||
|
||||
{ {"GambleMasterInit"}, NPC_Gamble_MasterInit, 0},
|
||||
{ {"GambleMasterLoop"}, NPC_Gamble_MasterLoop, 0},
|
||||
{ {"GambleMasterTalked"}, NPC_Gamble_MasterTalked, 0},
|
||||
{ {"GambleMasterWindowTalked"}, NPC_Gamble_MasterWindowTalked, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _TRANSER_MAN
|
||||
{ {"TranserManInit"}, NPC_TranserManInit, 0 },
|
||||
{ {"TranserManTalked"}, NPC_TranserManTalked, 0 },
|
||||
{ {"TranserManLoop"} , NPC_TranserManLoop, 0 },
|
||||
{ {"TranserManWindowTalked"}, NPC_TranserManWindowTalked, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_SELLSTH
|
||||
{ {"SellsthManInit"}, NPC_SellsthManInit, 0 },
|
||||
{ {"SellsthManTalked"}, NPC_SellsthManTalked, 0 },
|
||||
{ {"SellsthManLoop"} , NPC_SellsthManLoop, 0 },
|
||||
{ {"SellsthManWindowTalked"}, NPC_SellsthManWindowTalked, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_MAKEPAIR
|
||||
{ {"MakePairManInit"}, NPC_MakePairManInit, 0 },
|
||||
{ {"MakePairManTalked"}, NPC_MakePairManTalked, 0 },
|
||||
{ {"MakePairManLoop"} , NPC_MakePairManLoop, 0 },
|
||||
{ {"MakePairManWindowTalked"}, NPC_MakePairManWindowTalked,0 },
|
||||
#endif
|
||||
#ifdef _NPC_FUSION
|
||||
{ {"PetFusionManInit"}, NPC_PetFusionManInit, 0 },
|
||||
{ {"PetFusionManTalked"}, NPC_PetFusionManTalked, 0 },
|
||||
{ {"PetFusionManLoop"} , NPC_PetFusionManLoop, 0 },
|
||||
{ {"PetFusionManWindowTalked"}, NPC_PetFusionManWindowTalked,0 },
|
||||
#endif
|
||||
#ifdef _PAUCTION_MAN
|
||||
{ {"PauctionManInit"}, NPC_PauctionManInit, 0 },
|
||||
{ {"PauctionManTalked"}, NPC_PauctionManTalked, 0 },
|
||||
{ {"PauctionManLoop"} , NPC_PauctionManLoop, 0 },
|
||||
{ {"PauctionManWindowTalked"}, NPC_PauctionManWindowTalked, 0 },
|
||||
#endif
|
||||
#ifdef _ITEM_NPCCHANGE
|
||||
{ {"ItemchangeManInit"}, NPC_ItemchangeManInit, 0 },
|
||||
{ {"ItemchangeManTalked"}, NPC_ItemchangeManTalked, 0 },
|
||||
{ {"ItemchangeManLoop"} , NPC_ItemchangeManLoop, 0 },
|
||||
{ {"ItemchangeManWindowTalked"}, NPC_ItemchangeManWindowTalked, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _CFREE_petskill
|
||||
{ {"FreePetSkillInit"} , NPC_FreePetSkillShopInit, 0 },
|
||||
{ {"FreePetSkillTalked"} , NPC_FreePetSkillShopTalked, 0 },
|
||||
{ {"FreePetSkillWindowTalked"}, NPC_FreePetSkillShopWindowTalked, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _PETRACE // 宠物竞速
|
||||
{ {"PetRaceMasterInit"}, NPC_PetRaceMasterInit, 0},
|
||||
{ {"PetRaceMasterLoop"}, NPC_PetRaceMasterLoop, 0},
|
||||
{ {"PetRaceMasterTalked"}, NPC_PetRaceMasterTalked, 0},
|
||||
{ {"PetRaceMasterWindowTalked"}, NPC_PetRaceMasterWindowTalked, 0},
|
||||
|
||||
{ {"PetRacePetInit"}, NPC_PetRacePetInit, 0},
|
||||
{ {"PetRacePetLoop"}, NPC_PetRacePetLoop, 0},
|
||||
{ {"PetRacePetTalked"}, NPC_PetRacePetTalked, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _NEW_WARPMAN
|
||||
{ {"NewNpcManInit"}, NPC_NewNpcManInit, 0},
|
||||
{ {"NewNpcManLoop"}, NPC_NewNpcManLoop, 0},
|
||||
{ {"NewNpcManTalked"}, NPC_NewNpcManTalked, 0},
|
||||
{ {"NewNpcManWindowTalked"}, NPC_NewNpcManWindowTalked, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _MARKET_TRADE
|
||||
{ {"MapTradeManInit"}, MapTradeManInit, 0},
|
||||
{ {"MapTradeManLoop"}, MapTradeManLoop, 0},
|
||||
{ {"MapTradeManTalked"}, MapTradeManTalked, 0},
|
||||
{ {"MapTradeManWindowTalked"}, MapTradeManWindowTalked, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _AUCTIONEER
|
||||
{ {"AuctioneerInit"}, NPC_AuctioneerInit, 0},
|
||||
{ {"AuctioneerTalked"}, NPC_AuctioneerTalked, 0},
|
||||
{ {"AuctioneerWindowTalked"}, NPC_AuctioneerWindowTalked, 0},
|
||||
{ {"AuctioneerLoop"}, NPC_AuctioneerLoop, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _BLACK_MARKET
|
||||
{ {"BlackMarketInit"}, NPC_BlackMarketInit, 0},
|
||||
{ {"BlackMarketTalked"}, NPC_BlackMarketTalked, 0},
|
||||
{ {"BlackMarketWindowTalked"}, NPC_BlackMarketWindowTalked, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _ALLDOMAN // (不可开) Syu ADD 排行榜NPC
|
||||
{ {"AlldomanInit"} , NPC_AlldomanInit, 0 },
|
||||
{ {"AlldomanTalked"} , NPC_AlldomanTalked , 0 },
|
||||
{ {"AlldomanWindowTalked"}, NPC_AlldomanWindowTalked , 0},
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_WELFARE
|
||||
{ {"WelfareInit"} , NPC_WelfareInit, 0 },
|
||||
{ {"WelfareTalked"} , NPC_WelfareTalked , 0 },
|
||||
{ {"WelfareWindowTalked"}, NPC_WelfareWindowTalked , 0},
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_WELFARE_2 // WON ADD 职业NPC-2
|
||||
{ {"WelfareInit2"} , NPC_WelfareInit2, 0 },
|
||||
{ {"WelfareTalked2"} , NPC_WelfareTalked2, 0 },
|
||||
{ {"WelfareWindowTalked2"}, NPC_WelfareWindowTalked2, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_VERYWELFARE
|
||||
{ {"VeryWelfareInit"} , NPC_VeryWelfareInit, 0 },
|
||||
{ {"VeryWelfareTalked"} , NPC_VeryWelfareTalked , 0 },
|
||||
{ {"VeryWelfareWindowTalked"}, NPC_VeryWelfareWindowTalked , 0},
|
||||
#endif
|
||||
|
||||
#ifdef _CONTRACT
|
||||
{ {"ITEM_contract"}, ITEM_contract, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _TIME_TICKET
|
||||
{ {"ITEM_timeticket"}, ITEM_timeticket, 0},
|
||||
#endif
|
||||
|
||||
#ifdef _RACEMAN
|
||||
{ {"RacemanInit"} ,NPC_RacemanInit, 0 },
|
||||
{ {"RacemanTalked"} ,NPC_RacemanTalked, 0 },
|
||||
{ {"RacemanWindowTalked"},NPC_RacemanWindowTalked ,0 },
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_SETLOVER // 结婚物品
|
||||
{ {"ITEM_SetLoverUser"}, ITEM_SetLoverUser, 0 },
|
||||
{ {"ITEM_LoverWarp"}, ITEM_LoverWarp, 0 },
|
||||
{ {"ITEM_LoverUnmarry"}, ITEM_LoverUnmarry, 0 },
|
||||
#endif
|
||||
|
||||
#ifdef _GM_ITEM // GM命令物品
|
||||
{ {"ITEM_GMFUNCTION"}, ITEM_GMFUNCTION, 0 },
|
||||
#endif
|
||||
};
|
||||
|
||||
BOOL initFunctionTable( void )
|
||||
{
|
||||
|
||||
int i;
|
||||
{
|
||||
char* strings[arraysizeof(correspondStringAndFunctionTable)];
|
||||
int stringnum=0;
|
||||
for( i=0 ; i<arraysizeof(correspondStringAndFunctionTable) ; i++ )
|
||||
strings[stringnum++] =
|
||||
correspondStringAndFunctionTable[i].functionName.string;
|
||||
if( ! checkStringsUnique( strings, stringnum , 1 ) ){
|
||||
fprint("Function Name Table is overlapped.\n" );
|
||||
fprint("It is not allowed\n");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < arraysizeof(correspondStringAndFunctionTable) ; i ++ ){
|
||||
correspondStringAndFunctionTable[i].hashcode =
|
||||
hashpjw( correspondStringAndFunctionTable[i].
|
||||
functionName.string);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void* getFunctionPointerFromName( char* funcname )
|
||||
{
|
||||
int i;
|
||||
int hashcode;
|
||||
if( funcname == NULL || funcname[0] == '\0' ){
|
||||
return NULL;
|
||||
}
|
||||
hashcode = hashpjw( funcname );
|
||||
for( i=0 ; i<arraysizeof(correspondStringAndFunctionTable) ; i++ )
|
||||
if( correspondStringAndFunctionTable[i].hashcode == hashcode )
|
||||
if( strcmp( correspondStringAndFunctionTable[i].functionName.string,funcname ) == 0 ){
|
||||
DebugFunctionName = correspondStringAndFunctionTable[i].functionName.string;
|
||||
return correspondStringAndFunctionTable[i].functionPointer;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
print("No such Function: %s\n" ,funcname );
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
10
gmsv/genver.h
Normal file
10
gmsv/genver.h
Normal file
@ -0,0 +1,10 @@
|
||||
char *genver="
|
||||
__VERSION_H__
|
||||
_NEW_SERVER_
|
||||
_SERVER_NUMS
|
||||
UNIQUE_KEYCODEITEM 100
|
||||
UNIQUE_KEYCODEPET 'i'
|
||||
ile (standard input) matches
|
||||
<<Generated at Tue Aug 7 00:48:56 PDT 2018>>
|
||||
by : Áúzoro¹¤×÷ÊÒ
|
||||
";
|
9
gmsv/genver.sh
Normal file
9
gmsv/genver.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
IN=./include/version.h
|
||||
OUT=./genver.h
|
||||
touch main.c
|
||||
echo "char *genver=\"" > $OUT
|
||||
cat $IN | grep -e "^#define" | cut -b 9- | sed "s/\"/\'/g" | \
|
||||
sed 's/\\/\\\\/g' >> $OUT
|
||||
echo "<<Generated at "`date`">>" >> $OUT
|
||||
echo "by : Áúzoro¹¤×÷ÊÒ\n\";" >> $OUT
|
381
gmsv/handletime.c
Normal file
381
gmsv/handletime.c
Normal file
@ -0,0 +1,381 @@
|
||||
#define __HANDLETIME_C__
|
||||
#include "version.h"
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "handletime.h"
|
||||
|
||||
#define LSTIME_SECONDS_PER_DAY 5400 /* LSTIME域 少氏及蜇 及 醒 */
|
||||
|
||||
/*
|
||||
LSTIME_SECONDS_PER_DAY 毛 尹月午}凛棉及褡心填宁毛 尹月仇午互匹五月[
|
||||
|
||||
袄 LS凛棉匹域 丐凶曰及蜇 及凛棉醒
|
||||
9000 ( 赏) 2.5 [hour]
|
||||
900 0.25[hour] = 15[min]
|
||||
90 0.025[hour] = 1.5[min] = 90[sec]
|
||||
9 9[sec]
|
||||
|
||||
*/
|
||||
|
||||
#define LSTIME_HOURS_PER_DAY 1024 /* LSTIME域 少氏及LSTIME及凛棉醒 */
|
||||
#define LSTIME_DAYS_PER_YEAR 100 /* LSTIME域 少氏及LSTIME及 醒 */
|
||||
|
||||
|
||||
// WON REM
|
||||
/*
|
||||
// Nuke 0701: localtime
|
||||
|
||||
struct timeval NowTime;
|
||||
#ifdef localtime
|
||||
#undef localtime
|
||||
#endif
|
||||
|
||||
struct tm *localtime(const time_t *timep)
|
||||
{
|
||||
static struct tm lt;
|
||||
memset(<,0,sizeof(lt));
|
||||
lt.tm_sec=*timep %60;
|
||||
lt.tm_min=(*timep %3600) / 60;
|
||||
lt.tm_hour=(*timep % 86400) / 3600;
|
||||
return <
|
||||
}
|
||||
*/
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* 域伙□皿卞域荚裟壬木化}凛棉毛褡户月[
|
||||
* 娄醒
|
||||
* 卅仄
|
||||
* 忒曰袄
|
||||
* 岳 TRUE(1)
|
||||
* 撩 FALSE(0)
|
||||
------------------------------------------------------------*/
|
||||
BOOL setNewTime( void )
|
||||
{
|
||||
if( gettimeofday( &NowTime, (struct timezone*)NULL) != 0 ) {
|
||||
NowTime.tv_sec = time(0);
|
||||
// Nuke 0701: Localtime down
|
||||
print("\n time err !! \n");
|
||||
return FALSE;
|
||||
}
|
||||
NowTime.tv_sec += DEBUG_ADJUSTTIME;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
漆葭绎卞仄凶[byHiO 1998/12/4 18:37
|
||||
*******************************************************************/
|
||||
static long era = (long)912766409 + 5400;
|
||||
/* SA及啃卞内日仄凶 */
|
||||
/* LS葭 毛烂聒允月化五午□卅醒袄[
|
||||
弁仿奶失件玄午 元元扎卅中午分户[*/
|
||||
|
||||
/*******************************************************************
|
||||
穴扑件凛棉井日LS凛棉卞允月
|
||||
long t : time匹请月
|
||||
LSTIME *lstime : LSTIME厌瞻 尺及禾奶件正
|
||||
*******************************************************************/
|
||||
void RealTimeToLSTime(long t , LSTIME *lstime)
|
||||
{
|
||||
long lsseconds = t - era; /* LS葭 井日及 醒 */
|
||||
long lsdays; /* LS葭 井日及 醒 */
|
||||
|
||||
/* 葭 井日及 醒毛1 癫曰及 醒匹喃月午} 卞卅月 */
|
||||
lstime->year = (int)( lsseconds/(LSTIME_SECONDS_PER_DAY*LSTIME_DAYS_PER_YEAR) );
|
||||
|
||||
lsdays = lsseconds/LSTIME_SECONDS_PER_DAY;/* 引内葭 井日及 醒毛煌遥仄化 */
|
||||
lstime->day = lsdays % LSTIME_DAYS_PER_YEAR;/* 癫凶曰及 醒匹喃匀凶丐引曰互 */
|
||||
|
||||
|
||||
/*(450*12) 匹1 */
|
||||
lstime->hour = (int)(lsseconds % LSTIME_SECONDS_PER_DAY )
|
||||
/* 仇仇引匹匹}域 互铵引匀化井日窒 凶匀凶井[ */
|
||||
* LSTIME_HOURS_PER_DAY / LSTIME_SECONDS_PER_DAY;
|
||||
/* 域 丐凶曰及 醒匹喃匀化井日域 丐凶曰及凛棉醒毛井仃月午蜇箕窒凛
|
||||
卅及井互歹井月[*/
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
LS凛棉井日穴扑件凛棉卞允月
|
||||
LSTIME *lstime : LSTIME厌瞻 尺及禾奶件正
|
||||
long *t : 凛棉尺及禾奶件正
|
||||
*******************************************************************/
|
||||
void LSTimeToRealTime( LSTIME *lstime, long *t)
|
||||
{
|
||||
*t=(long)(
|
||||
( lstime->hour*LSTIME_DAYS_PER_YEAR+lstime->day) /* 凛棉 */
|
||||
*LSTIME_HOURS_PER_DAY
|
||||
|
||||
+ lstime->year)
|
||||
/*仇及楮醒反壬什匀化中月方丹卞苇尹月[nakamura */
|
||||
|
||||
|
||||
*450;
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
LS凛棉匹漆及凛棉嗉坌毛 月
|
||||
曰袄 int : 0}苹1}镞2} 3
|
||||
LSTIME *lstime : LSTIME厌瞻 尺及禾奶件正
|
||||
*******************************************************************/
|
||||
LSTIME_SECTION getLSTime (LSTIME *lstime)
|
||||
{
|
||||
if (NIGHT_TO_MORNING < lstime->hour
|
||||
&& lstime->hour <= MORNING_TO_NOON)
|
||||
return LS_MORNING;
|
||||
else if(NOON_TO_EVENING < lstime->hour
|
||||
&& lstime->hour <= EVENING_TO_NIGHT)
|
||||
return LS_EVENING;
|
||||
else if(EVENING_TO_NIGHT < lstime->hour
|
||||
&& lstime->hour <= NIGHT_TO_MORNING)
|
||||
return LS_NIGHT;
|
||||
else
|
||||
return LS_NOON;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _ASSESS_SYSEFFICACY
|
||||
static clock_t TotalClock = 0;
|
||||
static clock_t StartClock = 0;
|
||||
//static int EndClock = 0;
|
||||
//static float SysTime=0.0;
|
||||
static clock_t EndClock = 0;
|
||||
static double SysTime=0.0;
|
||||
static int Cnum = 0;
|
||||
|
||||
#ifdef _ASSESS_SYSEFFICACY_SUB
|
||||
static clock_t Net_TotalClock = 0;
|
||||
static clock_t NPCGEN_TotalClock = 0;
|
||||
static clock_t Battle_TotalClock = 0;
|
||||
static clock_t Char_TotalClock = 0;
|
||||
static clock_t Petmail_TotalClock = 0;
|
||||
static clock_t Family_TotalClock = 0;
|
||||
static clock_t SaveCheck_TotalClock = 0;
|
||||
static clock_t GMBroadCast_TotalClock = 0;
|
||||
static double Net_SysTime=0.0;
|
||||
static double NPCGEN_SysTime=0.0;
|
||||
static double Battle_SysTime=0.0;
|
||||
static double Char_SysTime=0.0;
|
||||
static double Petmail_SysTime=0.0;
|
||||
static double Family_SysTime=0.0;
|
||||
static double SaveCheck_SysTime=0.0;
|
||||
static double GMBroadCast_SysTime=0.0;
|
||||
static clock_t SubStartClock = 0;
|
||||
#endif
|
||||
|
||||
void Assess_InitSysEfficacy()
|
||||
{
|
||||
TotalClock = 0;
|
||||
StartClock = 0;
|
||||
EndClock = 0;
|
||||
#ifdef _ASSESS_SYSEFFICACY_SUB
|
||||
Net_TotalClock = 0;
|
||||
NPCGEN_TotalClock = 0;
|
||||
Battle_TotalClock = 0;
|
||||
Char_TotalClock = 0;
|
||||
Petmail_TotalClock = 0;
|
||||
Family_TotalClock = 0;
|
||||
SaveCheck_TotalClock = 0;
|
||||
GMBroadCast_TotalClock = 0;
|
||||
|
||||
SubStartClock = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Assess_SysEfficacy( int flg)
|
||||
{
|
||||
if( flg == 0 ){
|
||||
StartClock=clock();
|
||||
}else if( flg == 1 ){
|
||||
EndClock = clock();
|
||||
if( EndClock < StartClock ) return;
|
||||
TotalClock += (int)(EndClock-StartClock);
|
||||
Cnum++;
|
||||
if( Cnum%500 == 0 ){
|
||||
SysTime = (float)(TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
TotalClock = 0;
|
||||
#ifdef _ASSESS_SYSEFFICACY_SUB
|
||||
Net_SysTime = (float)(Net_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
Net_TotalClock = 0;
|
||||
NPCGEN_SysTime = (float)(NPCGEN_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
NPCGEN_TotalClock = 0;
|
||||
Battle_SysTime = (float)(Battle_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
Battle_TotalClock = 0;
|
||||
Char_SysTime = (float)(Char_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
Char_TotalClock = 0;
|
||||
Petmail_SysTime = (float)(Petmail_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
Petmail_TotalClock = 0;
|
||||
Family_SysTime = (float)(Family_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
Family_TotalClock = 0;
|
||||
SaveCheck_SysTime = (float)(SaveCheck_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
SaveCheck_TotalClock = 0;
|
||||
GMBroadCast_SysTime = (float)(GMBroadCast_TotalClock/Cnum)/CLOCKS_PER_SEC;
|
||||
GMBroadCast_TotalClock = 0;
|
||||
#endif
|
||||
Cnum = 0;
|
||||
}
|
||||
}
|
||||
/*
|
||||
EndClock = clock();
|
||||
if( StartClock != 0 ){
|
||||
if( EndClock < StartClock ) return;
|
||||
TotalClock += (int)(EndClock-StartClock);
|
||||
Cnum++;
|
||||
if( Cnum%500 == 0 ){
|
||||
SysTime = (float)TotalClock/Cnum;
|
||||
TotalClock = 0;
|
||||
}
|
||||
}
|
||||
StartClock = EndClock;
|
||||
*/
|
||||
}
|
||||
|
||||
void ASSESS_getSysEfficacy( float *TVsec)
|
||||
{
|
||||
*TVsec = SysTime;
|
||||
}
|
||||
|
||||
#ifdef _ASSESS_SYSEFFICACY_SUB
|
||||
void Assess_SysEfficacy_sub( int flg, int loop)
|
||||
{
|
||||
|
||||
if( flg == 0 ){
|
||||
SubStartClock = clock();
|
||||
}else if( flg == 1 ){
|
||||
EndClock = clock();
|
||||
if( EndClock < SubStartClock ) return;
|
||||
|
||||
switch( loop) {
|
||||
case 1: // Net_TotalClock
|
||||
Net_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 2: // NPCGEN_TotalClock
|
||||
NPCGEN_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 3: // Battle_TotalClock
|
||||
Battle_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 4: // Char_TotalClock
|
||||
Char_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 5: // Petmail_TotalClock
|
||||
Petmail_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 6: // Family_TotalClock
|
||||
Family_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 7: // SaveCheck_TotalClock
|
||||
SaveCheck_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
case 8: // GMBroadCast_TotalClock
|
||||
GMBroadCast_TotalClock += (int)(EndClock-SubStartClock);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ASSESS_getSysEfficacy_sub( float *TVsec, int loop_index)
|
||||
{
|
||||
switch( loop_index) {
|
||||
case 1:
|
||||
*TVsec = Net_SysTime;
|
||||
break;
|
||||
case 2:
|
||||
*TVsec = NPCGEN_SysTime;
|
||||
break;
|
||||
case 3:
|
||||
*TVsec = Battle_SysTime;
|
||||
break;
|
||||
case 4:
|
||||
*TVsec = Char_SysTime;
|
||||
break;
|
||||
case 5:
|
||||
*TVsec = Petmail_SysTime;
|
||||
break;
|
||||
case 6:
|
||||
*TVsec = Family_SysTime;
|
||||
break;
|
||||
case 7:
|
||||
*TVsec = SaveCheck_SysTime;
|
||||
break;
|
||||
case 8:
|
||||
*TVsec = GMBroadCast_SysTime;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _CHECK_BATTLETIME
|
||||
|
||||
#include "battle.h"
|
||||
static clock_t battleComClock = 0;
|
||||
double battleComTotalTime[BATTLE_COM_END];
|
||||
long battleComTotalUse[BATTLE_COM_END];
|
||||
|
||||
void check_battle_com_init( void)
|
||||
{
|
||||
print("\n check_battle_com_init... ");
|
||||
print("\n BATTLE_COM_END = %d ", BATTLE_COM_END);
|
||||
memset( battleComTotalTime, 0, sizeof(double)*BATTLE_COM_END);
|
||||
memset( battleComTotalUse, 0, sizeof(long)*BATTLE_COM_END);
|
||||
}
|
||||
|
||||
void check_battle_com_begin( void)
|
||||
{
|
||||
print(" bi ");
|
||||
battleComClock = clock();
|
||||
}
|
||||
|
||||
void check_battle_com_end( int b_com)
|
||||
{
|
||||
clock_t endClock;
|
||||
double usedClock;
|
||||
|
||||
endClock = clock();
|
||||
usedClock = (double)(endClock - battleComClock)/CLOCKS_PER_SEC;
|
||||
|
||||
print(" BC[%d,%0.10f] ", b_com, usedClock);
|
||||
battleComTotalTime[b_com] += usedClock;
|
||||
battleComTotalUse[b_com] ++;
|
||||
|
||||
print(" bo ");
|
||||
|
||||
}
|
||||
|
||||
void check_battle_com_show( void)
|
||||
{
|
||||
FILE *outfile;
|
||||
int i;
|
||||
char outstr[1024];
|
||||
|
||||
outfile = fopen( "battle_com_time.txt", "w");
|
||||
if( !outfile)
|
||||
{
|
||||
print("\n OPEN battle_com_time.txt ERROR!!! \n");
|
||||
return;
|
||||
}
|
||||
|
||||
for( i =0; i <BATTLE_COM_END; i++)
|
||||
{
|
||||
sprintf( outstr, "%d\t=\t%0.10f\t*\t%d\n",
|
||||
i,
|
||||
(double)(battleComTotalTime[i]/battleComTotalUse[i]),
|
||||
battleComTotalUse[i] );
|
||||
fputs( outstr, outfile);
|
||||
}
|
||||
fclose( outfile);
|
||||
|
||||
print("\n RECORD battle_com_time.txt COMPLETE \n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
45
gmsv/include/addressbook.h
Normal file
45
gmsv/include/addressbook.h
Normal file
@ -0,0 +1,45 @@
|
||||
#ifndef __ADDRESSBOOK_H__
|
||||
#define __ADDRESSBOOK_H__
|
||||
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "net.h"
|
||||
|
||||
#define ADDRESSBOOK_MAX 40
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int use;
|
||||
BOOL online; /* 锹澎平乓仿互扔□田 卞中凶日TRUE,
|
||||
公丹匹卅井匀凶日FALSE */
|
||||
int level; /* 锹澎平乓仿及伊矛伙 */
|
||||
int duelpoint; /* duelpoint*/
|
||||
int graphicsno; /* 锹澎平乓仿及 飓 寞 */
|
||||
char cdkey[CDKEYLEN]; /* CD 瓜件田□ */
|
||||
char charname[CHARNAMELEN]; /* 锹澎平乓仿及 蟆 */
|
||||
int transmigration; /* 鳖戏荚醒 */
|
||||
|
||||
} ADDRESSBOOK_entry;
|
||||
|
||||
|
||||
|
||||
|
||||
char *ADDRESSBOOK_makeAddressbookString( ADDRESSBOOK_entry *a );
|
||||
BOOL ADDRESSBOOK_makeAddressbookEntry( char *in , ADDRESSBOOK_entry *a );
|
||||
BOOL ADDRESSBOOK_deleteEntry( int meindex ,int index );
|
||||
BOOL ADDRESSBOOK_addEntry( int meindex );
|
||||
BOOL ADDRESSBOOK_sendAddressbookTable( int cindex );
|
||||
BOOL ADDRESSBOOK_sendAddressbookTableOne( int cindex, int num );
|
||||
BOOL ADDRESSBOOK_sendMessage( int cindex, int aindex , char *text ,
|
||||
int color );
|
||||
BOOL ADDRESSBOOK_sendMessage_FromOther( char *fromcdkey, char *fromcharaname,
|
||||
char *tocdkey, char *tocharaname,
|
||||
char* text , int color );
|
||||
|
||||
void ADDRESSBOOK_notifyLoginLogout( int cindex , int flg );
|
||||
void ADDRESSBOOK_addAddressBook( int meindex, int toindex);
|
||||
void ADDRESSBOOK_DispatchMessage( char *cd, char *nm, char *value, int mode);
|
||||
int ADDRESSBOOK_getIndexInAddressbook(int cindex , char *cdkey, char *charname);
|
||||
BOOL ADDRESSBOOK_AutoaddAddressBook( int meindex, int toindex);
|
||||
|
||||
#endif
|
1006
gmsv/include/anim_tbl.h
Normal file
1006
gmsv/include/anim_tbl.h
Normal file
File diff suppressed because it is too large
Load Diff
55
gmsv/include/autil.h
Normal file
55
gmsv/include/autil.h
Normal file
@ -0,0 +1,55 @@
|
||||
#include "version.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifndef __UTIL_H_
|
||||
#define __UTIL_H_
|
||||
|
||||
|
||||
#define SLICE_MAX 20
|
||||
#define SLICE_SIZE 65500
|
||||
|
||||
extern char *MesgSlice[SLICE_MAX];
|
||||
extern int SliceCount; // count slices in MesgSlice
|
||||
|
||||
extern char PersonalKey[4096];
|
||||
|
||||
#define DEFAULTTABLE \
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz{}"
|
||||
#define DEFAULTFUNCBEGIN "&"
|
||||
#define DEFAULTFUNCEND "#"
|
||||
|
||||
BOOL util_Init(void);
|
||||
|
||||
// WON ADD
|
||||
//void util_SplitMessage(char *source, char *separator);
|
||||
BOOL util_SplitMessage(char *source, char *separator);
|
||||
|
||||
|
||||
void util_EncodeMessage(char *dst, char *src);
|
||||
void util_DecodeMessage(char *dst, char *src);
|
||||
int util_GetFunctionFromSlice(int *func, int *fieldcount);
|
||||
void util_DiscardMessage(void);
|
||||
#define util_SendMesg( fd, func, buffer) _util_SendMesg( __FILE__, __LINE__, fd, func, buffer)
|
||||
void _util_SendMesg(char *file, int line, int fd, int func, char *buffer);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Encoding function units. Use in Encrypting functions.
|
||||
int util_256to64(char *dst, char *src, int len, char *table);
|
||||
int util_64to256(char *dst, char *src, char *table);
|
||||
int util_256to64_shr(char *dst, char *src, int len, char *table, char *key);
|
||||
int util_shl_64to256(char *dst, char *src, char *table, char *key);
|
||||
int util_256to64_shl(char *dst, char *src, int len, char *table, char *key);
|
||||
int util_shr_64to256(char *dst, char *src, char *table, char *key);
|
||||
|
||||
void util_swapint(int *dst, int *src, char *rule);
|
||||
void util_xorstring(char *dst, char *src);
|
||||
void util_shrstring(char *dst, char *src, int offs);
|
||||
void util_shlstring(char *dst, char *src, int offs);
|
||||
// -------------------------------------------------------------------
|
||||
// Encrypting functions
|
||||
int util_deint(int sliceno, int *value);
|
||||
int util_mkint(char *buffer, int value);
|
||||
int util_destring(int sliceno, char *value);
|
||||
int util_mkstring(char *buffer, char *value);
|
||||
|
||||
#endif
|
683
gmsv/include/battle.h
Normal file
683
gmsv/include/battle.h
Normal file
@ -0,0 +1,683 @@
|
||||
#ifndef __BATTLE_H__
|
||||
#define __BATTLE_H__
|
||||
|
||||
#define BATTLE_ENTRY_MAX 10
|
||||
#define BATTLE_PLAYER_MAX 5
|
||||
#define SIDE_OFFSET 10
|
||||
|
||||
#define BATTLE_STRING_MAX 4096
|
||||
#define BATTLE_TIME_LIMIT (60*60)
|
||||
|
||||
|
||||
#define DUELPOINT_RATE (0.1)
|
||||
|
||||
enum{
|
||||
BATTLE_MODE_NONE = 0, // 无战斗状态
|
||||
BATTLE_MODE_INIT, // 战斗初始化
|
||||
BATTLE_MODE_BATTLE, // 战斗中
|
||||
BATTLE_MODE_FINISH, // 战斗结束
|
||||
BATTLE_MODE_STOP, // 战斗结束(未使用)
|
||||
BATTLE_MODE_WATCHBC, // 观战初始化
|
||||
BATTLE_MODE_WATCHPRE, // 观战(没作用)
|
||||
BATTLE_MODE_WATCHWAIT, // 观战(没作用)
|
||||
BATTLE_MODE_WATCHMOVIE, // 观战(没作用)
|
||||
BATTLE_MODE_WATCHAFTER, // 观战(没作用)
|
||||
BATTLE_MODE_END
|
||||
};
|
||||
|
||||
|
||||
enum{
|
||||
BATTLE_TYPE_NONE = 0,
|
||||
BATTLE_TYPE_P_vs_E = 1,
|
||||
BATTLE_TYPE_P_vs_P = 2,
|
||||
BATTLE_TYPE_E_vs_E = 3,
|
||||
BATTLE_TYPE_WATCH = 4,
|
||||
BATTLE_TYPE_DP_BATTLE = 5,
|
||||
BATTLE_TYPE_BOSS_BATTLE = 6,
|
||||
BATTLE_TYPE_END
|
||||
};
|
||||
|
||||
|
||||
enum{
|
||||
BATTLE_CHARMODE_NONE = 0, // 无战斗状态
|
||||
BATTLE_CHARMODE_INIT, // 战斗初始化
|
||||
BATTLE_CHARMODE_C_WAIT, // 等待战斗指令
|
||||
BATTLE_CHARMODE_C_OK, // 已输入战斗指令
|
||||
BATTLE_CHARMODE_BATTLE, // 未使用
|
||||
BATTLE_CHARMODE_RESCUE, // 由help状态进入的
|
||||
BATTLE_CHARMODE_FINAL, // 战斗结束
|
||||
BATTLE_CHARMODE_WATCHINIT, // 观战初始化
|
||||
BATTLE_CHARMODE_COMMAND, // 未使用
|
||||
BATTLE_CHARMODE_END
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum{
|
||||
BATTLE_ERR_NONE = 0,
|
||||
BATTLE_ERR_NOTASK,
|
||||
BATTLE_ERR_NOUSE,
|
||||
BATTLE_ERR_PARAM,
|
||||
BATTLE_ERR_ENTRYMAX,
|
||||
BATTLE_ERR_TYPE,
|
||||
BATTLE_ERR_CHARAINDEX,
|
||||
BATTLE_ERR_BATTLEINDEX,
|
||||
BATTLE_ERR_NOENEMY,
|
||||
BATTLE_ERR_ALREADYBATTLE,
|
||||
BATTLE_ERR_SAMEPARTY,
|
||||
BATTLE_ERR_END
|
||||
}BATTLE_ERR;
|
||||
|
||||
|
||||
enum{
|
||||
BATTLE_S_TYPE_PLAYER = 0,
|
||||
BATTLE_S_TYPE_ENEMY,
|
||||
BATTLE_S_TYPE_END
|
||||
};
|
||||
|
||||
|
||||
typedef enum{
|
||||
BATTLE_COM_NONE,
|
||||
BATTLE_COM_ATTACK,
|
||||
BATTLE_COM_GUARD,
|
||||
BATTLE_COM_CAPTURE,
|
||||
BATTLE_COM_ESCAPE,
|
||||
BATTLE_COM_PETIN,
|
||||
BATTLE_COM_PETOUT,
|
||||
BATTLE_COM_ITEM,
|
||||
BATTLE_COM_BOOMERANG,
|
||||
BATTLE_COM_COMBO,
|
||||
BATTLE_COM_COMBOEND,
|
||||
BATTLE_COM_WAIT,
|
||||
|
||||
BATTLE_COM_SEKIBAN = 1000,
|
||||
BATTLE_COM_S_RENZOKU,
|
||||
BATTLE_COM_S_GBREAK,
|
||||
BATTLE_COM_S_GUARDIAN_ATTACK,
|
||||
BATTLE_COM_S_GUARDIAN_GUARD,
|
||||
BATTLE_COM_S_CHARGE,
|
||||
BATTLE_COM_S_MIGHTY,
|
||||
BATTLE_COM_S_POWERBALANCE,
|
||||
BATTLE_COM_S_STATUSCHANGE,
|
||||
BATTLE_COM_S_EARTHROUND0,
|
||||
BATTLE_COM_S_EARTHROUND1,
|
||||
BATTLE_COM_S_LOSTESCAPE,
|
||||
BATTLE_COM_S_ABDUCT,
|
||||
BATTLE_COM_S_STEAL,
|
||||
BATTLE_COM_S_NOGUARD,
|
||||
BATTLE_COM_S_CHARGE_OK,
|
||||
BATTLE_COM_JYUJYUTU = 2000,
|
||||
|
||||
BATTLE_COM_COMPELESCAPE, //强制离开
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
BATTLE_COM_S_ATTACK_MAGIC, // 宠物魔法
|
||||
#endif
|
||||
|
||||
#ifdef _PSKILL_FALLGROUND
|
||||
BATTLE_COM_S_FALLRIDE, //落马术
|
||||
#endif
|
||||
#ifdef _PETSKILL_EXPLODE
|
||||
BATTLE_COM_S_EXPLODE,
|
||||
#endif
|
||||
#ifdef _PETSKILL_TIMID
|
||||
BATTLE_COM_S_TIMID,
|
||||
#endif
|
||||
#ifdef _PETSKILL_2TIMID
|
||||
BATTLE_COM_S_2TIMID,
|
||||
#endif
|
||||
#ifdef _PETSKILL_ANTINTER
|
||||
BATTLE_COM_S_ANTINTER,
|
||||
#endif
|
||||
#ifdef _PETSKILL_PROPERTY
|
||||
BATTLE_COM_S_PROPERTYSKILL,
|
||||
#endif
|
||||
#ifdef _PETSKILL_TEAR
|
||||
BATTLE_COM_S_PETSKILLTEAR,
|
||||
#endif
|
||||
#ifdef _BATTLE_LIGHTTAKE
|
||||
BATTLE_COM_S_LIGHTTAKE,
|
||||
#endif
|
||||
#ifdef _BATTLE_ATTCRAZED // ANDY 疯狂暴走
|
||||
BATTLE_COM_S_ATTCRAZED,
|
||||
#endif
|
||||
#ifdef _SHOOTCHESTNUT // Syu ADD 宠技:丢栗子
|
||||
BATTLE_COM_S_ATTSHOOT,
|
||||
#endif
|
||||
#ifdef _BATTLESTEAL_FIX
|
||||
BATTLE_COM_S_STEALMONEY,
|
||||
#endif
|
||||
#ifdef _PRO_BATTLEENEMYSKILL
|
||||
BATTLE_COM_S_ENEMYRELIFE, //NPC ENEMY 复活技能
|
||||
BATTLE_COM_S_ENEMYREHP, //NPC ENEMY 补血技能
|
||||
BATTLE_COM_S_ENEMYHELP, //NPC ENEMY 招人
|
||||
#endif
|
||||
#ifdef _SKILL_DAMAGETOHP
|
||||
BATTLE_COM_S_DAMAGETOHP, //嗜血技
|
||||
#endif
|
||||
#ifdef _Skill_MPDAMAGE
|
||||
BATTLE_COM_S_MPDAMAGE, //MP伤害
|
||||
#endif
|
||||
#ifdef _SKILL_WILDVIOLENT_ATT
|
||||
BATTLE_COM_S_WILDVIOLENTATTACK, //狂暴攻击 vincent add 2002/05/16
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_SPEEDY_ATT
|
||||
BATTLE_COM_S_SPEEDYATTACK, //疾速攻击 vincent add 2002/05/20
|
||||
#endif
|
||||
#ifdef _SKILL_GUARDBREAK2
|
||||
BATTLE_COM_S_GBREAK2, //破除防御2 vincent add 2002/05/20
|
||||
#endif
|
||||
#ifdef _SKILL_SACRIFICE
|
||||
BATTLE_COM_S_SACRIFICE, //救援 vincent add 2002/05/30
|
||||
#endif
|
||||
#ifdef _SKILL_WEAKEN
|
||||
BATTLE_COM_S_WEAKEN, //虚弱 vincent add 2002/07/11
|
||||
#endif
|
||||
#ifdef _SKILL_DEEPPOISON
|
||||
BATTLE_COM_S_DEEPPOISON, //剧毒 vincent add 2002/07/16
|
||||
#endif
|
||||
#ifdef _SKILL_BARRIER
|
||||
BATTLE_COM_S_BARRIER, //魔障 vincent add 2002/07/16
|
||||
#endif
|
||||
#ifdef _SKILL_NOCAST
|
||||
BATTLE_COM_S_NOCAST, //沉默 vincent add 2002/07/16
|
||||
#endif
|
||||
#ifdef _SKILL_ROAR
|
||||
BATTLE_COM_S_ROAR, //大吼 vincent add 2002/07/11
|
||||
#endif
|
||||
#ifdef _BATTLENPC_WARP_PLAYER
|
||||
BATTLE_COM_WARP, // npc warp player
|
||||
#endif
|
||||
#ifdef _SKILL_TOOTH
|
||||
BATTLE_COM_S_TOOTHCRUSHE,
|
||||
#endif
|
||||
#ifdef _PSKILL_MODIFY
|
||||
BATTLE_COM_S_MODIFYATT,
|
||||
#endif
|
||||
#ifdef _PSKILL_MDFYATTACK
|
||||
BATTLE_COM_S_MDFYATTACK,
|
||||
#endif
|
||||
#ifdef _MAGIC_SUPERWALL
|
||||
BATTLE_COM_S_SUPERWALL,
|
||||
#endif
|
||||
#ifdef _SKILL_REFRESH
|
||||
BATTLE_COM_S_REFRESH,
|
||||
#endif
|
||||
#ifdef _VARY_WOLF
|
||||
BATTLE_COM_S_VARY,
|
||||
#endif
|
||||
#ifdef _PETSKILL_SETDUCK
|
||||
BATTLE_COM_S_SETDUCK,
|
||||
#endif
|
||||
#ifdef _MAGICPET_SKILL
|
||||
BATTLE_COM_S_SETMAGICPET,
|
||||
#endif
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
|
||||
// 巫师
|
||||
BATTLE_COM_S_VOLCANO_SPRINGS, // 火山泉
|
||||
BATTLE_COM_S_FIRE_BALL, // 火星球
|
||||
BATTLE_COM_S_FIRE_SPEAR, // 火龙枪
|
||||
BATTLE_COM_S_SUMMON_THUNDER, // 召雷术
|
||||
BATTLE_COM_S_CURRENT, // 电流术
|
||||
BATTLE_COM_S_STORM, // 暴风雨
|
||||
BATTLE_COM_S_ICE_ARROW, // 冰箭术
|
||||
BATTLE_COM_S_ICE_CRACK, // 冰爆术
|
||||
BATTLE_COM_S_ICE_MIRROR, // 冰镜术
|
||||
BATTLE_COM_S_DOOM, // 世界末日
|
||||
BATTLE_COM_S_BLOOD, // 嗜血成性
|
||||
BATTLE_COM_S_BLOOD_WORMS, // 嗜血蛊
|
||||
BATTLE_COM_S_SIGN, // 一针见血
|
||||
BATTLE_COM_S_FIRE_ENCLOSE, // 火附体
|
||||
BATTLE_COM_S_ICE_ENCLOSE, // 冰附体
|
||||
BATTLE_COM_S_THUNDER_ENCLOSE, // 雷附体
|
||||
BATTLE_COM_S_ENCLOSE, // 附身术
|
||||
BATTLE_COM_S_TRANSPOSE, // 移形换位
|
||||
// 勇士
|
||||
BATTLE_COM_S_BRUST, // 爆击
|
||||
BATTLE_COM_S_CHAIN_ATK, // 连环攻击
|
||||
BATTLE_COM_S_AVOID, // 回避
|
||||
BATTLE_COM_S_RECOVERY, // 补血
|
||||
BATTLE_COM_S_WEAPON_FOCUS, // 武器专精
|
||||
BATTLE_COM_S_REBACK, // 状态回复
|
||||
BATTLE_COM_S_CHAIN_ATK_2, // 双重攻击
|
||||
BATTLE_COM_S_SCAPEGOAT, // 舍已为友
|
||||
BATTLE_COM_S_ENRAGE, // 激化攻击
|
||||
BATTLE_COM_S_COLLECT, // 能量聚集
|
||||
BATTLE_COM_S_FOCUS, // 专注战斗
|
||||
BATTLE_COM_S_SHIELD_ATTACK, // 盾击
|
||||
BATTLE_COM_S_DUAL_WEAPON, // 二刀流
|
||||
BATTLE_COM_S_DEFLECT, // 格档
|
||||
BATTLE_COM_S_THROUGH_ATTACK, // 贯穿攻击
|
||||
BATTLE_COM_S_CAVALRY, // 座骑攻击
|
||||
BATTLE_COM_S_DEAD_ATTACK, // 濒死攻击
|
||||
BATTLE_COM_S_CONVOLUTE, // 回旋攻击
|
||||
BATTLE_COM_S_CHAOS, // 混乱攻击
|
||||
// 猎人
|
||||
BATTLE_COM_S_TRAP, // 陷阱
|
||||
BATTLE_COM_S_TRACK, // 追寻敌踪
|
||||
BATTLE_COM_S_DOCILE, // 驯伏宠物
|
||||
BATTLE_COM_S_ENRAGE_PET, // 激怒宠物
|
||||
BATTLE_COM_S_DRAGNET, // 天罗地网
|
||||
BATTLE_COM_S_ENTWINE, // 树根缠绕
|
||||
BATTLE_COM_S_AUTARKY, // 自给自足
|
||||
BATTLE_COM_S_PLUNDER, // 体掠夺
|
||||
BATTLE_COM_S_TOXIN_WEAPON, // 毒素武器
|
||||
BATTLE_COM_S_RESIST_FIRE, // 火抗性提升
|
||||
BATTLE_COM_S_RESIST_ICE, // 冰抗性提升
|
||||
BATTLE_COM_S_RESIST_THUNDER, // 雷抗性提升
|
||||
BATTLE_COM_S_G_RESIST_FIRE, // 团体火抗性提升
|
||||
BATTLE_COM_S_G_RESIST_ICE, // 团体冰抗性提升
|
||||
BATTLE_COM_S_G_RESIST_THUNDER, // 团体雷抗性提升
|
||||
BATTLE_COM_S_ATTACK_WEAK, // 弱点攻击
|
||||
BATTLE_COM_S_INSTIGATE, // 挑拨
|
||||
BATTLE_COM_S_OBLIVION, // 遗忘
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
BATTLE_COM_S_RESIST_F_I_T, // 自然威能
|
||||
BATTLE_COM_S_CALL_NATURE, // 号召自然
|
||||
BATTLE_COM_S_BOUNDARY, // 四属性结界
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _PET_SKILL_SARS // WON ADD 毒煞蔓延
|
||||
BATTLE_COM_S_SARS,
|
||||
#endif
|
||||
#ifdef _SONIC_ATTACK // WON ADD 音波攻击
|
||||
BATTLE_COM_S_SONIC,
|
||||
BATTLE_COM_S_SONIC2,
|
||||
#endif
|
||||
#ifdef _PETSKILL_REGRET
|
||||
BATTLE_COM_S_REGRET,
|
||||
BATTLE_COM_S_REGRET2,
|
||||
#endif
|
||||
#ifdef _PETSKILL_GYRATE
|
||||
BATTLE_COM_S_GYRATE,
|
||||
#endif
|
||||
#ifdef _PETSKILL_ACUPUNCTURE
|
||||
BATTLE_COM_S_ACUPUNCTURE,
|
||||
#endif
|
||||
#ifdef _PETSKILL_RETRACE
|
||||
BATTLE_COM_S_RETRACE,
|
||||
#endif
|
||||
#ifdef _PETSKILL_HECTOR
|
||||
BATTLE_COM_S_HECTOR,
|
||||
#endif
|
||||
#ifdef _PETSKILL_FIREKILL
|
||||
BATTLE_COM_S_FIREKILL,
|
||||
#endif
|
||||
#ifdef _PETSKILL_DAMAGETOHP
|
||||
BATTLE_COM_S_DAMAGETOHP2, //暗月狂狼(嗜血技的变体)
|
||||
#endif
|
||||
#ifdef _PETSKILL_BECOMEFOX
|
||||
BATTLE_COM_S_BECOMEFOX,
|
||||
#endif
|
||||
#ifdef _PETSKILL_BECOMEPIG
|
||||
BATTLE_COM_S_BECOMEPIG,
|
||||
#endif
|
||||
#ifdef _PETSKILL_SHOWMERCY
|
||||
BATTLE_COM_S_SHOWMERCY,
|
||||
#endif
|
||||
#ifdef _PETSKILL_LER
|
||||
BATTLE_COM_S_BAT_FLY, // 雷尔技 - 群蝠四窜
|
||||
BATTLE_COM_S_DIVIDE_ATTACK, // 雷尔技 - 分身地裂
|
||||
#endif
|
||||
#ifdef _PETSKILL_BATTLE_MODEL
|
||||
BATTLE_COM_S_BATTLE_MODEL, // 宠物技能战斗模组
|
||||
#endif
|
||||
|
||||
BATTLE_COM_END
|
||||
}BATTLE_COM;
|
||||
|
||||
|
||||
enum{
|
||||
BATTLE_RET_NORMAL,
|
||||
BATTLE_RET_CRITICAL,
|
||||
BATTLE_RET_MISS,
|
||||
BATTLE_RET_DODGE,
|
||||
BATTLE_RET_ALLGUARD,
|
||||
#ifdef _EQUIT_ARRANGE
|
||||
BATTLE_RET_ARRANGE,
|
||||
#endif
|
||||
BATTLE_RET_END
|
||||
}BATTLE_RET;
|
||||
|
||||
|
||||
#define BC_FLG_NEW (1<<0)
|
||||
#define BC_FLG_DEAD (1<<1)
|
||||
#define BC_FLG_PLAYER (1<<2)
|
||||
#define BC_FLG_POISON (1<<3)
|
||||
#define BC_FLG_PARALYSIS (1<<4)
|
||||
#define BC_FLG_SLEEP (1<<5)
|
||||
#define BC_FLG_STONE (1<<6)
|
||||
#define BC_FLG_DRUNK (1<<7)
|
||||
#define BC_FLG_CONFUSION (1<<8)
|
||||
#define BC_FLG_HIDE (1<<9)
|
||||
#define BC_FLG_REVERSE (1<<10)
|
||||
#ifdef _MAGIC_WEAKEN
|
||||
#define BC_FLG_WEAKEN (1<<11) // 虚弱
|
||||
#endif
|
||||
#ifdef _MAGIC_DEEPPOISON
|
||||
#define BC_FLG_DEEPPOISON (1<<12) // 剧毒
|
||||
#endif
|
||||
#ifdef _MAGIC_BARRIER
|
||||
#define BC_FLG_BARRIER (1<<13) // 魔障
|
||||
#endif
|
||||
#ifdef _MAGIC_NOCAST
|
||||
#define BC_FLG_NOCAST (1<<14) // 沉默
|
||||
#endif
|
||||
|
||||
#ifdef _PET_SKILL_SARS // WON ADD 毒煞蔓延
|
||||
#define BC_FLG_SARS (1<<15) // 毒煞
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
#define BC_FLG_DIZZY (1<<16) // 晕眩
|
||||
#define BC_FLG_ENTWINE (1<<17) // 树根缠绕
|
||||
#define BC_FLG_DRAGNET (1<<18) // 天罗地网
|
||||
#define BC_FLG_ICECRACK (1<<19) // 冰爆术
|
||||
#define BC_FLG_OBLIVION (1<<20) // 遗忘
|
||||
#define BC_FLG_ICEARROW (1<<21) // 冰箭
|
||||
#define BC_FLG_BLOODWORMS (1<<22) // 嗜血蛊
|
||||
#define BC_FLG_SIGN (1<<23) // 一针见血
|
||||
#define BC_FLG_CARY (1<<24) // 挑拨
|
||||
#define BC_FLG_F_ENCLOSE (1<<25) // 火附体
|
||||
#define BC_FLG_I_ENCLOSE (1<<26) // 冰附体
|
||||
#define BC_FLG_T_ENCLOSE (1<<27) // 雷附体
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
#define BC_FLG_WATER (1<<28) // 水附体
|
||||
#define BC_FLG_FEAR (1<<29) // 恐惧
|
||||
#endif
|
||||
#ifdef _PETSKILL_LER
|
||||
#define BC_FLG_CHANGE (1<<30) // 雷尔变身
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#define BP_FLG_JOIN (1<<0)
|
||||
#define BP_FLG_PLAYER_MENU_OFF (1<<1)
|
||||
#define BP_FLG_BOOMERANG (1<<2)
|
||||
#define BP_FLG_PET_MENU_OFF (1<<3)
|
||||
#define BP_FLG_ENEMY_SURPRISAL (1<<4)
|
||||
#define BP_FLG_PLAYER_SURPRISAL (1<<5)
|
||||
|
||||
|
||||
#define CHAR_BATTLEFLG_ULTIMATE (1<<0)
|
||||
#define CHAR_BATTLEFLG_AIBAD (1<<1)
|
||||
#define CHAR_BATTLEFLG_REVERSE (1<<2)
|
||||
#define CHAR_BATTLEFLG_GUARDIAN (1<<3)
|
||||
#define CHAR_BATTLEFLG_NORETURN (1<<4)
|
||||
#define CHAR_BATTLEFLG_RECOVERY (1<<5)
|
||||
#define CHAR_BATTLEFLG_ABIO (1<<6)
|
||||
#define CHAR_BATTLEFLG_NODUCK (1<<7)
|
||||
|
||||
#define GETITEM_MAX 3
|
||||
typedef struct
|
||||
{
|
||||
int attacker;
|
||||
}INVADER;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int charaindex;
|
||||
int bid;
|
||||
int escape;
|
||||
int flg;
|
||||
int guardian;
|
||||
int duelpoint;
|
||||
int getitem[GETITEM_MAX];
|
||||
}BATTLE_ENTRY;
|
||||
#define BENT_FLG_ULTIMATE (1<<0)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
int flg;
|
||||
int common_dp;
|
||||
BATTLE_ENTRY Entry[BATTLE_ENTRY_MAX];
|
||||
}BATTLE_SIDE;
|
||||
|
||||
#define BSIDE_FLG_SURPRISE ( 1 << 0 )
|
||||
#define BSIDE_FLG_HELP_OK ( 1 << 1 )
|
||||
|
||||
|
||||
|
||||
typedef struct _Battle
|
||||
{
|
||||
BOOL use; /* 银匀化中月井升丹井 */
|
||||
int battleindex; /* 田玄伙 寞 */
|
||||
int mode; /* 蜇箕及爵 乒□玉 */
|
||||
int type; /* 爵 正奶皿 (0:骚橘)(1:DUEL)(2:示旦爵) */
|
||||
int dpbattle; /* DP田玄伙井" */
|
||||
int norisk; /* 韶氏匹手伉旦弁及 中田玄伙井" */
|
||||
int turn; /* 正□件醒 */
|
||||
int timer; /* 它巨奶玄羁卞银丹正奶穴 */
|
||||
int leaderindex; /* 巨件市它件玄毛粟仇仄凶平乓仿及奶件犯永弁旦 */
|
||||
int winside; /* 厍仄凶扔奶玉 */
|
||||
int field_att; /* 白奴□伙玉及箪岭 */
|
||||
int att_count; /* 白奴□伙玉及箪岭 祭 及正奶穴 */
|
||||
int att_pow; /* 白奴□伙玉及箪岭 祭 及由伐□ */
|
||||
int field_no;
|
||||
int flg; /* 备潘白仿弘 */
|
||||
BATTLE_SIDE Side[2];
|
||||
#ifdef _BATTLE_TIMESPEED
|
||||
unsigned int CreateTime;
|
||||
unsigned int EndTime;
|
||||
unsigned int PartTime;
|
||||
int flgTime;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
//冰爆术存放
|
||||
int ice_count;//暂存数量
|
||||
int ice_bout[20];//回合计数
|
||||
BOOL ice_use[20];//是否使用
|
||||
int ice_toNo[20];//对象
|
||||
int ice_level[20];//攻击力
|
||||
int ice_array[20];
|
||||
int ice_charaindex[20];
|
||||
int ice_attackNo[20];
|
||||
#endif
|
||||
|
||||
#ifdef _DEATH_CONTEND
|
||||
int menum;
|
||||
int tonum;
|
||||
#endif
|
||||
|
||||
#ifdef _ACTION_BULLSCR
|
||||
int enemynum;
|
||||
#endif
|
||||
int iEntryBack[BATTLE_ENTRY_MAX*2]; // 蟆正□件瓒 今木化中凶丢件田□
|
||||
int iEntryBack2[BATTLE_ENTRY_MAX*2]; // 蟆正□件瓒 今木化中凶丢件田□
|
||||
int createindex; /* 仇及爵 毛综曰请仄凶平乓仿奶件犯永弁旦(NPC卅升) */
|
||||
int (*WinFunc)( int battleindex, int charaindex );
|
||||
#ifdef _DEATH_CONTEND//计算胜败func
|
||||
int (*PkFunc)( int menum, int tonum, int winside, int battlemap);
|
||||
int battlemap;
|
||||
#endif
|
||||
struct _Battle *pNext; // 戚及棋爵弘伙□皿
|
||||
struct _Battle *pBefore; // 蟆及棋爵弘伙□皿
|
||||
}BATTLE;
|
||||
|
||||
#define BATTLE_FLG_FREEDP ( 1 << 0 ) // 仆化手 蛹日卅中
|
||||
#define BATTLE_FLG_CHARALOST ( 1 << 1 ) // 平乓仿互韶氏分曰 仃凶曰仄化中月
|
||||
|
||||
|
||||
|
||||
enum{ // 晓及field_att 卞 木月袄
|
||||
BATTLE_ATTR_NONE = 0, // 箪岭
|
||||
BATTLE_ATTR_EARTH, // 哗
|
||||
BATTLE_ATTR_WATER, //
|
||||
BATTLE_ATTR_FIRE, // 绍
|
||||
BATTLE_ATTR_WIND, // 氘
|
||||
BATTLE_ATTR_END
|
||||
};
|
||||
|
||||
|
||||
//krynn 2001/12/28
|
||||
enum
|
||||
{
|
||||
BATTLE_SIDE_RIGHT, // 战斗中右侧 right side of battle
|
||||
BATTLE_SIDE_LEFT, // 战斗中左侧 left side of battle
|
||||
BATTLE_SIDE_WATCH, // 观战 watch battle player
|
||||
};
|
||||
//krynn end
|
||||
|
||||
#define TARGET_SIDE_0 20 // 惘础 扔奶玉ㄟ 隙烂
|
||||
#define TARGET_SIDE_1 21 // 尔础 扔奶玉ㄠ 隙烂
|
||||
#define TARGET_ALL 22 // 蝈 隙烂
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
|
||||
#define TARGET_SIDE_0_B_ROW 26 // 右下後一列
|
||||
#define TARGET_SIDE_0_F_ROW 25 // 右下前一列
|
||||
#define TARGET_SIDE_1_F_ROW 24 // 左上前一列
|
||||
#define TARGET_SIDE_1_B_ROW 23 // 左上後一列
|
||||
|
||||
// won add
|
||||
#define TARGER_THROUGH 27
|
||||
|
||||
#endif
|
||||
|
||||
extern int gItemCrushRate; // 莽 犯白巧伙玄
|
||||
extern BATTLE *BattleArray; /* 爵 正旦弁 */
|
||||
extern int BATTLE_battlenum; /* 及醒 */
|
||||
extern char szAllBattleString[BATTLE_STRING_MAX]; /* 爵 卞银丹戊穴件玉 侬 */
|
||||
extern char *pszBattleTop, *pszBattleLast; /* 爵 卞银丹 侬 及匏 */
|
||||
extern char szBadStatusString[]; // 旦 □正旦唱橘迕 侬
|
||||
extern int gWeponType; // 蜇箕及 湛及潘
|
||||
extern float gDamageDiv; // 母丢□斥坌喃
|
||||
|
||||
#define BATTLE_CHECKINDEX( a ) ( ((a)>=BATTLE_battlenum || (a)<0 )?(FALSE):(TRUE) )
|
||||
#define BATTLE_CHECKSIDE( a ) ( ((a)>=2 || (a)<0)?(FALSE):( TRUE) )
|
||||
#define BATTLE_CHECKNO( a ) ( ((a)>=20 || (a)<0 )?(FALSE):(TRUE) )
|
||||
#define BATTLE_CHECKADDRESS( a ) ((&BattleArray[0])<=(a) && (a)<=(&BattleArray[BATTLE_battlenum-1] )?(TRUE):(FALSE) )
|
||||
|
||||
#define IsBATTLING( a ) (CHAR_getWorkInt((a),CHAR_WORKBATTLEMODE)?(TRUE):(FALSE))
|
||||
|
||||
#define STRCPY_TAIL( _pszTop, _pszLast, _szBuffer) { int _len = strlen( _szBuffer ); ( _pszTop + _len < (_pszLast)-1 )?( memcpy( _pszTop, _szBuffer, _len ), _pszTop += _len, _pszTop[0] = 0):(0); }
|
||||
|
||||
#define BATTLESTR_ADD( _szBuffer ){ int _len = strlen( _szBuffer ); ( pszBattleTop + _len < ( pszBattleLast)-1 )?( memcpy( pszBattleTop, _szBuffer, _len ), pszBattleTop += _len, pszBattleTop[0] = 0):(0); }
|
||||
|
||||
#define BATTLE_MAP_MAX 219
|
||||
|
||||
#define CH_FIX_PLAYERLEVELUP (+2) // 皿伊奶乩□及伊矛伙互失永皿
|
||||
#define CH_FIX_PLAYERDEAD (-2) // 皿伊奶乩□互骚橘韶
|
||||
#define CH_FIX_PLAYEULTIMATE (-4) // 皿伊奶乩□互失伙 奴丢永玄韶
|
||||
#define CH_FIX_PETESCAPE (-1) // 矢永玄互 仆凶
|
||||
|
||||
#define AI_FIX_PETLEVELUP (+5*100) // 矢永玄互伊矛伙失永皿
|
||||
#define AI_FIX_PETWIN (+1) // 矢永玄互衬毛逦仄凶
|
||||
#define AI_FIX_PETGOLDWIN (+2*10) // 矢永玄互伊矛伙及嫖中衬毛逦仄凶
|
||||
#define AI_FIX_PETRECOVERY (+10) // 爵 卞荚汊仄化手日匀凶
|
||||
#define AI_FIX_PETRESSURECT (+3*100) // 爵 卞汊唾仄化手日匀凶
|
||||
//#define AI_FIX_PETRECOVERY (+50) // 爵 卞荚汊仄化手日匀凶
|
||||
|
||||
#define AI_FIX_SEKKAN (-2*100) // 愤坌及矢永玄毛 猾
|
||||
#define AI_FIX_PLAYERULTIMATE (-10*100) // 愤坌及潜谛互失伙 奴丢永玄韶
|
||||
#define AI_FIX_PETULTIMATE (-10*100) // 矢永玄互失伙 奴丢永玄韶
|
||||
#define AI_FIX_PLAYERDEAD (-1*100) // 愤坌及潜谛互竣濮
|
||||
#define AI_FIX_PETDEAD (-5*100) // 矢永玄互竣濮
|
||||
|
||||
|
||||
#ifdef _Item_ReLifeAct
|
||||
int BATTLE_getBattleDieIndex( int battleindex, int bid );
|
||||
#endif
|
||||
|
||||
int BATTLE_No2Index( int battleindex, int No);
|
||||
|
||||
int BATTLE_Index2No( int battleindex, int charaindex);
|
||||
|
||||
BOOL BATTLE_initBattleArray( int battlenum);
|
||||
|
||||
int BATTLE_CreateBattle( void );
|
||||
int BATTLE_DeleteBattle( int battleindex);
|
||||
|
||||
int BATTLE_NewEntry( int charaindex, int battleindex, int side);
|
||||
|
||||
#define BATTLE_Exit( charaindex, battleindex) _BATTLE_Exit( __FILE__, __LINE__, charaindex, battleindex)
|
||||
INLINE int _BATTLE_Exit( char *file, int line, int charaindex ,int battleindex);
|
||||
|
||||
#define BATTLE_ExitAll( battleindex) _BATTLE_ExitAll( __FILE__, __LINE__, battleindex)
|
||||
INLINE void _BATTLE_ExitAll( char *file, int line, int battleindex);
|
||||
|
||||
int BATTLE_CreateVsPlayer( int charaindex0, int charaindex1);
|
||||
|
||||
int BATTLE_CreateVsEnemy( int charaindex, int mode, int npcindex);
|
||||
|
||||
int BATTLE_CountEntry( int battleindex, int side);
|
||||
|
||||
int BATTLE_Loop( void );
|
||||
|
||||
int BATTLE_FinishSet( int battleindex );
|
||||
int BATTLE_StopSet( int battleindex );
|
||||
int BATTLE_RescueEntry( int charaindex, int toindex);
|
||||
|
||||
int BATTLE_PetDefaultExit( int charaindex, int battleindex);
|
||||
|
||||
int BATTLE_PetDefaultEntry(
|
||||
int charaindex, // 矢永玄毛 匀化中月皿伊奶乩□及
|
||||
int battleindex,// 田玄伙奶件犯永弁旦
|
||||
int side
|
||||
);
|
||||
|
||||
BOOL BATTLE_RescueTry( int charaindex);
|
||||
|
||||
BOOL BATTLE_RescueParentTry(
|
||||
int charaindex,
|
||||
int pindex
|
||||
);
|
||||
|
||||
int BATTLE_DefaultAttacker( int battleindex, int side);
|
||||
|
||||
BOOL BATTLE_IsThrowWepon( int itemindex);
|
||||
|
||||
void BATTLE_BadStatusString( int defNo, int status );
|
||||
int BATTLE_MultiList( int battleindex, int toNo, int ToList[] );
|
||||
BOOL BATTLE_IsCharge( int com );
|
||||
BOOL BATTLE_CanMoveCheck( int charaindex );
|
||||
int BATTLE_TargetCheck( int battleindex, int defNo);
|
||||
char *BATTLE_CharTitle( int charaindex );
|
||||
void BATTLE_EscapeDpSend( int battleindex, int charaindex );
|
||||
int BATTLE_GetDuelPoint( int battleindex, int side, int num);
|
||||
int BATTLE_TargetCheckDead( int battleindex, int defNo);
|
||||
|
||||
void BATTLE_MultiListDead( int battleindex, int toNo, int ToList[] );
|
||||
BOOL BATTLE_WatchTry( int charaindex);
|
||||
int BATTLE_WatchEntry( int charaindex, int toindex);
|
||||
void BATTLE_WatchStop( int charaindex );
|
||||
int BATTLE_WatchUnLink( int battleindex );
|
||||
void BATTLE_BpSendToWatch( BATTLE *pBattle, char *pszBcString);
|
||||
|
||||
int BATTLE_GetWepon( int charaindex );
|
||||
|
||||
#ifdef _ITEM_EQUITSPACE
|
||||
int BATTLE_GetEqShield( int charaindex );
|
||||
#endif
|
||||
|
||||
int BATTLE_GetAttackCount( int charaindex );
|
||||
int DoujyouRandomWeponSet( int charaindex );
|
||||
void BATTLE_AttReverse( int charaindex );
|
||||
void BATTLE_BadStatusAllClr( int charaindex );
|
||||
#define CHAR_GETWORKINT_HIGH( index, pos ) ( CHAR_getWorkInt( (index), (pos) ) >> 16 )
|
||||
#define CHAR_SETWORKINT_HIGH( index, pos, set ) { int iTmp = CHAR_getWorkInt( (index), (pos) ) & 0xFFFF, work = (set); CHAR_setWorkInt( (index), (pos), (work << 16)|iTmp ); }
|
||||
#define CHAR_GETWORKINT_LOW( index, pos ) ( CHAR_getWorkInt( (index), (pos) ) & 0xFFFF )
|
||||
#define CHAR_SETWORKINT_LOW( index, pos, set ) { int iTmp = CHAR_getWorkInt( index, pos ) & 0xFFFF0000, work = (set); CHAR_setWorkInt( (index), (pos), (work & 0x0000FFFF) | iTmp ); }
|
||||
|
||||
int Battle_getTotalBattleNum();
|
||||
|
||||
#ifdef _TYPE_TOXICATION
|
||||
void CHAR_ComToxicationHp( int charaindex);
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
void BATTLE_ProfessionStatus_init( int battleindex, int charaindex );
|
||||
void BATTLE_ProfessionStatusSeq( int battleindex, int charaindex);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
10
gmsv/include/battle_ai.h
Normal file
10
gmsv/include/battle_ai.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef __BATTLE_AI_H__
|
||||
#define __BATTLE_AI_H__
|
||||
|
||||
/* Ô»éø */
|
||||
int BATTLE_ai_all( int battleindex, int side, int turn);
|
||||
int BATTLE_ai_one( int charaindex, int battleindex, int side, int turn);
|
||||
#ifdef _ENEMY_ATTACK_AI
|
||||
int GetSubdueAtt(int index);
|
||||
#endif
|
||||
#endif
|
27
gmsv/include/battle_command.h
Normal file
27
gmsv/include/battle_command.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef __BATTLE_COMMAND_H__
|
||||
#define __BATTLE_COMMAND_H__
|
||||
|
||||
void BattleCommandDispach(
|
||||
int fd,
|
||||
char *command
|
||||
);
|
||||
|
||||
void BattleEncountOut(
|
||||
int charaindex
|
||||
);
|
||||
|
||||
BOOL BATTLE_CommandSend( int charaindex, char *pszCommand );
|
||||
|
||||
BOOL BATTLE_MakeCharaString(
|
||||
int battleindex,
|
||||
char *pszCommand, // 平乓仿弁正□树 请 燮
|
||||
int size // 扔奶术
|
||||
);
|
||||
|
||||
void BATTLE_CharSendAll( int battleindex );
|
||||
|
||||
BOOL BATTLE_PetDefaultCommand( int petindex );
|
||||
|
||||
void BATTLE_ActSettingSend( int battleindex );
|
||||
|
||||
#endif
|
383
gmsv/include/battle_event.h
Normal file
383
gmsv/include/battle_event.h
Normal file
@ -0,0 +1,383 @@
|
||||
#ifndef __BATTLE_EVENT_H__
|
||||
#define __BATTLE_EVENT_H__
|
||||
|
||||
#define BCC_HIT 'H'
|
||||
#define BCC_FIRE 'F'
|
||||
|
||||
#define BCF_DEATH (1 << 0)
|
||||
#define BCF_NORMAL (1 << 1)
|
||||
#define BCF_KAISHIN (1 << 2)
|
||||
#define BCF_GUARD (1 << 3)
|
||||
#define BCF_COUNTER (1 << 4)
|
||||
#define BCF_DODGE (1 << 5)
|
||||
#define BCF_ULTIMATE_1 (1 << 6)
|
||||
#define BCF_ULTIMATE_2 (1 << 7)
|
||||
#define BCF_GBREAK (1 << 8)
|
||||
#define BCF_GUARDIAN (1 << 9)
|
||||
#define BCF_REFRECT (1 << 10)
|
||||
#define BCF_ABSORB (1 << 11)
|
||||
#define BCF_VANISH (1 << 12)
|
||||
#define BCF_CRUSH (1 << 13)
|
||||
#define BCF_FALL (1 << 14) //落马术
|
||||
#ifdef _SKILL_TOOTH
|
||||
#define BCF_TOOTH (1 << 15) // 齿
|
||||
#endif
|
||||
#ifdef _PSKILL_MODIFY
|
||||
#define BCF_ATTDOUBLE (1 << 16) //属性强化
|
||||
#endif
|
||||
#ifdef _SKILL_ROAR
|
||||
#define BCF_ROAR (1 << 17) //宠技:大吼(克年兽)
|
||||
#endif
|
||||
|
||||
#ifdef _MAGIC_DEFMAGICATT
|
||||
#define BCF_DEFMAGICATT (1 << 19)
|
||||
#endif
|
||||
#ifdef _MAGIC_SUPERWALL
|
||||
#define BCF_SUPERWALL (1 << 20)
|
||||
#endif
|
||||
#ifdef _PSKILL_MDFYATTACK
|
||||
#define BCF_MODIFY (1 << 21)
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
#define BCF_F_SKILLACT (1 << 22) //击中前秀图
|
||||
#define BCF_TRAP (1 << 25) //陷阱
|
||||
#define BCF_NO_DAMAGE (1 << 26) //双重攻击
|
||||
#endif
|
||||
#define BCF_B_SKILLACT (1 << 23) //击中後秀图
|
||||
|
||||
|
||||
|
||||
#ifdef _EQUIT_ARRANGE
|
||||
#define BCF_B_ARRANGE (1 << 24) //格挡秀图
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_ACUPUNCTURE
|
||||
#define BCF_ACUPUNCTURE (1 << 27)
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_ANTINTER
|
||||
#define BCF_ANTINTER (1 << 28)
|
||||
#endif
|
||||
#ifdef _PETSKILL_EXPLODE
|
||||
#define BCF_EXPLODE (1 << 29)
|
||||
#endif
|
||||
|
||||
#ifdef _OTHER_MAGICSTAUTS
|
||||
#ifdef _MAGICSTAUTS_RESIST
|
||||
#define MAXSTATUSTYPE 6
|
||||
#else
|
||||
#define MAXSTATUSTYPE 3
|
||||
#endif //_MAGICSTAUTS_RESIST
|
||||
extern char MagicStatus[MAXSTATUSTYPE][36];
|
||||
extern int MagicTbl[];
|
||||
extern int MagicTypeTbl[];
|
||||
#endif
|
||||
|
||||
extern char *aszStatus[];
|
||||
extern char *aszStatusFull[];
|
||||
extern int StatusTbl[];
|
||||
extern int RegTbl[];
|
||||
extern int MagicDefTbl[];
|
||||
extern char *aszMagicDefFull[];
|
||||
extern char *aszMagicDef[];
|
||||
|
||||
extern char *aszParamChange[];
|
||||
extern char *aszParamChangeFull[];
|
||||
extern int aParamChangeTbl[];
|
||||
|
||||
extern float gBattleDamageModyfy;
|
||||
extern int gBattleDuckModyfy;
|
||||
extern int gBattleStausChange;
|
||||
extern int gBattleStausTurn;
|
||||
|
||||
enum{
|
||||
BATTLE_ST_NONE, // 0 "正常",
|
||||
BATTLE_ST_POISON, // 1 "毒",
|
||||
BATTLE_ST_PARALYSIS, // 2 "麻",
|
||||
BATTLE_ST_SLEEP, // 3 "眠",
|
||||
BATTLE_ST_STONE, // 4 "石",
|
||||
BATTLE_ST_DRUNK, // 5 "醉",
|
||||
BATTLE_ST_CONFUSION, // 6 "乱",
|
||||
BATTLE_ST_WEAKEN, // 7 "虚"
|
||||
BATTLE_ST_DEEPPOISON,// 8 "剧毒"
|
||||
BATTLE_ST_BARRIER, // 9 "魔障"
|
||||
BATTLE_ST_NOCAST, // 10 "沉默"
|
||||
#ifdef _PET_SKILL_SARS // WON ADD 毒煞蔓延
|
||||
BATTLE_ST_SARS, // 11 "煞"
|
||||
#endif
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
BATTLE_ST_DIZZY, // 12 "晕"
|
||||
BATTLE_ST_ENTWINE, // 13 "缠"
|
||||
BATTLE_ST_DRAGNET, // 14 "天罗地网"
|
||||
BATTLE_ST_ICECRACK, // 15 "冰爆术"
|
||||
BATTLE_ST_OBLIVION, // 16 "遗忘"
|
||||
BATTLE_ST_ICEARROW, // 17 "冰箭"
|
||||
BATTLE_ST_BLOODWORMS,// 18 "嗜血蛊"
|
||||
BATTLE_ST_SIGN, // 19 "一针见血"
|
||||
BATTLE_ST_INSTIGATE, // 20 "挑拨"
|
||||
BATTLE_ST_F_ENCLOSE, // 21 "火附体"
|
||||
BATTLE_ST_I_ENCLOSE, // 22 "冰附体"
|
||||
BATTLE_ST_T_ENCLOSE, // 23 "雷附体"
|
||||
BATTLE_ST_FOCUS, // 24 "专注战斗"
|
||||
BATTLE_ST_RESIST_F, // 25 "火抗"
|
||||
BATTLE_ST_RESIST_I, // 26 "冰抗"
|
||||
BATTLE_ST_RESIST_T, // 27 "雷抗"
|
||||
BATTLE_ST_F_ENCLOSE2, // 28 "火附"
|
||||
BATTLE_ST_I_ENCLOSE2, // 29 "冰附"
|
||||
BATTLE_ST_T_ENCLOSE2, // 30 "雷附"
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
BATTLE_ST_RESIST_F_I_T, //31 "火冰雷抗"
|
||||
//BATTLE_ST_BOUNDARY_F, //32 "火结界
|
||||
BATTLE_ST_WATER, //32 "水附体"
|
||||
BATTLE_ST_WORKANNEX, //33 "附身"
|
||||
BATTLE_ST_FEAR, //34 "恐惧"
|
||||
BATTLE_ST_ICECRACK2, // 35 "冰爆术"
|
||||
BATTLE_ST_ICECRACK3, // 36
|
||||
BATTLE_ST_ICECRACK4, // 37
|
||||
BATTLE_ST_ICECRACK5, // 38
|
||||
BATTLE_ST_ICECRACK6, // 39
|
||||
BATTLE_ST_ICECRACK7, // 40
|
||||
BATTLE_ST_ICECRACK8, // 41
|
||||
BATTLE_ST_ICECRACK9, // 42
|
||||
BATTLE_ST_ICECRACK10, // 43
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
BATTLE_ST_END
|
||||
};
|
||||
|
||||
#ifdef _OTHER_MAGICSTAUTS
|
||||
enum{
|
||||
BATTLE_MST_NONE,
|
||||
BATTLE_MST_DEFMAGIC,
|
||||
BATTLE_MST_SUPERWALL,
|
||||
#ifdef _MAGICSTAUTS_RESIST
|
||||
BATTLE_MST_MAGICFIRE,
|
||||
BATTLE_MST_MAGICTHUNDER,
|
||||
BATTLE_MST_MAGICICE,
|
||||
#endif
|
||||
BATTLE_MST_END
|
||||
};
|
||||
#endif
|
||||
|
||||
enum{
|
||||
BATTLE_MD_NONE,
|
||||
BATTLE_MD_ABSROB,
|
||||
BATTLE_MD_REFLEC,
|
||||
BATTLE_MD_VANISH,
|
||||
BATTLE_MD_TRAP,
|
||||
#ifdef _PETSKILL_ACUPUNCTURE
|
||||
BATTLE_MD_ACUPUNCTURE, //针刺外皮
|
||||
#endif
|
||||
BATTLE_MD_END
|
||||
};
|
||||
|
||||
#ifdef _PETSKILL_RETRACE
|
||||
//存放BATTLE_Attack函式执行後的攻击模式
|
||||
typedef struct tagBattle_Attack_ReturnData_x1
|
||||
{
|
||||
int Battle_Attack_ReturnData;
|
||||
}Battle_Attack_ReturnData_x1;
|
||||
Battle_Attack_ReturnData_x1 Battle_Attack_ReturnData_x;
|
||||
|
||||
#endif
|
||||
|
||||
int BATTLE_DamageCalc( int attackindex, int defindex );
|
||||
|
||||
BOOL BATTLE_Attack( int battleindex, int attackNo, int defNo );
|
||||
|
||||
BOOL BATTLE_Counter( int battleindex, int attackNo, int defNo );
|
||||
|
||||
BOOL BATTLE_Capture( int battleindex, int attackNo, int defNo );
|
||||
|
||||
void BATTLE_Guard( int battleindex, int attackNo );
|
||||
|
||||
// Nuke 20040112 fix for performance
|
||||
#define BATTLE_BroadCast(A,B,C) 0
|
||||
#define BATTLE_BroadCastOn(A,B,C) 0
|
||||
//int BATTLE_BroadCast( int battleindex, char *pszBuffer, int color );
|
||||
//int BATTLE_BroadCastOn( int battleindex, char *pszBuffer, int color );
|
||||
|
||||
BOOL BATTLE_Escape( int battleindex, int attackNo, int flag);
|
||||
|
||||
int BATTLE_NoAction( int battleindex, int attackNo );
|
||||
|
||||
int BATTLE_PetIn( int battleindex, int attackNo );
|
||||
|
||||
int BATTLE_PetOut( int battleindex, int attackNo );
|
||||
|
||||
int BATTLE_SurpriseCheck( int battleindex );
|
||||
|
||||
int BATTLE_Magic( int battleindex, int attackNo );
|
||||
|
||||
int BATTLE_S_GBreak( int battleindex, int attackNo, int defNo );
|
||||
|
||||
#ifdef _SKILL_GUARDBREAK2//破除防御2 vincent add 2002/05/20
|
||||
int BATTLE_S_GBreak2( int battleindex, int attackNo, int defNo );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_SACRIFICE
|
||||
int BATTLE_S_Sacrifice( int battleindex, int attackNo, int defNo );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_REFRESH
|
||||
int BATTLE_S_Refresh( int battleindex, int attackNo, int defNo, int marray );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_WEAKEN //vincent宠技:虚弱
|
||||
int BATTLE_S_Weaken( int battleindex, int attackNo, int defNo, int marray );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_DEEPPOISON //vincent宠技:剧毒
|
||||
int BATTLE_S_Deeppoison( int battleindex, int attackNo, int defNo, int marray );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_BARRIER //vincent宠技:魔障
|
||||
int BATTLE_S_Barrier( int battleindex, int attackNo, int defNo, int marray );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_NOCAST //vincent宠技:沉默
|
||||
int BATTLE_S_Nocast( int battleindex, int attackNo, int defNo, int marray );
|
||||
#endif
|
||||
|
||||
#ifdef _SKILL_ROAR //vincent宠技:大吼
|
||||
int BATTLE_S_Roar( int battleindex, int attackNo, int defNo, int marray );
|
||||
#endif
|
||||
|
||||
int BATTLE_Charge( int battleindex, int attackNo );
|
||||
|
||||
|
||||
int BATTLE_StatusAttackCheck(
|
||||
|
||||
int attackindex,
|
||||
int defindex,
|
||||
int status,
|
||||
//BATTLE_ST_POISON, 1 "毒",
|
||||
//BATTLE_ST_PARALYSIS, 2 "麻",
|
||||
//BATTLE_ST_SLEEP, 3 "眠",
|
||||
//BATTLE_ST_STONE, 4 "石",
|
||||
//BATTLE_ST_DRUNK, 5 "醉",
|
||||
//BATTLE_ST_CONFUSION, 6 "乱"
|
||||
int PerOffset,
|
||||
int Range,
|
||||
float Bai,
|
||||
int *pPer
|
||||
);
|
||||
|
||||
int BATTLE_Combo( int battleindex, int *pAttackList, int defNo );
|
||||
|
||||
int BATTLE_EarthRoundHide( int battleindex, int attackNo );
|
||||
|
||||
int BATTLE_GetDamageReact( int charaindex );
|
||||
|
||||
void BATTLE_talkToCli( int charaindex, char *pszBuffer, int color );
|
||||
|
||||
#ifdef _PETSKILL_SETDUCK
|
||||
BOOL BATTLE_CheckMySkillDuck( int charaindex );
|
||||
#endif
|
||||
|
||||
BOOL BATTLE_LostEscape( int battleindex, int attackNo );
|
||||
|
||||
BOOL BATTLE_Abduct( int battleindex, int attackNo, int defNo, int array );
|
||||
|
||||
void BATTLE_Steal( int battleindex, int attackNo, int defNo );
|
||||
|
||||
int BATTLE_getReactFlg( int index, int react);
|
||||
|
||||
#ifdef _BATTLESTEAL_FIX
|
||||
void BATTLE_StealMoney( int battleindex, int attackNo, int defNo) ;
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_LER
|
||||
void BATTLE_BatFly(int battleindex,int attackNo,int myside);
|
||||
void BATTLE_DivideAttack(int battleindex,int attackNo,int myside);
|
||||
void BATTLE_LerChange(int battleindex,int charaindex,int no);
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_BATTLE_MODEL
|
||||
void BATTLE_BattleModel(int battleindex,int attackNo,int myside);
|
||||
#endif
|
||||
|
||||
// Robin 0727 Ride Pet
|
||||
#define ATTACKSIDE 1
|
||||
#define DEFFENCESIDE 2
|
||||
|
||||
float BATTLE_adjustRidePet3A( int charaindex, int petindex, int workindex, int action );
|
||||
|
||||
int BATTLE_getRidePet( int charaindex );
|
||||
|
||||
#ifdef _PSKILL_FALLGROUND //落马术
|
||||
int BATTLE_S_FallGround( int battleindex, int attackNo, int defNo, int skill_type );
|
||||
#endif
|
||||
#ifdef _PETSKILL_EXPLODE
|
||||
int BATTLE_S_Explode( int battleindex, int attackNo, int defNo, int skill_type );
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_PROPERTY
|
||||
int BATTLE_S_PetSkillProperty( int battleindex, int attackNo, int skill_type, int skill);
|
||||
#endif
|
||||
|
||||
int BATTLE_S_AttackDamage( int battleindex, int attackNo, int defNo, int skill_type, int skill);
|
||||
|
||||
#ifdef _MAGIC_SUPERWALL
|
||||
int PETSKILL_MagicStatusChange_Battle( int battleindex, int attackNo, int toNo, int marray);
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_SETDUCK
|
||||
int PETSKILL_SetDuckChange_Battle( int battleindex, int attackNo, int toNo, int marray);
|
||||
#endif
|
||||
|
||||
#ifdef _MAGICPET_SKILL
|
||||
int PETSKILL_SetMagicPet_Battle( int battleindex, int attackNo, int toNo, int marray);
|
||||
#endif
|
||||
|
||||
#ifdef _TAKE_ITEMDAMAGE
|
||||
int BATTLE_ItemCrushCheck( int charaindex , int flg);
|
||||
int BATTLE_ItemCrush( int charaindex, int ItemEquip, int Damages, int flg);
|
||||
#endif
|
||||
|
||||
#ifdef _PRO_BATTLEENEMYSKILL
|
||||
int BATTLE_E_ENEMYREFILE( int battleindex, int attackNo, int defNo, int skill_type );
|
||||
|
||||
int BATTLE_E_ENEMYREHP( int battleindex, int attackNo, int defNo, int skill_type );
|
||||
|
||||
int BATTLE_E_ENEMYHELP( int battleindex, int attackNo, int defNo, int skill_type );
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _PREVENT_TEAMATTACK
|
||||
int BATTLE_CheckSameSide( int charaindex, int toNo);
|
||||
#endif
|
||||
|
||||
#ifdef _USER_CHARLOOPS
|
||||
int CHAR_BattleStayLoop( int charaindex);//原地遇敌
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_PROPERTY
|
||||
int PET_PetskillPropertyEvent( int Myindex, int defindex, int *damage, int *T_Pow, int size);
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
int battle_profession_attack_fun(int battleindex, int attackNo, int defNo, int charaindex);
|
||||
int battle_profession_attack_magic_fun(int battleindex, int attackNo, int defNo, int charaindex);
|
||||
int battle_profession_assist_fun(int battleindex, int attackNo, int defNo, int charaindex);
|
||||
int battle_profession_status_chang_fun(int battleindex, int attackNo, int defNo, int charaindex);
|
||||
int BATTLE_check_profession_duck( int charaindex, int per );
|
||||
int BATTLE_PROFESSION_ATK_PET_DamageSub( int attackindex, int defindex, int *pDamage, int *pPetDamage, int *pRefrect, int skill_level );
|
||||
int PROFESSION_BATTLE_StatusAttackCheck( int charaindex, int toindex, int status, int Success );
|
||||
int BATTLE_PROFESSION_CONVOLUTE_GET_DAMAGE( int attackindex, int defindex, int skill_level );
|
||||
int BATTLE_PROFESSION_THROUGH_ATTACK_GET_DAMAGE( int attackindex, int defindex );
|
||||
int BATTLE_PROFESSION_RANG_ATTACK_DAMAGE( int charaindex, int attackNo, int defNo, int skill_type, int status, int turn, int perStatus, int effect, int img1, int img2 );
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_FIREKILL //火线猎杀专用
|
||||
int BATTLE_Attack_FIREKILL( int battleindex, int attackNo, int defNo );
|
||||
#endif
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
BOOL BATTLE_BattleUltimate( int battleindex, int bid ); //检查此位 上是否被打飞
|
||||
#endif
|
||||
|
||||
#endif
|
36
gmsv/include/battle_item.h
Normal file
36
gmsv/include/battle_item.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef _BATTLE_ITEM_H_
|
||||
#define _BATTLE_ITEM_H_
|
||||
//--------------------------------------------------------------
|
||||
// 솎呻呵켈 馬챘陵焞禁堯퀼섟醴
|
||||
//--------------------------------------------------------------
|
||||
// 얽 섟堯퀼
|
||||
void ITEM_useRecovery_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useStatusChange_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useMagicDef_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useParamChange_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useFieldChange_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useAttReverse_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useStatusRecovery_Battle( int charaindex, int toindex, int itemindex );
|
||||
void ITEM_useCaptureUp_Battle( int charaindex, int toindex, int itemindex );
|
||||
#ifdef _ITEM_CRACKER
|
||||
void ITEM_useCracker_Effect( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
#ifdef _ITEM_ADDEXP //vincent 쒔駱瓊<EFA49A>
|
||||
void ITEM_useAddexp_Effect( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
#ifdef _ITEM_REFRESH //vincent 썩뇜嫩끽榴檄돛야
|
||||
void ITEM_useRefresh_Effect( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
//Terry add 2001/12/24
|
||||
#ifdef _ITEM_FIRECRACKER
|
||||
void ITEM_useFirecracker_Battle(int charaindex,int toindex,int itemindex);
|
||||
#endif
|
||||
//Terry end
|
||||
|
||||
#ifdef _ITEM_MAGICRECOVERY
|
||||
void ITEM_useMRecovery_Battle( int charaindex, int toNo, int haveitemindex );
|
||||
#endif
|
||||
#ifdef _ITEM_USEMAGIC
|
||||
void ITEM_useMagic_Battle( int charaindex, int toNo, int haveitemindex );
|
||||
#endif
|
||||
#endif
|
341
gmsv/include/battle_magic.h
Normal file
341
gmsv/include/battle_magic.h
Normal file
@ -0,0 +1,341 @@
|
||||
#ifndef _BATTLE_MAGIC_H_
|
||||
#define _BATTLE_MAGIC_H_
|
||||
|
||||
#define MAGIC_EFFECT_USER 100600
|
||||
#define SPR_heal 100601
|
||||
#define SPR_heal2 100602
|
||||
#define SPR_heal3 100603
|
||||
#define SPR_tyusya 100604
|
||||
#define SPR_hoshi 100605
|
||||
|
||||
|
||||
#define MAGIC_ID_RECOVERY 1
|
||||
#define MAGIC_ID_STATUS_RECOVERY 3
|
||||
#define MAGIC_ID_FIELD_CHANGE 4
|
||||
#define MAGIC_ID_BADSTATUS 5
|
||||
|
||||
enum{
|
||||
BFUKI_CAPTUREUP,
|
||||
BFUKI_END
|
||||
};
|
||||
|
||||
|
||||
enum{
|
||||
PC_KIND_NONE,
|
||||
PC_KIND_ATTACK,
|
||||
PC_KIND_DEFENSE,
|
||||
PC_KIND_QUICK,
|
||||
PC_KIND_CHARM,
|
||||
PC_KIND_CAPTURE,
|
||||
PC_KIND_END
|
||||
};
|
||||
|
||||
int MAGIC_Recovery_Battle(
|
||||
int charaindex,
|
||||
int toindex,
|
||||
int magicindex,
|
||||
int mp
|
||||
);
|
||||
|
||||
int MAGIC_FieldAttChange_Battle(
|
||||
int charaindex,
|
||||
int toindex,
|
||||
int marray,
|
||||
int mp
|
||||
);
|
||||
|
||||
int MAGIC_StatusChange_Battle(
|
||||
int charaindex,
|
||||
int toindex,
|
||||
int marray,
|
||||
int mp
|
||||
);
|
||||
|
||||
#ifdef _MAGIC_DEEPPOISON
|
||||
int MAGIC_StatusChange_Battle2(
|
||||
int charaindex,
|
||||
int toindex,
|
||||
int marray,
|
||||
int mp
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef _OTHER_MAGICSTAUTS
|
||||
int MAGIC_MagicStatusChange_Battle( int charaindex, int toNo, int marray, int mp );
|
||||
|
||||
#endif
|
||||
|
||||
int MAGIC_MagicDef_Battle(
|
||||
int charaindex,
|
||||
int toNo,
|
||||
int marray,
|
||||
int mp
|
||||
);
|
||||
|
||||
void BATTLE_MultiRecovery(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int kind,
|
||||
int power,
|
||||
int per,
|
||||
int UseEffect,
|
||||
#ifdef _CHANGEITEMUSE // Syu ADD 调整战斗中使用料理设定
|
||||
int RecevEffect,
|
||||
int power1
|
||||
#else
|
||||
int RecevEffect
|
||||
#endif
|
||||
|
||||
);
|
||||
|
||||
#ifdef _IMPRECATE_ITEM
|
||||
void BATTLE_ImprecateRecovery(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int kind,
|
||||
int powers,
|
||||
int rounds,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
#endif
|
||||
void BATTLE_MultiStatusChange(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int status,
|
||||
int turn,
|
||||
int UseEffect,
|
||||
int RecevEffect,
|
||||
int Success
|
||||
);
|
||||
|
||||
#ifdef _OTHER_MAGICSTAUTS
|
||||
void BATTLE_MultiMagicStatusChange(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int status,
|
||||
int turn,
|
||||
int UseEffect,
|
||||
int RecevEffect,
|
||||
int nums
|
||||
);
|
||||
#endif
|
||||
|
||||
void BATTLE_MultiMagicDef(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int kind,
|
||||
int count,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
|
||||
void BATTLE_MultiParamChange(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int kind,
|
||||
int power,
|
||||
int par,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
|
||||
int MAGIC_FieldAttChange_Battle(
|
||||
int charaindex,
|
||||
int toNo,
|
||||
int marray,
|
||||
int mp
|
||||
);
|
||||
|
||||
int BATTLE_FieldAttChange(
|
||||
int charaindex,
|
||||
char *pArg
|
||||
);
|
||||
|
||||
void BATTLE_MultiAttReverse(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
|
||||
|
||||
void BATTLE_MultiStatusRecovery(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int status,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
|
||||
int MAGIC_StatusRecovery_Battle(
|
||||
int charaindex,
|
||||
int toNo,
|
||||
int marray,
|
||||
int mp
|
||||
);
|
||||
|
||||
void BATTLE_MultiRessurect(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int power,
|
||||
int per,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
|
||||
void BATTLE_MultiCaptureUp(
|
||||
int battleindex,
|
||||
int attackNo,
|
||||
int toNo,
|
||||
int power,
|
||||
int UseEffect,
|
||||
int RecevEffect
|
||||
);
|
||||
//
|
||||
//***********************************************************
|
||||
|
||||
//****************************************************************
|
||||
//
|
||||
// 竣濮井日汊唾允月热诸
|
||||
//
|
||||
int MAGIC_Ressurect_Battle(
|
||||
int charaindex, // 井仃月谛及奶件犯永弁旦
|
||||
int toNo, // 井仃日木月谛及奶件犯永弁旦
|
||||
int marray, // magicindex
|
||||
int mp // MP
|
||||
);
|
||||
// 岳 仄凶日 TRUE
|
||||
// 撩 仄凶日 FALSE
|
||||
//****************************************************************
|
||||
|
||||
//****************************************************************
|
||||
//
|
||||
// 箪岭及 鳖毛允月热诸
|
||||
//
|
||||
int MAGIC_AttReverse_Battle(
|
||||
int charaindex, // 井仃月谛及奶件犯永弁旦
|
||||
int toNo, // 井仃日木月谛及奶件犯永弁旦
|
||||
int marray, // magicindex
|
||||
int mp // MP
|
||||
);
|
||||
// 岳 仄凶日 TRUE
|
||||
// 撩 仄凶日 FALSE
|
||||
//****************************************************************
|
||||
//****************************************************************
|
||||
//
|
||||
// 凯 祭允月热诸
|
||||
//
|
||||
int MAGIC_CaptureUp_Battle(
|
||||
int charaindex, // 井仃月谛及奶件犯永弁旦
|
||||
int toNo, // 井仃日木月谛及奶件犯永弁旦
|
||||
int marray, // magicindex
|
||||
int mp // MP
|
||||
);
|
||||
// 岳 仄凶日 TRUE
|
||||
// 撩 仄凶日 FALSE
|
||||
//****************************************************************
|
||||
|
||||
//***********************************************************
|
||||
//
|
||||
// 芊羁匹 醒及平乓仿弁正□毛汊唾今六月今日卞 芊 豢毛馨笛
|
||||
//
|
||||
void BATTLE_MultiResAndDef(
|
||||
int battleindex, // 田玄伙奶件犯永弁旦
|
||||
int attackNo, // 井仃月谛 寞
|
||||
int toNo, // 井仃日木月谛 寞
|
||||
int power, // 湘 荚汊袄
|
||||
int per, // ⊙井"
|
||||
int kind, // 芊 豢及潘
|
||||
int count, // 窒荚 什井
|
||||
int UseEffect, // 银丹谛及巨白尼弁玄
|
||||
int RecevEffect // 井仃日木月谛及巨白尼弁玄
|
||||
);
|
||||
//
|
||||
//***********************************************************
|
||||
//****************************************************************
|
||||
//
|
||||
// 汊唾≈ 芊 豢毛芨尹月热诸
|
||||
//
|
||||
int MAGIC_ResAndDef_Battle(
|
||||
int charaindex, // 井仃月谛及奶件犯永弁旦
|
||||
int toNo, // 井仃日木月谛及奶件犯永弁旦
|
||||
int marray, // magicindex
|
||||
int mp // MP
|
||||
);
|
||||
// 岳 仄凶日 TRUE
|
||||
// 撩 仄凶日 FALSE
|
||||
//****************************************************************
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
int MAGIC_AttMagic_Battle( int charaindex , int toNo , int marray , int mp );
|
||||
#ifdef _FIX_MAGICDAMAGE
|
||||
void BATTLE_MultiAttMagic( int battleindex, int attackNo, int toNo,
|
||||
int attIdx ,int FieldAttr ,int Power, int MagicLv);
|
||||
|
||||
#else
|
||||
void BATTLE_MultiAttMagic( int battleindex , int attackNo , int toNo , int attIdx , int FieldAttr , int Power );
|
||||
#endif
|
||||
int MAGIC_AttMagic_Battle( int charaindex , int toNo , int marray , int mp );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef _MAGIC_TOCALL
|
||||
int MAGIC_ToCallDragon_Battle( int charaindex , int toNo , int marray , int mp );
|
||||
|
||||
void BATTLE_MultiToCallDragonMagic( int battleindex, int attackNo, int toNo,
|
||||
int attIdx ,int FieldAttr ,int Power, int ImageNo);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _Item_ReLifeAct
|
||||
void BATTLE_MultiReLife( int battleindex, int attackNo, int toNo, int power, int RecevEffect );
|
||||
#endif
|
||||
#ifdef _MAGIC_WEAKEN
|
||||
int MAGIC_ParamChange_Turn_Battle(int charaindex,int toNo,int marray,int mp);
|
||||
void BATTLE_MultiParamChangeTurn( int battleindex,int attackNo,int toNo,int status,int UseEffect,int RecevEffect,int turn, int Success);
|
||||
#endif
|
||||
int BATTLE_MagicEffect( int battleindex,int attackNo,int ToList[],int MyEffect,int ToEffect );
|
||||
|
||||
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
void PROFESSION_MAGIC_ATTAIC( int battleindex, int attackNo, int toNo, int attIdx, int FieldAttr, int skill);
|
||||
int PROFESSION_MAGIC_ATTAIC_Effect( int battleindex, int attackNo, int ToList[], int AttackMgcNo );
|
||||
int analysis_profession_parameter( int attIdx, int skill, int toNo, int charaindex );
|
||||
void PROFESSION_MAGIC_GET_PRACTICE( float *hp_power, float *mp_power, float *dec_hp, float *dec_mp, int charaindex );
|
||||
void PROFESSION_MAGIC_TOLIST_SORT( int *list, int *listidx, int charaindex );
|
||||
void PROFESSION_MAGIC_CHANGE_STATUS( int charaindex, int hp_power, float mp_power, float *add_hp, float *add_mp );
|
||||
void PROFESSION_MAGIC_GET_IMG2( int toNo, int charaindex, int attIdx, char *pszOption );
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
int PROFESSION_MAGIC_GET_DAMAGE( int attackindex, int defindex, int magic_type, int power, int command );
|
||||
#else
|
||||
int PROFESSION_MAGIC_GET_DAMAGE( int attackindex, int defindex, int magic_type, int power );
|
||||
#endif
|
||||
int PROFESSION_MAGIC_DODGE( int atk_index, int def_index, int magic_type );
|
||||
void PROFESSION_MAGIC_CHANG_IMG2( int img2, char *pszOption, int attIdx );
|
||||
int PROFESSION_MAGIC_CHANG_STATUS(int command,int battleindex, int charaindex, int charaidx, int power, int no);
|
||||
int PROFESSION_MAGIC_GET_ICE_MIRROR_DAMAGE( int attackindex, int defindex, int command, int power );
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_FIREKILL
|
||||
void BATTLE_MultiAttMagic_Fire( int battleindex, int attackNo, int defNo,
|
||||
int FieldAttr , int Power);
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_ADDSKILL
|
||||
unsigned int GET_PROFESSION_magic_uiSpriteNum(int idx);
|
||||
#endif
|
||||
|
||||
#endif
|
11
gmsv/include/buf.h
Normal file
11
gmsv/include/buf.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef __BUF_H__
|
||||
#define __BUF_H__
|
||||
|
||||
#include "common.h"
|
||||
void memEnd( void );
|
||||
BOOL configmem( int unit , int unitnumber );
|
||||
BOOL memInit( void );
|
||||
void* allocateMemory( const unsigned int nbyte );
|
||||
void freeMemory( void* freepointer );
|
||||
void showMem( char *buf);
|
||||
#endif
|
771
gmsv/include/char.h
Normal file
771
gmsv/include/char.h
Normal file
@ -0,0 +1,771 @@
|
||||
#ifndef __CHAR_H__
|
||||
#define __CHAR_H__
|
||||
|
||||
#include "common.h"
|
||||
#include "char_base.h"
|
||||
#include "net.h"
|
||||
#include "char_data.h"
|
||||
|
||||
|
||||
/*------------------------------------------------------------
|
||||
*白巧件玄及缙及烂聒
|
||||
*------------------------------------------------------------*/
|
||||
typedef enum
|
||||
{
|
||||
CHAR_COLORWHITE,
|
||||
CHAR_COLORCYAN,
|
||||
CHAR_COLORPURPLE,
|
||||
CHAR_COLORBLUE,
|
||||
CHAR_COLORYELLOW,
|
||||
CHAR_COLORGREEN,
|
||||
CHAR_COLORRED,
|
||||
CHAR_COLORGRAY,
|
||||
CHAR_COLORBLUE2,
|
||||
CHAR_COLORGREEN2,
|
||||
|
||||
}CHAR_COLOR;
|
||||
/*====================平乓仿及综岳卞楮允月楮醒====================*/
|
||||
void CHAR_createNewChar( int clifd, int dataplacenum,char* charname ,
|
||||
int imgno,int faceimgno,
|
||||
int vital,int str,int tgh,int dex,
|
||||
int earth,int water,int fire,int wind,
|
||||
int hometown , char *cdkey );
|
||||
|
||||
/*====================平乓仿及夫弘奶件====================*/
|
||||
|
||||
#ifdef _BAD_PLAYER // WON ADD 送坏玩家去关
|
||||
void CHAR_login( int clifd, char* data, int saveindex, int badplayer );
|
||||
#else
|
||||
void CHAR_login( int clifd, char* data, int saveindex );
|
||||
#endif
|
||||
|
||||
#define CHAR_warpToSpecificPoint( cindex, fl, x, y) _CHAR_warpToSpecificPoint( __FILE__, __LINE__, cindex, fl, x, y)
|
||||
BOOL _CHAR_warpToSpecificPoint( char *file, int line,
|
||||
int charaindex, int fl, int x, int y);
|
||||
|
||||
|
||||
/*====================平乓仿及本□皮====================*/
|
||||
/*====================平乓仿及夫弘失它玄====================*/
|
||||
BOOL CHAR_charSaveFromConnectAndChar( int fd,Char* ch, int unlock );
|
||||
BOOL CHAR_charSaveFromConnect( int fd,int unlock );
|
||||
#define CHAR_logout( clifd, save) _CHAR_logout( __FILE__, __LINE__, clifd, save)
|
||||
BOOL _CHAR_logout( char *file, int line, int clifd, BOOL save);
|
||||
|
||||
/*====================watch event ====================*/
|
||||
void CHAR_sendWatchEvent( int objindex, int chac, int* opt,int optlen,BOOL myflg );
|
||||
|
||||
/*====================旦平伙====================*/
|
||||
BOOL CHAR_Skillupsend(int charaindex );
|
||||
void CHAR_SkillUp( int charaindex, int skillid );
|
||||
void CHAR_useSkill( int charaindex, int dir ,int skindex );
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CHAR_WALKSUCCESSED, /* 岳 */
|
||||
CHAR_WALKSYSTEMERROR, /* 扑旦 丞巨仿□ 及index民尼永弁卞
|
||||
* 夫匀井井匀凶午井 */
|
||||
CHAR_WALKEXTEND, /* 区左□田□仄化汹仇丹午仄凶[NPC卞及心*/
|
||||
CHAR_WALKHITOBJECT, /* 窒井 卞癫匀化}汹仃卅井匀凶 */
|
||||
CHAR_WALKPREWALK, /* prewalk奶矛件玄匹汹仃卅井匀凶( 檗祭 ) */
|
||||
CHAR_WALKDIE, /* 韶氏匹中化汹仃卅中 */
|
||||
CHAR_WALK1357, /* 标户 轾卞汹仇丹午仄化汹仃卅井匀凶 */
|
||||
}CHAR_WALKRET;
|
||||
|
||||
/*====================平乓仿及啖 卞楮允月楮醒====================*/
|
||||
void CHAR_ctodirmode(char moji , int* dir , int* mode);
|
||||
INLINE void CHAR_getDXDY( int dir , int* dx, int* dy );
|
||||
INLINE int CHAR_getDX( int dir );
|
||||
INLINE int CHAR_getDY( int dir );
|
||||
int CHAR_getSameCoordinateObjects(int* objbuf, int siz,int ff, int fx, int fy);
|
||||
void CHAR_walkcall( int index );
|
||||
void CHAR_walk_start(int index, int x, int y, char* dir, BOOL mapsendmode);
|
||||
void CHAR_walk_init( int fd, int x, int y, char *direction, BOOL mapsendmode);
|
||||
|
||||
CHAR_WALKRET CHAR_walk(int index, int dir, int mode);
|
||||
|
||||
char* CHAR_makeOptionString( Char* ch );
|
||||
char* CHAR_makeStatusString( int index, char* category );
|
||||
|
||||
#define CHAR_makeObjectCString( objindex, buf, buflen) _CHAR_makeObjectCString( __FILE__, __LINE__, objindex, buf, buflen)
|
||||
BOOL _CHAR_makeObjectCString( char *file, int line, int objindex, char* buf, int buflen );
|
||||
|
||||
//BOOL CHAR_sendStatusString( int charaindex, char* category );
|
||||
#define CHAR_sendStatusString( A, B) _CHAR_sendStatusString( A, B, __FILE__, __LINE__ )
|
||||
BOOL _CHAR_sendStatusString( int charaindex, char* category, char* file, int line );
|
||||
BOOL CHAR_sendItemData( int charaindex, int *itemgroup, int num);
|
||||
BOOL CHAR_sendItemDataOne( int charaindex, int haveitemindex);
|
||||
BOOL CHAR_send_P_StatusString( int charaindex, unsigned int indextable );
|
||||
BOOL CHAR_send_N_StatusString( int charaindex, int num, unsigned int indextable );
|
||||
BOOL CHAR_send_K_StatusString( int charaindex, int num, unsigned int indextable );
|
||||
|
||||
void CHAR_inputOwnTitle( int index ,char* name );
|
||||
|
||||
void CHAR_selectTitle( int index, int titleindex );
|
||||
void CHAR_deleteTitle( int index, int titleindex );
|
||||
|
||||
#define CHAR_complianceParameter( index) _CHAR_complianceParameter( index, __FILE__, __LINE__)
|
||||
int _CHAR_complianceParameter( int index, char *FILE, int LINE);
|
||||
|
||||
int CHAR_findSurplusItemBox( int index );
|
||||
int CHAR_findEmptyItemBox( int index );
|
||||
int CHAR_findEmptyPoolItemBox( int index );
|
||||
int CHAR_findEmptyItemBoxNo( int index );
|
||||
|
||||
void CHAR_moveEquipItem( int index, int fromindex, int toindex );
|
||||
void CHAR_ItemUse( int charaindex, int to_charaindex, int haveitemindex );
|
||||
void CHAR_DropItem( int charaindex, int itemindex );
|
||||
int CHAR_DropItemAbsolute( int itemindex, int floor, int x, int y,BOOL net);
|
||||
BOOL CHAR_DropItemFXY( int charaindex, int itemcharaindex, int fl,
|
||||
int x, int y, int* objindex );
|
||||
int CHAR_addItemSpecificItemIndex( int charaindex, int itemindex );
|
||||
|
||||
void CHAR_PickUpItem( int charaindex, int dir );
|
||||
void CHAR_DropMoney( int charaindex, int amount );
|
||||
int CHAR_addItem( int charaindex, int itemid );
|
||||
int CHAR_addItemToChar( Char* ch, int itemid );
|
||||
|
||||
int CHAR_pickupFollowPet( int charaindex, int petindex );
|
||||
|
||||
#ifdef _GAMBLE_ROULETTE
|
||||
int NPC_MAPCLEANGOLD( int meindex , int floor);
|
||||
#endif
|
||||
|
||||
#ifdef _DROPSTAKENEW
|
||||
#define MAXSTAKENUM 5
|
||||
int CasinoAccumulation(int charindex, int npcindex, int floor, int wincasinotype);
|
||||
void CHAR_talkToFloor(int floor, int talkindex, char* message, CHAR_COLOR color);
|
||||
int SetCasinoMap(int npcindex, int casinotype, int mapdropflag);
|
||||
int CasinoPay(int npcindex, int wincasinotype);
|
||||
#endif
|
||||
|
||||
void CHAR_sendCSpecifiedObjindex( int fd, int index);
|
||||
void CHAR_sendSpecifiedobjindexCToCharaindex(int charaindex,int objindex);
|
||||
|
||||
void CHAR_sendCToArroundCharacter( int charaindex );
|
||||
|
||||
void CHAR_sendArroundCharaData( int charaindex );
|
||||
|
||||
void CHAR_sendCDArroundChar( int fl, int x, int y, int objindex );
|
||||
void CHAR_sendCDArroundChar_Main( int fl, int x, int y, int objindex, BOOL mode );
|
||||
|
||||
|
||||
void CHAR_Look( int charaindex, int dir );
|
||||
|
||||
void CHAR_initChatMagic(void);
|
||||
|
||||
char* CHAR_appendNameAndTitle( int charaindex, char* src, char* buf,
|
||||
int buflen );
|
||||
void CHAR_Talk( int fd, int index,char* message,int color, int area );
|
||||
|
||||
void CHAR_Loop( void );
|
||||
|
||||
#define WINDOW_BUTTONTYPE_NONE (0)
|
||||
#define WINDOW_BUTTONTYPE_OK (1 << 0)
|
||||
#define WINDOW_BUTTONTYPE_CANCEL (1 << 1)
|
||||
#define WINDOW_BUTTONTYPE_YES (1 << 2)
|
||||
#define WINDOW_BUTTONTYPE_NO (1 << 3)
|
||||
#define WINDOW_BUTTONTYPE_PREV (1 << 4)
|
||||
#define WINDOW_BUTTONTYPE_NEXT (1 << 5)
|
||||
|
||||
#define WINDOW_BUTTONTYPE_OKCANCEL (WINDOW_BUTTONTYPE_OK | WINDOW_BUTTONTYPE_CANCEL)
|
||||
#define WINDOW_BUTTONTYPE_YESNO (WINDOW_BUTTONTYPE_YES | WINDOW_BUTTONTYPE_NO)
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
WINDOW_MESSAGETYPE_MESSAGE,
|
||||
WINDOW_MESSAGETYPE_MESSAGEANDLINEINPUT,
|
||||
WINDOW_MESSAGETYPE_SELECT,
|
||||
WINDOW_MESSAGETYPE_PETSELECT,
|
||||
WINDOW_MESSAGETYPE_PARTYSELECT,
|
||||
WINDOW_MESSAGETYPE_PETANDPARTYSELECT,
|
||||
WINDOW_MESSAGETYPE_ITEMSHOPMENU,
|
||||
WINDOW_MESSAGETYPE_ITEMSHOPMAIN,
|
||||
WINDOW_MESSAGETYPE_LIMITITEMSHOPMAIN,
|
||||
WINDOW_MESSAGETYPE_PETSKILLSHOP,
|
||||
WINDOW_MESSAGETYPE_WIDEMESSAGE,
|
||||
WINDOW_MESSAGETYPE_WIDEMESSAGEANDLINEINPUT,
|
||||
WINDOW_MESSAGETYPE_POOLITEMSHOPMENU,
|
||||
WINDOW_MESSAGETYPE_POOLITEMSHOPMAIN,
|
||||
|
||||
WINDOW_MESSAGETYPE_FAMILYADD,
|
||||
WINDOW_MESSAGETYPE_FAMILYJOIN,
|
||||
WINDOW_MESSAGETYPE_FAMILYOUT,
|
||||
WINDOW_MESSAGETYPE_FAMILYEND,
|
||||
//=======================================
|
||||
// shan add
|
||||
WINDOW_FMMESSAGETYPE_SELECT,
|
||||
WINDOW_FMMESSAGETYPE_DENGON,
|
||||
WINDOW_FMMESSAGETYPE_FMSDENGON,
|
||||
WINDOW_FMMESSAGETYPE_POINTLIST,
|
||||
#ifdef _FMVER21
|
||||
WINDOW_FMMESSAGETYPE_TOP30DP,
|
||||
#endif
|
||||
WINDOW_FMMESSAGETYPE_DP,
|
||||
WINDOW_MESSAGETYPE_BANK,
|
||||
|
||||
// Arminius 7.12 scheduleman
|
||||
WINDOW_MESSAGETYPE_PKSCHEDULELIST,
|
||||
WINDOW_MESSAGETYPE_PKSCHEDULESELECTFAMILY,
|
||||
WINDOW_MESSAGETYPE_PKSCHEDULEDETAIL,
|
||||
|
||||
// Robin
|
||||
WINDOW_MESSAGETYPE_LOGINMESSAGE,
|
||||
WINDOW_MESSAGETYPE_FAMILYTAX,
|
||||
WINDOW_MESSAGETYPE_SHOWRIDEPET,
|
||||
WINDOW_MESSAGETYPE_FAMILYDETAIL,
|
||||
|
||||
WINDOW_MESSAGETYPE_LEADERSELECT,
|
||||
WINDOW_MESSAGETYPE_LEADERSELECTQ,
|
||||
WINDOW_MESSAGETYPE_LEADERSELECTA,
|
||||
|
||||
// Arminius 1.3 Auctioneer
|
||||
WINDOW_MESSAGETYPE_AUCTIONNEW,
|
||||
WINDOW_MESSAGETYPE_AUCTIONLIST_BUY,
|
||||
WINDOW_MESSAGETYPE_AUCTIONSURVEY,
|
||||
WINDOW_MESSAGETYPE_AUCTIONMODIFY,
|
||||
WINDOW_MESSAGETYPE_AUCTIONLIST_MODIFY,
|
||||
#ifdef _BLACK_MARKET
|
||||
WINDOW_MESSAGETYPE_BLACKMARKET,
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_FUSION
|
||||
WINDOWS_MESSAGETYPE_PETFUSION,
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_CANNEDFOOD
|
||||
WINDOWS_MESSAGETYPE_PETSKILLSHOW,
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_SELLSTH
|
||||
WINDOWS_MESSAGETYPE_SELLSTHMENU,
|
||||
WINDOWS_MESSAGETYPE_SELLSTHVIEW,
|
||||
WINDOWS_MESSAGETYPE_SELLSTHSELL,
|
||||
#endif
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD 人物职业技能
|
||||
WINDOW_MESSAGETYPE_PROFESSIONSHOP,
|
||||
#endif
|
||||
#ifdef _NPC_WELFARE_2 // WON ADD 职业NPC-2
|
||||
WINDOW_MESSAGETYPE_PROFESSIONSHOP2,
|
||||
#endif
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
WINDOW_FMMESSAGETYPE_10_MEMONTUM, // 十大气势家族
|
||||
WINDOW_FMMESSAGETYPE_FM_MEMONTUM, // 自己家族气势排名
|
||||
WINDOW_FMMESSAGETYPE_MANOR_SCHEDULE, // 挑战庄园排行
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
WINDOW_MESSAGETYPE_ANGELMESSAGE = 101,
|
||||
WINDOW_MESSAGETYPE_ANGELASK,
|
||||
#endif
|
||||
|
||||
#ifdef _MOUSE_DBL_CLICK
|
||||
WINDOW_MESSAGETYPE_MOUSEGETNAME,
|
||||
#endif
|
||||
|
||||
#ifdef _CONTRACT
|
||||
WINDOW_MESSAGETYPE_CONTRACT,
|
||||
#endif
|
||||
|
||||
#ifdef _RACEMAN
|
||||
WINDOW_MESSAGETYPE_RACEMAN_RANK,
|
||||
#endif
|
||||
|
||||
}WINDOW_MESSAGETYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CHAR_WINDOWTYPE_RETURNTOELDER=-1, /* 赢 尺 月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_RESURRECTION=-2, /* 汊唾允月它奴件玉它 */
|
||||
|
||||
CHAR_WINDOWTYPE_SELECTBATTLE = 1, /* 月爵 毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTDUEL = 2, /* 月DUEL毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTTRADECARD = 3, /* 铜跟晶毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTPARTY = 4, /* 由□ 奴毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTBATTLEWATCH = 5, /* 棋爵毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_MICMESSAGE = 6, /* MICNPC毛银匀化请月它奴件玉它 */
|
||||
|
||||
// CoolFish: Trade 2001/4/18
|
||||
CHAR_WINDOWTYPE_SELECTTRADE = 7, /* 交易 Window */
|
||||
|
||||
CHAR_WINDOWTYPE_SELECTRENAMEITEM_PAGE1 = 10, /* 蟆毛 凳允月失奶 丞毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTRENAMEITEM_PAGE2 = 11, /* 蟆毛 凳允月失奶 丞毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTRENAMEITEM_PAGE3 = 12, /* 蟆毛 凳允月失奶 丞毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTRENAMEITEM_PAGE4 = 13, /* 蟆毛 凳允月失奶 丞毛蓟 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTRENAMEITEM_RENAME = 14, /* 蟆毛 允月它奴件玉它 */
|
||||
CHAR_WINDOWTYPE_SELECTRENAMEITEM_RENAME_ATTENTION = 15, /* 蟆毛 允月它奴件玉它 */
|
||||
|
||||
CHAR_WINDOWTYPE_DENGON = 50, /* 鳗蜕 */
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWMAN_START = 100,
|
||||
CHAR_WINDOWTYPE_WINDOWMAN_STARTMSG = CHAR_WINDOWTYPE_WINDOWMAN_START,
|
||||
CHAR_WINDOWTYPE_WINDOWMAN_END = 200,
|
||||
|
||||
CHAR_WINDOWTYPE_JANKEN_START = 210,
|
||||
CHAR_WINDOWTYPE_JANKEN_MAIN = 211,
|
||||
CHAR_WINDOWTYPE_JANKEN_END = 212,
|
||||
|
||||
CHAR_WINDOWTYPE_TRANSMIGRATION_START = 213,
|
||||
CHAR_WINDOWTYPE_TRANSMIGRATION_MAIN = 214,
|
||||
CHAR_WINDOWTYPE_TRANSMIGRATION_END = 215,
|
||||
CHAR_WINDOWTYPE_TRANSMIGRATION_NONE = 216,
|
||||
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_START = 220,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_STARTMSG = CHAR_WINDOWTYPE_WINDOWHEALER_START,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_HPMSG = 221,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_OKHPMSG = 222,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_SPIRITMSG = 223,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_OKSPIRITMSG = 224,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_ALLMSG = 225,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_OKALLMSG = 226,
|
||||
CHAR_WINDOWTYPE_WINDOWHEALER_END = 227,
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWSAVEPOINT_START = 230,
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_STARTMSG = 231,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_NOWEVENT = 232,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_ENDEVENT = 233,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_REQMAINMSG = 234,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_ACCMAINMSG = 235,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_NOMALMSG = 236,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_CLEANMSG = 237,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_REQTHANK = 238,
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_ACCTHANK = 239,
|
||||
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_START = 240,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_STARTMSG = CHAR_WINDOWTYPE_WINDOWITEMSHOP_START,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_MENU = 241,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_BUY_MSG = 242,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_SELL_MSG = 243,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_END = 244,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_LIMIT = 245,
|
||||
CHAR_WINDOWTYPE_WINDOWITEMSHOP_EXPRESS = 246,
|
||||
|
||||
CHAR_WINDOWTYPE_DUELRANKING_START = 250,
|
||||
CHAR_WINDOWTYPE_DUELRANKING_TOPRANKING = 251,
|
||||
CHAR_WINDOWTYPE_DUELRANKING_MYRANKING = 252,
|
||||
CHAR_WINDOWTYPE_DUELRANKING_WAIT = 253,
|
||||
CHAR_WINDOWTYPE_DEFEND_BILLDBOARD = 254,
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWPETSKILLSHOP = 260,
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_START = 261,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_PETSELECT = 262,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_MAIN = 263,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_GOLDOVER = 264,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_PETSELECT2 = 265,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_MAIN2 = 266,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_DRAWSELECT = 267,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_ASKDRAW = 268,
|
||||
CHAR_WINDOWTYPE_WINDOWPETSHOP_END = 269,
|
||||
|
||||
CHAR_WINDOWTYPE_WINDOWWARPMAN_MAIN = 271,
|
||||
CHAR_WINDOWTYPE_WINDOWWARPMAN_ERR = 272,
|
||||
CHAR_WINDOWTYPE_WINDOWWARPMAN_END = 273,
|
||||
|
||||
CHAR_WINDOWTYPE_NPCENEMY_START = 281,
|
||||
|
||||
CHAR_WINDOWTYPE_CHARM_START = 282,
|
||||
CHAR_WINDOWTYPE_CHARM_END = 283,
|
||||
|
||||
CHAR_WINDOWTYPE_QUIZ_START = 284,
|
||||
CHAR_WINDOWTYPE_QUIZ_MAIN = 285,
|
||||
CHAR_WINDOWTYPE_QUIZ_END = 286,
|
||||
|
||||
CHAR_WINDOWTYPE_CHECKMAN_START = 287,
|
||||
CHAR_WINDOWTYPE_CHECKMAN_MAIN = 288,
|
||||
CHAR_WINDOWTYPE_CHECKMAN_END = 289,
|
||||
|
||||
CHAR_WINDOWTYPE_FAMILYMAN_START = 320,
|
||||
CHAR_WINDOWTYPE_FAMILYMAN_ADD = 321,
|
||||
CHAR_WINDOWTYPE_FAMILYMAN_JOIN = 322,
|
||||
CHAR_WINDOWTYPE_FAMILYMAN_OUT = 323,
|
||||
CHAR_WINDOWTYPE_FAMILYMAN_BROKEN = 324,
|
||||
|
||||
CHAR_WINDOWTYPE_BANKMAN = 330,
|
||||
|
||||
// CoolFish: FMPKMan 2001/7/4
|
||||
CHAR_WINDOWTYPE_FMPKMAN_START = 340,
|
||||
CHAR_WINDOWTYPE_FMPKMAN_VIEW = 341,
|
||||
CHAR_WINDOWTYPE_FMPKMAN_LEAVEPK = 342,
|
||||
CHAR_WINDOWTYPE_FMPKCALLMAN_START = 345,
|
||||
CHAR_WINDOWTYPE_FMPKCALLMAN_CALL = 346,
|
||||
CHAR_WINDOWTYPE_FMPKCALLMAN_COME = 347,
|
||||
CHAR_WINDOWTYPE_FMPKCALLMAN_LEAVE = 348,
|
||||
|
||||
// Arminius 7.13 scheduleman
|
||||
CHAR_WINDOWTYPE_SCHEDULEMAN_START = 350,
|
||||
CHAR_WINDOWTYPE_SCHEDULEMAN_SELECT = 351,
|
||||
CHAR_WINDOWTYPE_SCHEDULEMAN_DETAIL = 352,
|
||||
|
||||
// Arminius 7.27
|
||||
CHAR_WINDOWTYPE_MANORPK_START = 360,
|
||||
CHAR_WINDOWTYPE_MANORPK_ASK = 361,
|
||||
CHAR_WINDOWTYPE_MANORPK_END = 362,
|
||||
|
||||
// shan
|
||||
CHAR_WINDOWTYPE_FM_DENGON = 370, // 家族留言板
|
||||
CHAR_WINDOWTYPE_FM_FMSDENGON = 371, // 家族之间留言板
|
||||
CHAR_WINDOWTYPE_FM_MESSAGE1 = 372, // 说明视窗(据点)
|
||||
CHAR_WINDOWTYPE_FM_MESSAGE2 = 373, // 说明视窗(成员)
|
||||
CHAR_WINDOWTYPE_FM_SELECT = 374, // 选项视窗
|
||||
CHAR_WINDOWTYPE_FM_MEMBERLIST = 375, // 成员列表
|
||||
CHAR_WINDOWTYPE_FM_POINTLIST = 376, // 据点列表
|
||||
CHAR_WINDOWTYPE_FM_DPTOP = 377, // 强者表(前叁十大列榜)
|
||||
CHAR_WINDOWTYPE_FM_DPME = 378, // 强者表(自己的列榜)
|
||||
CHAR_WINDOWTYPE_FM_DPSELECT = 379, // 强者表的选项视窗
|
||||
|
||||
// Terry 2001/08/31
|
||||
#ifdef _SERVICE
|
||||
CHAR_WINDOWTYPE_SERVICE_START = 380, // 石器服务员确定视窗
|
||||
CHAR_WINDOWTYPE_SERVICE_EXIT = 381, // 石器服务员取消视窗
|
||||
CHAR_WINDOWTYPE_SERVICE_CONTINUE = 382, // 石器服务员继续视窗
|
||||
CHAR_WINDOWTYPE_SERVICE_WAIT = 383, // 石器服务员等待视窗
|
||||
#endif
|
||||
|
||||
#ifdef _PET_TRANS
|
||||
CHAR_WINDOWTYPE_PETTRANS_START = 384,
|
||||
CHAR_WINDOWTYPE_PETTRANS_SELECT = 385,
|
||||
CHAR_WINDOWTYPE_PETTRANS_SELPET = 386,
|
||||
CHAR_WINDOWTYPE_PETTRANS_MAIN1 = 387,
|
||||
CHAR_WINDOWTYPE_PETTRANS_END = 389,
|
||||
#endif
|
||||
|
||||
#ifdef _GAMBLE_BANK
|
||||
NPC_GambleBank_START = 390,
|
||||
NPC_GambleBank_SELECT,
|
||||
NPC_GambleBank_BANK,
|
||||
NPC_GambleBank_CHANG1,
|
||||
NPC_GambleBank_CHANG2,
|
||||
NPC_GambleBank_END,
|
||||
#endif
|
||||
|
||||
#ifdef _PETRACE
|
||||
CHAR_WINDOWTYPE_PETRACEMASTER_START = 410,
|
||||
CHAR_WINDOWTYPE_PETRACEMASTER_RULE,
|
||||
CHAR_WINDOWTYPE_PETRACEMASTER_PET,
|
||||
CHAR_WINDOWTYPE_PETRACEMASTER_LEAVE,
|
||||
#endif
|
||||
|
||||
#ifdef _GAMBLE_ROULETTE
|
||||
WINDOWTYPE_GAMBLEROULETTE_START = 415,
|
||||
WINDOWTYPE_GAMBLEROULETTE_SELECT,
|
||||
WINDOWTYPE_GAMBLEROULETTE_END,
|
||||
#endif
|
||||
|
||||
#ifdef _AUCTIONEER
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_START = 420,
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_NEW,
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_LIST_BUY,
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_SURVEY,
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_MODIFY,
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_LIST_MODIFY,
|
||||
CHAR_WINDOWTYPE_AUCTIONEER_END,
|
||||
#endif
|
||||
|
||||
#ifdef _NEWEVENT
|
||||
CHAR_WINDOWTYPE_WINDOWEVENT_ACCTHANKNEW = 430,
|
||||
#endif
|
||||
|
||||
#ifdef _BLACK_MARKET
|
||||
CHAR_WINDOWTYPE_BLACKMARKET = 435,
|
||||
#endif
|
||||
|
||||
#ifdef _TRANSER_MAN
|
||||
NPC_TRANSERMAN_START = 440,
|
||||
NPC_TRANSERMAN_SELECT,
|
||||
NPC_TRANSERMAN_WARP,
|
||||
NPC_TRANSERMAN_END,
|
||||
#endif
|
||||
#ifdef _ITEM_NPCCHANGE
|
||||
NPC_ITEMCHANGE_START = 445,
|
||||
NPC_ITEMCHANGE_SELECT,
|
||||
NPC_ITEMCHANGE_MESSAGE,
|
||||
NPC_ITEMCHANGE_END,
|
||||
#endif
|
||||
|
||||
#ifdef _PAUCTION_MAN
|
||||
NPC_PAUCTION_START,
|
||||
NPC_PAUCTION_SELECT,
|
||||
NPC_PAUCTION_BUY,
|
||||
NPC_PAUCTION_SELL,
|
||||
NPC_PAUCTION_WARP,
|
||||
NPC_PAUCTION_END,
|
||||
#endif
|
||||
#ifdef _ALLDOMAN // (不可开) Syu ADD 排行榜NPC
|
||||
NPC_ALLDOMAN_START = 460,
|
||||
NPC_ALLDOMAN_START2,
|
||||
NPC_ALLDOMAN_START3,
|
||||
NPC_ALLDOMAN_HEAL,
|
||||
NPC_ALLDOMAN_GIVEMONEY,
|
||||
NPC_ALLDOMAN_MAIN_WND ,
|
||||
NPC_ALLDOMAN_SELECT_WND ,
|
||||
NPC_ALLDOMAN_LIST_WND ,
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_CANNEDFOOD
|
||||
ITEM_WINDOWTYPE_SELECTPETSKILL_SELECT = 470,
|
||||
ITEM_WINDOWTYPE_SELECTPETSKILL_END,
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_WELFARE
|
||||
NPC_WELFARE_START = 480,
|
||||
NPC_WELFARE_END,
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_VERYWELFARE
|
||||
NPC_VERYWELFARE_START = 490,
|
||||
NPC_VERYWELFARE_NO1,
|
||||
NPC_VERYWELFARE_NO2,
|
||||
NPC_VERYWELFARE_NO3,
|
||||
NPC_VERYWELFARE_END,
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_WELFARE_2 // WON ADD 职业NPC-2
|
||||
NPC_WELFARE_START2 = 495,
|
||||
NPC_WELFARE_END2,
|
||||
#endif
|
||||
|
||||
#ifdef _NPC_DEPOTPET
|
||||
CHAR_WINDOWTYPE_DEPOTPETSHOP_MENU = 510,
|
||||
CHAR_WINDOWTYPE_DEPOTPETSHOP_HANDLE,
|
||||
CHAR_WINDOWTYPE_DEPOTPETSHOP_ADD,
|
||||
CHAR_WINDOWTYPE_DEPOTPETSHOP_GET,
|
||||
CHAR_WINDOWTYPE_DEPOTPETSHOP_ASKADD,
|
||||
CHAR_WINDOWTYPE_DEPOTPETSHOP_ASKGET,
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
CHAR_WINDOWTYPE_ANGEL_ASK = 520,
|
||||
CHAR_WINDOWTYPE_ANGEL_CLEAN,
|
||||
#endif
|
||||
|
||||
#ifdef _CONTRACT
|
||||
CHAR_WINDOWTYPE_CONTRACT_ANSWER = 530,
|
||||
#endif
|
||||
|
||||
#ifdef _RACEMAN //猎宠大会
|
||||
CHAR_WINDOWTYPE_RACE_START = 540, // 开始
|
||||
CHAR_WINDOWTYPE_RACE_SUBJECT, // 猎宠比赛题目
|
||||
CHAR_WINDOWTYPE_RACE_TICKET, // 领取猎宠证
|
||||
CHAR_WINDOWTYPE_RACE_PETSELECT, // 宠物选择
|
||||
CHAR_WINDOWTYPE_RACE_CHECKIN, // 猎宠登记
|
||||
CHAR_WINDOWTYPE_RACE_RANK, // 猎宠排行榜
|
||||
CHAR_WINDOWTYPE_RACE_PRIZE, // 兑奖
|
||||
CHAR_WINDOWTYPE_RACE_NORMAL, // 无标题视窗
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK1, // 新手排行榜
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK2, // 排行榜
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK3, // 排行榜
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK4, // 排行榜
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK5, // 排行榜
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK11, // 显示历史记录
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK12, // 显示历史记录
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK13, // 显示历史记录
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK14, // 显示历史记录
|
||||
CHAR_WINDOWTYPE_RACE_SHOWRANK15, // 显示历史记录
|
||||
CHAR_WINDOWTYPE_RACE_QUIZ, // 通关密语
|
||||
#endif
|
||||
|
||||
}CHAR_WINDOWTYPE;
|
||||
|
||||
#ifdef _GMRELOAD
|
||||
typedef struct tagGMInfo
|
||||
{
|
||||
char cdkey[24];
|
||||
int level;
|
||||
}GMInfo;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
|
||||
#define MAXMISSION 100
|
||||
#define MAXMISSIONTABLE 1000
|
||||
|
||||
struct MissionInfo
|
||||
{
|
||||
int id;
|
||||
char detail[1024];
|
||||
int level;
|
||||
char eventflag[1024];
|
||||
//char bonus[1024];
|
||||
int limittime;
|
||||
};
|
||||
|
||||
struct MissionTable
|
||||
{
|
||||
char angelinfo[128];
|
||||
char heroinfo[128];
|
||||
int mission;
|
||||
int flag;
|
||||
int time;
|
||||
int limittime;
|
||||
};
|
||||
|
||||
extern struct MissionInfo missionlist[MAXMISSION];
|
||||
extern struct MissionTable missiontable[MAXMISSIONTABLE];
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _JOBDAILY
|
||||
|
||||
#define MAXDAILYLIST 1000
|
||||
#define MAXMISSIONFLAG 1000
|
||||
typedef struct _DailyFileType
|
||||
{
|
||||
char jobid[10]; //任务编号
|
||||
char rule[16384]; //条件判断
|
||||
char explain[200]; //任务说明
|
||||
char state[20]; //状态说明
|
||||
}DailyFileType;
|
||||
//extern struct DailyFileType dailyfile[MAXDAILYLIST];
|
||||
|
||||
#endif
|
||||
|
||||
BOOL CHAR_talkToCli( int talkedcharaindex,int talkcharaindex, char* message, CHAR_COLOR color );
|
||||
void CHAR_talkToCliAndParty( int talkedcharaindex,int talkcharaindex,char* message, CHAR_COLOR color );
|
||||
|
||||
BOOL CHAR_talkToCharacter( int talkedcharaindex,int talkcharaindex, char* message );
|
||||
void CHAR_getCoordinationDir( int dir , int x, int y ,int c,
|
||||
int *xout , int *yout );
|
||||
BOOL CHAR_createCharacter( int type, int floor, int x, int y, int dir,
|
||||
int* charaindex, int* objindex, BOOL seemap );
|
||||
void CHAR_CharaDelete( int charaindex );
|
||||
void CHAR_ObjectDelete( int objindex );
|
||||
int CHAR_makeDBKey( int charaindex, char *pszBuffer, int size );
|
||||
int CHAR_getEmptyPartyArray( int charaindex);
|
||||
BOOL CHAR_JoinParty( int charaindex );
|
||||
void CHAR_JoinParty_Main( int charaindex, int targetindex);
|
||||
BOOL CHAR_DischargeParty( int charaindex, int flg);
|
||||
BOOL CHAR_DischargePartyNoMsg( int charaindex);
|
||||
BOOL CHAR_setMyPosition_main( int index, int x, int y, int setdir, BOOL CAFlg);
|
||||
BOOL CHAR_setMyPosition( int index, int x, int y, BOOL CAFlg);
|
||||
|
||||
void CHAR_CharaDeleteHavePet( int charaindex);
|
||||
int CHAR_sendAction( int charaindex, int action, int mode);
|
||||
void CHAR_sendLeader( int objindex, int leader);
|
||||
void CHAR_sendBattleWatch( int objindex, int onoff);
|
||||
void CHAR_sendBattleEffect( int charaindex, int onoff);
|
||||
|
||||
// shan
|
||||
void CHAR_sendTradeEffect( int charaindex, int onoff);
|
||||
#ifdef _MIND_ICON
|
||||
void CHAR_sendMindEffect( int charaindex, int onoff);
|
||||
#endif
|
||||
#ifdef _ITEM_CRACKER
|
||||
void CHAR_sendCrackerEffect( int charaindex, int onoff);
|
||||
#endif
|
||||
|
||||
void CHAR_inputUserPetName( int index , int havepetindex, char* name );
|
||||
int CHAR_getPartyIndex( int index, int num);
|
||||
void CHAR_processWindow(int charaindex, int seqno, int select,
|
||||
int objindex, char* data );
|
||||
void CHAR_AddCharm( int charaindex, int iValue );
|
||||
void CHAR_PetAddVariableAi( int petindex, int iValue );
|
||||
void CHAR_PartyUpdate( int charaindex, int senddata );
|
||||
char *CHAR_getUseName( int charaindex );
|
||||
char *CHAR_getUseID( int charaindex );
|
||||
EXTERN int EnemyMoveNum; /* 凛卞 嫖 仃月衬及醒 */
|
||||
extern char *DebugFunctionName;
|
||||
extern int DebugPoint;
|
||||
|
||||
#define DB_DUELPOINT "db_duel" // 犯亘巨伙禾奶件玄犯□正矛□旦
|
||||
#define DB_ADDRESSBOOK "db_addressbook" // 失玉伊旦皮永弁犯□正矛□旦
|
||||
|
||||
BOOL CHAR_send_DpDBUpdate( int charaindex );
|
||||
BOOL CHAR_send_DpDBUpdate_AddressBook( int charaindex, int mode );
|
||||
|
||||
|
||||
void CHAR_sendPMEToArroundCharacter( int charaindex, int petindex, int flg, int no );
|
||||
void CHAR_sendPMEToArroundCharacterFLXY( int petindex,
|
||||
int fl, int x, int y, int dir, int flg, int no );
|
||||
|
||||
void CHAR_sendSEoArroundCharacter( int fl, int x, int y, int senumber, int sw );
|
||||
|
||||
BOOL CHAR_initEffectSetting( char* filename );
|
||||
void CHAR_checkEffect( int charaindex);
|
||||
void CHAR_checkEffectLoop( void);
|
||||
void CHAR_initDebugChatCdkey( void);
|
||||
int CHAR_setChatMagicCDKey( int mode, char *cdkey);
|
||||
|
||||
|
||||
float GetRecoveryRate( int charaindex );
|
||||
int storeCharaData( void );
|
||||
#ifdef _MAGIC_REHPAI //补血AI
|
||||
int Magic_RideGetHP( int toindex, int petindex, int flg);
|
||||
#endif
|
||||
// CoolFish: Trade 2001/4/18
|
||||
int CHAR_findTotalEmptyItem(int index);
|
||||
|
||||
|
||||
#ifdef _FIX_METAMORIDE
|
||||
int CHAR_CHECKJOINENEMY( int index);
|
||||
#endif
|
||||
|
||||
#ifdef _NPCSERVER_NEW
|
||||
BOOL NPCSERVER_CreateObjindexFromServer( int fd, int npcindex, char *Name, int image,
|
||||
int dir, int floor, int x, int y);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _SEND_EFFECT // WON ADD AC送下雪、下雨等特效
|
||||
#define CHAR_EFFECT_SETTINGBUFFER 256
|
||||
typedef struct tagCHAR_effectsetting
|
||||
{
|
||||
int floor; // 白夫失
|
||||
int effect; // 梢请 寞
|
||||
int level; // 梢请及伊矛伙[ 蜇及雄今[
|
||||
int sendflg; // 憎巨白尼弁玄毛霜匀凶井升丹井[
|
||||
char month[CHAR_EFFECT_SETTINGBUFFER]; // 垫允月畸
|
||||
char day[CHAR_EFFECT_SETTINGBUFFER]; // 垫允月
|
||||
char hour[CHAR_EFFECT_SETTINGBUFFER]; // 垫允月凛棉
|
||||
char min[CHAR_EFFECT_SETTINGBUFFER]; // 垫允月坌
|
||||
char expire[CHAR_EFFECT_SETTINGBUFFER]; // 垫仄化中月赢今[(
|
||||
|
||||
}CHAR_effectsetting;
|
||||
|
||||
CHAR_effectsetting* CHAR_effect;
|
||||
int CHAR_effectnum;
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_PILENUMS
|
||||
int CHAR_getMyMaxPilenum( int charaindex);
|
||||
#endif
|
||||
|
||||
#ifdef _PET_LOSTPET
|
||||
BOOL CHAR_CharSaveLostPet( int petindex, int type);
|
||||
#endif
|
||||
#ifdef _ALLDOMAN
|
||||
void InitHeroList( void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _STREET_VENDOR
|
||||
void CHAR_sendStreetVendor(int charaindex,char *message);
|
||||
void CHAR_sendStreetVendorDataToCli(int charaindex,int toindex);
|
||||
void CHAR_sendStreetVendorOneDataToCli(int charaindex,int toindex,int sendindex);
|
||||
#endif
|
||||
|
||||
BOOL checkUnlawWarpFloor( int floor);
|
||||
|
||||
#ifdef _HELP_NEWHAND
|
||||
void CHAR_loginAddItemForNew( int charaindex );
|
||||
#endif
|
||||
|
||||
#ifdef _JOBDAILY
|
||||
void CHAR_JobDaily(int charaindex,char *data);
|
||||
#endif
|
||||
|
||||
#ifdef _TEACHER_SYSTEM
|
||||
void CHAR_Teacher_system(int charaindex,char *data);
|
||||
void CHAR_Teacher_system_View(int charaindex,int iOnLine,char *data);
|
||||
#endif
|
||||
|
||||
#ifdef _TIME_TICKET
|
||||
void check_TimeTicket();
|
||||
int check_TimeTicketMap(int floor);
|
||||
#endif
|
||||
|
1783
gmsv/include/char_base.h
Normal file
1783
gmsv/include/char_base.h
Normal file
File diff suppressed because it is too large
Load Diff
120
gmsv/include/char_data.h
Normal file
120
gmsv/include/char_data.h
Normal file
@ -0,0 +1,120 @@
|
||||
#ifndef __CHAR_DATA_H__
|
||||
#define __CHAR_DATA_H__
|
||||
|
||||
#include "item.h"
|
||||
#include "char.h"
|
||||
|
||||
|
||||
#define CHAR_CLASS01_PASSLV 20
|
||||
|
||||
#define BATEBAN 2
|
||||
#define FIRSTPOSITIONMAXINDEX 1
|
||||
#define ELDERINDEXSTART FIRSTPOSITIONMAXINDEX+BATEBAN+1
|
||||
|
||||
typedef struct tagLevelUpPattern
|
||||
{
|
||||
#if 1
|
||||
struct Exptbl{
|
||||
int origin;
|
||||
int multi;
|
||||
}exptbl[3];
|
||||
int hpupminpoint; /* hp 及丐互月 斓袄*/
|
||||
int hpupmaxpoint; /* hp 及丐互月 斓袄*/
|
||||
|
||||
int needexp; /* 邰卅烦董袄 */
|
||||
#else
|
||||
int uppoint[5];
|
||||
#endif
|
||||
}LevelUpPattern;
|
||||
|
||||
/*====================赓渝袄}伊皮伙失永皿楮溢====================*/
|
||||
BOOL CHAR_getDefaultChar( Char* nc, int imagenumber );
|
||||
|
||||
/*====================隶 } 飓 寞赘尹楮溢====================*/
|
||||
int CHAR_getNewImagenumberFromEquip( int basebaseimagenumber,
|
||||
ITEM_CATEGORY category );
|
||||
/*==================== 飓 寞 侬 -> 寞楮溢====================*/
|
||||
void CHAR_initSeekGraphicNumberFromString();
|
||||
int CHAR_seekGraphicNumberFromString( char* string );
|
||||
|
||||
|
||||
|
||||
/*====================平乓仿及赓渝袄楮溢====================*/
|
||||
BOOL CHAR_getInitElderPosition( Char* ch,int hometown);
|
||||
BOOL CHAR_getElderPosition( int elderindex, int* fl, int* x, int* y );
|
||||
|
||||
void CHAR_setInitValues( Char* ch );
|
||||
|
||||
|
||||
/*==================== 衬匏 楮溢====================*/
|
||||
typedef enum
|
||||
{
|
||||
CHAR_INVAREA,
|
||||
CHAR_CANNOTDROPAREA,
|
||||
CHAR_CANNOTMAGICAREA,
|
||||
CHAR_AREAKIND_NONE,
|
||||
}CHAR_AREAKIND;
|
||||
|
||||
BOOL CHAR_initInvinciblePlace( char* filename );
|
||||
BOOL CHAR_isCannotMagicArea( int floor , int x, int y, int magicnum );
|
||||
BOOL CHAR_initAppearPosition( char* filename );
|
||||
BOOL CHAR_isInvincibleArea( int floor , int x, int y );
|
||||
BOOL CHAR_isAppearPosition( int floor, int *x, int *y);
|
||||
BOOL CHAR_isCannotDropArea( int floor , int x, int y );
|
||||
|
||||
|
||||
/* 赢 楮溢 */
|
||||
BOOL CHAR_ElderSetPosition( int elderindex ,int fl,int x ,int y);
|
||||
|
||||
|
||||
|
||||
/*************************************************
|
||||
酵烂伊矛伙失永皿质
|
||||
*************************************************/
|
||||
|
||||
|
||||
int GetEnemyExp( int level );
|
||||
|
||||
int CHAR_GetLevel();
|
||||
int CHAR_GetLevelExp( int charaindex, int level );
|
||||
int CHAR_GetOldLevelExp( int level);
|
||||
|
||||
int CHAR_LevelUpCheck( int charaindex , int toindex);
|
||||
|
||||
int CHAR_PetLevelUp( int petindex );
|
||||
|
||||
BOOL CHAR_checkFaceImageNumber( int imagenumber, int faceimagenumber);
|
||||
BOOL CHAR_checkPlayerImageNumber( int imagenumber);
|
||||
|
||||
int CHAR_PetTakeLevelUp( int petindex, int lv); //强制宠物升级
|
||||
int CHAR_PetTakeDrop( int petindex, int floor, int ox, int oy); //强制丢弃宠物升级
|
||||
|
||||
#ifdef _NPC_FUSION
|
||||
int PETFUSION_FusionPetSub( int charaindex, int Subindex1, int Subindex2, int *work, int *skill);
|
||||
BOOL PETFUSION_FusionPetMain( int charaindex, int Mainindex, int *work, int *skill);
|
||||
BOOL PETFUSION_DelPet( int toindex, int Mainindex, int Subindex1, int Subindex2, int flg);
|
||||
int PETFUSION_Evolution( int charaindex, int petindex);
|
||||
#endif
|
||||
int PETTRANS_PetTransManStatus( int toindex, int petindex1, int petindex2);
|
||||
#ifdef _PET_2TRANS
|
||||
int NPC_PetTransManGetAns( int total1, int total2, int LV, int rank, int tran);
|
||||
#else
|
||||
int NPC_PetTransManGetAns( int total1, int total2, int LV, int rank);
|
||||
#endif //_PET_2TRANS
|
||||
|
||||
#ifdef _CHIKULA_STONE
|
||||
void CHAR_AutoChikulaStone( int charaindex, int Dflg);
|
||||
#endif
|
||||
|
||||
#ifdef _STATUS_WATERWORD //水世界状态
|
||||
void CHAR_CheckWaterStatus( int charaindex);
|
||||
#endif
|
||||
|
||||
int CHAR_findSurplusPetBox( int charaindex );
|
||||
|
||||
#ifdef _USER_EXP_CF
|
||||
void setNeedLevelUpTbls(int level,int exp);
|
||||
void setMaxLevel(int level);
|
||||
#endif
|
||||
|
||||
#endif
|
31
gmsv/include/char_event.h
Normal file
31
gmsv/include/char_event.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __CHAR_EVENT_H__
|
||||
#define __CHAR_EVENT_H__
|
||||
|
||||
#include "char_base.h"
|
||||
|
||||
void CHAR_allpostwalk( int index );
|
||||
BOOL CHAR_allprewalk( int index,int* dir,int* mode);
|
||||
|
||||
void CHAR_recoveryStatus( int charaindex );
|
||||
void CHAR_loopFunc( int index );
|
||||
void CHAR_playerWatchfunc( int meindex, int moveindex, CHAR_ACTION act,
|
||||
int x, int y, int dir, int* opt, int optlen );
|
||||
|
||||
void CHAR_sendWallDamage( int charaindex,int x, int y, int damage );
|
||||
void CHAR_playerresurrect( int charaindex, int hp );
|
||||
|
||||
int CHAR_die( int charaindex );
|
||||
void CHAR_playerTalkedfunc( int charaindex, int talkindex,char* message,
|
||||
int color, int channel );
|
||||
|
||||
void CHAR_recoveryStatus( int charaindex );
|
||||
BOOL CHAR_makeCADefaultString( int objindex,char* buf,int buflen, int act );
|
||||
BOOL CHAR_makeCAOPT1String( int objindex,char* buf,
|
||||
int buflen, int act,int opt1 );
|
||||
BOOL CHAR_makeCAOPT3String( int objindex,char* buf,
|
||||
int buflen, int act,int opt1,int opt2,int opt3 );
|
||||
#ifdef _STREET_VENDOR
|
||||
BOOL CHAR_makeCAOPTString(int objindex,char* buf,int buflen,int act,char *string);
|
||||
#endif
|
||||
|
||||
#endif
|
24
gmsv/include/char_talk.h
Normal file
24
gmsv/include/char_talk.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef __CHAR_TALK_H__
|
||||
#define __CHAR_TALK_H__
|
||||
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "net.h"
|
||||
|
||||
|
||||
void CHAR_getMessageBody(char* message, char* kind, int kindlen,
|
||||
char** body);
|
||||
|
||||
#ifdef _GM_SIGUSR2
|
||||
typedef void (*CHATMAGICFUNC2)(int,char*);//¹¦ÄÜÏàͬtypedef void (*CHATMAGICFUNC)(int,char*);
|
||||
CHATMAGICFUNC2 gm_CHAR_getChatMagicFuncPointer(char* name,BOOL isDebug);
|
||||
#endif
|
||||
|
||||
int CHAR_getChatMagicFuncLevel(char* name,BOOL isDebug);
|
||||
int CHAR_getChatMagicFuncNameAndString( int ti, char* name, char *usestring, int level, BOOL isDebug);
|
||||
int CHAR_getChatMagicFuncMaxNum( void);
|
||||
|
||||
void OneByOneTkChannel ( int fd , char *tmp1 , char *tmp2 , int color) ;
|
||||
|
||||
|
||||
#endif
|
256
gmsv/include/chatmagic.h
Normal file
256
gmsv/include/chatmagic.h
Normal file
@ -0,0 +1,256 @@
|
||||
#ifndef __CHATMAGIC_H__
|
||||
#define __CHATMAGIC_H__
|
||||
#include "version.h"
|
||||
|
||||
void CHAR_CHAT_DEBUG_hp( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_mp( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_setmp( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_str( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_dex( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_tgh( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_vital( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_luck( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_gold( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_additem( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_metamo( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_warp( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_info( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_sysinfo( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_announce(int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_level( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_delitem( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_superman( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_battlein( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_battleout( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_petmake( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_enemyrestart( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_s_gb( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_s_gu( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_s_tame( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_fieldatt( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_s_ren( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_s_geki( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_s_hai( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_j_state( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_battlewatch( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_eventclean( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_eventsetend( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_eventsetnow( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_debug( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_exp( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_dp( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_setTrans( int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_getuser(int charindex ,char *message);//ttom +1 14/11/2000
|
||||
void CHAR_CHAT_DEBUG_shutup(int charindex ,char *message);//ttom 22/11/2000
|
||||
void CHAR_CHAT_DEBUG_waeikick( int charindex, char* message );//ttom 12/02/2000
|
||||
void CHAR_CHAT_DEBUG_effect( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_jail( int charindex, char* message );//ttom 01/11/2001
|
||||
void CHAR_CHAT_DEBUG_shutupall(int charindex ,char *message);//ttom 02/01/2001
|
||||
void CHAR_CHAT_DEBUG_send(int charindex ,char *message);//ttom 02/01/2001
|
||||
void CHAR_CHAT_DEBUG_noenemy(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_loginannounce(int charaindex, char* message); // Arminius 7.12 login announce
|
||||
void CHAR_CHAT_DEBUG_deletepet(int charaindex, char* message); // Robin 0720
|
||||
void CHAR_CHAT_DEBUG_deleteitem(int charaindex, char* message); // Robin 0720
|
||||
void CHAR_CHAT_DEBUG_checklock(int charaindex, char* message); // Arminius 7.25
|
||||
void CHAR_CHAT_DEBUG_unlock(int charaindex, char* message);
|
||||
void CHAR_CHAT_DEBUG_unlockserver(int charaindex, char* message);
|
||||
void CHAR_CHAT_DEBUG_fixfmdata(int charaindex, char* message); // CoolFish: GM Family 2001/7/31
|
||||
void CHAR_CHAT_DEBUG_shutdown(int charaindex, char* message); // Robin 1008
|
||||
void CHAR_CHAT_DEBUG_manorpk(int charaindex, char *message);
|
||||
|
||||
void CHAR_CHAT_DEBUG_watchevent( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_fixfmpk(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_reloadmsip( int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_cleanfreepet(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_engineer( int charindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_waeikickall( int charindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_remserver( int charaindex, char *message );
|
||||
void CHAR_CHAT_DEBUG_showMem(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_playerspread( int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_reset( int charaindex, char* message );
|
||||
|
||||
#ifdef _GMRELOAD
|
||||
void CHAR_CHAT_DEBUG_gmreload(int charaindex, char *message);
|
||||
#endif
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物职业
|
||||
void CHAR_CHAT_DEBUG_addsk( int charaindex, char *message );
|
||||
void CHAR_CHAT_DEBUG_delsk( int charaindex, char *message );
|
||||
#endif
|
||||
#ifdef _TEST_PETCREATE
|
||||
void CHAR_CHAT_DEBUG_createpet( int charaindex, char *message );
|
||||
void TEST_CreatPet( );
|
||||
#endif
|
||||
void CHAR_CHAT_DEBUG_cleanfloor( int charaindex, char *message);
|
||||
|
||||
#ifdef _GAMBLE_BANK
|
||||
void CHAR_CHAT_DEBUG_setgamblenum( int charaindex, char *message );
|
||||
#endif
|
||||
#ifdef _WAEI_KICK
|
||||
void CHAR_CHAT_DEBUG_gmkick( int charindex, char* message);
|
||||
#endif
|
||||
// WON ADD 修正族长问题
|
||||
void CHAR_CHAT_DEBUG_fixfmleader(int charaindex, char *message);
|
||||
|
||||
// WON ADD 当机指令
|
||||
void CHAR_CHAT_DEBUG_crash(int charaindex, char *message);
|
||||
|
||||
#ifdef _PETSKILL_SETDUCK
|
||||
void CHAR_CHAT_DEBUG_SetDuck( int charaindex, char *message);
|
||||
#endif
|
||||
#ifdef _TYPE_TOXICATION
|
||||
void CHAR_CHAT_DEBUG_Toxication( int charaindex, char *message);
|
||||
#endif
|
||||
#ifdef _ACTION_BULLSCR
|
||||
void CHAR_CHAT_DEBUG_setascore(int charindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_getascore(int charindex, char *message);
|
||||
#endif
|
||||
#ifdef _NEW_PLAYERGOLD
|
||||
void CHAR_CHAT_DEBUG_acnewplayer(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_loadnewplayer( int charaindex, char*message );
|
||||
#endif
|
||||
#ifdef _SEND_EFFECT // WON ADD AC送下雪、下雨等特效
|
||||
void CHAR_CHAT_DEBUG_sendeffect(int charaindex, char *message);
|
||||
#endif
|
||||
#ifdef _TEST_DROPITEMS
|
||||
void CHAR_CHAT_DEBUG_dropmypet( int charindex, char *message );
|
||||
void CHAR_CHAT_DEBUG_dropmyitem( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _ACTION_GMQUE
|
||||
void CHAR_CHAT_DEBUG_cleanqute( int charaindex, char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _CHAR_PROFESSION // WON ADD 人物职业
|
||||
void CHAR_CHAT_DEBUG_show_profession( int charaindex, char*message );
|
||||
void CHAR_CHAT_DEBUG_set_regist( int charaindex, char*message );
|
||||
#endif
|
||||
|
||||
void CHAR_CHAT_DEBUG_checktrade( int charaindex, char*message);
|
||||
|
||||
void CHAR_CHAT_DEBUG_checktime( int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_samecode( int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_silent(int charindex ,char *message);
|
||||
void CHAR_CHAT_DEBUG_help( int charindex, char *message);
|
||||
#ifdef _EQUIT_ARRANGE
|
||||
void CHAR_CHAT_DEBUG_arrange( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _EQUIT_SEQUENCE
|
||||
void CHAR_CHAT_DEBUG_sequence( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _GM_IDENTIFY
|
||||
void CHAR_CHAR_DEBUG_gmidentify( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
void CHAR_CHAT_DEBUG_showtemp( int charaindex, char*message );
|
||||
|
||||
#ifdef _EQUIT_NEGLECTGUARD
|
||||
void CHAR_CHAT_DEBUG_setneguard( int charaindex, char* message );
|
||||
#endif
|
||||
|
||||
#ifdef _DEATH_CONTEND
|
||||
void CHAR_CHAT_DEBUG_updatepklist( int charaindex, char* message );
|
||||
#endif
|
||||
|
||||
void CHAR_CHAT_DEBUG_petlevelup( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_petexpup( int charaindex, char* message );
|
||||
|
||||
void CHAR_CHAT_DEBUG_reloadpkteamlist( int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_setBattle( int charaindex, char *message );
|
||||
|
||||
|
||||
#ifdef _CHAR_POOLITEM
|
||||
void CHAR_CHAT_DEBUG_saveditem(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_insertditem(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_ShowMyDepotItems( int charaindex, char *message );
|
||||
void CHAR_CHAT_DEBUG_InSideMyDepotItems( int charaindex, char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _CHAR_POOLPET
|
||||
void CHAR_CHAT_DEBUG_savedpet(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_insertdpet(int charaindex, char *message);
|
||||
void CHAR_CHAT_DEBUG_ShowMyDepotPets( int charaindex, char *message );
|
||||
void CHAR_CHAT_DEBUG_InSideMyDepotPets( int charaindex, char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD 家族战GM指令
|
||||
void CHAR_CHAR_DEBUG_reloadfm( int charaindex, char* message );
|
||||
void CHAR_CHAR_DEBUG_fmpk( int charaindex, char* message );
|
||||
void CHAR_CHAR_DEBUG_fmpk_clean( int charaindex, char* message );
|
||||
#endif
|
||||
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
void CHAR_CHAT_DEBUG_set_momentum( int charaindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_set_manor_owner( int charindex, char* message );
|
||||
void CHAR_CHAT_DEBUG_set_schedule_time( int charindex, char* message );
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
void CHAR_CHAT_DEBUG_angelinfo(int charindex ,char *message);
|
||||
void CHAR_CHAT_DEBUG_angelclean(int charindex ,char *message);
|
||||
void CHAR_CHAT_DEBUG_angelcreate(int charindex ,char *message);
|
||||
void CHAR_CHAT_DEBUG_missionreload(int charindex ,char *message);
|
||||
#endif
|
||||
|
||||
void CHAR_CHAT_DEBUG_itemreload(int charindex ,char *message);
|
||||
|
||||
void CHAR_CHAT_DEBUG_skywalker(int charaindex ,char *message);
|
||||
|
||||
#ifdef _ITEM_ADDEXP
|
||||
void CHAR_CHAT_DEBUG_itemaddexp(int charaindex ,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _DEF_FMFREETIME
|
||||
void CHAR_CHAT_DEBUG_fmfreetime(int charaindex,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _DEF_GETYOU
|
||||
void CHAR_CHAT_DEBUG_getyou(int charaindex,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _DEF_NEWSEND
|
||||
void CHAR_CHAT_DEBUG_newsend(int charindex ,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _DEF_SUPERSEND
|
||||
void CHAR_CHAT_DEBUG_supersend(int charindex ,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _FONT_SIZE
|
||||
void CHAR_CHAT_DEBUG_fsize(int charindex ,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _JOBDAILY
|
||||
void CHAR_CHAT_DEBUG_rejobdaily(int charindex ,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _RACEMAN
|
||||
void CHAR_CHAT_DEBUG_changeask(int charindex ,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _CREATE_MM_1_2
|
||||
void CHAR_CHAT_DEBUG_MM(int charaindex , char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _SendTo
|
||||
void CHAR_CHAT_DEBUG_Sendto( int charaindex , char *message );
|
||||
#endif
|
||||
|
||||
void CHAR_CHAT_printcount( int charaindex, char* message );
|
||||
|
||||
#ifdef _GM_ITEM
|
||||
void CHAR_CHAT_DEBUG_GMFUNCTION( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _GM_RIDE
|
||||
void CHAR_CHAT_DEBUG_SETRIDE( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_MVRIDE( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
#ifdef _LOCK_IP
|
||||
void CHAR_CHAT_DEBUG_LOCK_IP( int charindex , char *message );
|
||||
void CHAR_CHAT_DEBUG_DISPLAY_LOCK_IP( int charindex , char *message );
|
||||
#endif
|
||||
|
||||
#endif
|
57
gmsv/include/chatroom.h
Normal file
57
gmsv/include/chatroom.h
Normal file
@ -0,0 +1,57 @@
|
||||
#ifndef __CHATROOM_H__
|
||||
#define __CHATROOM_H__
|
||||
#include "version.h"
|
||||
|
||||
#define MAX_CHATROOM 10
|
||||
#define MAX_PPLINROOM 100
|
||||
|
||||
#ifdef _UNIVERSE_CHATROOM
|
||||
|
||||
typedef struct _tagChatRoomCharaList{
|
||||
char cdkey[256];
|
||||
char name[256];
|
||||
char own[256];
|
||||
int fd;
|
||||
int use;
|
||||
}CRCharaList;
|
||||
|
||||
typedef struct _tagUniChatRoom
|
||||
{
|
||||
int use;
|
||||
int charanum;
|
||||
int masindex;
|
||||
int masfd;
|
||||
CRCharaList charalist[MAX_PPLINROOM];
|
||||
char chatname[32];
|
||||
}UniChatRoomlist;
|
||||
|
||||
void resetChat_users( int chat, int ti);
|
||||
void InitChatRoom( void );
|
||||
void ChatRoom_List ( int fd );
|
||||
int ChatRoom_getfree( void);
|
||||
void saac_ChatRoom_recvall ( int fd , char *result, char *data, int charaindex, int clifdid);
|
||||
void ChatRoom_Leave( int charaindex);
|
||||
void ChatRoom_Destroy ( char *data);
|
||||
void ChatRoom_recvall( int fd, char *data);
|
||||
void CHATROOM_getChatRoomList( void);
|
||||
|
||||
#else
|
||||
|
||||
void InitChatRoom ( void ) ;
|
||||
void ChatRoom_List ( int fd );
|
||||
BOOL ChatCheck_BeMaster( int myindex, int chatnum);
|
||||
BOOL ChatCheck_Free( int myindex);
|
||||
BOOL ChatRoom_Create ( int myindex , char *message);
|
||||
BOOL ChatRoom_Destroy ( int myindex ) ;
|
||||
void ChatRoom_Kick ( int myindex , int toindex ) ;
|
||||
void ChatRoom_Make ( int myindex , int toindex ) ;
|
||||
void ChatRoom_Leave ( int myindex ) ;
|
||||
void ChatRoom_Join ( int myindex , int num ) ;
|
||||
void ChatRoom_Agree ( int myindex , int toindex , int YesNo ) ;
|
||||
void ChatRoom_Message ( int myindex , char *message ) ;
|
||||
void ChatRoom_Refresh ( int Num ) ;
|
||||
void ChatRoom_recvall ( int fd , char *data ) ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
65
gmsv/include/common.h
Normal file
65
gmsv/include/common.h
Normal file
@ -0,0 +1,65 @@
|
||||
#ifndef __COMMON_H__
|
||||
#define __COMMON_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* MACROS */
|
||||
#define RETURNFALSEIFFALSE(x) if(!x)return FALSE;
|
||||
#define EXITWITHEXITCODEIFFALSE(x,code) if(!x)exit(code);
|
||||
#ifdef __GNUC__
|
||||
#define print(format,arg...) fprintf( stderr, format ,##arg)
|
||||
#define fprint(format,arg...) fprintf( stderr, "%s:%d " format , __FILE__ , __LINE__ , ##arg)
|
||||
#endif
|
||||
#define debug(x,y) fprintf( stderr, #x " = %" #y "\n" , x)
|
||||
#define arraysizeof( x ) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
#define errorprint {extern int errno;fprint( "%s\n" ,strerror(errno));}
|
||||
|
||||
#define BACKSLASH '\\'
|
||||
#define NEWLINE '\n'
|
||||
#define TAB '\t'
|
||||
#define SPACE ' '
|
||||
|
||||
/*票及 define 方曰兜蝈卞允月 */
|
||||
/*#define min( x,y ) ((x)>(y)?(y):(x))
|
||||
#define max( x,y ) ((x)>(y)?(x):(y))*/
|
||||
#define min( x,y ) ({typeof(x) __x=(x),__y=(y);(__x < __y) ? __x : __y; })
|
||||
#define max( x,y ) ({typeof(x) __x=(x),__y=(y);(__x < __y) ? __y : __x; })
|
||||
#define swap( x,y )({typeof(x) __x=(y);(y)=(x);(x)=__x;})
|
||||
#define SUCCESSFUL "successful"
|
||||
#define FAILED "failed"
|
||||
|
||||
#ifdef _BAD_PLAYER // WON ADD 送坏玩家去关
|
||||
#define BADPLAYER "badplayer"
|
||||
#endif
|
||||
|
||||
#define LOCK 1
|
||||
#define UNLOCK 0
|
||||
|
||||
#define STRINGBUFSIZ 4096
|
||||
|
||||
#define OPEN {FILE* f;f=fopen("a.txt","a");
|
||||
#define CLOSE fclose(f);}
|
||||
|
||||
#define time_diff_us(new,old) ((unsigned)( (new.tv_sec - old.tv_sec)*1000000 + ( new.tv_usec - old.tv_usec ) ))
|
||||
|
||||
|
||||
|
||||
|
||||
extern int snprintf (char* , size_t, const char* , ...)
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((format (printf,3,4)));
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define ON 1
|
||||
#define OFF 0
|
||||
#define BOOL int
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#define INLINE inline
|
||||
#define USE_MTIO 0
|
||||
|
||||
#endif
|
276
gmsv/include/configfile.h
Normal file
276
gmsv/include/configfile.h
Normal file
@ -0,0 +1,276 @@
|
||||
#ifndef __CONFIGFILE_H__
|
||||
#define __CONFIGFILE_H__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __CONFIGFILE_C__
|
||||
#define EXTERN
|
||||
#else /* __CONFIGFILE_C__ */
|
||||
#define EXTERN extern
|
||||
#endif /* __CONFIGFILE_C__ */
|
||||
|
||||
// Arminius 7.12 login announce
|
||||
extern char announcetext[8192];
|
||||
void AnnounceToPlayer(int charaindex);
|
||||
// Robin 0720
|
||||
void AnnounceToPlayerWN(int fd);
|
||||
void LoadAnnounce(void);
|
||||
|
||||
#ifdef _PET_TALKPRO
|
||||
#define PETTALK_MAXID 8
|
||||
typedef struct {
|
||||
int ID;
|
||||
char DATA[10240*10]; //1M
|
||||
}PTALK;
|
||||
extern PTALK pettalktext[PETTALK_MAXID];
|
||||
void LoadPetTalk(void);
|
||||
#else
|
||||
|
||||
extern char pettalktext[4096];
|
||||
void LoadPetTalk(void);
|
||||
#endif
|
||||
|
||||
#ifdef _GAMBLE_BANK
|
||||
#define GAMBLEBANK_ITEMSMAX 100
|
||||
#define DEFEND_ITEMSMAX 40
|
||||
typedef struct REGAMBLEBANKITEMS {
|
||||
char name[128];
|
||||
int Gnum;
|
||||
int ItemId;
|
||||
int type;
|
||||
}GAMBLEBANK_ITEMS;
|
||||
|
||||
extern GAMBLEBANK_ITEMS GB_ITEMS[GAMBLEBANK_ITEMSMAX];
|
||||
|
||||
void Load_GambleBankItems( void);
|
||||
#endif
|
||||
|
||||
#ifdef _CFREE_petskill
|
||||
#define PETSKILL_CODE 300
|
||||
typedef struct REPETSKILL_CODES {
|
||||
char name[128];
|
||||
int TempNo;
|
||||
int PetId;
|
||||
char Code[256];
|
||||
}PETSKILL_CODES;
|
||||
|
||||
extern PETSKILL_CODES Code_skill[PETSKILL_CODE];
|
||||
void Load_PetSkillCodes( void);
|
||||
#endif
|
||||
|
||||
#ifdef _BLACK_MARKET
|
||||
struct BlackMarketItem {
|
||||
char iName[128];
|
||||
int iGraphicsNum;
|
||||
int iId[4][3];
|
||||
int iCondition[4];
|
||||
int GCondition;
|
||||
};
|
||||
#define BMIMAX 1000
|
||||
struct BlackMarketItem BMItem[BMIMAX];
|
||||
int BMINum;
|
||||
int BMSellList[12];
|
||||
#endif
|
||||
|
||||
#ifdef _GMRELOAD
|
||||
#define GMMAXNUM 100
|
||||
struct GMINFO
|
||||
{
|
||||
char cdkey[24];
|
||||
int level;
|
||||
};
|
||||
extern struct GMINFO gminfo[GMMAXNUM];
|
||||
#endif
|
||||
|
||||
BOOL readconfigfile( char* filename );
|
||||
|
||||
void defaultConfig( char* argv0 );
|
||||
char* getProgname( void );
|
||||
char* getConfigfilename( void );
|
||||
void setConfigfilename( char* newv );
|
||||
|
||||
unsigned int getDebuglevel( void );
|
||||
unsigned int setDebuglevel( unsigned int newv );
|
||||
unsigned int getMemoryunit( void );
|
||||
unsigned int getMemoryunitnum( void );
|
||||
char* getAccountservername( void );
|
||||
unsigned short getAccountserverport( void );
|
||||
char* getAccountserverpasswd( void );
|
||||
char* getGameservername( void );
|
||||
|
||||
#ifdef _M_SERVER
|
||||
char* getmservername(void);
|
||||
void setmservername( char *msname);
|
||||
unsigned int getmserverport(void);
|
||||
void setmserverport( int port);
|
||||
#endif
|
||||
|
||||
#ifdef _NPCSERVER_NEW
|
||||
char *getnpcserveraddr(void);
|
||||
unsigned int getnpcserverport(void);
|
||||
void NS_setAddressAndPort( char *address, int nport);
|
||||
#endif
|
||||
|
||||
unsigned short getPortnumber( void );
|
||||
|
||||
int getServernumber( void );
|
||||
int getReuseaddr( void );
|
||||
int getNodelay( void );
|
||||
int getLogWriteTime(void);
|
||||
int getLogIOTime( void);
|
||||
int getLogGameTime(void);
|
||||
int getLogNetloopFaster(void);
|
||||
int getSaacwritenum( void );
|
||||
void setSaacwritenum( int num );
|
||||
int getSaacreadnum( void );
|
||||
void setSaacreadnum( int num );
|
||||
|
||||
unsigned int getFdnum( void );
|
||||
unsigned int getPetcharnum( void );
|
||||
unsigned int getOtherscharnum( void );
|
||||
unsigned int getObjnum( void );
|
||||
unsigned int getItemnum( void );
|
||||
unsigned int getBattlenum( void );
|
||||
|
||||
char* getTopdir( void );
|
||||
char* getMapdir( void );
|
||||
char* getMaptilefile( void );
|
||||
char* getBattleMapfile( void );
|
||||
char* getItemfile( void );
|
||||
char* getInvfile( void );
|
||||
char* getAppearfile( void );
|
||||
char* getEffectfile( void );
|
||||
char* getTitleNamefile( void );
|
||||
char* getTitleConfigfile( void );
|
||||
char* getLsgenlogfilename( void );
|
||||
char* getStoredir( void );
|
||||
#ifdef _STORECHAR
|
||||
char* getStorechar( void );
|
||||
#endif
|
||||
char* getNpcdir( void );
|
||||
char* getLogdir( void );
|
||||
char* getLogconffile( void );
|
||||
char* getChatMagicPasswd( void );
|
||||
unsigned int getChatMagicCDKeyCheck( void );
|
||||
|
||||
|
||||
unsigned int getFilesearchnum( void );
|
||||
unsigned int getNpctemplatenum( void );
|
||||
unsigned int getNpccreatenum( void );
|
||||
unsigned int getWalksendinterval( void );
|
||||
void setWalksendinterval( unsigned int );
|
||||
unsigned int getCAsendinterval_ms( void );
|
||||
void setCAsendinterval_ms( unsigned int );
|
||||
unsigned int getCDsendinterval_ms( void );
|
||||
void setCDsendinterval_ms( unsigned int );
|
||||
unsigned int getOnelooptime_ms( void );
|
||||
void setOnelooptime_ms( unsigned int );
|
||||
unsigned int getCharSavesendinterval( void );
|
||||
void setCharSavesendinterval( unsigned int interval);
|
||||
unsigned int getAddressbookoffmsgnum( void );
|
||||
unsigned int getProtocolreadfrequency( void );
|
||||
unsigned int getAllowerrornum( void );
|
||||
unsigned int getLogHour( void );
|
||||
unsigned int getBattleDebugMsg( void );
|
||||
void setBattleDebugMsg( unsigned int );
|
||||
|
||||
char* getEncountfile( void );
|
||||
char* getEnemyfile( void );
|
||||
char* getGroupfile( void );
|
||||
char* getEnemyBasefile( void );
|
||||
char* getMagicfile( void );
|
||||
#ifdef __ATTACK_MAGIC
|
||||
|
||||
char* getAttMagicfileName( void );
|
||||
|
||||
#endif
|
||||
|
||||
char* getPetskillfile( void );
|
||||
char *getItematomfile( void );
|
||||
char *getQuizfile( void );
|
||||
|
||||
#ifdef _PROFESSION_SKILL // WON ADD ÈËÎïÖ°Òµ¼¼ÄÜ
|
||||
char* getProfession( void );
|
||||
#endif
|
||||
|
||||
unsigned int getPetdeletetime( void );
|
||||
void setPetdeletetime( unsigned int interval );
|
||||
|
||||
unsigned int getItemdeletetime( void );
|
||||
void setItemdeletetime( unsigned int interval );
|
||||
//ttom add this because the second have this function
|
||||
//unsigned int getAcwriteSize( void );
|
||||
|
||||
#ifdef _DEL_DROP_GOLD
|
||||
unsigned int getGolddeletetime( void );
|
||||
void setGolddeletetime( unsigned int interval );
|
||||
#endif
|
||||
|
||||
unsigned int setEncodeKey( void );
|
||||
unsigned int setAcWBSize( void );
|
||||
//ttom end
|
||||
|
||||
// CoolFish: +2 2001/4/18
|
||||
unsigned int getAcwriteSize( void );
|
||||
unsigned int getErrUserDownFlg( void );
|
||||
|
||||
// Arminius 7.24 manor pk
|
||||
char* getGameserverID( void );
|
||||
unsigned short getAllowManorPK( void );
|
||||
|
||||
// Terry 2001/10/03 service ap
|
||||
char* getApID(void);
|
||||
unsigned short getApPort(void);
|
||||
int getLoopTime(void);
|
||||
int getEnableService(void);
|
||||
|
||||
#ifdef _GMRELOAD
|
||||
char* getGMSetfile(void);
|
||||
BOOL LoadGMSet(char *filename);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_QUITPARTY
|
||||
char* getitemquitparty( void );
|
||||
#endif
|
||||
#ifdef _BLACK_MARKET
|
||||
char* getBMItemFile(void);
|
||||
BOOL LoadBMItem( char* filename );
|
||||
#endif
|
||||
|
||||
#ifdef _AUCTIONEER
|
||||
char* getAuctiondir(void);
|
||||
#endif
|
||||
|
||||
#ifdef _MUSEUM
|
||||
int getMuseum(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _NEW_PLAYER_CF
|
||||
int getNewplayertrans( void );
|
||||
int getNewplayerlv( void );
|
||||
int getNewplayergivepet( unsigned int index );
|
||||
void setNewplayergivepet( unsigned int index ,unsigned int interval);
|
||||
int getNewplayerpetlv( void );
|
||||
unsigned int getNewplayergivegold( void );
|
||||
#endif
|
||||
|
||||
#ifdef _USER_EXP_CF
|
||||
BOOL LoadEXP( char* filename );
|
||||
char* getEXPfile( void );
|
||||
int getNeedLevelUpTbls( int level );
|
||||
int getMaxLevel( void );
|
||||
int getYBLevel( void );
|
||||
#endif
|
||||
|
||||
#ifdef _LOCK_IP
|
||||
char* getLockipPath( void );
|
||||
int loadLockip( char* filename );
|
||||
int saveLockip( void );
|
||||
int getMaxLockip( void );
|
||||
int cmpLockip( int index, int a, int b, int c, int d, int login );
|
||||
int addLockip( int a, int b ,int c ,int d, int locktime );
|
||||
char *dispalyLockip( int index );
|
||||
#endif
|
31
gmsv/include/correct_bug.h
Normal file
31
gmsv/include/correct_bug.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __CORRECT_BUG_H__
|
||||
#define __CORRECT_BUG_H__
|
||||
|
||||
/* ---------------------- (未开放区) ---------------------------*/
|
||||
//#define _NO_WARP // 阻档进入英雄岛不限等及随意进出入四大村庄 code:建军 (不可开放)
|
||||
//#define _FAMILYBANKSTONELOG // Syu ADD 新增家族银行存取Log (SAAC的要一起开)
|
||||
#define _kr_ip // WON ADD 不锁gm指令ip
|
||||
//#define _WON_TEST // WON TEST
|
||||
//#define _CHANGEITEMUSE // Syu ADD 调整战斗中使用料理设定
|
||||
/* ----------------------- (待测区) ---------------------------*/
|
||||
//#define _CRASHSTOREPETMAIL // Syu ADD 修正宠物邮件
|
||||
//#define _SYUTESTBATTLE // Syu ADD
|
||||
|
||||
/* ----------------------- (开放区) ---------------------------*/
|
||||
#define _add_item_log_name // WON ADD 在item的log中增加item名称
|
||||
#define _PETSKILLBUG // Syu ADD 修正宠物问题
|
||||
#define _FIXWOLF // Syu ADD 修正狼人变身Bug
|
||||
#define _FIXMAGICBUG // Syu ADD 修正魔法熟练、抗性暴掉问题
|
||||
#define _FIXPETFALL // Syu ADD 修正落马术
|
||||
#define _FIX_ITEMRELIFE // WON ADD 修正替身娃娃问题
|
||||
#define _FIX_SPEED_UPLEVEL // WON ADD 修正加速
|
||||
#define _FIX_PETMAIL // WON ADD 修正宠邮
|
||||
#define _FIX_EQUIP_ITEM // WON ADD 修正道具需重新装备
|
||||
#define _ADD_PETMAIL_NUM // WON ADD 宠邮数量GM指令
|
||||
#define _FIX_equipNoenemy // WON ADD 修正太阳神首饰
|
||||
#define _FIX_PETMAIL2 // WON ADD 修正宠邮2
|
||||
#define _FIXITEMANISHOW // Syu ADD 修正回合性补血装备道具骑宠时宠物不显示动画问题
|
||||
#define _FIX_GP_PET_SKILL // WON ADD 修正gp宠会落马术
|
||||
|
||||
|
||||
#endif
|
192
gmsv/include/deathcontend.h
Normal file
192
gmsv/include/deathcontend.h
Normal file
@ -0,0 +1,192 @@
|
||||
#include "version.h"
|
||||
|
||||
#ifdef _DEATH_CONTEND
|
||||
|
||||
//团队人物名单
|
||||
typedef struct
|
||||
{
|
||||
int use;
|
||||
char cdkey[64];
|
||||
char name[64];
|
||||
}PkTeamMans;
|
||||
//战斗纪录
|
||||
typedef struct
|
||||
{
|
||||
int use;
|
||||
int teamnum;
|
||||
int flg; //0 1
|
||||
}BattleHistorys;
|
||||
|
||||
#define MAXTEAMMANNUM 5 //队伍最高人数
|
||||
#define MAXBATTLENUM 100 //队伍最高战斗纪录
|
||||
#define MAXTEAMNUM 1000
|
||||
|
||||
#define DEFMAXBATTLENUM 50 //最高决斗场次
|
||||
#define DEFWINSCORE 90
|
||||
#define DEFLOSERATE 0.4
|
||||
//决斗参赛队伍info
|
||||
typedef struct _tagPkTeamLists
|
||||
{
|
||||
int use; //flg
|
||||
int teamnum; //队伍序号
|
||||
char teamname[64]; //队伍名称
|
||||
char pathdir[64]; //队伍资料目录
|
||||
char leadercdkey[64]; //队长CDKEY
|
||||
int win; //胜
|
||||
int lost; //负
|
||||
int battleplay; //总场次
|
||||
int score;
|
||||
int inside; //录取旗标
|
||||
int read;
|
||||
PkTeamMans MyTeamMans[MAXTEAMMANNUM];
|
||||
BattleHistorys BHistory[MAXBATTLENUM];
|
||||
}PkTeamLists;
|
||||
|
||||
#define MAXJOINTEAM 40
|
||||
#define MAXWATCHMAP 16
|
||||
typedef struct
|
||||
{
|
||||
int use;
|
||||
int teamnum;
|
||||
char cdkey[256];
|
||||
char name[256];
|
||||
int toindex;
|
||||
int fd;
|
||||
}JoinTeamList;
|
||||
|
||||
typedef struct _tagPKProcedureRow
|
||||
{
|
||||
int use;
|
||||
int time;
|
||||
int type;
|
||||
JoinTeamList Team[2];
|
||||
}PKProcedures;
|
||||
|
||||
enum{
|
||||
PKTYPE_NONE=0, //无
|
||||
PKTYPE_WAIT, //等待其他队伍加入
|
||||
PKTYPE_STANDBY, //准备对战等待时间
|
||||
PKTYPE_PK, //对战中
|
||||
};
|
||||
|
||||
void del_rn( char *s );
|
||||
void PKLIST_ResetOneTeamMan( int ti ); //重置队员名单
|
||||
void PKLIST_ResetOneBHistory( int ti ); //重置对战名单
|
||||
void PKLIST_ResetOnePkTeamList( int ti ); //重置参赛队伍资料
|
||||
int PKLIST_InitPkTeamList( int teamnum ); //重置
|
||||
|
||||
int PKLIST_GetPkTeamListArray( int teamnum, char *cdkey);
|
||||
int PKLIST_GetPkTeamListArrayFromNum( int teamnum);
|
||||
//确认重复约战
|
||||
BOOL PKLIST_CHECKPkTeamSame( int teamnum, int charaindex, char *cdkey, int toteamnum );
|
||||
//确认对战场数
|
||||
int PKLIST_CHECKPkTeamNew( int teamnum, int charaindex, char *cdkey );
|
||||
|
||||
//LOAD DATA
|
||||
BOOL PKLIST_LoadPkTeamListDataSub( int ti, char *data);
|
||||
BOOL PKLIST_LoadPkTeamListDataMyTeamMans( int ti, char *data);
|
||||
BOOL PKLIST_LoadPkTeamListDataBHistory( int ti, char *data);
|
||||
//BOOL PKLIST_LoadPkTeamListData( char *data); //处理ac送来的 pklist
|
||||
BOOL PKLIST_LoadPkTeamListData(void); // 改成读档
|
||||
void PKLIST_SavePkTeamListData(void);
|
||||
void PKLIST_LoadInitPkTeamListData(void); // 读取最原始的参赛名单
|
||||
void PKLIST_UpData(char *mycdkey,char *tocdkey,int menum,int tonum,int winer,int flg);
|
||||
int PKLIST_GetOneBHistory( int ti );
|
||||
int PKLIST_SetOneBHistory( int ti, int hi, int use, int teamnum, int flg );
|
||||
int PKLIST_UpdateOnePkTeamData( int ti, int forti, int winerflg);
|
||||
|
||||
void PKLIST_InsertTeamNum( int charaindex );
|
||||
BOOL PKLIST_GetTeamLeaderCdkey( int teamnum, char *buf);
|
||||
void PKLIST_ShowPkListTeamData( void);
|
||||
|
||||
int NPC_PKLIST_Finish_Exit( int menum, int tonum, int winside, int battlemap);
|
||||
|
||||
|
||||
BOOL PKLIST_HandleChartsMess( int fd, char *data, int type, int flg);
|
||||
BOOL PKLIST_GetChartsListData( int ti, char *data, int sizes );
|
||||
BOOL PKLIST_GetMyPKListTeamData( int teamnum, char *data, int sizes );
|
||||
|
||||
|
||||
/*
|
||||
BOOL PKLIST_CheckPKSameTeam( int charaindex );
|
||||
BOOL PKLIST_JoinPKProcedures( int charaindex );
|
||||
void PKLIST_DelPKProcedures( int ti, int side );
|
||||
void PKLIST_CheckPKProcedures( void );
|
||||
|
||||
void PKLIST_CheckPKProcedures_PKTYPEWAIT( int ti);
|
||||
void PKLIST_CheckPKProcedures_PKTYPESTANDBY( int ti);
|
||||
*/
|
||||
|
||||
//赛程
|
||||
void PKLIST_DelPKProcedures( int ti, int side, int type);
|
||||
BOOL PKLIST_CheckPklistInServerMap( int ti, int side);
|
||||
BOOL PKLIST_CheckPKSameTeam( int charaindex );
|
||||
BOOL PKLIST_CheckPKReapetTeam( int menum, int tonum);
|
||||
BOOL PKLIST_JoinPKProcedures( int charaindex );
|
||||
void PKLIST_CheckTeamBeEnable( void);
|
||||
void PKLIST_warp( int ti, int side, int fl, int x, int y );
|
||||
void NPC_PKLIST_PlayerLogout_Exit( int charaindex );
|
||||
int PKLIST_GetPKProcedureArray( int menum );
|
||||
|
||||
BOOL PKLIST_CheckLOCKTeam( int menum);
|
||||
void PKLIST_LOCKTeam( int menum);
|
||||
void PKLIST_UNLOCKTeam( int menum);
|
||||
void PKLIST_Sort_PKListSort( void);
|
||||
|
||||
//正式赛
|
||||
typedef struct _tagArrangeBattle
|
||||
{
|
||||
int use;
|
||||
int fl;
|
||||
int code;
|
||||
int teamnum;
|
||||
int type; //0 NULL // 1 in battle
|
||||
int time;
|
||||
char teamname[256];
|
||||
int toindex;
|
||||
|
||||
struct _tagArrangeBattle *next[2];
|
||||
struct _tagArrangeBattle *top;
|
||||
}ArrangeBattleC;
|
||||
|
||||
#define MAXBAFLOOR 20
|
||||
#define MAXNOWBATTLE 128
|
||||
|
||||
#define MAXBAHEAD 16
|
||||
#define MAXBATTLEPAGE MAXJOINTEAM
|
||||
|
||||
void ABATTLE_InitABattle( int maxnums );
|
||||
int ABATTLE_CreateNet( ArrangeBattleC *now, int ti, int fl, int maxfl);
|
||||
void ABATTLE_ShowNet( ArrangeBattleC *now, int fl);
|
||||
void ABATTLE_ShowBattlefromFl( int ti, int fl);
|
||||
ArrangeBattleC *ArrangeBattleC_getNew( void);
|
||||
|
||||
|
||||
BOOL ABATTLE_InsertBattle( ArrangeBattleC *aB); //排入赛程
|
||||
void ABATTLE_EnterBattle( ArrangeBattleC *aB); //入围
|
||||
void ABATTLE_EliminateBattlefromFl( ArrangeBattleC *aB);//剔除
|
||||
|
||||
BOOL ABATTLE_CheckInABattle( int ti);//确认赛程战斗状态 包含时间
|
||||
int ABATTLE_FindBattlefromFl( int ti, int fl); //找寻可加入赛程队伍组合
|
||||
|
||||
void ABATTLE_CheckBattlefromFl(int charindex, int ti,int battleindex); //确认层次是否完成 且 排置赛程
|
||||
int ABATTLE_CheckBattlefromFl_sub(int charindex, int ti, int fl,int battleindex); //确认层次是否完成
|
||||
|
||||
|
||||
ArrangeBattleC *ABATTLE_getInBattle( int teamnum); //取得赛程head form teamnum
|
||||
|
||||
void ABATTLE_MakeInABattleString( void); //制作赛程字串
|
||||
|
||||
BOOL PKLIST_GetABattlelistDataString( int ti, int *tindex, int *stime,
|
||||
char *buf1, char *buf2, char *buf3, int flg);//取得赛程字串
|
||||
|
||||
ArrangeBattleC *ArrangeBattleC_getInBattleArray( int ti);
|
||||
|
||||
|
||||
|
||||
|
||||
void ABATTLE_RecordBattle( int ti, char *buf1, char *tstr1,char *buf2, char *tstr2);
|
||||
void remove_r( char *s );
|
||||
void ABATTLE_GetRecordBattle( void);
|
||||
|
||||
#endif
|
4
gmsv/include/defend.h
Normal file
4
gmsv/include/defend.h
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef __DEFEND_H__
|
||||
#define __DEFEND_H__
|
||||
|
||||
#endif
|
40
gmsv/include/encount.h
Normal file
40
gmsv/include/encount.h
Normal file
@ -0,0 +1,40 @@
|
||||
#ifndef __ENCOUNT_H__
|
||||
#define __ENCOUNT_H__
|
||||
|
||||
#define ENCOUNT_GROUPMAXNUM 10
|
||||
|
||||
BOOL ENCOUNT_initEncount( char* filename );
|
||||
BOOL ENCOUNT_reinitEncount( void );
|
||||
int ENCOUNT_getEncountAreaArray( int floor, int x, int y);
|
||||
int ENCOUNT_getEncountPercentMin( int charaindex, int floor , int x, int y );
|
||||
int ENCOUNT_getEncountPercentMax( int charaindex, int floor , int x, int y );
|
||||
int ENCOUNT_getCreateEnemyMaxNum( int floor , int x, int y );
|
||||
int ENCOUNT_getEncountIndex( int floor , int x, int y );
|
||||
int ENCOUNT_getEncountIndexFromArray( int array );
|
||||
int ENCOUNT_getEncountPercentFromArray( int array );
|
||||
int ENCOUNT_getCreateEnemyMaxNumFromArray( int array );
|
||||
int ENCOUNT_getGroupIdFromArray( int array, int grouparray );
|
||||
int ENCOUNT_getGroupProbFromArray( int array, int grouparray );
|
||||
int ENCOUNT_getZorderFromArray( int array );
|
||||
|
||||
#ifdef _ADD_ENCOUNT // WON ADD 增加敌遭遇触发修件
|
||||
typedef struct tagENCOUNT_Table
|
||||
{
|
||||
int index;
|
||||
int floor;
|
||||
int encountprob_min; /* 巨件市它件玄割 */
|
||||
int encountprob_max; /* 巨件市它件玄割 */
|
||||
int enemymaxnum; /* 升木分仃衬毛综月井 */
|
||||
int zorder;
|
||||
int groupid[ENCOUNT_GROUPMAXNUM]; /* 弘伙□皿No */
|
||||
int createprob[ENCOUNT_GROUPMAXNUM]; /* 公及弘伙□皿及请蜇 */
|
||||
int event_now;
|
||||
int event_end;
|
||||
int enemy_group; // 怪物的group 编号
|
||||
RECT rect;
|
||||
}ENCOUNT_Table;
|
||||
|
||||
ENCOUNT_Table *ENCOUNT_table;
|
||||
#endif
|
||||
|
||||
#endif
|
253
gmsv/include/enemy.h
Normal file
253
gmsv/include/enemy.h
Normal file
@ -0,0 +1,253 @@
|
||||
#ifndef __ENEMY_H__
|
||||
#define __ENEMY_H__
|
||||
|
||||
enum
|
||||
{
|
||||
E_T_SIZE_NORMAL,
|
||||
E_T_SIZE_BIG,
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_T_TEMPNO,
|
||||
E_T_INITNUM,
|
||||
E_T_LVUPPOINT,
|
||||
E_T_BASEVITAL,
|
||||
E_T_BASESTR,
|
||||
E_T_BASETGH,
|
||||
E_T_BASEDEX,
|
||||
E_T_MODAI,
|
||||
E_T_GET,
|
||||
E_T_EARTHAT,
|
||||
E_T_WATERAT,
|
||||
E_T_FIREAT,
|
||||
E_T_WINDAT,
|
||||
E_T_POISON, /* 汹仁凶太卞母丢□斥 */
|
||||
E_T_PARALYSIS, /* 仄太木}1 及垫 互匹五卅中[ */
|
||||
E_T_SLEEP, /* 戽曰[垫 匹五卅中 */
|
||||
E_T_STONE, /* 檗[垫 匹五卅中 */
|
||||
E_T_DRUNK, /* 办丹[ 互票互月 */
|
||||
E_T_CONFUSION, /* 渔刭[ 猾 毛赀月 */
|
||||
E_T_PETSKILL1,
|
||||
E_T_PETSKILL2,
|
||||
E_T_PETSKILL3,
|
||||
E_T_PETSKILL4,
|
||||
E_T_PETSKILL5,
|
||||
E_T_PETSKILL6,
|
||||
E_T_PETSKILL7,
|
||||
E_T_RARE,
|
||||
E_T_CRITICAL,
|
||||
E_T_COUNTER,
|
||||
E_T_SLOT,
|
||||
E_T_IMGNUMBER,
|
||||
E_T_PETFLG,
|
||||
E_T_SIZE,
|
||||
E_T_ATOMBASEADD1,
|
||||
E_T_ATOMFIXMIN1,
|
||||
E_T_ATOMFIXMAX1,
|
||||
E_T_ATOMBASEADD2,
|
||||
E_T_ATOMFIXMIN2,
|
||||
E_T_ATOMFIXMAX2,
|
||||
E_T_ATOMBASEADD3,
|
||||
E_T_ATOMFIXMIN3,
|
||||
E_T_ATOMFIXMAX3,
|
||||
E_T_ATOMBASEADD4,
|
||||
E_T_ATOMFIXMIN4,
|
||||
E_T_ATOMFIXMAX4,
|
||||
E_T_ATOMBASEADD5,
|
||||
E_T_ATOMFIXMIN5,
|
||||
E_T_ATOMFIXMAX5,
|
||||
E_T_LIMITLEVEL, // Arminius 7.30 limit level
|
||||
#ifdef _PET_FUSION
|
||||
E_T_FUSIONCODE,
|
||||
#endif
|
||||
E_T_DATAINTNUM,
|
||||
}ENEMYTEMP_DATAINT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
E_T_NAME,
|
||||
E_T_ATOMFIXNAME1,
|
||||
E_T_ATOMFIXNAME2,
|
||||
E_T_ATOMFIXNAME3,
|
||||
E_T_ATOMFIXNAME4,
|
||||
E_T_ATOMFIXNAME5,
|
||||
E_T_DATACHARNUM,
|
||||
|
||||
}ENEMYTEMP_DATACHAR;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ENEMY_ID,
|
||||
ENEMY_TEMPNO,
|
||||
ENEMY_LV_MIN,
|
||||
ENEMY_LV_MAX,
|
||||
ENEMY_CREATEMAXNUM,
|
||||
ENEMY_CREATEMINNUM,
|
||||
ENEMY_TACTICS,
|
||||
ENEMY_EXP,
|
||||
ENEMY_DUELPOINT,
|
||||
ENEMY_STYLE,
|
||||
ENEMY_PETFLG, /* 矢永玄卞卅月井升丹井 */
|
||||
|
||||
ENEMY_ITEM1,
|
||||
ENEMY_ITEM2,
|
||||
ENEMY_ITEM3,
|
||||
ENEMY_ITEM4,
|
||||
ENEMY_ITEM5,
|
||||
ENEMY_ITEM6,
|
||||
ENEMY_ITEM7,
|
||||
ENEMY_ITEM8,
|
||||
ENEMY_ITEM9,
|
||||
ENEMY_ITEM10,
|
||||
ENEMY_ITEMPROB1,
|
||||
ENEMY_ITEMPROB2,
|
||||
ENEMY_ITEMPROB3,
|
||||
ENEMY_ITEMPROB4,
|
||||
ENEMY_ITEMPROB5,
|
||||
ENEMY_ITEMPROB6,
|
||||
ENEMY_ITEMPROB7,
|
||||
ENEMY_ITEMPROB8,
|
||||
ENEMY_ITEMPROB9,
|
||||
ENEMY_ITEMPROB10,
|
||||
|
||||
ENEMY_DATAINTNUM,
|
||||
|
||||
}ENEMY_DATAINT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ENEMY_NAME,
|
||||
ENEMY_TACTICSOPTION,
|
||||
#ifdef _BATTLENPC_WARP_PLAYER
|
||||
ENEMY_ACT_CONDITION,
|
||||
#endif
|
||||
ENEMY_DATACHARNUM,
|
||||
}ENEMY_DATACHAR;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GROUP_ID,
|
||||
GROUP_APPEARBYITEMID, /* 仇及失奶 丞毛 匀化中凶日请蜇允月 -1 反 骰*/
|
||||
GROUP_NOTAPPEARBYITEMID, /* 仇及失奶 丞毛 匀化中凶日请蜇仄卅中 -1 反 骰*/
|
||||
ENEMY_ID1,
|
||||
ENEMY_ID2,
|
||||
ENEMY_ID3,
|
||||
ENEMY_ID4,
|
||||
ENEMY_ID5,
|
||||
ENEMY_ID6,
|
||||
ENEMY_ID7,
|
||||
ENEMY_ID8,
|
||||
ENEMY_ID9,
|
||||
ENEMY_ID10,
|
||||
CREATEPROB1,
|
||||
CREATEPROB2,
|
||||
CREATEPROB3,
|
||||
CREATEPROB4,
|
||||
CREATEPROB5,
|
||||
CREATEPROB6,
|
||||
CREATEPROB7,
|
||||
CREATEPROB8,
|
||||
CREATEPROB9,
|
||||
CREATEPROB10,
|
||||
GROUP_DATAINTNUM,
|
||||
}GROUP_DATAINT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GROUP_NAME,
|
||||
GROUP_DATACHARNUM,
|
||||
|
||||
}GROUP_DATACHAR;
|
||||
|
||||
|
||||
typedef struct tagENEMY_EnemyTable
|
||||
{
|
||||
int intdata[ENEMY_DATAINTNUM];
|
||||
STRING64 chardata[ENEMY_DATACHARNUM];
|
||||
int enemytemparray;
|
||||
}ENEMY_EnemyTable;
|
||||
|
||||
typedef struct tagENEMYTEMP_Table
|
||||
{
|
||||
int intdata[E_T_DATAINTNUM];
|
||||
//ANDY_EDIT
|
||||
STRING64 chardata[E_T_DATACHARNUM];
|
||||
|
||||
}ENEMYTEMP_Table;
|
||||
|
||||
typedef struct tagGROUP_Table
|
||||
{
|
||||
int intdata[GROUP_DATAINTNUM];
|
||||
STRING32 chardata[GROUP_DATACHARNUM];
|
||||
int enemyarray[CREATEPROB1 - ENEMY_ID1];
|
||||
}GROUP_Table;
|
||||
|
||||
|
||||
|
||||
INLINE BOOL ENEMY_CHECKINDEX( int index);
|
||||
INLINE int ENEMY_setInt( int index, ENEMY_DATAINT element, int data);
|
||||
INLINE int ENEMY_getInt( int index, ENEMY_DATAINT element);
|
||||
|
||||
INLINE int *ENEMY_getIntdata( int index);
|
||||
|
||||
INLINE BOOL ENEMY_setChar( int index ,ENEMY_DATACHAR element, char* new );
|
||||
INLINE char *ENEMY_getChar( int index, ENEMY_DATACHAR element);
|
||||
int ENEMY_getEnemyNum( void);
|
||||
BOOL ENEMY_initEnemy( char* filename );
|
||||
BOOL ENEMY_reinitEnemy( void );
|
||||
int ENEMY_createEnemy( int array, int baselevel );
|
||||
int *ENEMY_getEnemy( int charaindex, int x, int y);
|
||||
int ENEMY_createPetFromEnemyIndex( int charaindex, int array);
|
||||
|
||||
int ENEMY_getEnemyArrayFromId( int EnemyId);
|
||||
int ENEMY_getEnemyArrayFromTempNo( int EnemyTempNo);
|
||||
int ENEMY_getEnemyIdFromTempNo( int EnemyTempNo);
|
||||
int ENEMY_getEnemyTempNoFromId( int EnemyId);
|
||||
|
||||
#ifdef _TEST_PETCREATE
|
||||
int ENEMY_TEST_createPetIndex( int array);
|
||||
#endif
|
||||
|
||||
int ENEMYTEMP_getEnemyNum( void);//krynn 2001/12/13
|
||||
INLINE BOOL ENEMYTEMP_CHECKINDEX( int index);
|
||||
INLINE int ENEMYTEMP_setInt( int index, ENEMYTEMP_DATAINT element, int data);
|
||||
INLINE int ENEMYTEMP_getInt( int index, ENEMYTEMP_DATAINT element);
|
||||
INLINE char *ENEMYTEMP_getChar( int index, ENEMYTEMP_DATACHAR element);
|
||||
INLINE BOOL ENEMYTEMP_getInt_setChar( int index ,ENEMYTEMP_DATACHAR element, char* new );
|
||||
INLINE char *ENEMYTEMP_getInt_getChar( int index, ENEMYTEMP_DATACHAR element);
|
||||
int ENEMYTEMP_getInt_getEnemyNum( void);
|
||||
BOOL ENEMYTEMP_getInt_initEnemy( char* filename );
|
||||
BOOL ENEMYTEMP_getInt_reinitEnemy( void );
|
||||
int ENEMYTEMP_getEnemyTempArray( int enemyindex);
|
||||
int ENEMYTEMP_getEnemyTempArrayFromTempNo( int EnemyTempNo);
|
||||
int ENEMYTEMP_getEnemyTempArrayFromInitnum( int EnemyTempNo);
|
||||
|
||||
INLINE int GROUP_setInt( int index, GROUP_DATAINT element, int data);
|
||||
INLINE int GROUP_getInt( int index, GROUP_DATAINT element);
|
||||
INLINE BOOL GROUP_setChar( int index ,GROUP_DATACHAR element, char* new );
|
||||
INLINE char *GROUP_getChar( int index, GROUP_DATACHAR element);
|
||||
int GROUP_getEnemyNum( void);
|
||||
|
||||
BOOL ENEMYTEMP_initEnemy( char* filename );
|
||||
BOOL ENEMYTEMP_reinitEnemy( void );
|
||||
BOOL GROUP_initGroup( char* filename );
|
||||
BOOL GROUP_reinitGroup( void );
|
||||
|
||||
#ifdef _PET_EVOLUTION
|
||||
int EVOLUTION_createPetFromEnemyIndex( int charaindex, int baseindex, int flg);
|
||||
int PET_CheckIncubate( int charaindex);
|
||||
BOOL PETFUSION_getIndexForChar( int toindex, int *MainIndex, int *Subindex1,int *Subindex2, char *data);
|
||||
int NPC_getFusionTableForBase( int charaindex, int petindex1, int petindex2 );
|
||||
int NPC_getPetArrayForNo( int PetCode);
|
||||
BOOL PET_getEvolutionAns( int petindex, int *base);
|
||||
#endif
|
||||
|
||||
int PETFUSION_SetNewEgg( int toindex , int petindex, int array, int *work, int *skill1, int *skill2);
|
||||
BOOL PETFUSION_AddEgg(int toindex, int petID, int PetCode);
|
||||
|
||||
#ifdef _PET_TRANS
|
||||
int GetNewPet( int toindex , int petindex, int array, int *work);
|
||||
#endif
|
||||
|
||||
#endif
|
207
gmsv/include/enemyexptbl.h
Normal file
207
gmsv/include/enemyexptbl.h
Normal file
@ -0,0 +1,207 @@
|
||||
#ifndef __ENEMY_EXPTBL_H__
|
||||
#define __ENEMY_EXPTBL_H__
|
||||
|
||||
|
||||
static int enemybaseexptbl[] = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
9,
|
||||
12,
|
||||
15,
|
||||
18,
|
||||
22,
|
||||
26,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
46,
|
||||
52,
|
||||
58,
|
||||
65,
|
||||
72,
|
||||
79,
|
||||
87,
|
||||
95,
|
||||
104,
|
||||
113,
|
||||
122,
|
||||
131,
|
||||
141,
|
||||
151,
|
||||
162,
|
||||
173,
|
||||
184,
|
||||
196,
|
||||
208,
|
||||
220,
|
||||
233,
|
||||
246,
|
||||
260,
|
||||
274,
|
||||
288,
|
||||
303,
|
||||
318,
|
||||
333,
|
||||
348,
|
||||
365,
|
||||
381,
|
||||
398,
|
||||
415,
|
||||
432,
|
||||
450,
|
||||
468,
|
||||
486,
|
||||
506,
|
||||
525,
|
||||
545,
|
||||
564,
|
||||
585,
|
||||
606,
|
||||
627,
|
||||
648,
|
||||
670,
|
||||
692,
|
||||
714,
|
||||
737,
|
||||
760,
|
||||
784,
|
||||
808,
|
||||
832,
|
||||
857,
|
||||
882,
|
||||
907,
|
||||
933,
|
||||
959,
|
||||
956,
|
||||
1012,
|
||||
1040,
|
||||
1067,
|
||||
1095,
|
||||
1123,
|
||||
1152,
|
||||
1181,
|
||||
1210,
|
||||
1240,
|
||||
1270,
|
||||
1300,
|
||||
1331,
|
||||
1362,
|
||||
1394,
|
||||
1426,
|
||||
1458,
|
||||
1490,
|
||||
1524,
|
||||
1557,
|
||||
1590,
|
||||
1625,
|
||||
1659,
|
||||
1694,
|
||||
1729,
|
||||
1764,
|
||||
1800, // level 100
|
||||
1836,
|
||||
1872,
|
||||
1909,
|
||||
1946,
|
||||
1983,
|
||||
2021,
|
||||
2059,
|
||||
2097,
|
||||
2136,
|
||||
2175, // level 110
|
||||
2214,
|
||||
2254,
|
||||
2294,
|
||||
2334,
|
||||
2374,
|
||||
2414,
|
||||
2455,
|
||||
2496,
|
||||
2537,
|
||||
2578, // level 120
|
||||
2619,
|
||||
2661,
|
||||
2703,
|
||||
2745,
|
||||
2787,
|
||||
2829,
|
||||
2872,
|
||||
2915,
|
||||
2958,
|
||||
3000, // level 130
|
||||
3043,
|
||||
3088,
|
||||
3132,
|
||||
3176,
|
||||
3220,
|
||||
3264,
|
||||
3309,
|
||||
3354,
|
||||
3399,
|
||||
3444, // level 140
|
||||
3489,
|
||||
3535,
|
||||
3581,
|
||||
3627,
|
||||
3673,
|
||||
3719,
|
||||
3765,
|
||||
3812,
|
||||
3859,
|
||||
3906, // level 150
|
||||
3953,
|
||||
4000,
|
||||
4047,
|
||||
4095,
|
||||
4143,
|
||||
4191,
|
||||
4239,
|
||||
4287,
|
||||
4335,
|
||||
4384, // level 160
|
||||
4433,
|
||||
4482,
|
||||
4531,
|
||||
4580,
|
||||
4629,
|
||||
4679,
|
||||
4729,
|
||||
4779,
|
||||
4829,
|
||||
4879, // level 170
|
||||
4929,
|
||||
4980,
|
||||
5031,
|
||||
5082,
|
||||
5133,
|
||||
5184,
|
||||
5235,
|
||||
5287,
|
||||
5339,
|
||||
5391, // level 180
|
||||
5443,
|
||||
5495,
|
||||
5547,
|
||||
5599,
|
||||
5652,
|
||||
5705,
|
||||
5758,
|
||||
5811,
|
||||
5864,
|
||||
5917, // level 190
|
||||
5970,
|
||||
6024,
|
||||
6078,
|
||||
6132,
|
||||
6186,
|
||||
6240,
|
||||
6295,
|
||||
6350,
|
||||
6405,
|
||||
6460, // level 200
|
||||
};
|
||||
#endif
|
9
gmsv/include/event.h
Normal file
9
gmsv/include/event.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef __EVENT_H__
|
||||
#define __EVENT_H__
|
||||
|
||||
INLINE BOOL EVENT_CHECKEVENTINDEX( int event);
|
||||
int EVENT_main( int charaindex,int event, int x, int y);
|
||||
|
||||
|
||||
#endif
|
||||
|
255
gmsv/include/family.h
Normal file
255
gmsv/include/family.h
Normal file
@ -0,0 +1,255 @@
|
||||
#ifndef __FAMILY_H__
|
||||
#define __FAMILY_H__
|
||||
|
||||
#include "version.h"
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "net.h"
|
||||
#include "time.h"
|
||||
|
||||
#define FAMILY_MAXNUM 1000 // 家族数量
|
||||
#ifdef _FMVER21
|
||||
#define FAMILY_MAXMEMBER 100 // 家族人数
|
||||
#define FAMILY_MAXCHANNELMEMBER 50 // 频道人数
|
||||
#else
|
||||
#define FAMILY_MAXMEMBER 50 // 家族人数
|
||||
#define FAMILY_MAXCHANNELMEMBER 10 // 频道人数
|
||||
#endif
|
||||
#define FAMILY_MAXCHANNEL 5 // 家族频道
|
||||
|
||||
#define CHAR_MAXNAME 20
|
||||
#define CHAR_MAXID 20
|
||||
#define MINFMLEVLEFORPOINT 3 // 3 申请庄园最低等级
|
||||
#define FMLEADERLV 30 // 族长等级
|
||||
|
||||
#ifdef _FAMILY_MANORNUM_CHANGE
|
||||
#define FAMILY_FMPKFLOOR 15 // 家族PK图层
|
||||
#else
|
||||
#define FAMILY_FMPKFLOOR 9 // 家族PK图层
|
||||
#define FMPOINTNUM 4 // 有据点家族的最大数量
|
||||
#define MANORNUM 4
|
||||
#define FAMILY_MAXHOME 4 // 家族据点
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
FM_TOP_INTEGRATE = 1, // DPTOP 综合
|
||||
FM_TOP_ADV, // DPTOP 冒险
|
||||
FM_TOP_FEED, // DPTOP 饲育
|
||||
FM_TOP_SYNTHESIZE, // DPTOP 合成
|
||||
FM_TOP_DEALFOOD, // DPTOP 料理
|
||||
FM_TOP_PK, // DPTOP PK
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
FM_TOP_MOMENTUM = 8, // DPTOP 气势
|
||||
#endif
|
||||
FM_TOP_NUM, // DPTOP 数量
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
FM_FIX_ACCEPTFLAG = 1,
|
||||
FM_FIX_FMPK,
|
||||
FM_FIX_FMPET,
|
||||
FM_FIX_FMRULE,
|
||||
FM_FIX_DELFMTIME,
|
||||
FM_FIX_FMGOLD,
|
||||
FM_FIX_FMADV,
|
||||
FM_FIX_FMFEED,
|
||||
FM_FIX_FMSYNTHESIZE,
|
||||
FM_FIX_FMDEALFOOD,
|
||||
FM_FIX_FMLEADERCHANGE,
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
FM_FIX_FMMOMENTUM,
|
||||
FM_FIX_FAME,
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* 扔□田 及职及桦赭午及 cdkey charname 及赢今毛宁六月凶户卞
|
||||
* CHEKEYLEN, CHARNAMELEN
|
||||
* 毛银丹方丹卞 凳[
|
||||
*/
|
||||
|
||||
void CHAR_Family(int fd, int index, char* message);
|
||||
void ACAddFM(int fd, int result, int fmindex, int index);
|
||||
void ACJoinFM(int fd, int result, int recv);
|
||||
void ACLeaveFM(int fd, int result, int resultflag);
|
||||
void ACDelFM(int fd, int result);
|
||||
void ACShowFMList(int ret, int fmnum, char *data);
|
||||
void ACFMDetail(int ret, char *data, int charfdid);
|
||||
void ACShowMemberList(int result, int index, int fmnumm,
|
||||
int fmacceptflag, int fmjoinnum, char *data);
|
||||
void ACShowDpTop(int result,int num, char *data, int kindflag);
|
||||
void ACShowPointList(int result, char *data);
|
||||
void ACShowFMMemo(int result, int index, int num, int dataindex, char *data);
|
||||
|
||||
#ifdef _PERSONAL_FAME // Arminius: 家族个人声望
|
||||
void ACFMCharLogin(int fd, int ret, int index, int floor, int fmdp,
|
||||
int joinflag, int fmsetupflag, int flag, int charindex, int charfame
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
,int momentum
|
||||
#endif
|
||||
);
|
||||
#else
|
||||
void ACFMCharLogin(int fd, int ret, int index, int floor, int fmdp,
|
||||
int joinflag, int fmsetupflag, int flag, int charindex);
|
||||
#endif
|
||||
|
||||
void ACFMPointList(int ret, char *data);
|
||||
void ACSetFMPoint(int ret, int r, int clifd);
|
||||
void ACFMAnnounce(int ret, char *fmname, int fmindex, int index, int kindflag,
|
||||
char *data, int color);
|
||||
void ACFixFMPK(int winindex, int loseindex, int data);
|
||||
void ACFMJob( int fd, int ret, char* data1, char* data2 );
|
||||
|
||||
void FAMILY_Add(int fd, int meindex, char *message);
|
||||
void FAMILY_Join(int fd, int meindex, char *message);
|
||||
void FAMILY_Leave(int fd, int meindex, char *message);
|
||||
void FAMILY_Detail(int fd, int meindex, char *message);
|
||||
void FAMILY_CheckMember(int fd, int meindex, char *message);
|
||||
void FAMILY_Channel(int fd, int meindex, char *message);
|
||||
void FAMILY_Bank(int fd, int meindex, char *message);
|
||||
void FAMILY_SetPoint(int fd, int meindex, char *message);
|
||||
void FAMILY_Init(void);
|
||||
void FAMILY_SetAcceptFlag(int fd, int meindex, char *message);
|
||||
void FAMILY_FixRule( int fd, int meindex, char* message );
|
||||
void FAMILY_RidePet( int fd, int meindex, char* message );
|
||||
void FAMILY_LeaderFunc( int fd, int meindex, char* message );
|
||||
|
||||
|
||||
|
||||
#ifdef _CK_ONLINE_PLAYER_COUNT // WON ADD 计算线上人数
|
||||
void GS_SEND_PLAYER_COUNT(void);
|
||||
#endif
|
||||
|
||||
void SetFMPetVarInit(int meindex);
|
||||
void SetFMVarInit(int meindex);
|
||||
|
||||
|
||||
int CheckFMLeader(int meindex);
|
||||
int getFmLv(int playerindex);
|
||||
|
||||
void getNewFMList( void );
|
||||
void checkFamilyIndex( void );
|
||||
|
||||
int CheckLeaderQ(int meindex);
|
||||
|
||||
|
||||
// shan add Begin
|
||||
struct FMMEMBER_LIST
|
||||
{
|
||||
// int fmindex;
|
||||
int fmnum;
|
||||
int fmjoinnum;
|
||||
// BOOL use; // 0->没使用 1->使用
|
||||
int memberindex[FAMILY_MAXMEMBER];
|
||||
char numberlistarray[FAMILY_MAXMEMBER][64];
|
||||
char memo[35][220]; // family dengon
|
||||
int accept; // 召募成员与否
|
||||
int memonum;
|
||||
int memoindex;
|
||||
};
|
||||
// 家族之间的留言板
|
||||
struct FMS_MEMO
|
||||
{
|
||||
char memo[140][220];
|
||||
int memonum;
|
||||
int memoindex;
|
||||
};
|
||||
// 家族强者表
|
||||
struct FMS_DPTOP
|
||||
{
|
||||
int num; // 记录有多少个家族(综合)
|
||||
char topmemo[FAMILY_MAXNUM][128];
|
||||
int fmtopid[FAMILY_MAXNUM]; // 家族索引
|
||||
#ifdef _FMVER21
|
||||
int fmtopdp[FAMILY_MAXNUM]; // 家族综合声望
|
||||
#endif
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
int fmMomentum[FAMILY_MAXNUM]; // 家族气势
|
||||
char momentum_topmemo[30][96]; // 家族气势 top
|
||||
int momentum_topid[FAMILY_MAXNUM]; // 家族气势 top id 索引
|
||||
#endif
|
||||
int adv_num; // 冒险
|
||||
char adv_topmemo[30][96];
|
||||
int feed_num; // 伺育
|
||||
char feed_topmemo[30][96];
|
||||
int syn_num; // 合成
|
||||
char syn_topmemo[30][96];
|
||||
int food_num; // 料理
|
||||
char food_topmemo[30][96];
|
||||
int pk_num; // PK
|
||||
char pk_topmemo[30][96];
|
||||
};
|
||||
// 家族据点
|
||||
struct FM_POINTLIST
|
||||
{
|
||||
char pointlistarray[FAMILY_MAXHOME][1024]; // Arminius: 32->1024
|
||||
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
int fm_momentum[FAMILY_MAXHOME]; // 记录挑战时期开始时的守庄家族气势值
|
||||
BOOL fm_inwar[FAMILY_MAXHOME]; // 此庄园是否进行庄园排程中
|
||||
#endif
|
||||
};
|
||||
// 家族PK图层
|
||||
struct FM_PKFLOOR
|
||||
{
|
||||
int fl;
|
||||
};
|
||||
// End
|
||||
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
typedef struct _ManorSchedule_t{
|
||||
int iFmIndex[10]; // 排入挑战排程的家族索引
|
||||
int iFmMomentum[10]; // 家族气势
|
||||
int iSort[10]; // 排名用
|
||||
char szMemo[10][256]; // 记录: 家族名称|约战时间|家族气势
|
||||
char szFmName[10][32]; // 家族名称
|
||||
struct tm tm1[10]; // 记录挑战时间
|
||||
}ManorSchedule_t;
|
||||
|
||||
extern ManorSchedule_t ManorSchedule[MANORNUM];
|
||||
#endif
|
||||
|
||||
#define MAXFAMILYLIST 120000
|
||||
extern char familyListBuf[MAXFAMILYLIST];
|
||||
|
||||
void JoinMemberIndex( int charaindex, int fmindexi);
|
||||
|
||||
|
||||
#ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD 家族战GM指令
|
||||
|
||||
|
||||
#define fm_pk_max 200
|
||||
|
||||
typedef struct _fm_pk_struct
|
||||
{
|
||||
int fm_index[fm_pk_max];
|
||||
int fm_win[fm_pk_max];
|
||||
int fm_lose[fm_pk_max];
|
||||
int fm_score[fm_pk_max];
|
||||
char fm_name[fm_pk_max][30];
|
||||
}FM_PK_STRUCT;
|
||||
|
||||
|
||||
enum{
|
||||
FM_INDEX =0,
|
||||
FM_WIN,
|
||||
FM_LOSE,
|
||||
FM_SCORE,
|
||||
FM_NAME,
|
||||
};
|
||||
|
||||
|
||||
void setInt_fm_pk_struct( int index, int type, int num );
|
||||
void setChar_fm_pk_struct( int index, int type, char *msg );
|
||||
int getInt_fm_pk_struct( int index, int type );
|
||||
char *getChar_fm_pk_struct( int index, int type );
|
||||
int get_fm_leader_index( int fm1 );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
5
gmsv/include/function.h
Normal file
5
gmsv/include/function.h
Normal file
@ -0,0 +1,5 @@
|
||||
#ifndef __FUNCTION_H__
|
||||
#define __FUNCTION_H__
|
||||
BOOL initFunctionTable( void );
|
||||
void* getFunctionPointerFromName( char* funcname );
|
||||
#endif
|
57
gmsv/include/handletime.h
Normal file
57
gmsv/include/handletime.h
Normal file
@ -0,0 +1,57 @@
|
||||
#ifndef __HANDLETIME_H__
|
||||
#define __HANDLETIME_H__
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __HANDLETIME_C__
|
||||
#define EXTERN
|
||||
#else /*__HANDLETIME_C__*/
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
EXTERN struct timeval NowTime;
|
||||
EXTERN int DEBUG_ADJUSTTIME;
|
||||
|
||||
BOOL setNewTime( void );
|
||||
#ifdef _ASSESS_SYSEFFICACY
|
||||
void Assess_InitSysEfficacy( void);
|
||||
void Assess_SysEfficacy( int flg);
|
||||
void ASSESS_getSysEfficacy( float *TVsec);
|
||||
#ifdef _ASSESS_SYSEFFICACY_SUB
|
||||
void Assess_SysEfficacy_sub( int flg, int loop);
|
||||
void ASSESS_getSysEfficacy_sub( float *TVsec, int loop);
|
||||
#endif
|
||||
#endif
|
||||
// WON REM
|
||||
//struct tm *localtime(const time_t *timep);
|
||||
|
||||
/*仇仇井日票}HiO[LS凛棉楮溢[*/
|
||||
/* 凛棉150(坌)*60=9000 =750*12 匹 LS1 */
|
||||
/* LS1200凛棉 LS1 */
|
||||
/* LS100 匹 LS1 */
|
||||
typedef struct tagLSTIME
|
||||
{
|
||||
int year;
|
||||
int day;
|
||||
int hour;
|
||||
}LSTIME;
|
||||
|
||||
#define NIGHT_TO_MORNING 700
|
||||
#define MORNING_TO_NOON 930
|
||||
#define NOON_TO_EVENING 200
|
||||
#define EVENING_TO_NIGHT 300
|
||||
|
||||
typedef enum
|
||||
{
|
||||
LS_NIGHT = 0,
|
||||
LS_MORNING ,
|
||||
LS_NOON ,
|
||||
LS_EVENING ,
|
||||
}LSTIME_SECTION;
|
||||
|
||||
void RealTimeToLSTime(long t , LSTIME *lstime);
|
||||
/*void LSTimeToRealTime( LSTIME *lstime, long *t);*/
|
||||
LSTIME_SECTION getLSTime (LSTIME *lstime);
|
||||
|
||||
#endif
|
17
gmsv/include/init.h
Normal file
17
gmsv/include/init.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef __INIT_H__
|
||||
#define __INIT_H__
|
||||
#include "common.h"
|
||||
BOOL init( int argc , char** argv, char** env );
|
||||
|
||||
#ifdef _ITEM_QUITPARTY
|
||||
|
||||
typedef struct tagDisappearItem
|
||||
{
|
||||
char string[64];
|
||||
}DisappearItem;
|
||||
DisappearItem *Disappear_Item;
|
||||
int itemquitparty_num;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
443
gmsv/include/item.h
Normal file
443
gmsv/include/item.h
Normal file
@ -0,0 +1,443 @@
|
||||
|
||||
#ifndef __ITEM_H__
|
||||
#define __ITEM_H__
|
||||
|
||||
#include "char.h"
|
||||
|
||||
#define NULLITEM "0"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_FIST =0,
|
||||
ITEM_AXE,
|
||||
ITEM_CLUB,
|
||||
ITEM_SPEAR,
|
||||
ITEM_BOW,
|
||||
ITEM_SHIELD,
|
||||
ITEM_HELM,
|
||||
ITEM_ARMOUR,
|
||||
|
||||
ITEM_BRACELET =8,
|
||||
ITEM_MUSIC,
|
||||
ITEM_NECKLACE,
|
||||
ITEM_RING,
|
||||
ITEM_BELT,
|
||||
ITEM_EARRING,
|
||||
ITEM_NOSERING,
|
||||
ITEM_AMULET,
|
||||
/* ****** */
|
||||
ITEM_OTHER =16,
|
||||
ITEM_BOOMERANG, // 回旋标
|
||||
ITEM_BOUNDTHROW, // 投掷斧头
|
||||
ITEM_BREAKTHROW, // 投掷石
|
||||
ITEM_DISH =20,
|
||||
#ifdef _ITEM_INSLAY
|
||||
ITEM_METAL,
|
||||
ITEM_JEWEL,
|
||||
#endif
|
||||
#ifdef _ITEM_CHECKWARES
|
||||
ITEM_WARES, //货物
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_EQUITSPACE
|
||||
ITEM_WBELT, //腰带
|
||||
ITEM_WSHIELD, //盾
|
||||
ITEM_WSHOES, //鞋子
|
||||
#endif
|
||||
#ifdef _EQUIT_NEWGLOVE
|
||||
ITEM_WGLOVE, //手套
|
||||
#endif
|
||||
|
||||
#ifdef _ALCHEMIST
|
||||
ITEM_ALCHEMIST =30,
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
//ITEM_ANGELTOKEN,
|
||||
//ITEM_HEROTOKEN,
|
||||
#endif
|
||||
|
||||
ITEM_CATEGORYNUM,
|
||||
|
||||
}ITEM_CATEGORY;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_FIELD_ALL,
|
||||
ITEM_FIELD_BATTLE,
|
||||
ITEM_FIELD_MAP,
|
||||
}ITEM_FIELDTYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_TARGET_MYSELF,
|
||||
ITEM_TARGET_OTHER,
|
||||
ITEM_TARGET_ALLMYSIDE,
|
||||
ITEM_TARGET_ALLOTHERSIDE,
|
||||
ITEM_TARGET_ALL,
|
||||
}ITEM_TARGETTYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_ID,
|
||||
ITEM_BASEIMAGENUMBER,
|
||||
ITEM_COST,
|
||||
ITEM_TYPE,
|
||||
ITEM_ABLEUSEFIELD,
|
||||
ITEM_TARGET,
|
||||
ITEM_LEVEL, /* LEVEL */
|
||||
#ifdef _ITEM_MAXUSERNUM
|
||||
ITEM_DAMAGEBREAK, //物品使用次数
|
||||
#endif
|
||||
|
||||
#ifdef _ITEMSET4_TXT
|
||||
ITEM_USEPILENUMS, //物品堆叠次数
|
||||
ITEM_CANBEPILE, //是否可堆叠
|
||||
|
||||
ITEM_NEEDSTR,
|
||||
ITEM_NEEDDEX,
|
||||
ITEM_NEEDTRANS,
|
||||
ITEM_NEEDPROFESSION,
|
||||
#endif
|
||||
|
||||
#ifdef _TAKE_ITEMDAMAGE
|
||||
ITEM_DAMAGECRUSHE,
|
||||
ITEM_MAXDAMAGECRUSHE,
|
||||
#endif
|
||||
|
||||
#ifdef _ADD_DEAMGEDEFC
|
||||
ITEM_OTHERDAMAGE,
|
||||
ITEM_OTHERDEFC,
|
||||
#endif
|
||||
|
||||
#ifdef _SUIT_ITEM
|
||||
ITEM_SUITCODE,
|
||||
#endif
|
||||
|
||||
ITEM_ATTACKNUM_MIN, /* 斓 猾荚醒 */
|
||||
ITEM_ATTACKNUM_MAX, /* 嫖 猾荚醒 */
|
||||
ITEM_MODIFYATTACK, /* 猾 祭汹 */
|
||||
ITEM_MODIFYDEFENCE, /* 豢 祭汹 */
|
||||
ITEM_MODIFYQUICK, /* QUICK 祭汹 */
|
||||
|
||||
ITEM_MODIFYHP, /* HP 祭汹 */
|
||||
ITEM_MODIFYMP, /* MP 祭汹 */
|
||||
ITEM_MODIFYLUCK, /* LUCK 祭汹 */
|
||||
ITEM_MODIFYCHARM, /* CHARM 祭汹 */
|
||||
ITEM_MODIFYAVOID, /* 荚 膜恳 */
|
||||
ITEM_MODIFYATTRIB, /* 箪岭膜恳 */
|
||||
ITEM_MODIFYATTRIBVALUE, /* 箪岭膜恳袄 */
|
||||
ITEM_MAGICID, /* 热诸 寞 */
|
||||
ITEM_MAGICPROB, /* 热诸 */
|
||||
ITEM_MAGICUSEMP, /* 壅 MP */
|
||||
|
||||
#ifdef _ITEMSET5_TXT
|
||||
ITEM_MODIFYARRANGE,
|
||||
ITEM_MODIFYSEQUENCE,
|
||||
|
||||
ITEM_ATTACHPILE,
|
||||
ITEM_HITRIGHT, //额外命中
|
||||
#endif
|
||||
#ifdef _ITEMSET6_TXT
|
||||
ITEM_NEGLECTGUARD,
|
||||
// ITEM_BEMERGE,
|
||||
#endif
|
||||
/* 旦 □正旦膜恳袄[*/
|
||||
ITEM_POISON, /* 汹仁凶太卞母丢□斥 */
|
||||
ITEM_PARALYSIS, /* 仄太木}1 及垫 互匹五卅中[ */
|
||||
ITEM_SLEEP, /* 戽曰[垫 匹五卅中 */
|
||||
ITEM_STONE, /* 檗[垫 匹五卅中 */
|
||||
ITEM_DRUNK, /* 办丹[ 互票互月 */
|
||||
ITEM_CONFUSION, /* 渔刭[ 猾 毛赀月 */
|
||||
|
||||
ITEM_CRITICAL, /* 弁伉 奴市伙 膜恳 */
|
||||
|
||||
ITEM_USEACTION, /* 银匀凶凛及失弁扑亦件 */
|
||||
ITEM_DROPATLOGOUT, /* 夫弘失它玄允月凛卞 允井升丹井 */
|
||||
ITEM_VANISHATDROP, /* 仄凶凛卞壅尹月井升丹井 */
|
||||
ITEM_ISOVERED, /* 晓卞昙匀井日日木月井升丹井[*/
|
||||
ITEM_CANPETMAIL, /* 矢永玄丢□伙匹霜木月井 */
|
||||
ITEM_CANMERGEFROM, /* 宁岳葭卞卅木月井 */
|
||||
ITEM_CANMERGETO, /* 宁岳燮卞卅木月井 */
|
||||
|
||||
ITEM_INGVALUE0, /* 岳坌(5蜊坌) */
|
||||
ITEM_INGVALUE1,
|
||||
ITEM_INGVALUE2,
|
||||
ITEM_INGVALUE3,
|
||||
ITEM_INGVALUE4,
|
||||
|
||||
ITEM_PUTTIME, /* 失奶 丞互 井木凶凛棉 */
|
||||
ITEM_LEAKLEVEL, /* 怍互升木分仃壬木凶井 */
|
||||
ITEM_MERGEFLG, /* 宁岳今木凶失奶 丞井升丹井 */
|
||||
ITEM_CRUSHLEVEL, /* 莽木蘸宁中 0 2 ㄟ反莽木化卅中 2反蝈莽 */
|
||||
|
||||
ITEM_VAR1, /* 迕综仅 */
|
||||
ITEM_VAR2, /* 迕综仅 */
|
||||
ITEM_VAR3, /* 迕综仅 */
|
||||
ITEM_VAR4, /* 迕综仅 */
|
||||
|
||||
ITEM_DATAINTNUM,
|
||||
|
||||
}ITEM_DATAINT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_NAME, /* 蟆 癫及 蟆 */
|
||||
ITEM_SECRETNAME, /* 蟆 凳今木月第 岭 曰 */
|
||||
ITEM_EFFECTSTRING, /* 躲绊 侬 */
|
||||
ITEM_ARGUMENT, /* 失奶 丞及娄醒 */
|
||||
#ifdef _ITEM_INSLAY
|
||||
ITEM_TYPECODE,
|
||||
ITEM_INLAYCODE,
|
||||
#endif
|
||||
ITEM_CDKEY, /* 失奶 丞及 蟆毛 赓卞 凳仄凶谛及 */
|
||||
#ifdef _ITEM_FORUSERNAMES
|
||||
ITEM_FORUSERNAME,
|
||||
ITEM_FORUSERCDKEY,
|
||||
#endif
|
||||
// CoolFish: 2001/10/11
|
||||
#ifdef _UNIQUE_P_I
|
||||
ITEM_UNIQUECODE, /* 物品编码 */
|
||||
#endif
|
||||
|
||||
ITEM_INGNAME0, /* 岳坌及 蟆(5蜊坌) */
|
||||
ITEM_INGNAME1,
|
||||
ITEM_INGNAME2,
|
||||
ITEM_INGNAME3,
|
||||
ITEM_INGNAME4,
|
||||
|
||||
|
||||
ITEM_INITFUNC, /* 娄醒
|
||||
* ITEM_Item*
|
||||
* 忒曰袄 BOOL
|
||||
* 忒曰袄及啦 反 CHAR_INITFUNC
|
||||
* 午 元 */
|
||||
ITEM_FIRSTFUNCTION = ITEM_INITFUNC,
|
||||
ITEM_PREOVERFUNC, /* CHAR_PREOVERFUNC 毛辅寰 */
|
||||
ITEM_POSTOVERFUNC, /* CHAR_POSTOVERFUNC 毛辅寰*/
|
||||
ITEM_WATCHFUNC, /* CHAR_WATCHFUNC 毛辅寰 */
|
||||
ITEM_USEFUNC, /* 娄醒反}
|
||||
* int charaindex 平乓仿奶件犯永弁旦
|
||||
* int charitemindex 愤坌及
|
||||
* 失奶 丞 及窒
|
||||
* 毛银匀凶井
|
||||
*/
|
||||
ITEM_ATTACHFUNC, /* 娄醒反}
|
||||
* int charaindex 平乓仿奶件犯永弁旦
|
||||
* int itemindex 失奶 丞奶件犯永弁旦
|
||||
* 平乓仿弁正及 匀化中月失奶 丞
|
||||
* 及失奶 丞 匹及奶件犯永弁旦
|
||||
* 匹反卅中仪卞镗啦[
|
||||
*/
|
||||
ITEM_DETACHFUNC, /* 娄醒反}
|
||||
* int charaindex 平乓仿奶件犯永弁旦
|
||||
* int itemindex 失奶 丞奶件犯永弁旦
|
||||
* 平乓仿弁正及 匀化中月失奶 丞
|
||||
* 及失奶 丞 匹及奶件犯永弁旦
|
||||
* 匹反卅中仪卞镗啦[
|
||||
*/
|
||||
ITEM_DROPFUNC, /* 午仄凶午五
|
||||
* 娄醒反
|
||||
* int charaindex 午仄凶平乓仿
|
||||
* int itemindex 失奶 丞奶件犯永弁旦
|
||||
*/
|
||||
ITEM_PICKUPFUNC, /* 失奶 丞毛胶匀凶凛
|
||||
* 娄醒反
|
||||
* int charaindex 胶匀凶平乓仿index
|
||||
* int itemindex 失奶 丞奶件犯永弁旦
|
||||
*/
|
||||
#ifdef _Item_ReLifeAct
|
||||
ITEM_DIERELIFEFUNC, /*ANDY_ADD
|
||||
复活道具
|
||||
*/
|
||||
#endif
|
||||
|
||||
#ifdef _CONTRACT
|
||||
ITEM_CONTRACTTIME,
|
||||
ITEM_CONTRACTARG,
|
||||
#endif
|
||||
|
||||
ITEM_LASTFUNCTION,
|
||||
|
||||
ITEM_DATACHARNUM = ITEM_LASTFUNCTION,
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
ITEM_ANGELMISSION = ITEM_INGNAME0,
|
||||
ITEM_ANGELINFO = ITEM_INGNAME1,
|
||||
ITEM_HEROINFO = ITEM_INGNAME2,
|
||||
#endif
|
||||
|
||||
}ITEM_DATACHAR;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_WORKOBJINDEX,
|
||||
ITEM_WORKCHARAINDEX,
|
||||
#ifdef _MARKET_TRADE
|
||||
ITEM_WORKTRADEINDEX,
|
||||
ITEM_WORKTRADETYPE,
|
||||
ITEM_WORKTRADESELLINDEX,
|
||||
#endif
|
||||
#ifdef _ITEM_ORNAMENTS
|
||||
ITEM_CANPICKUP,
|
||||
#endif
|
||||
#ifdef _ITEM_TIME_LIMIT
|
||||
ITEM_WORKTIMELIMIT,
|
||||
#endif
|
||||
ITEM_WORKDATAINTNUM,
|
||||
}ITEM_WORKDATAINT;
|
||||
|
||||
|
||||
|
||||
typedef struct tagItem
|
||||
{
|
||||
int data[ITEM_DATAINTNUM];
|
||||
STRING64 string[ITEM_DATACHARNUM];
|
||||
int workint[ITEM_WORKDATAINTNUM];
|
||||
|
||||
void* functable[ITEM_LASTFUNCTION-ITEM_FIRSTFUNCTION];
|
||||
}ITEM_Item;
|
||||
|
||||
typedef struct tagITEM_table
|
||||
{
|
||||
int use;
|
||||
ITEM_Item itm;
|
||||
int randomdata[ITEM_DATAINTNUM];
|
||||
}ITEM_table;
|
||||
|
||||
|
||||
typedef struct tagITEM_exists
|
||||
{
|
||||
BOOL use;
|
||||
ITEM_Item itm;
|
||||
}ITEM_exists;
|
||||
|
||||
#ifdef _CONTRACT
|
||||
#define MAX_CONTRACTTABLE 10
|
||||
typedef struct tagITEM_contract
|
||||
{
|
||||
int used;
|
||||
char detail[2048];
|
||||
int argnum;
|
||||
}ITEM_contractTable;
|
||||
#endif
|
||||
|
||||
|
||||
#define ITEM_CHECKINDEX(index) \
|
||||
_ITEM_CHECKINDEX( __FILE__, __LINE__, index)
|
||||
INLINE BOOL _ITEM_CHECKINDEX( char *file, int line, int index);
|
||||
|
||||
|
||||
BOOL ITEM_initExistItemsArray( int num );
|
||||
BOOL ITEM_endExistItemsArray( void );
|
||||
#define ITEM_initExistItemsOne( itm) \
|
||||
_ITEM_initExistItemsOne( __FILE__, __LINE__, itm)
|
||||
int _ITEM_initExistItemsOne( char *file, int line, ITEM_Item* itm );
|
||||
|
||||
#define ITEM_endExistItemsOne( index ) \
|
||||
_ITEM_endExistItemsOne( index, __FILE__, __LINE__)
|
||||
|
||||
void _ITEM_endExistItemsOne( int index , char *file, int line);
|
||||
|
||||
#define ITEM_getInt( Index, element) _ITEM_getInt( __FILE__, __LINE__, Index, element )
|
||||
INLINE int _ITEM_getInt( char *file, int line, int index ,ITEM_DATAINT element);
|
||||
|
||||
|
||||
#define ITEM_setInt( Index, element, data) _ITEM_setInt( __FILE__, __LINE__, Index, element, data)
|
||||
INLINE int _ITEM_setInt( char *file, int line, int index ,ITEM_DATAINT element, int data);
|
||||
|
||||
|
||||
INLINE char* ITEM_getChar( int index ,ITEM_DATACHAR element );
|
||||
INLINE BOOL ITEM_setChar( int index ,ITEM_DATACHAR element , char* new);
|
||||
|
||||
INLINE int ITEM_getWorkInt( int index ,ITEM_WORKDATAINT element);
|
||||
INLINE int ITEM_setWorkInt( int index ,ITEM_WORKDATAINT element, int data);
|
||||
INLINE int ITEM_getITEM_itemnum( void );
|
||||
INLINE int ITEM_getITEM_UseItemnum( void );
|
||||
INLINE BOOL ITEM_getITEM_use( int index );
|
||||
void ITEM_constructFunctable( int itemindex );
|
||||
void* ITEM_getFunctionPointer( int itemindex, int functype );
|
||||
INLINE ITEM_Item *ITEM_getItemPointer( int index );
|
||||
int ITEM_getItemMaxIdNum( void);
|
||||
|
||||
|
||||
char* ITEM_makeStringFromItemData( ITEM_Item* one, int mode );
|
||||
char* ITEM_makeStringFromItemIndex( int index, int mode );
|
||||
|
||||
BOOL ITEM_makeExistItemsFromStringToArg( char* src , ITEM_Item* item, int mode );
|
||||
void ITEM_getDefaultItemSetting( ITEM_Item* itm);
|
||||
|
||||
|
||||
INLINE BOOL ITEM_CHECKITEMTABLE( int number );
|
||||
BOOL ITEM_readItemConfFile( char* filename );
|
||||
|
||||
|
||||
CHAR_EquipPlace ITEM_getEquipPlace( int charaindex, int itmid );
|
||||
|
||||
|
||||
char* ITEM_makeItemStatusString( int haveitemindex, int itemindex );
|
||||
char* ITEM_makeItemFalseString( void );
|
||||
char* ITEM_makeItemFalseStringWithNum( int haveitemindex );
|
||||
|
||||
|
||||
BOOL ITEM_makeItem( ITEM_Item* itm, int number );
|
||||
int ITEM_makeItemAndRegist( int number );
|
||||
|
||||
|
||||
void ITEM_equipEffect( int index );
|
||||
|
||||
void Other_DefcharWorkInt( int index);
|
||||
|
||||
char* ITEM_getAppropriateName(int itemindex);
|
||||
char* ITEM_getEffectString( int itemindex );
|
||||
|
||||
|
||||
int ITEM_getcostFromITEMtabl( int itemid );
|
||||
|
||||
#define ITEM_getNameFromNumber( id) _ITEM_getNameFromNumber( __FILE__, __LINE__, id)
|
||||
INLINE char* _ITEM_getNameFromNumber( char *file, int line, int itemid );
|
||||
|
||||
|
||||
int ITEM_getlevelFromITEMtabl( int itemid );
|
||||
int ITEM_getgraNoFromITEMtabl( int itemid );
|
||||
char *ITEM_getItemInfoFromNumber( int itemid );
|
||||
|
||||
int ITEM_getdropatlogoutFromITEMtabl( int itemid );
|
||||
int ITEM_getvanishatdropFromITEMtabl( int itemid );
|
||||
int ITEM_getcanpetmailFromITEMtabl( int itemid );
|
||||
int ITEM_getmergeItemFromFromITEMtabl( int itemid );
|
||||
|
||||
#ifdef _ITEM_CHECKWARES
|
||||
BOOL CHAR_CheckInItemForWares( int charaindex, int flg);
|
||||
#endif
|
||||
|
||||
BOOL ITEM_canuseMagic( int itemindex);
|
||||
// Nuke +1 08/23 : For checking the validity of item target
|
||||
int ITEM_isTargetValid( int charaindex, int itemindex, int toindex);
|
||||
|
||||
|
||||
#ifdef _IMPOROVE_ITEMTABLE
|
||||
BOOL ITEMTBL_CHECKINDEX( int ItemID);
|
||||
int ITEM_getSIndexFromTransList( int ItemID);
|
||||
int ITEM_getMaxitemtblsFromTransList( void);
|
||||
int ITEM_getTotalitemtblsFromTransList( void);
|
||||
#endif
|
||||
|
||||
int ITEMTBL_getInt( int ItemID, ITEM_DATAINT datatype);
|
||||
char *ITEMTBL_getChar( int ItemID, ITEM_DATACHAR datatype);
|
||||
|
||||
int ITEM_getItemDamageCrusheED( int itemindex);
|
||||
void ITEM_RsetEquit( int charaindex);//自动卸除装备位置错误之物品
|
||||
void ITEM_reChangeItemToPile( int itemindex);
|
||||
void ITEM_reChangeItemName( int itemindex);
|
||||
|
||||
|
||||
#ifdef _SIMPLIFY_ITEMSTRING
|
||||
void ITEM_getDefaultItemData( int itemID, ITEM_Item* itm);
|
||||
#endif
|
||||
|
||||
#ifdef _CONTRACT
|
||||
BOOL ITEM_initContractTable( );
|
||||
#endif
|
||||
|
||||
#endif
|
241
gmsv/include/item_event.h
Normal file
241
gmsv/include/item_event.h
Normal file
@ -0,0 +1,241 @@
|
||||
#ifndef __ITEM_EVENT_H__
|
||||
#define __ITEM_EVENT_H__
|
||||
#include "item.h"
|
||||
int ITEM_eventDrop( int itemindex, int charaindex, int itemcharaindex );
|
||||
BOOL ITEM_MedicineInit( ITEM_Item* itm );
|
||||
void ITEM_MedicineUsed( int charaindex, int to_charaindex, int itemindex );
|
||||
void ITEM_SandClockDetach( int charindex , int itemindex );
|
||||
void ITEM_SandClockLogin( int charaindex );
|
||||
void ITEM_SandClockLogout( int charaindex );
|
||||
void ITEM_chantMagicAttack( int charaindex, int itemindex, int toindex, float* damage );
|
||||
void ITEM_addTitleAttach( int charaindex, int itemindex );
|
||||
void ITEM_delTitleDetach( int charaindex, int itemindex );
|
||||
void ITEM_DeleteByWatched( int myobjindex, int moveobjindex, CHAR_ACTION act,
|
||||
int x, int y, int dir, int* opt, int optlen );
|
||||
void ITEM_DeleteTimeWatched( int myobjindex, int moveobjindex, CHAR_ACTION act,
|
||||
int x, int y, int dir, int* opt, int optlen );
|
||||
void ITEM_useEffectTohelos( int charaindex, int to_charaindex, int haveitemindex);
|
||||
void ITEM_useRecovery( int charaindex, int toindex, int haveitemindex);
|
||||
|
||||
void ITEM_useStatusChange( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useMagicDef( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useParamChange( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useFieldChange( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useAttReverse( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useStatusRecovery( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useRessurect( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useMic( int charaindex, int to_charaindex, int haveitemindex );
|
||||
void ITEM_dropMic( int charaindex, int itemindex );
|
||||
void ITEM_useCaptureUp( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useRenameItem( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useRenameItem_WindowResult( int charaindex, int seqno, int select, char *data);
|
||||
void ITEM_dropDice( int charaindex, int itemindex);
|
||||
void ITEM_pickupDice( int charaindex, int itemindex);
|
||||
void ITEM_useLottery( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_useWarp( int charaindex, int toindex, int haveitemindex );
|
||||
void ITEM_petFollow( int charaindex, int toindex, int haveitemindex );
|
||||
BOOL ITEM_initLottery(ITEM_Item* itm);
|
||||
void ITEM_useSkup( int charaindex, int toindex, int haveitemindex ); // Nuke 0624
|
||||
void ITEM_useNoenemy( int charaindex, int toindex, int haveitemindex ); // Nuke 0626
|
||||
void ITEM_equipNoenemy( int charaindex, int itemindex ); // Arminius 7.2: Ra's amulet
|
||||
void ITEM_remNoenemy( int charaindex, int itemindex ); // Arminius 7.2: Ra's amulet
|
||||
BOOL ITEM_getArgument( char* argument , char* entryname , char* buf , int buflen ); // Arminius 7.2: Ra's amulet
|
||||
void ITEM_useEncounter( int charaindex, int toindex, int haveitemindex); // Arminius 7.31 cursed stone
|
||||
#ifdef _ITEM_METAMO
|
||||
void ITEM_metamo( int charaindex, int toindex, int haveitemindex );
|
||||
void ITEM_ColorMetamo( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_CharaMetamo( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_SexMetamo( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
#ifdef _ITEM_CRACKER
|
||||
void ITEM_Cracker(int charaindex,int toindex,int haveitemindex);
|
||||
#endif
|
||||
#ifdef _ITEM_ADDEXP //vincent 经验提升
|
||||
void ITEM_Addexp(int charaindex,int toindex,int haveitemindex);
|
||||
#endif
|
||||
#ifdef _ITEM_REFRESH //vincent 解除异常状态道具
|
||||
void ITEM_Refresh(int charaindex,int toindex,int haveitemindex);
|
||||
#endif
|
||||
//Terry 2001/12/21
|
||||
#ifdef _ITEM_FIRECRACKER
|
||||
void ITEM_firecracker(int charaindex,int toindex,int haveitemindex);
|
||||
#endif
|
||||
//Terry end
|
||||
|
||||
#ifdef _PET_LIMITLEVEL
|
||||
void ITEM_useOtherEditBase( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_EDITBASES
|
||||
void ITEM_useFusionEditBase( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
void ITEM_WearEquip( int charaindex, int itemindex);
|
||||
void ITEM_ReWearEquip( int charaindex, int itemindex);
|
||||
|
||||
|
||||
#ifdef _ITEM_CONSTITUTION
|
||||
void ITEM_Constitution( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _Item_ReLifeAct
|
||||
void ITEM_DIErelife( int charaindex, int itemindex, int eqw );
|
||||
#endif
|
||||
|
||||
#ifdef _Item_MoonAct
|
||||
void ITEM_randEnemyEquipOne( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_randEnemyEquip( int charaindex, int itemindex);
|
||||
void ITEM_RerandEnemyEquip( int charaindex, int itemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_ORNAMENTS
|
||||
void ITEM_PutOrnaments( int charaindex, int itemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _CHIKULA_STONE
|
||||
void ITEM_ChikulaStone( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _SUIT_ITEM
|
||||
void ITEM_suitEquip( int charaindex, int itemindex);
|
||||
void ITEM_ResuitEquip( int charaindex, int itemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _EQUIT_DEFMAGIC
|
||||
void ITEM_MagicEquitWear( int charaindex, int itemindex);
|
||||
void ITEM_MagicEquitReWear( int charaindex, int itemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _EQUIT_RESIST
|
||||
void ITEM_MagicResist( int charaindex, int itemindex);
|
||||
void ITEM_MagicReResist( int charaindex, int itemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _MAGIC_RESIST_EQUIT // WON ADD 职业抗性装备
|
||||
void ITEM_P_MagicEquitWear( int charaindex, int itemindex );
|
||||
void ITEM_P_MagicEquitReWear( int charaindex, int itemindex );
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _Item_DeathAct
|
||||
void ITEM_UseDeathCounter( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _DEATH_CONTENDWATCH
|
||||
void ITEM_useWatchBattle( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _FEV_ADD_NEW_ITEM // FEV ADD 增加复活守精
|
||||
void ITEM_ResAndDef( int charaindex, int toindex, int haveitemindex );
|
||||
#endif
|
||||
|
||||
#ifdef _CHRISTMAS_REDSOCKS
|
||||
void ITEM_useMaxRedSocks( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _CHRISTMAS_REDSOCKS_NEW
|
||||
void ITEM_useMaxRedSocksNew( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_CANNEDFOOD
|
||||
void ITEM_useSkillCanned( int charaindex, int toindex, int itemNo);
|
||||
#endif
|
||||
|
||||
#ifdef _NEW_RIDEPETS
|
||||
void ITEM_useLearnRideCode( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_WARP_FIX_BI
|
||||
void recoverbi(int index);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_TIME_LIMIT
|
||||
void ITEM_TimeLimit( int charaindex);
|
||||
#endif
|
||||
|
||||
#ifdef _USEWARP_FORNUM
|
||||
void ITEM_useWarpForNum( int charaindex, int toindex, int haveitemindex );
|
||||
#endif
|
||||
|
||||
#ifdef _IMPRECATE_ITEM
|
||||
void ITEM_useImprecate( int charaindex, int toNo, int haveitemindex );
|
||||
#endif
|
||||
#ifdef _BLACK_MARKET
|
||||
void ITEM_BM_Exchange( int charaindex, int iindex);
|
||||
#endif
|
||||
|
||||
#ifdef _THROWITEM_ITEMS
|
||||
void ITEM_ThrowItemBox( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_WATERWORDSTATUS
|
||||
void ITEM_WaterWordStatus( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_LOVERPARTY
|
||||
void ITEM_LoverSelectUser( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_MAGICRECOVERY
|
||||
void ITEM_useMRecovery( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_USEMAGIC
|
||||
void ITEM_useMagic( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_CANNEDFOOD
|
||||
void ITEM_usePetSkillCanned_WindowResult( int charaindex, int seqno, int select, char *data);
|
||||
#endif
|
||||
|
||||
void ITEM_AddPRSkillPoint(int charaindex,int toindex,int haveitemindex);
|
||||
void ITEM_AddPRSkillPercent( int charaindex,int toindex,int haveitemindex);
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
void ITEM_AngelToken( int charaindex, int toindex, int haveitemindex );
|
||||
void ITEM_HeroToken( int charaindex, int toindex, int haveitemindex );
|
||||
#endif
|
||||
#ifdef _HALLOWEEN_EFFECT
|
||||
void ITEM_MapEffect(int charaindex,int toindex,int haveitemindex);
|
||||
#endif
|
||||
void ITEM_changePetOwner( int charaindex, int toindex, int haveitemindex);
|
||||
|
||||
#ifdef _CONTRACT
|
||||
void ITEM_contract( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _TIME_TICKET
|
||||
void ITEM_timeticket( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_SETLOVER
|
||||
void ITEM_SetLoverUser( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_LoverWarp( int charaindex, int toindex, int haveitemindex);
|
||||
void ITEM_LoverUnmarry( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _GM_ITEM
|
||||
void ITEM_GMFUNCTION( int charaindex, int toindex, int haveitemindex);
|
||||
#endif
|
||||
|
||||
enum{
|
||||
BD_KIND_HP,
|
||||
BD_KIND_MP,
|
||||
BD_KIND_CHARM,
|
||||
BD_KIND_AI,
|
||||
BD_KIND_CURSE,
|
||||
BD_KIND_BESTOW,
|
||||
BD_KIND_WISHES,
|
||||
#ifdef _CHANGEITEMUSE // Syu ADD 调整战斗中使用料理设定
|
||||
BD_KIND_HP_MP,
|
||||
#endif
|
||||
#ifdef _ITEM_UNBECOMEPIG
|
||||
BD_KIND_UNBECOMEPIG,
|
||||
#endif
|
||||
#ifdef _ITEM_PROPERTY
|
||||
BD_KIND_PROPERTY,
|
||||
#endif
|
||||
BD_KIND_END
|
||||
};
|
||||
|
||||
#endif
|
22
gmsv/include/item_gen.h
Normal file
22
gmsv/include/item_gen.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef __ITEM_GEN_H__
|
||||
#define __ITEM_GEN_H__
|
||||
|
||||
|
||||
int ITEM_initItemIngCache( void );
|
||||
int ITEM_initItemAtom( char *fn );
|
||||
int ITEM_initRandTable( void);
|
||||
int ITEM_mergeItem( int charaindex, ITEM_Item *items, int num , int money, int petid, int searchtable, int petindex, int alchemist);
|
||||
int ITEM_canDigest( ITEM_Item *t );
|
||||
int ITEM_mergeItem_merge( int charaindex,int petid, char *data, int petindex, int alchemist);
|
||||
|
||||
#ifdef _ITEM_INSLAY
|
||||
int PETSKILL_ITEM_inslay( int charindex, int inslayindex, int itemindex);
|
||||
#endif
|
||||
|
||||
#ifdef _PETSKILL_FIXITEM
|
||||
int PETSKILL_ITEM_FixItem( int charindex, int fixindex, int *itemindex);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
52
gmsv/include/item_trade.h
Normal file
52
gmsv/include/item_trade.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef __MAPTRADE_H__
|
||||
#define __MAPTRADE_H__
|
||||
#include "char.h"
|
||||
|
||||
typedef struct tagMapTrade {
|
||||
int masterindex;
|
||||
int x;
|
||||
int y;
|
||||
int Ttime;
|
||||
int Goodindex;
|
||||
char Goodname[256];
|
||||
}MapTrade;
|
||||
|
||||
#define TRADEMAP 1090
|
||||
#define TRADEXSIZE 4
|
||||
#define TRADEYSIZE 4
|
||||
|
||||
BOOL CHECKMAP_TRADE( int charindex, int floor, int x, int y);
|
||||
int CHECKMAP_TRADEXY( int charindex, int floor, int x, int y);
|
||||
BOOL MAP_TRADEDROP( int charindex, int itemindex,int floor, int x, int y);
|
||||
BOOL MAP_TRADEPICKUP( int charindex, int itemindex, int floor, int x, int y, int flg);
|
||||
|
||||
void InitMapTradeData( int index, int Stime);
|
||||
|
||||
int TRADE_getMasterInt( int index);
|
||||
int TRADE_getTimeInt( int index);
|
||||
BOOL TRADE_setMasterInt( int index, int Num);
|
||||
BOOL TRADE_setTimeInt( int index, int Num);
|
||||
int TRADE_AddMasrerTrade( int toindex); //É趨̯λÖ÷ÈË
|
||||
int TRADE_getMaxNumInt();
|
||||
void MAPTRADE_CLEANGOLD( int floor, int num);
|
||||
BOOL MAPTRADE_CHECKMASTERIN( int masterindex , int toindex, int num);
|
||||
BOOL MAPTRADE_CHECKMAPFULL(int fl, int x, int y);
|
||||
BOOL MAP_TRADEPETDROP( int charindex, int petindex,int floor, int x, int y);
|
||||
int MAPTRADE_getItemSpace( int meindex, int itemindex);
|
||||
int MAPTRADE_getPetSpace( int masterindex, int petindex);
|
||||
|
||||
int MAPTRADE_getSellIndex( int index);
|
||||
BOOL MAPTRADE_setSellIndex( int index, int num);
|
||||
void MAPTRADE_setCharSellName( int index, char *buf);
|
||||
char* MAPTRADE_getCharSellName( int index );
|
||||
|
||||
#define TRADESTARTNUM 1
|
||||
#define TRADETYPE_SELL (1<<3)
|
||||
#define TRADEITEMID 0
|
||||
#define TRADEPETID 0
|
||||
#define TRADEPETUPLV ((1<<24)+(1<<16)+(1<<8)+1)
|
||||
#define TRADEPETTYPE (1<<4)
|
||||
#define TRADEITEMTYPE (1<<8)
|
||||
#endif
|
||||
|
||||
|
17
gmsv/include/levelup.h
Normal file
17
gmsv/include/levelup.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef _LEVELUP_H
|
||||
#define _LEVELUP_H
|
||||
|
||||
int GetEnemyExp( int level );
|
||||
|
||||
int BATTLE_GetLevelExp(
|
||||
int charaindex,
|
||||
int level
|
||||
);
|
||||
|
||||
int BATTLE_LevelUpCheck(
|
||||
int charaindex
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
22
gmsv/include/link.h
Normal file
22
gmsv/include/link.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef __LINK_H__
|
||||
#define __LINK_H__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/*
|
||||
* 伉旦玄厌瞻毛烂聒允月 [
|
||||
* 仇及伉旦玄反val反 读卞反窒手仄卅中[勾引曰禾奶件正□及戊疋□及心
|
||||
* 垫丹[
|
||||
*/
|
||||
typedef struct tagNode
|
||||
{
|
||||
struct tagNode* next; /*戚及用□玉尺及禾奶件正□*/
|
||||
char* val; /*忡 允月 侬 */
|
||||
int size; /*val及扔奶术*/
|
||||
}Node;
|
||||
|
||||
BOOL Nodeappendhead( Node** top , Node* add );
|
||||
BOOL Nodeappendtail( Node** top , Node* add );
|
||||
BOOL Noderemovehead( Node** top , Node* ret);
|
||||
BOOL Noderemovetail( Node** top , Node* ret);
|
||||
#endif
|
353
gmsv/include/log.h
Normal file
353
gmsv/include/log.h
Normal file
@ -0,0 +1,353 @@
|
||||
#ifndef __LOG_H__
|
||||
#define __LOG_H__
|
||||
#include <time.h>
|
||||
typedef enum
|
||||
{
|
||||
LOG_TALK,
|
||||
LOG_PROC,
|
||||
LOG_ITEM,
|
||||
LOG_STONE,
|
||||
LOG_PET,
|
||||
LOG_TENSEI,
|
||||
LOG_KILL, //ttom 12/26/2000 kill the pet & items
|
||||
LOG_TRADE, // CoolFish: 2001/4/19
|
||||
LOG_HACK, // Arminius 2001/6/14
|
||||
LOG_SPEED, // Nuke 0626
|
||||
LOG_FMPOP, // CoolFish: 2001/9/12
|
||||
LOG_FAMILY, // Robin 10/02
|
||||
LOG_GM, // Shan
|
||||
#ifdef _SERVICE
|
||||
LOG_SERVICE, // Terry 2001/09/28
|
||||
#endif
|
||||
#ifdef _GAMBLE_ROULETTE
|
||||
LOG_GAMBLE,
|
||||
#endif
|
||||
#ifdef _TEST_PETCREATE
|
||||
LOG_CREATPET,
|
||||
LOG_AVGCREATPET,
|
||||
#endif
|
||||
|
||||
LOG_LOGIN,
|
||||
PETTRANS,
|
||||
//Syu 增加庄园战胜负Log
|
||||
LOG_FMPKRESULT,
|
||||
|
||||
// Syu ADD 新增家族个人银行存取Log (不含家族银行)
|
||||
LOG_BANKSTONELOG,
|
||||
|
||||
LOG_ACMESS,
|
||||
LOG_PKCONTEND,
|
||||
#ifdef _STREET_VENDOR
|
||||
LOG_STREET_VENDOR,
|
||||
#endif
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
LOG_ANGEL,
|
||||
#endif
|
||||
|
||||
#ifdef _LOG_OTHER
|
||||
LOG_OTHER,
|
||||
#endif
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
LOG_FMPK_GETMONEY,
|
||||
LOG_FM_FAME_SHOP,
|
||||
#endif
|
||||
|
||||
LOG_TYPE_NUM,
|
||||
}LOG_TYPE;
|
||||
|
||||
void closeAllLogFile( void );
|
||||
BOOL initLog( char* filename );
|
||||
void printl( LOG_TYPE logtype, char* format , ... );
|
||||
|
||||
|
||||
void LogAcMess( int fd, char *type, char *mess );
|
||||
|
||||
void LogItem(
|
||||
char *CharName, /* 平乓仿弁正 */
|
||||
char *CharID,
|
||||
int ItemNo, /* 失奶 丞 寞 */
|
||||
char *Key, /* 平□伐□玉 */
|
||||
int floor, /* 甄 */
|
||||
int x,
|
||||
int y,
|
||||
char *uniquecode, // shan 2001/12/14
|
||||
char *itemname, int itemID
|
||||
);
|
||||
void LogPkContend( char *teamname1, char *teamname2,
|
||||
int floor, int x, int y, int flg );
|
||||
|
||||
void LogPetTrans(
|
||||
char *cdkey, char *uniwuecde, char *uniwuecde2, char *CharName, int floor, int x, int y,
|
||||
int petID1, char *PetName1, int petLV, int petrank, int vital1, int str1, int tgh1, int dex1, int total1,
|
||||
int petID2, char *PetName2, int vital2, int str2, int tgh2, int dex2, int total2,
|
||||
int work0, int work1, int work2, int work3, int ans, int trans
|
||||
);
|
||||
|
||||
void LogPet(
|
||||
char *CharName, /* 平乓仿弁正 */
|
||||
char *CharID,
|
||||
char *PetName,
|
||||
int PetLv,
|
||||
char *Key, /* 平□伐□玉 */
|
||||
int floor, /* 甄 */
|
||||
int x,
|
||||
int y,
|
||||
char *uniquecode // shan 2001/12/14
|
||||
);
|
||||
|
||||
#ifdef _STREET_VENDOR
|
||||
void LogStreetVendor(
|
||||
char *SellName,
|
||||
char *SellID,
|
||||
char *BuyName,
|
||||
char *BuyID,
|
||||
char *ItemPetName,
|
||||
int PetLv, //若是道具此值为 -1
|
||||
int iPrice,
|
||||
char *Key,
|
||||
int Sfloor,
|
||||
int Sx,
|
||||
int Sy,
|
||||
int Bfloor,
|
||||
int Bx,
|
||||
int By,
|
||||
char *uniquecode
|
||||
);
|
||||
#endif
|
||||
|
||||
void LogTensei(
|
||||
char *CharName, /* 平乓仿弁正 */
|
||||
char *CharID,
|
||||
char *Key, /* 平□伐□玉 */
|
||||
int level, //伊矛伙
|
||||
int transNum, //鳖戏荚醒
|
||||
int quest, //弁巨旦玄醒
|
||||
int home, //请褥哗
|
||||
int item, // 笛失奶 丞 井曰醒
|
||||
int pet, // 笛矢永玄 井曰醒
|
||||
int vital, // 祭蟆Vital
|
||||
int b_vital, // 祭 vital
|
||||
int str, // 祭蟆str
|
||||
int b_str, // 祭 str
|
||||
int tgh, // 祭蟆
|
||||
int b_tgh, // 祭
|
||||
int dex, // 祭蟆
|
||||
int b_dex // 祭
|
||||
);
|
||||
// Syu ADD 新增家族个人银行存取Log (不含家族银行)
|
||||
void LogFamilyBankStone(
|
||||
char *CharName,
|
||||
char *CharId,
|
||||
int Gold,
|
||||
int MyGold,
|
||||
char *Key,
|
||||
int floor,
|
||||
int x,
|
||||
int y,
|
||||
int banksum
|
||||
);
|
||||
|
||||
void LogStone(
|
||||
int TotalGold,
|
||||
char *CharName, /* 平乓仿弁正 */
|
||||
char *CharId, /* 交□扒□ID */
|
||||
int Gold, /* 嗯喊 */
|
||||
int MyGold,
|
||||
char *Key, /* 平□伐□玉 */
|
||||
int floor, /* 甄 */
|
||||
int x,
|
||||
int y
|
||||
);
|
||||
|
||||
void LogTalk(
|
||||
char *CharName, /* 平乓仿弁正 */
|
||||
char *CharID,
|
||||
int floor, /* 甄 */
|
||||
int x,
|
||||
int y,
|
||||
char *message
|
||||
);
|
||||
|
||||
// Terry 2001/09/28
|
||||
#ifdef _SERVICE
|
||||
void LogService(
|
||||
char *CharName, //角色名称
|
||||
char *CharID, //玩家ID
|
||||
int itemid, //物品ID
|
||||
char *Key, //说明
|
||||
int floor,
|
||||
int x,
|
||||
int y
|
||||
);
|
||||
#endif
|
||||
//ttom 12/26/2000 kill pet & items
|
||||
void LogKill(
|
||||
char *CharName,
|
||||
char *CharId,
|
||||
char *CharPet_Item
|
||||
);
|
||||
//ttom
|
||||
|
||||
// CoolFish: 2001/4/19
|
||||
void LogTrade(char *message);
|
||||
// CoolFish: 2001/9/12
|
||||
void LogFMPOP(char *message);
|
||||
|
||||
// Arminius 2001/6/14
|
||||
enum
|
||||
{
|
||||
HACK_NOTHING,
|
||||
HACK_GETFUNCFAIL,
|
||||
HACK_NOTDISPATCHED,
|
||||
HACK_CHECKSUMERROR,
|
||||
HACK_HP,
|
||||
HACK_TYPE_NUM,
|
||||
}HACK_TYPE;
|
||||
void logHack(int fd, int errcode);
|
||||
// Nuke 0626
|
||||
void logSpeed(int fd);
|
||||
|
||||
void closeAllLogFile( void );
|
||||
int openAllLogFile( void );
|
||||
|
||||
// Robin 10/02
|
||||
void LogFamily(
|
||||
char *FMName,
|
||||
int fmindex,
|
||||
char *charName,
|
||||
char *charId,
|
||||
char *keyWord,
|
||||
char *data
|
||||
);
|
||||
|
||||
// Shan 11/02
|
||||
void LogGM(
|
||||
char *CharName, //角色名称
|
||||
char *CharID, //玩家ID
|
||||
char *Message, //指令内容
|
||||
int floor,
|
||||
int x,
|
||||
int y
|
||||
);
|
||||
|
||||
void LogLogin(
|
||||
char *CharID, //玩家ID
|
||||
char *CharName, //角色名称
|
||||
int saveIndex,
|
||||
char *ipadress
|
||||
);
|
||||
|
||||
#ifdef _TEST_PETCREATE
|
||||
void LogCreatPet(
|
||||
char *PetName, int petid, int lv,int hp, int char_vital, int char_str, int char_tgh, int char_dex,
|
||||
int vital, int str, int tgh, int dex, int fixstr, int fixtgh, int fixdex,
|
||||
int lvup, int petrank, int flg
|
||||
);
|
||||
#endif
|
||||
|
||||
void LogCreatFUPet(
|
||||
char *PetName, int petid, int lv, int hp,
|
||||
int vital, int str, int tgh, int dex,
|
||||
int fixstr, int fixtgh, int fixdex, int trans, int flg);
|
||||
|
||||
#ifdef _GAMBLE_ROULETTE
|
||||
|
||||
void LogGamble(
|
||||
char *CharName, //角色名称
|
||||
char *CharID, //玩家ID
|
||||
char *Key, //说明
|
||||
int floor,
|
||||
int x,
|
||||
int y,
|
||||
int player_stone, //所拥有金钱
|
||||
int Gamble_stone, //下注本金
|
||||
int get_stone, //获得
|
||||
int Gamble_num,
|
||||
int flg //flg = 1 玩家 2 庄家
|
||||
);
|
||||
#endif
|
||||
|
||||
void LogBankStone(
|
||||
char *CharName, /* 平乓仿弁正 */
|
||||
char *CharId, /* 交□扒□ID */
|
||||
int meindex,
|
||||
int Gold, /* 嗯喊 */
|
||||
char *Key, /* 平□伐□玉 */
|
||||
int floor, /* 甄 */
|
||||
int x,
|
||||
int y,
|
||||
int my_gold,
|
||||
int my_personagold
|
||||
);
|
||||
|
||||
//Syu 增加庄园战胜负Log
|
||||
void Logfmpk(
|
||||
char *winner, int winnerindex, int num1,
|
||||
char *loser, int loserindex, int num2, char *date, char *buf1, char *buf2, int flg);
|
||||
|
||||
#ifdef _NEW_MANOR_LAW
|
||||
void LogFMPKGetMomey(
|
||||
char *szFMName,
|
||||
char *szID,
|
||||
char *szCharName,
|
||||
int iMomentum,
|
||||
int iGetMoney,
|
||||
int iDest
|
||||
);
|
||||
void LogFMFameShop(
|
||||
char *szFMName,
|
||||
char *szID,
|
||||
char *szCharName,
|
||||
int iFame,
|
||||
int iCostFame
|
||||
);
|
||||
#endif
|
||||
|
||||
void backupAllLogFile( struct tm *ptm );
|
||||
|
||||
|
||||
#ifdef _TEST_PETCREATE
|
||||
void backupTempLogFile( char *buf, char *entryname, int Num);
|
||||
#endif
|
||||
|
||||
void LogPetPointChange(
|
||||
char * CharName, char *CharID, char *PetName, int petindex, int errtype,
|
||||
int PetLv, char *Key,int floor, int x, int y);
|
||||
|
||||
void LogPetFeed(
|
||||
char * CharName, char *CharID, char *PetName, int petindex,
|
||||
int PetLv, char *Key,int floor, int x, int y, char *ucode);
|
||||
|
||||
#ifdef _ANGEL_SUMMON
|
||||
void LogAngel( char *msg);
|
||||
#endif
|
||||
|
||||
void warplog_to_file( void );
|
||||
void warplog_from_file( void );
|
||||
|
||||
typedef struct {
|
||||
int floor;
|
||||
int incount;
|
||||
int outcount;
|
||||
}tagWarplog;
|
||||
#define MAXMAPNUM 700
|
||||
extern tagWarplog warplog[MAXMAPNUM];
|
||||
|
||||
typedef struct {
|
||||
int floor1;
|
||||
int floor2;
|
||||
int count;
|
||||
}tagWarpCount;
|
||||
#define MAXMAPLINK 1000
|
||||
extern tagWarpCount warpCount[MAXMAPLINK];
|
||||
|
||||
#ifdef _LOG_OTHER
|
||||
void LogOther(
|
||||
char *CharName,
|
||||
char *CharID,
|
||||
char *message
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif
|
375
gmsv/include/lssproto_serv.h
Normal file
375
gmsv/include/lssproto_serv.h
Normal file
@ -0,0 +1,375 @@
|
||||
#ifndef _PROTOCOL_H_
|
||||
#define _PROTOCOL_H_
|
||||
|
||||
#include "lssproto_util.h" // for StoneAge
|
||||
|
||||
#ifdef MAXLSRPCARGS
|
||||
#if ( MAXLSRPCARGS <= ( 13 + 1 ) )
|
||||
#undef MAXLSRPCARGS
|
||||
#define MAXLSRPCARGS ( 13 + 1 )
|
||||
#endif
|
||||
#else
|
||||
#define MAXLSRPCARGS ( 13 + 1 )
|
||||
#endif
|
||||
|
||||
int lssproto_InitServer(int (*writefunc)(int,char*,int) , int worksiz );
|
||||
void lssproto_SetServerLogFiles( char *read , char *write );
|
||||
void lssproto_CleanupServer( void );
|
||||
int lssproto_ServerDispatchMessage(int fd, char *encoded);
|
||||
|
||||
#define SEPARATOR ";"
|
||||
|
||||
#define LSSPROTO_W_RECV 0
|
||||
#define LSSPROTO_W2_RECV 1
|
||||
#define LSSPROTO_XYD_SEND 2
|
||||
#define LSSPROTO_EV_RECV 3
|
||||
#define LSSPROTO_EV_SEND 4
|
||||
#define LSSPROTO_EN_RECV 5
|
||||
#define LSSPROTO_DU_RECV 6
|
||||
#define LSSPROTO_EN_SEND 7
|
||||
#define LSSPROTO_EO_RECV 8
|
||||
#define LSSPROTO_BU_RECV 9
|
||||
#define LSSPROTO_JB_RECV 10
|
||||
#define LSSPROTO_LB_RECV 11
|
||||
#define LSSPROTO_RS_SEND 12
|
||||
#define LSSPROTO_RD_SEND 13
|
||||
#define LSSPROTO_B_RECV 14
|
||||
#define LSSPROTO_B_SEND 15
|
||||
#define LSSPROTO_SKD_RECV 16
|
||||
#define LSSPROTO_ID_RECV 17
|
||||
#define LSSPROTO_PI_RECV 18
|
||||
#define LSSPROTO_DI_RECV 19
|
||||
#define LSSPROTO_DG_RECV 20
|
||||
#define LSSPROTO_DP_RECV 21
|
||||
#define LSSPROTO_I_SEND 22
|
||||
#define LSSPROTO_MI_RECV 23
|
||||
#define LSSPROTO_SI_SEND 24
|
||||
#define LSSPROTO_MSG_RECV 25
|
||||
#define LSSPROTO_MSG_SEND 26
|
||||
#define LSSPROTO_PMSG_RECV 27
|
||||
#define LSSPROTO_PME_SEND 28
|
||||
#define LSSPROTO_AB_RECV 29
|
||||
#define LSSPROTO_AB_SEND 30
|
||||
#define LSSPROTO_ABI_SEND 31
|
||||
#define LSSPROTO_DAB_RECV 32
|
||||
#define LSSPROTO_AAB_RECV 33
|
||||
#define LSSPROTO_L_RECV 34
|
||||
#define LSSPROTO_TK_RECV 35
|
||||
#define LSSPROTO_TK_SEND 36
|
||||
#define LSSPROTO_MC_SEND 37
|
||||
#define LSSPROTO_M_RECV 38
|
||||
#define LSSPROTO_M_SEND 39
|
||||
#define LSSPROTO_C_RECV 40
|
||||
#define LSSPROTO_C_SEND 41
|
||||
#define LSSPROTO_CA_SEND 42
|
||||
#define LSSPROTO_CD_SEND 43
|
||||
#define LSSPROTO_R_SEND 44
|
||||
#define LSSPROTO_S_RECV 45
|
||||
#define LSSPROTO_S_SEND 46
|
||||
#define LSSPROTO_D_SEND 47
|
||||
#define LSSPROTO_FS_RECV 48
|
||||
#define LSSPROTO_FS_SEND 49
|
||||
#define LSSPROTO_HL_RECV 50
|
||||
#define LSSPROTO_HL_SEND 51
|
||||
#define LSSPROTO_PR_RECV 52
|
||||
#define LSSPROTO_PR_SEND 53
|
||||
#define LSSPROTO_KS_RECV 54
|
||||
#define LSSPROTO_KS_SEND 55
|
||||
#define LSSPROTO_AC_RECV 56
|
||||
#define LSSPROTO_MU_RECV 57
|
||||
#define LSSPROTO_PS_RECV 58
|
||||
#define LSSPROTO_PS_SEND 59
|
||||
#define LSSPROTO_ST_RECV 60
|
||||
#define LSSPROTO_DT_RECV 61
|
||||
#define LSSPROTO_FT_RECV 62
|
||||
#define LSSPROTO_SKUP_SEND 63
|
||||
#define LSSPROTO_SKUP_RECV 64
|
||||
#define LSSPROTO_KN_RECV 65
|
||||
#define LSSPROTO_WN_SEND 66
|
||||
#define LSSPROTO_WN_RECV 67
|
||||
#define LSSPROTO_EF_SEND 68
|
||||
#define LSSPROTO_SE_SEND 69
|
||||
#define LSSPROTO_SP_RECV 70
|
||||
#define LSSPROTO_CLIENTLOGIN_RECV 71
|
||||
#define LSSPROTO_CLIENTLOGIN_SEND 72
|
||||
#define LSSPROTO_CREATENEWCHAR_RECV 73
|
||||
#define LSSPROTO_CREATENEWCHAR_SEND 74
|
||||
#define LSSPROTO_CHARDELETE_RECV 75
|
||||
#define LSSPROTO_CHARDELETE_SEND 76
|
||||
#define LSSPROTO_CHARLOGIN_RECV 77
|
||||
#define LSSPROTO_CHARLOGIN_SEND 78
|
||||
#define LSSPROTO_CHARLIST_RECV 79
|
||||
#define LSSPROTO_CHARLIST_SEND 80
|
||||
#define LSSPROTO_CHARLOGOUT_RECV 81
|
||||
#define LSSPROTO_CHARLOGOUT_SEND 82
|
||||
#define LSSPROTO_PROCGET_RECV 83
|
||||
#define LSSPROTO_PROCGET_SEND 84
|
||||
#define LSSPROTO_PLAYERNUMGET_RECV 85
|
||||
#define LSSPROTO_PLAYERNUMGET_SEND 86
|
||||
#define LSSPROTO_ECHO_RECV 87
|
||||
#define LSSPROTO_ECHO_SEND 88
|
||||
#define LSSPROTO_SHUTDOWN_RECV 89
|
||||
#define LSSPROTO_NU_SEND 90
|
||||
#define LSSPROTO_TD_RECV 91
|
||||
#define LSSPROTO_TD_SEND 92
|
||||
#define LSSPROTO_FM_SEND 93
|
||||
#define LSSPROTO_FM_RECV 94
|
||||
#define LSSPROTO_WO_SEND 95
|
||||
#define LSSPROTO_PETST_RECV 96
|
||||
#define LSSPROTO_BM_RECV 97 // _BLACK_MARKET
|
||||
|
||||
#ifdef _MIND_ICON
|
||||
#define LSSPROTO_MA_RECV 98
|
||||
#endif
|
||||
|
||||
#ifdef _FIX_DEL_MAP // WON ADD 玩家抽地图送监狱
|
||||
#define LSSPROTO_DM_RECV 99
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_CRACKER
|
||||
#define LSSPROTO_IC_SEND 100
|
||||
#endif
|
||||
|
||||
#ifdef _MAGIC_NOCAST // 精灵:沉默
|
||||
#define LSSPROTO_NC_SEND 101
|
||||
#endif
|
||||
#ifdef _CHECK_GAMESPEED
|
||||
#define LSSPROTO_CS_RECV 103 //加速探针
|
||||
#define LSSPROTO_CS_SEND 104 //加速探针
|
||||
#endif
|
||||
|
||||
#ifdef _TEAM_KICKPARTY
|
||||
#define LSSPROTO_KTEAM_RECV 106
|
||||
#endif
|
||||
#ifdef _PETS_SELECTCON
|
||||
#define LSSPROTO_PETST_SEND 107
|
||||
#endif
|
||||
#ifdef _NEWREQUESTPROTOCOL // (不可开) Syu ADD 新增Protocol要求细项
|
||||
#define LSSPROTO_RESIST_RECV 108
|
||||
#define LSSPROTO_RESIST_SEND 109
|
||||
#endif
|
||||
#ifdef _OUTOFBATTLESKILL // (不可开) Syu ADD 非战斗时技能Protocol
|
||||
#define LSSPROTO_BATTLESKILL_RECV 110
|
||||
#define LSSPROTO_BATTLESKILL_SEND 111
|
||||
#endif
|
||||
#ifdef _CHATROOMPROTOCOL // (不可开) Syu ADD 聊天室频道
|
||||
#define LSSPROTO_CHATROOM_RECV 112
|
||||
#define LSSPROTO_CHATROOM_SEND 113
|
||||
#endif
|
||||
|
||||
#define LSSPROTO_SPET_RECV 114 // Robin 待机宠
|
||||
#define LSSPROTO_SPET_SEND 115
|
||||
|
||||
#ifdef _STREET_VENDOR
|
||||
#define LSSPROTO_STREET_VENDOR_RECV 116 // 摆摊功能
|
||||
#define LSSPROTO_STREET_VENDOR_SEND 117
|
||||
#endif
|
||||
|
||||
#ifdef _RIGHTCLICK
|
||||
#define LSSPROTO_RCLICK_RECV 118
|
||||
#define LSSPROTO_RCLICK_SEND 119
|
||||
#endif
|
||||
|
||||
#ifdef _JOBDAILY
|
||||
#define LSSPROTO_JOBDAILY_SEND 120 // CYG 任务日志功能
|
||||
#define LSSPROTO_JOBDAILY_RECV 121
|
||||
#endif
|
||||
|
||||
#ifdef _TEACHER_SYSTEM
|
||||
#define LSSPROTO_TEACHER_SYSTEM_RECV 122 // 导师功能
|
||||
#define LSSPROTO_TEACHER_SYSTEM_SEND 123
|
||||
#endif
|
||||
|
||||
#ifdef _ADD_STATUS_2
|
||||
#define LSSPROTO_S2_RECV 124
|
||||
#define LSSPROTO_S2_SEND 125
|
||||
#endif
|
||||
|
||||
void lssproto_W_recv(int fd,int x,int y,char* direction);
|
||||
void lssproto_W2_recv(int fd,int x,int y,char* direction);
|
||||
void lssproto_XYD_send(int fd,int x,int y,int dir);
|
||||
void lssproto_EV_recv(int fd,int event,int seqno,int x,int y,int dir);
|
||||
void lssproto_EV_send(int fd,int seqno,int result);
|
||||
void lssproto_EN_recv(int fd,int x,int y);
|
||||
void lssproto_DU_recv(int fd,int x,int y);
|
||||
void lssproto_EN_send(int fd,int result,int field);
|
||||
void lssproto_EO_recv(int fd,int dummy);
|
||||
void lssproto_BU_recv(int fd,int dummy);
|
||||
void lssproto_JB_recv(int fd,int x,int y);
|
||||
void lssproto_LB_recv(int fd,int x,int y);
|
||||
void lssproto_RS_send(int fd,char* data);
|
||||
void lssproto_RD_send(int fd,char* data);
|
||||
void lssproto_B_recv(int fd,char* command);
|
||||
void lssproto_B_send(int fd,char* command);
|
||||
void lssproto_SKD_recv(int fd,int dir,int index);
|
||||
void lssproto_ID_recv(int fd,int x,int y,int haveitemindex,int toindex);
|
||||
void lssproto_PI_recv(int fd,int x,int y,int dir);
|
||||
void lssproto_DI_recv(int fd,int x,int y,int itemindex);
|
||||
void lssproto_DG_recv(int fd,int x,int y,int amount);
|
||||
void lssproto_DP_recv(int fd,int x,int y,int petindex);
|
||||
void lssproto_I_send(int fd,char* data);
|
||||
void lssproto_MI_recv(int fd,int fromindex,int toindex);
|
||||
void lssproto_SI_send(int fd,int fromindex,int toindex);
|
||||
void lssproto_MSG_recv(int fd,int index,char* message,int color);
|
||||
void lssproto_MSG_send(int fd,int aindex,char* text,int color);
|
||||
void lssproto_PMSG_recv(int fd,int index,int petindex,int itemindex,char* message,int color);
|
||||
void lssproto_PME_send(int fd,int objindex,int graphicsno,int x,int y,int dir,int flg,int no,char* cdata);
|
||||
void lssproto_AB_recv(int fd);
|
||||
void lssproto_AB_send(int fd,char* data);
|
||||
void lssproto_ABI_send(int fd,int num,char* data);
|
||||
void lssproto_DAB_recv(int fd,int index);
|
||||
void lssproto_AAB_recv(int fd,int x,int y);
|
||||
void lssproto_L_recv(int fd,int dir);
|
||||
void lssproto_TK_recv(int fd,int x,int y,char* message,int color,int area);
|
||||
void lssproto_TK_send(int fd,int index,char* message,int color);
|
||||
void lssproto_MC_send(int fd,int fl,int x1,int y1,int x2,int y2,int tilesum,int objsum,int eventsum,char* data);
|
||||
void lssproto_M_recv(int fd,int fl,int x1,int y1,int x2,int y2);
|
||||
void lssproto_M_send(int fd,int fl,int x1,int y1,int x2,int y2,char* data);
|
||||
void lssproto_C_recv(int fd,int index);
|
||||
void lssproto_C_send(int fd,char* data);
|
||||
void lssproto_CA_send(int fd,char* data);
|
||||
void lssproto_CD_send(int fd,char* data);
|
||||
void lssproto_R_send(int fd,char* data);
|
||||
void lssproto_S_recv(int fd,char* category);
|
||||
void lssproto_S_send(int fd,char* data);
|
||||
void lssproto_D_send(int fd,int category,int dx,int dy,char* data);
|
||||
void lssproto_FS_recv(int fd,int flg);
|
||||
void lssproto_FS_send(int fd,int flg);
|
||||
void lssproto_HL_recv(int fd,int flg);
|
||||
void lssproto_HL_send(int fd,int flg);
|
||||
void lssproto_PR_recv(int fd,int x,int y,int request);
|
||||
void lssproto_PR_send(int fd,int request,int result);
|
||||
void lssproto_KS_recv(int fd,int petarray);
|
||||
void lssproto_KS_send(int fd,int petarray,int result);
|
||||
|
||||
#ifdef _STANDBYPET
|
||||
void lssproto_SPET_recv(int fd,int standbypet);
|
||||
void lssproto_SPET_send(int fd,int standbypet,int result);
|
||||
#endif
|
||||
|
||||
void lssproto_AC_recv(int fd,int x,int y,int actionno);
|
||||
void lssproto_MU_recv(int fd,int x,int y,int array,int toindex);
|
||||
void lssproto_PS_recv(int fd,int havepetindex,int havepetskill,int toindex,char* data);
|
||||
void lssproto_PS_send(int fd,int result,int havepetindex,int havepetskill,int toindex);
|
||||
void lssproto_ST_recv(int fd,int titleindex);
|
||||
void lssproto_DT_recv(int fd,int titleindex);
|
||||
void lssproto_FT_recv(int fd,char* data);
|
||||
void lssproto_SKUP_send(int fd,int point);
|
||||
void lssproto_SKUP_recv(int fd,int skillid);
|
||||
void lssproto_KN_recv(int fd,int havepetindex,char* data);
|
||||
void lssproto_WN_send(int fd,int windowtype,int buttontype,int seqno,int objindex,char* data);
|
||||
void lssproto_WN_recv(int fd,int x,int y,int seqno,int objindex,int select,char* data);
|
||||
void lssproto_EF_send(int fd,int effect,int level,char* option);
|
||||
void lssproto_SE_send(int fd,int x,int y,int senumber,int sw);
|
||||
void lssproto_SP_recv(int fd,int x,int y,int dir);
|
||||
void lssproto_ClientLogin_recv(int fd,char* cdkey,char* passwd);
|
||||
void lssproto_ClientLogin_send(int fd,char* result);
|
||||
void lssproto_CreateNewChar_recv(int fd,int dataplacenum,char* charname,int imgno,int faceimgno,int vital,int str,int tgh,int dex,int earth,int water,int fire,int wind,int hometown);
|
||||
void lssproto_CreateNewChar_send(int fd,char* result,char* data);
|
||||
void lssproto_CharDelete_recv(int fd,char* charname);
|
||||
void lssproto_CharDelete_send(int fd,char* result,char* data);
|
||||
void lssproto_CharLogin_recv(int fd,char* charname);
|
||||
void lssproto_CharLogin_send(int fd,char* result,char* data);
|
||||
|
||||
#ifdef _PKSEVER_VER
|
||||
void lssproto_CharList_recv( int fd, int star);
|
||||
#else
|
||||
void lssproto_CharList_recv(int fd);
|
||||
#endif
|
||||
|
||||
void lssproto_CharList_send(int fd,char* result,char* data);
|
||||
void lssproto_CharLogout_recv(int fd, int flg);
|
||||
void lssproto_CharLogout_send(int fd,char* result,char* data);
|
||||
void lssproto_ProcGet_recv(int fd);
|
||||
void lssproto_ProcGet_send(int fd,char* data);
|
||||
void lssproto_PlayerNumGet_recv(int fd);
|
||||
void lssproto_PlayerNumGet_send(int fd,int logincount,int player);
|
||||
void lssproto_Echo_recv(int fd,char* test);
|
||||
void lssproto_Echo_send(int fd,char* test);
|
||||
void lssproto_Shutdown_recv(int fd,char* passwd,int min);
|
||||
|
||||
void lssproto_TD_send(int fd, int index, char* message);
|
||||
void lssproto_TD_recv(int fd, char* message);
|
||||
|
||||
#ifdef _CHATROOMPROTOCOL // (不可开) Syu ADD 聊天室频道
|
||||
void lssproto_CHATROOM_recv(int fd , char *data) ;
|
||||
void lssproto_CHATROOM_send(int fd , char* message ) ;
|
||||
#endif
|
||||
|
||||
#ifdef _NEWREQUESTPROTOCOL // (不可开) Syu ADD 新增Protocol要求细项
|
||||
void lssproto_RESIST_recv(int fd ) ;
|
||||
void lssproto_RESIST_send(int fd , char* message ) ;
|
||||
#endif
|
||||
#ifdef _OUTOFBATTLESKILL // (不可开) Syu ADD 非战斗时技能Protocol
|
||||
void lssproto_BATTLESKILL_recv(int fd, int iNum) ;
|
||||
void lssproto_BATTLESKILL_send(int fd , char* message ) ;
|
||||
#endif
|
||||
|
||||
void lssproto_NU_send(int fd, int nu);
|
||||
|
||||
void lssproto_FM_send(int fd, char* message);
|
||||
void lssproto_FM_recv(int fd, char* message);
|
||||
|
||||
void lssproto_WO_send(int fd,int effect);
|
||||
void lssproto_PETST_recv( int fd, int nPet, int sPet);
|
||||
void lssproto_BM_recv(int fd, int iindex);
|
||||
|
||||
#ifdef _FIX_DEL_MAP // WON ADD 玩家抽地图送监狱
|
||||
void lssproto_DM_recv( int fd );
|
||||
#endif
|
||||
|
||||
#ifdef _MIND_ICON
|
||||
void lssproto_MA_recv(int fd, int x, int y, int nMind);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_CRACKER
|
||||
void lssproto_IC_send(int fd, int x, int y);
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_CRACKER
|
||||
void lssproto_NC_send(int fd,int flg);
|
||||
#endif
|
||||
|
||||
#ifdef _CHECK_GAMESPEED
|
||||
void lssproto_CS_recv( int fd );
|
||||
void lssproto_CS_send( int fd, int deltimes);
|
||||
#endif
|
||||
|
||||
#ifdef _TEAM_KICKPARTY
|
||||
void lssproto_KTEAM_recv( int fd, int si);
|
||||
#endif
|
||||
|
||||
#ifdef _PETS_SELECTCON
|
||||
void lssproto_PETS_send(int fd,int petarray,int result);
|
||||
//#define LSSPROTO_PETST_SEND 107
|
||||
#endif
|
||||
|
||||
#ifdef _STREET_VENDOR
|
||||
void lssproto_STREET_VENDOR_recv(int fd,char *message);
|
||||
void lssproto_STREET_VENDOR_send(int fd,char *message);
|
||||
#endif
|
||||
|
||||
#ifdef _RCLICK
|
||||
void lssproto_RCLICK_recv(int fd, int type, char* data);
|
||||
void lssproto_RCLICK_send(int fd, int type, char* data);
|
||||
#endif
|
||||
|
||||
#ifdef _JOBDAILY
|
||||
void lssproto_JOBDAILY_recv(int fd,char *data);
|
||||
void lssproto_JOBDAILY_send(int fd,char *data);
|
||||
#endif
|
||||
|
||||
#ifdef _TEACHER_SYSTEM
|
||||
void lssproto_TEACHER_SYSTEM_recv(int fd,char *data);
|
||||
void lssproto_TEACHER_SYSTEM_send(int fd,char *data);
|
||||
#endif
|
||||
|
||||
#ifdef _ADD_STATUS_2
|
||||
void lssproto_S2_recv(int fd,char *data);
|
||||
void lssproto_S2_send(int fd,char *data);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
110
gmsv/include/lssproto_util.h
Normal file
110
gmsv/include/lssproto_util.h
Normal file
@ -0,0 +1,110 @@
|
||||
#ifndef _LSSPROTOUTIL_H_
|
||||
#define _LSSPROTOUTIL_H_
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef WIN32
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
//#define lssproto__ENCRYPT
|
||||
#define lssproto__NODEBUG
|
||||
struct lssproto_ {
|
||||
int (*write_func)(int,char*,int) ; /* write function */
|
||||
size_t workbufsize; /* size of work area */
|
||||
char *work,*arraywork,*escapework,*val_str,*ret_work; /* work areas which have same size */
|
||||
char *cryptwork,*jencodecopy,*jencodeout,*compresswork; /* these work has bigger size (3times)*/
|
||||
char** token_list; /* token list */
|
||||
unsigned long message_id; /*= 1, */ /* for generating message IDs */
|
||||
};
|
||||
#ifdef _LSSPROTOUTIL_C_
|
||||
struct lssproto_ lssproto = {
|
||||
NULL,
|
||||
0,
|
||||
NULL,NULL,NULL,NULL,NULL,
|
||||
NULL,NULL,NULL,NULL,
|
||||
NULL,
|
||||
1,
|
||||
};
|
||||
char **lssproto_stringwrapper;
|
||||
char lssproto_readlogfilename[1024];
|
||||
char lssproto_writelogfilename[1024];
|
||||
#else
|
||||
extern char **lssproto_stringwrapper;
|
||||
extern struct lssproto_ lssproto;
|
||||
extern char lssproto_readlogfilename[1024];
|
||||
extern char lssproto_writelogfilename[1024];
|
||||
#endif
|
||||
|
||||
char* lssproto_escapeString( char*a );
|
||||
char* lssproto_descapeString( char*a );
|
||||
void lssproto_splitString( char *src );
|
||||
void lssproto_strcpysafe( char *dest, char *src, int len );
|
||||
void lssproto_strcatsafe( char *dest , char *src , int maxlen );
|
||||
char*lssproto_mkstr_int( int i );
|
||||
char*lssproto_mkstr_u_int( unsigned int i );
|
||||
char*lssproto_mkstr_long( long l );
|
||||
char*lssproto_mkstr_u_long( unsigned long l );
|
||||
char*lssproto_mkstr_short( short s );
|
||||
char*lssproto_mkstr_u_short( short s );
|
||||
char*lssproto_mkstr_char( char c );
|
||||
char*lssproto_mkstr_u_char( char c);
|
||||
char*lssproto_mkstr_string( char*a );
|
||||
char*lssproto_mkstr_float( float f );
|
||||
char*lssproto_mkstr_double( double d );
|
||||
char*lssproto_mkstr_int_array( int size , int *array );
|
||||
char*lssproto_mkstr_u_int_array( int size , int *array );
|
||||
char*lssproto_mkstr_short_array( int size , short *array );
|
||||
char*lssproto_mkstr_u_short_array(int size , short *array );
|
||||
char *lssproto_mkstr_char_array( int size , char *array );
|
||||
char *lssproto_mkstr_u_char_array( int size , unsigned char *array );
|
||||
char *lssproto_mkstr_float_array( int size , float *array );
|
||||
char *lssproto_mkstr_double_array( int size , double *array );
|
||||
int lssproto_demkstr_int( char*a );
|
||||
unsigned int lssproto_demkstr_u_int( char*a );
|
||||
long lssproto_demkstr_long( char*a );
|
||||
unsigned long lssproto_demkstr_u_long(char*a );
|
||||
short lssproto_demkstr_short( char*a );
|
||||
unsigned short lssproto_demkstr_u_short( char*a );
|
||||
char lssproto_demkstr_char( char*a );
|
||||
unsigned char lssproto_demkstr_u_char( char*a );
|
||||
float lssproto_demkstr_float( char*a );
|
||||
double lssproto_demkstr_double(char*a );
|
||||
char* lssproto_demkstr_string( char*a);
|
||||
int *lssproto_demkstr_int_array( char**tk ,int *buf ,int start , int size );
|
||||
int *lssproto_demkstr_u_int_array( char **tk , int *buf , int start , int size );
|
||||
unsigned int *lssproto_demkstr_long_array(
|
||||
char **tk , unsigned int *buf , int start , int size );
|
||||
unsigned long *lssproto_demkstr_u_long_array(
|
||||
char **tk , unsigned long *buf , int start , int size );
|
||||
short *lssproto_demkstr_short_array( char **tk , short *buf , int start , int size );
|
||||
unsigned short*lssproto_demkstr_u_short_array(
|
||||
char **tk , unsigned short *buf , int start , int size );
|
||||
char *lssproto_demkstr_char_array( char **tk , char *buf , int start , int size );
|
||||
unsigned char *lssproto_demkstr_u_char_array(
|
||||
char **tk , unsigned char*buf , int start , int size );
|
||||
float *lssproto_demkstr_float_array( char **tk , float *buf , int start , int size );
|
||||
double *lssproto_demkstr_u_double_array( char **tk , double *buf , int start , int size );
|
||||
char *lssproto_wrapStringAddr( char *copy , int maxcopylen , char*src );
|
||||
|
||||
void lssproto_GetMessageInfo( int *id , char *funcname , int len,char **tk );
|
||||
int lssproto_ClientRead(void);
|
||||
void lssproto_consumeLine(char *buf , int ofs );
|
||||
void lssproto_copyLine( char*src , char *out , int maxoutlen );
|
||||
void lssproto_Send( int fd , char *msg );
|
||||
int lssproto_AllocateCommonWork(int bufsiz);
|
||||
unsigned int lssproto_GetNewMessageID(void);
|
||||
void lssproto_CreateHeader(char*out, char *fname );
|
||||
void lssproto_CreateHeaderID( char *out,unsigned long msgid , char *fname );
|
||||
int lssproto_default_write_wrap( int fd , char *buf , int size );
|
||||
void lssproto_bzero( char *b , int siz );
|
||||
void lssproto_bcopy(char*s , char *d , int siz );
|
||||
char *lssproto_Ltoa( long v );
|
||||
char *lssproto_Ultoa( unsigned long v );
|
||||
void lssproto_DebugSend( int fd , char *msg );
|
||||
/* Modified by ringo to fasten int type transfer */
|
||||
char *lssproto_cnv10to62( int a, char *out, int outlen );
|
||||
int lssproto_a62toi( char *a );
|
||||
extern int JENCODE_KEY;
|
||||
#endif
|
||||
|
||||
|
67
gmsv/include/magic.h
Normal file
67
gmsv/include/magic.h
Normal file
@ -0,0 +1,67 @@
|
||||
#ifndef __MAGIC_H__
|
||||
#define __MAGIC_H__
|
||||
|
||||
/* 热诸 */
|
||||
int MAGIC_Use( int charaindex, int haveitemindex, int toindex);
|
||||
int MAGIC_Recovery( int charaindex, int toindex,int marray, int mp );
|
||||
int MAGIC_OtherRecovery( int charaindex, int toindex, int marray, int mp );
|
||||
int MAGIC_FieldAttChange( int charaindex, int toindex, int marray, int mp );
|
||||
int MAGIC_StatusChange( int charaindex, int toindex, int marray, int mp );
|
||||
#ifdef _MAGIC_DEEPPOISON
|
||||
int MAGIC_StatusChange2( int charaindex, int toindex, int marray, int mp );
|
||||
#endif
|
||||
int MAGIC_StatusRecovery( int charaindex, int toindex, int marray, int mp );
|
||||
int MAGIC_MagicDef( int charaindex, int toindex, int marray, int mp );
|
||||
int MAGIC_Ressurect( int charaindex, int toindex, int marray, int mp );
|
||||
int MAGIC_AttReverse( int charaindex, int toindex, int marray, int mp );
|
||||
int MAGIC_ResAndDef( int charaindex, int toindex, int marray, int mp );
|
||||
#ifdef _OTHER_MAGICSTAUTS
|
||||
int MAGIC_MagicStatusChange( int charaindex, int toindex, int marray, int mp );
|
||||
#endif
|
||||
#ifdef __ATTACK_MAGIC
|
||||
int MAGIC_AttMagic( int charaindex , int toindex , int marray , int mp );
|
||||
#endif
|
||||
#ifdef _ITEM_METAMO
|
||||
int MAGIC_Metamo( int charaindex, int toindex,int marray, int mp );
|
||||
#endif
|
||||
|
||||
#ifdef _ITEM_ATTSKILLMAGIC
|
||||
int MAGIC_AttSkill( int charaindex, int toindex,int marray, int mp );
|
||||
#endif
|
||||
#ifdef _MAGIC_WEAKEN// vincent 精灵:虚弱
|
||||
int MAGIC_Weaken( int charaindex, int toindex, int marray, int mp );
|
||||
#endif
|
||||
#ifdef _MAGIC_BARRIER// vincent 精灵:魔障
|
||||
int MAGIC_Barrier( int charaindex, int toindex, int marray, int mp );
|
||||
#endif
|
||||
#ifdef _MAGIC_NOCAST// vincent 精灵:沉默
|
||||
int MAGIC_Nocast( int charaindex, int toindex, int marray, int mp );
|
||||
#endif
|
||||
#ifdef _MAGIC_TOCALL
|
||||
int MAGIC_ToCallDragon( int charaindex, int toindex,int marray, int mp );
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// 失奶 丞及匏 井日热诸 寞毛忒允
|
||||
//
|
||||
int MAGIC_GetArrayNo(
|
||||
int charaindex, // 平乓仿弁正奶件犯永弁旦
|
||||
int haveitemindex // 匀化月失奶 丞及匏
|
||||
);
|
||||
//
|
||||
//----------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
//
|
||||
// 热诸毛 涛银丹
|
||||
//
|
||||
int MAGIC_DirectUse(
|
||||
int charaindex, // 银丹平乓仿及奶件犯永弁旦
|
||||
int marray, // 银丹热诸及奶件犯永弁旦
|
||||
int toindex, // 簿卞银丹"
|
||||
int itemnum
|
||||
);
|
||||
//
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
142
gmsv/include/magic_base.h
Normal file
142
gmsv/include/magic_base.h
Normal file
@ -0,0 +1,142 @@
|
||||
#ifndef __MAGIC_BASE_H__
|
||||
#define __MAGIC_BASE_H__
|
||||
|
||||
#include "util.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MAGIC_FIELD_ALL, /* 允屯化及桦赭匹银尹月 */
|
||||
MAGIC_FIELD_BATTLE, /* 爵 及心 */
|
||||
MAGIC_FIELD_MAP, /* 骚橘穴永皿晓及心 */
|
||||
|
||||
}MAGIC_FIELDTYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MAGIC_TARGET_MYSELF, /* 愤坌及心 */
|
||||
MAGIC_TARGET_OTHER, /* 职及谛 愤坌殖戈) */
|
||||
MAGIC_TARGET_ALLMYSIDE, /* 蝈 */
|
||||
MAGIC_TARGET_ALLOTHERSIDE, /* 锹澎础蝈 */
|
||||
MAGIC_TARGET_ALL, /* 蝈化 */
|
||||
MAGIC_TARGET_NONE, /* 簿手蓟 请 卅中[ 豢支凶户及凛 */
|
||||
MAGIC_TARGET_OTHERWITHOUTMYSELF,/* 职及谛 愤坌殖引卅中) */
|
||||
MAGIC_TARGET_WITHOUTMYSELFANDPET, /* 愤坌午矢永玄动陆 */
|
||||
MAGIC_TARGET_WHOLEOTHERSIDE,/* 及扔奶玉蝈 */
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
|
||||
MAGIC_TARGET_SINGLE, // 针对敌方的某一人
|
||||
MAGIC_TARGET_ONE_ROW, // 针对敌方的某一列
|
||||
MAGIC_TARGET_ALL_ROWS, // 针对敌方的所有人
|
||||
|
||||
#endif
|
||||
}MAGIC_TARGETTYPE;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MAGIC_ID, /* 栋 寞 */
|
||||
MAGIC_FIELD, /* 银尹月桦赭 */
|
||||
MAGIC_TARGET, /* 覆擂 */
|
||||
MAGIC_TARGET_DEADFLG, /* 韶氏分樊手覆擂卞殖户月井 */
|
||||
#ifdef __ATTACK_MAGIC
|
||||
MAGIC_IDX ,
|
||||
#endif
|
||||
MAGIC_DATAINTNUM,
|
||||
}MAGIC_DATAINT;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MAGIC_NAME, /* 热诸 */
|
||||
MAGIC_COMMENT, /* 戊丢件玄*/
|
||||
MAGIC_FUNCNAME, /* 楮醒 */
|
||||
MAGIC_OPTION, /* 左皿扑亦件 */
|
||||
MAGIC_DATACHARNUM,
|
||||
}MAGIC_DATACHAR;
|
||||
|
||||
typedef struct tagMagic
|
||||
{
|
||||
int data[MAGIC_DATAINTNUM];
|
||||
STRING64 string[MAGIC_DATACHARNUM];
|
||||
|
||||
}Magic;
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
|
||||
typedef struct tagAttMagic
|
||||
{
|
||||
unsigned int uiSpriteNum;// 此咒术在Spr_x.bin的编号
|
||||
unsigned int uiAttackType;// 攻击的方式:单人,整排( 轮流 ) , 整排( 轮流 ) , 整排( 同时 ) , 全体( 轮流 ) , 全体( 同时 )
|
||||
unsigned int uiSliceTime;// 轮流攻击时的时间差
|
||||
unsigned int uiShowType; // 显示的位置方式:中央、指定
|
||||
int siSx; // 显示的位置 - X轴
|
||||
int siSy; // 显示的位置 - Y轴
|
||||
unsigned int uiShowBehindChar; // 显示在人物的前方或下方
|
||||
unsigned int uiShakeScreen; // 是否震动画面
|
||||
unsigned int uiShakeFrom; // 震动画面的起始时间( 毫秒 )
|
||||
unsigned int uiShakeTo; // 震动画面的结束时间( 毫秒 _
|
||||
unsigned int uiPrevMagicNum; // 前置咒术的索引号( 0XFFFFFFFFFF 表示无前置咒术 )
|
||||
int siPrevMagicSx; // 前置咒术的显示位置 - X轴
|
||||
int siPrevMagicSy; // 前置咒术的显示位置 - Y轴
|
||||
int siPrevMagicOnChar; // 前置咒术显示在人物的前方或下方
|
||||
unsigned int uiPostMagicNum; // 後置咒术的索引号( 0XFFFFFFFF 表示无後置咒术 )
|
||||
int siPostMagicSx; // 後置咒术的显示位置 - X轴
|
||||
int siPostMagicSy; // 後置咒术的显示位置 - Y轴
|
||||
int siPostMagicOnChar; // 後置咒术显示在人物的前方或下方
|
||||
int siField[3][5]; // 攻击索引
|
||||
}AttMagic;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _MAGIC_TOCALL
|
||||
|
||||
typedef struct tagToCallMagic
|
||||
{
|
||||
unsigned int uiSpriteNum;// 此咒术在Spr_x.bin的编号
|
||||
unsigned int uiAttackType;// 攻击的方式:单人,整排( 轮流 ) , 整排( 轮流 ) , 整排( 同时 ) , 全体( 轮流 ) , 全体( 同时 )
|
||||
unsigned int uiSliceTime;// 轮流攻击时的时间差
|
||||
unsigned int uiShowType; // 显示的位置方式:中央、指定
|
||||
int siSx; // 显示的位置 - X轴
|
||||
int siSy; // 显示的位置 - Y轴
|
||||
unsigned int uiShowBehindChar; // 显示在人物的前方或下方
|
||||
unsigned int uiShakeScreen; // 是否震动画面
|
||||
unsigned int uiShakeFrom; // 震动画面的起始时间( 毫秒 )
|
||||
unsigned int uiShakeTo; // 震动画面的结束时间( 毫秒 _
|
||||
unsigned int uiPrevMagicNum; // 前置咒术的索引号( 0XFFFFFFFFFF 表示无前置咒术 )
|
||||
int siPrevMagicSx; // 前置咒术的显示位置 - X轴
|
||||
int siPrevMagicSy; // 前置咒术的显示位置 - Y轴
|
||||
int siPrevMagicOnChar; // 前置咒术显示在人物的前方或下方
|
||||
unsigned int uiPostMagicNum; // 後置咒术的索引号( 0XFFFFFFFF 表示无後置咒术 )
|
||||
int siPostMagicSx; // 後置咒术的显示位置 - X轴
|
||||
int siPostMagicSy; // 後置咒术的显示位置 - Y轴
|
||||
int siPostMagicOnChar; // 後置咒术显示在人物的前方或下方
|
||||
int isPostDisappear; // 咒术一般攻击完时是否马上消失
|
||||
int ToCallMagicNo; // 召唤术的编号
|
||||
}ToCallMagic;
|
||||
|
||||
#endif
|
||||
|
||||
typedef int (*MAGIC_CALLFUNC)( int, int, int, int );
|
||||
|
||||
INLINE BOOL MAGIC_CHECKINDEX( int index );
|
||||
INLINE int MAGIC_getInt( int index, MAGIC_DATAINT element);
|
||||
INLINE int MAGIC_setInt( int index, MAGIC_DATAINT element, int data);
|
||||
INLINE char* MAGIC_getChar( int index, MAGIC_DATACHAR element);
|
||||
INLINE BOOL MAGIC_setChar( int index ,MAGIC_DATACHAR element, char* new );
|
||||
int MAGIC_getMagicNum( void);
|
||||
BOOL MAGIC_initMagic( char *filename);
|
||||
BOOL MAGIC_reinitMagic( void );
|
||||
|
||||
#ifdef __ATTACK_MAGIC
|
||||
|
||||
BOOL ATTMAGIC_initMagic( char *filename );
|
||||
BOOL ATTMAGIC_reinitMagic( void );
|
||||
|
||||
#endif
|
||||
|
||||
int MAGIC_getMagicArray( int magicid);
|
||||
MAGIC_CALLFUNC MAGIC_getMagicFuncPointer(char* name);
|
||||
// Nuke +1 08/23 : For checking the validity of magic target
|
||||
int MAGIC_isTargetValid( int magicid, int toindex);
|
||||
|
||||
#endif
|
||||
|
10
gmsv/include/magic_field.h
Normal file
10
gmsv/include/magic_field.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef __MAGIC_FIELD_H__
|
||||
#define __MAGIC_FIELD_H__
|
||||
|
||||
/* 白奴□伙玉匹银迕允月热诸 */
|
||||
|
||||
int MAGIC_Recovery_Field( int charaindex, int magicindex);
|
||||
int MAGIC_OtherRecovery_Field( int charaindex, int toindex, int magicindex);
|
||||
|
||||
#endif
|
||||
|
11
gmsv/include/map_deal.h
Normal file
11
gmsv/include/map_deal.h
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef __MAP_DEAL_H__
|
||||
#define __MAP_DEAL_H__
|
||||
BOOL MAP_walkAbleFromPoint( int ff, int fx, int fy, BOOL isfly );
|
||||
BOOL MAP_walkAble( int index,int ff, int fx, int fy);
|
||||
void MAP_preovered( int index );
|
||||
void MAP_postovered( int index );
|
||||
BOOL MAP_sendArroundCharNeedFD( int fd,int charaindex );
|
||||
BOOL MAP_sendArroundChar(int charaindex);
|
||||
|
||||
#endif
|
||||
|
7
gmsv/include/map_util.h
Normal file
7
gmsv/include/map_util.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef __MAP_UTIL_H__
|
||||
#define __MAP_UTIL_H__
|
||||
|
||||
BOOL MAP_getMapDataFromCharIndex( int index , int* map );
|
||||
BOOL MAP_getMapDataFromFXY( int f , int x , int y, int* map );
|
||||
|
||||
#endif
|
21
gmsv/include/map_warppoint.h
Normal file
21
gmsv/include/map_warppoint.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef __MAPWARPPOINT_H__
|
||||
#define __MAPWARPPOINT_H__
|
||||
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
|
||||
int MAPPOINT_InitMapWarpPoint( void);
|
||||
void MAPPOINT_resetMapWarpPoint( int flg);
|
||||
int MAPPOINT_loadMapWarpPoint( void);
|
||||
|
||||
BOOL MAPPOINT_CHECKINDEX( int ps);
|
||||
int MAPPOINT_getMPointEVType( int ps);
|
||||
|
||||
int MAPPOINT_creatMapWarpObj( int pointindex, char *buf, int objtype);
|
||||
int MAPPOINT_setMapWarpGoal( int ps, char *buf);
|
||||
int MAPPOINT_setMapWarpFrom( int ps, char *buf);
|
||||
int MAPPOINT_getMapWarpGoal( int ps, int ofl, int ox, int oy, int *fl, int *x, int *y);
|
||||
|
||||
void MAPPOINT_MapWarpHandle( int charaindex, int ps, int ofl, int ox, int oy );
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user