1681 lines
36 KiB
C++
1681 lines
36 KiB
C++
![]() |
#include "../systeminc/version.h"
|
|||
|
#include"../systeminc/system.h"
|
|||
|
#include"../systeminc/action.h"
|
|||
|
#include"../systeminc/pc.h"
|
|||
|
#include"../systeminc/character.h"
|
|||
|
#include"../systeminc/map.h"
|
|||
|
#include"../systeminc/tool.h"
|
|||
|
#include"../systeminc/anim_tbl.h"
|
|||
|
#include"../systeminc/loadsprbin.h"
|
|||
|
#include"../systeminc/netmain.h"
|
|||
|
#include"../systeminc/lssproto_cli.h"
|
|||
|
#include"../systeminc/savedata.h"
|
|||
|
#include"../systeminc/menu.h"
|
|||
|
#include"../systeminc/field.h"
|
|||
|
#include"../systeminc/login.h"
|
|||
|
#include"../systeminc/netproc.h"
|
|||
|
|
|||
|
PC pc;
|
|||
|
short maxPcNo;
|
|||
|
short selectPcNo;
|
|||
|
short prSendMode = 0;
|
|||
|
short prSendFlag = 0;
|
|||
|
|
|||
|
short jbSendFlag;
|
|||
|
short duelSendFlag;
|
|||
|
|
|||
|
int loginDp;
|
|||
|
|
|||
|
short helpFlag = 0;
|
|||
|
|
|||
|
short tradeFlag = 0;
|
|||
|
short tradeStatus = 0;
|
|||
|
|
|||
|
PET pet[MAX_PET];
|
|||
|
|
|||
|
#ifdef _CHAR_PROFESSION // WON ADD <20><><EFBFBD><EFBFBD>ְҵ
|
|||
|
PROFESSION_SKILL profession_skill[MAX_PROFESSION_SKILL];
|
|||
|
#endif
|
|||
|
|
|||
|
MAGIC magic[MAX_MAGIC];
|
|||
|
|
|||
|
#ifdef MAX_AIRPLANENUM
|
|||
|
PARTY party[MAX_AIRPLANENUM];
|
|||
|
#else
|
|||
|
PARTY party[MAX_PARTY];
|
|||
|
#endif
|
|||
|
short partyModeFlag = 0;
|
|||
|
|
|||
|
|
|||
|
CHARLISTTABLE chartable[MAXCHARACTER];
|
|||
|
|
|||
|
ADDRESS_BOOK addressBook[MAX_ADR_BOOK];
|
|||
|
|
|||
|
BATTLE_RESULT_MSG battleResultMsg;
|
|||
|
|
|||
|
PET_SKILL petSkill[MAX_PET][MAX_SKILL];
|
|||
|
|
|||
|
|
|||
|
char newCharacterName[CHAR_NAME_LEN+1];
|
|||
|
int newCharacterGraNo;
|
|||
|
int newCharacterFaceGraNo;
|
|||
|
int newCharacterVit;
|
|||
|
int newCharacterStr;
|
|||
|
int newCharacterTgh;
|
|||
|
int newCharacterDex;
|
|||
|
int newCharacterEarth;
|
|||
|
int newCharacterWater;
|
|||
|
int newCharacterFire;
|
|||
|
int newCharacterWind;
|
|||
|
int newCharacterHomeTown;
|
|||
|
|
|||
|
template <typename T>
|
|||
|
inline void swap(T &T1, T &T2)
|
|||
|
{
|
|||
|
T TTemp;
|
|||
|
|
|||
|
TTemp = T1;
|
|||
|
T1 = T2;
|
|||
|
T2 = TTemp;
|
|||
|
}
|
|||
|
|
|||
|
void swap(char *a, char *b)
|
|||
|
{
|
|||
|
char tmp[256];
|
|||
|
|
|||
|
if(strlen(a) > 255 || strlen(b) > 255)
|
|||
|
return;
|
|||
|
|
|||
|
strcpy(tmp, a);
|
|||
|
strcpy(a, b);
|
|||
|
strcpy(b, tmp);
|
|||
|
}
|
|||
|
|
|||
|
//void swapInteger(int *, int *);
|
|||
|
//void swapShort(short *, short *);
|
|||
|
//void swapString(char *, char *);
|
|||
|
|
|||
|
void initPcAll(void)
|
|||
|
{
|
|||
|
int i;
|
|||
|
memset(&pc, 0, sizeof(pc));
|
|||
|
memset(&pet, 0, sizeof(pet));
|
|||
|
memset(&magic, 0, sizeof(magic));
|
|||
|
memset(&party, 0, sizeof(party));
|
|||
|
memset(&petSkill, 0, sizeof(petSkill));
|
|||
|
|
|||
|
#ifdef _CHAR_PROFESSION // WON ADD <20><><EFBFBD><EFBFBD>ְҵ
|
|||
|
memset(&profession_skill, 0, sizeof(profession_skill));
|
|||
|
#endif
|
|||
|
|
|||
|
pc.mailPetNo = -1;
|
|||
|
#ifdef _MORECHARACTERS_
|
|||
|
extern int <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﵱǰҳ<EFBFBD><EFBFBD>;
|
|||
|
getUserSetting(selectPcNo+<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﵱǰҳ<EFBFBD><EFBFBD>*2);
|
|||
|
#else
|
|||
|
getUserSetting(selectPcNo);
|
|||
|
#endif
|
|||
|
|
|||
|
partyModeFlag = 0;
|
|||
|
sPetStatFlag = 1;
|
|||
|
|
|||
|
#ifdef MAX_AIRPLANENUM
|
|||
|
for (i = 0; i < MAX_AIRPLANENUM; i++)
|
|||
|
#else
|
|||
|
for (i = 0; i < MAX_PARTY; i++)
|
|||
|
#endif
|
|||
|
{
|
|||
|
party[i].useFlag = 0;
|
|||
|
party[i].id = 0;
|
|||
|
party[i].ptAct = NULL;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#if 1
|
|||
|
pc.faceGraNo = newCharacterFaceGraNo;
|
|||
|
pc.dp = loginDp;
|
|||
|
#endif
|
|||
|
|
|||
|
// shan 2002/01/18
|
|||
|
{
|
|||
|
FILE *fp;
|
|||
|
char filename[255];
|
|||
|
char vTemp[32];
|
|||
|
|
|||
|
sprintf_s(filename, "map\\bgm%d.dat", sCharSide);
|
|||
|
if((fp = fopen(filename, "rb+"))!=NULL)
|
|||
|
{
|
|||
|
fread(&vTemp, sizeof(char), 2, fp);
|
|||
|
fclose (fp);
|
|||
|
fMapBgm = atoi(vTemp);
|
|||
|
}
|
|||
|
}
|
|||
|
#ifdef _STREET_VENDOR
|
|||
|
pc.iOnStreetVendor = 0;
|
|||
|
#endif
|
|||
|
#ifdef _MOVE_SCREEN
|
|||
|
pc.bCanUseMouse = FALSE;//TRUE;
|
|||
|
pc.bMoveScreenMode = FALSE;
|
|||
|
iScreenMoveX = 0;
|
|||
|
iScreenMoveY = 0;
|
|||
|
#endif
|
|||
|
#ifdef _THEATER
|
|||
|
pc.iTheaterMode = 0;
|
|||
|
pc.iSceneryNumber = -1;
|
|||
|
#endif
|
|||
|
#ifdef _SFUMATO
|
|||
|
pc.sfumato = 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦͼ<C8BE><CDBC>ɫ<EFBFBD><C9AB>
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void initPc(void)
|
|||
|
{
|
|||
|
int walk = 0, height = 0;
|
|||
|
int i;
|
|||
|
#ifndef _STONDEBUG_
|
|||
|
createPc(pc.graNo, nowGx, nowGy, pc.dir);
|
|||
|
#else
|
|||
|
if(offlineFlag)
|
|||
|
{
|
|||
|
createPc(SPR_pet004, nowGx, nowGy, pc.dir);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
createPc(pc.graNo, nowGx, nowGy, pc.dir);
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
if((pc.status & CHR_STATUS_W))
|
|||
|
{
|
|||
|
walk = 1;
|
|||
|
}
|
|||
|
if((pc.status & CHR_STATUS_H))
|
|||
|
{
|
|||
|
height = 1;
|
|||
|
}
|
|||
|
#ifdef _CHAR_PROFESSION // WON ADD <20><><EFBFBD><EFBFBD>ְҵ
|
|||
|
// #ifdef _GM_IDENTIFY // Rog ADD GMʶ<4D><CAB6>
|
|||
|
// setPcParam(pc.name, pc.freeName, pc.level, pc.ridePetName, pc.ridePetLevel, pc.nameColor, walk, height, pc.profession_class, pc.profession_level, pc.profession_exp, pc.profession_skill_point, pc.ptAct->gm_name);
|
|||
|
// setPcParam(pc.name, pc.freeName, pc.level, pc.ridePetName, pc.ridePetLevel, pc.nameColor, walk, height, pc.profession_class, pc.profession_level, pc.profession_skill_point, pc.ptAct->gm_name);
|
|||
|
// #else
|
|||
|
// setPcParam(pc.name, pc.freeName, pc.level, pc.ridePetName, pc.ridePetLevel, pc.nameColor, walk, height, pc.profession_class, pc.profession_level, pc.profession_exp, pc.profession_skill_point);
|
|||
|
#ifdef _ALLDOMAN // (<28><><EFBFBD>ɿ<EFBFBD>) Syu ADD <20><><EFBFBD>а<EFBFBD>NPC
|
|||
|
setPcParam(pc.name, pc.freeName, pc.level, pc.ridePetName, pc.ridePetLevel, pc.nameColor, walk, height, pc.profession_class, pc.profession_level, pc.profession_skill_point , pc.herofloor);
|
|||
|
#else
|
|||
|
setPcParam(pc.name, pc.freeName, pc.level, pc.ridePetName, pc.ridePetLevel, pc.nameColor, walk, height, pc.profession_class, pc.profession_level, pc.profession_skill_point);
|
|||
|
#endif
|
|||
|
// #endif
|
|||
|
#else
|
|||
|
setPcParam(pc.name, pc.freeName, pc.level, pc.ridePetName, pc.ridePetLevel, pc.nameColor, walk, height);
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef _FRIENDCHANNEL
|
|||
|
// strcpy(pc.chatRoomNum,"");
|
|||
|
#endif
|
|||
|
|
|||
|
if(pc.ptAct != NULL)
|
|||
|
{
|
|||
|
pc.ptAct->hp = pc.hp;
|
|||
|
pc.ptAct->maxHp = pc.maxHp;
|
|||
|
|
|||
|
// ??<3F>ѩ<EFBFBD>????????????????<3F><>
|
|||
|
#ifdef MAX_AIRPLANENUM
|
|||
|
for (i = 0; i < MAX_AIRPLANENUM; i++)
|
|||
|
#else
|
|||
|
for(i = 0; i < MAX_PARTY; i++)
|
|||
|
#endif
|
|||
|
{
|
|||
|
if(party[i].useFlag != 0 && party[i].id == pc.id)
|
|||
|
{
|
|||
|
party[i].ptAct = pc.ptAct;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
prSendMode = 0;
|
|||
|
prSendFlag = 0;
|
|||
|
jbSendFlag = 0;
|
|||
|
duelSendFlag = 0;
|
|||
|
helpFlag = 0;
|
|||
|
|
|||
|
#ifdef _NPC_MAGICCARD
|
|||
|
for(i=0;i<20;i++){
|
|||
|
bShowflag[i] = FALSE;
|
|||
|
iShowdamage[i]=0;
|
|||
|
iOffsetY[i] = 0;
|
|||
|
iPosition[i] = 0;
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC????<3F><>
|
|||
|
void createPc(int graNo, int gx, int gy, int dir)
|
|||
|
{
|
|||
|
pc.graNo = graNo;
|
|||
|
pc.dir = dir;
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
{
|
|||
|
pc.ptAct = createCharAction(graNo, gx, gy, dir);
|
|||
|
if(pc.ptAct != NULL)
|
|||
|
{
|
|||
|
pc.ptAct->atr |= ACT_ATR_TYPE_PC;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
setPcGraNo(graNo, dir);
|
|||
|
setPcWarpPoint(gx, gy);
|
|||
|
setPcPoint();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???????
|
|||
|
void resetPc(void)
|
|||
|
{
|
|||
|
int i;
|
|||
|
|
|||
|
if(pc.ptAct != NULL)
|
|||
|
{
|
|||
|
#ifdef _ITEM_FIREWORK
|
|||
|
if (((CHAREXTRA*)pc.ptAct->pYobi)->pActFirework[0])
|
|||
|
{
|
|||
|
DeathAction(((CHAREXTRA*)pc.ptAct->pYobi)->pActFirework[0]);
|
|||
|
((CHAREXTRA*)pc.ptAct->pYobi)->pActFirework[0] = NULL;
|
|||
|
}
|
|||
|
if (((CHAREXTRA*)pc.ptAct->pYobi)->pActFirework[1])
|
|||
|
{
|
|||
|
DeathAction(((CHAREXTRA*)pc.ptAct->pYobi)->pActFirework[1]);
|
|||
|
((CHAREXTRA*)pc.ptAct->pYobi)->pActFirework[1] = NULL;
|
|||
|
}
|
|||
|
#endif
|
|||
|
#ifdef _NPC_MAGICCARD
|
|||
|
for(i=0;i<4;i++){
|
|||
|
if (((CHAREXTRA*)pc.ptAct->pYobi)->pActMagiccard[i]){
|
|||
|
DeathAction(((CHAREXTRA*)pc.ptAct->pYobi)->pActMagiccard[i]);
|
|||
|
((CHAREXTRA*)pc.ptAct->pYobi)->pActMagiccard[i] = NULL;
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
#ifdef _THEATER
|
|||
|
for (i = 0; i < 5; i++)
|
|||
|
{
|
|||
|
if (pc.pActNPC[i])
|
|||
|
{
|
|||
|
DeathAction(pc.pActNPC[i]);
|
|||
|
pc.pActNPC[i] = NULL;
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
DeathAction(pc.ptAct);
|
|||
|
pc.ptAct = NULL;
|
|||
|
}
|
|||
|
|
|||
|
// ????????<3F><>????
|
|||
|
delPcLeader();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC?????????<3F>k?<3F>@<40>e
|
|||
|
void setPcGraNo(int graNo, int dir)
|
|||
|
{
|
|||
|
pc.graNo = graNo;
|
|||
|
pc.dir = dir;
|
|||
|
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->anim_chr_no = graNo;
|
|||
|
pc.ptAct->anim_ang = dir;
|
|||
|
#ifdef _SFUMATO
|
|||
|
pc.ptAct->sfumato = pc.sfumato; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦͼ<C8BE><CDBC>ɫ<EFBFBD><C9AB>
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???ID?<3F>@<40>e
|
|||
|
void setPcId(int id)
|
|||
|
{
|
|||
|
pc.id = id;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC??????<3F>I<EFBFBD>@<40>e
|
|||
|
void setPcWarpPoint(int gx, int gy)
|
|||
|
{
|
|||
|
// if(pc.ptAct == NULL)
|
|||
|
// return;
|
|||
|
|
|||
|
setWarpMap(gx, gy);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???????<3F>t?<3F>i???
|
|||
|
void setPcPoint(void)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->mx = nowX;
|
|||
|
pc.ptAct->my = nowY;
|
|||
|
pc.ptAct->gx = nowGx;
|
|||
|
pc.ptAct->gy = nowGy;
|
|||
|
pc.ptAct->vx = nowVx;
|
|||
|
pc.ptAct->vy = nowVy;
|
|||
|
pc.ptAct->nextGx = nextGx;
|
|||
|
pc.ptAct->nextGy = nextGy;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???????<3F>@<40>e
|
|||
|
void setPcDir(int dir)
|
|||
|
{
|
|||
|
pc.dir = dir;
|
|||
|
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->anim_ang = dir;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ???????<3F>@<40>e
|
|||
|
void setPcAction(int act)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->anim_no = act;
|
|||
|
if(pc.ptAct->anim_no != ANIM_WALK)
|
|||
|
{
|
|||
|
pc.ptAct->anim_no_bak = -1;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#ifdef __EMOTION
|
|||
|
void setPcEmotion(int emotion)
|
|||
|
{
|
|||
|
CHAREXTRA *ext;
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
ext = (CHAREXTRA *)pc.ptAct->pYobi;
|
|||
|
if(ext->ptActEmotion){
|
|||
|
DeathAction(ext->ptActEmotion);
|
|||
|
ext->ptActEmotion = NULL;
|
|||
|
}
|
|||
|
ext->ptActEmotion =
|
|||
|
createCommmonEffectAction(emotion, pc.ptAct->gx, pc.ptAct->gy, 0, 0, DISP_PRIO_CHAR);
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
// ????????<3F>֢t<D6A2><74><EFBFBD>x
|
|||
|
int getPcAction(void)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return -1;
|
|||
|
|
|||
|
return pc.ptAct->anim_no;
|
|||
|
}
|
|||
|
|
|||
|
#ifdef _CHANNEL_MODIFY
|
|||
|
extern int TalkMode;
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef _CHAR_PROFESSION // WON ADD <20><><EFBFBD><EFBFBD>ְҵ
|
|||
|
// #ifdef _GM_IDENTIFY // Rog ADD GMʶ<4D><CAB6>
|
|||
|
// void setPcParam(char *name, char *freeName, int level, char *petname, int petlevel, int nameColor, int walk, int height, int profession_class, int profession_level, int profession_exp, int profession_skill_point , char *gm_name)
|
|||
|
// void setPcParam(char *name, char *freeName, int level, char *petname, int petlevel, int nameColor, int walk, int height, int profession_class, int profession_level, int profession_skill_point , char *gm_name)
|
|||
|
// #else
|
|||
|
// void setPcParam(char *name, char *freeName, int level, char *petname, int petlevel, int nameColor, int walk, int height, int profession_class, int profession_level, int profession_exp, int profession_skill_point)
|
|||
|
#ifdef _ALLDOMAN // (<28><><EFBFBD>ɿ<EFBFBD>) Syu ADD <20><><EFBFBD>а<EFBFBD>NPC
|
|||
|
void setPcParam(char *name, char *freeName, int level, char *petname, int petlevel, int nameColor, int walk, int height, int profession_class, int profession_level, int profession_skill_point , int herofloor)
|
|||
|
#else
|
|||
|
void setPcParam(char *name, char *freeName, int level, char *petname, int petlevel, int nameColor, int walk, int height, int profession_class, int profession_level, int profession_skill_point)
|
|||
|
#endif
|
|||
|
// #endif
|
|||
|
#else
|
|||
|
void setPcParam(char *name, char *freeName, int level, char *petname, int petlevel, int nameColor, int walk, int height)
|
|||
|
#endif
|
|||
|
{
|
|||
|
int nameLen;
|
|||
|
int freeNameLen;
|
|||
|
int petnameLen;
|
|||
|
#ifdef _GM_IDENTIFY // Rog ADD GMʶ<4D><CAB6>
|
|||
|
int gmnameLen;
|
|||
|
#endif
|
|||
|
nameLen = strlen(name);
|
|||
|
if(nameLen <= CHAR_NAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.name, name);
|
|||
|
}
|
|||
|
|
|||
|
freeNameLen = strlen(freeName);
|
|||
|
if(freeNameLen <= CHAR_FREENAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.freeName, freeName);
|
|||
|
}
|
|||
|
|
|||
|
pc.level = level;
|
|||
|
|
|||
|
petnameLen = strlen(petname);
|
|||
|
if(petnameLen <= CHAR_FREENAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.ridePetName, petname);
|
|||
|
}
|
|||
|
|
|||
|
pc.ridePetLevel = petlevel;
|
|||
|
|
|||
|
pc.nameColor = nameColor;
|
|||
|
if(walk != 0) // ??<3F><>?<3F><>??
|
|||
|
{
|
|||
|
pc.status |= CHR_STATUS_W;
|
|||
|
}
|
|||
|
if(height != 0) // ?????
|
|||
|
{
|
|||
|
pc.status |= CHR_STATUS_H;
|
|||
|
}
|
|||
|
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
if(nameLen <= CHAR_NAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.ptAct->name, name);
|
|||
|
}
|
|||
|
if(freeNameLen <= CHAR_FREENAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.ptAct->freeName, freeName);
|
|||
|
}
|
|||
|
pc.ptAct->level = level;
|
|||
|
|
|||
|
if(petnameLen <= CHAR_FREENAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.ptAct->petName, petname);
|
|||
|
}
|
|||
|
pc.ptAct->petLevel = petlevel;
|
|||
|
|
|||
|
pc.ptAct->itemNameColor = nameColor;
|
|||
|
|
|||
|
#ifdef _CHAR_PROFESSION // WON ADD <20><><EFBFBD><EFBFBD>ְҵ
|
|||
|
pc.profession_class = profession_class;
|
|||
|
pc.ptAct->profession_class = profession_class;
|
|||
|
pc.profession_level = profession_level;
|
|||
|
// pc.profession_exp = profession_exp;
|
|||
|
pc.profession_skill_point = profession_skill_point;
|
|||
|
#endif
|
|||
|
#ifdef _ALLDOMAN // (<28><><EFBFBD>ɿ<EFBFBD>) Syu ADD <20><><EFBFBD>а<EFBFBD>NPC
|
|||
|
pc.herofloor = herofloor;
|
|||
|
#endif
|
|||
|
#ifdef _GM_IDENTIFY // Rog ADD GMʶ<4D><CAB6>
|
|||
|
gmnameLen = strlen(gm_name);
|
|||
|
if(gmnameLen <= 33){
|
|||
|
strcpy(pc.ptAct->gm_name, gm_name);
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef _CHANNEL_MODIFY
|
|||
|
#ifdef _CHAR_PROFESSION
|
|||
|
if(pc.profession_class == 0){
|
|||
|
pc.etcFlag &= ~PC_ETCFLAG_CHAT_OCC;
|
|||
|
//TalkMode = 0;
|
|||
|
}
|
|||
|
#endif
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC????<3F>ѩ<EFBFBD>???????<3F>@<40>e????
|
|||
|
void updataPcAct(void)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
if(strlen(pc.name) <= CHAR_NAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.ptAct->name, pc.name);
|
|||
|
}
|
|||
|
if(strlen(pc.freeName) <= CHAR_FREENAME_LEN)
|
|||
|
{
|
|||
|
strcpy(pc.ptAct->freeName, pc.freeName);
|
|||
|
}
|
|||
|
pc.ptAct->level = pc.level;
|
|||
|
pc.ptAct->hp = pc.hp;
|
|||
|
pc.ptAct->maxHp = pc.maxHp;
|
|||
|
#ifdef _SFUMATO
|
|||
|
pc.ptAct->sfumato = pc.sfumato; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦͼ<C8BE><CDBC>ɫ<EFBFBD><C9AB>
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???????????
|
|||
|
void setPcLeader(void)
|
|||
|
{
|
|||
|
pc.status |= CHR_STATUS_LEADER;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC????????????????
|
|||
|
void delPcLeader(void)
|
|||
|
{
|
|||
|
pc.status &= (~CHR_STATUS_LEADER);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???????????????
|
|||
|
void setPcParty(void)
|
|||
|
{
|
|||
|
pc.status |= CHR_STATUS_PARTY;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC?????????????????
|
|||
|
void delPcParty(void)
|
|||
|
{
|
|||
|
pc.status &= (~CHR_STATUS_PARTY);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC?????<3F>P??????
|
|||
|
void setPcWatch(void)
|
|||
|
{
|
|||
|
pc.status |= CHR_STATUS_WATCH;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC?????<3F>P??????????
|
|||
|
void delPcWatch(void)
|
|||
|
{
|
|||
|
pc.status &= (~CHR_STATUS_WATCH);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ??<3F><>??????????
|
|||
|
//?<3F><>?????????????<3F><>?<3F>v???<3F><><EFBFBD><EFBFBD>?
|
|||
|
void setPcWalkFlag(void)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->walkFlag = 1;
|
|||
|
}
|
|||
|
|
|||
|
// ??????<3F><>??????????
|
|||
|
//?<3F><>?????????????<3F><>?<3F>v???<3F><><EFBFBD><EFBFBD>?
|
|||
|
void delPcWalkFlag(void)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->walkFlag = 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// <20><>?????<3F><><EFBFBD><EFBFBD>
|
|||
|
int checkPcWalkFlag(void)
|
|||
|
{
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return 0;
|
|||
|
|
|||
|
return (int)pc.ptAct->walkFlag;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>????????
|
|||
|
void setPcUseMagic(void)
|
|||
|
{
|
|||
|
pc.status |= CHR_STATUS_USE_MAGIC;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>????????
|
|||
|
void delPcUseMagic(void)
|
|||
|
{
|
|||
|
pc.status &= (~CHR_STATUS_USE_MAGIC);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// PC???<3F><>??<3F><>?
|
|||
|
void setPcFukidashi(unsigned int offTime)
|
|||
|
{
|
|||
|
CHAREXTRA *ext;
|
|||
|
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.status |= CHR_STATUS_FUKIDASHI;
|
|||
|
ext = (CHAREXTRA *)pc.ptAct->pYobi;
|
|||
|
ext->drawFukidashiTime = offTime + TimeGetTime();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ???????????<3F><><EFBFBD>q?<3F><>?<3F>@<40>e
|
|||
|
void setPcNameColor(int color)
|
|||
|
{
|
|||
|
pc.pcNameColor = color;
|
|||
|
|
|||
|
if(pc.ptAct == NULL)
|
|||
|
return;
|
|||
|
|
|||
|
pc.ptAct->charNameColor = color;
|
|||
|
}
|
|||
|
|
|||
|
#ifdef _ANGEL_SUMMON
|
|||
|
void setPcAngel(void)
|
|||
|
{
|
|||
|
int find = FALSE;
|
|||
|
for(int i =0; i <CHAR_EQUIPPLACENUM; i++) {
|
|||
|
if(pc.item[i].graNo == 35268)
|
|||
|
find = TRUE;
|
|||
|
}
|
|||
|
if(find)
|
|||
|
pc.status |= CHR_STATUS_ANGEL;
|
|||
|
}
|
|||
|
|
|||
|
void delPcAngel(void)
|
|||
|
{
|
|||
|
pc.status &= (~CHR_STATUS_ANGEL);
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef _NPC_MAGICCARD
|
|||
|
extern struct Posstruct Positiontable[];
|
|||
|
#endif
|
|||
|
|
|||
|
// PC???<3F>h?<3F><>? /////////////////////////////////////////////////////////
|
|||
|
void changePcAct(int x, int y, int dir, int action,
|
|||
|
int effectno, int effectparam1, int effectparam2)
|
|||
|
{
|
|||
|
switch(action)
|
|||
|
{
|
|||
|
// ??<3F>֢t
|
|||
|
case 0:
|
|||
|
#if 0
|
|||
|
#if 1
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
#else
|
|||
|
// ??????????????????
|
|||
|
if(partyModeFlag == 0 || (pc.status & CHR_STATUS_LEADER) != 0)
|
|||
|
{
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
}
|
|||
|
#endif
|
|||
|
#endif
|
|||
|
setPcAction(ANIM_STAND);
|
|||
|
break;
|
|||
|
#ifdef _SHOWFAMILYBADGE_
|
|||
|
case 43:
|
|||
|
if(effectno >= 0){
|
|||
|
if(pc.familyName[0])
|
|||
|
setCharFamily( pc.ptAct, effectno);
|
|||
|
}else
|
|||
|
delCharFamily( pc.ptAct);
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef FAMILY_MANOR_
|
|||
|
case 44:
|
|||
|
if(effectno >= 0){
|
|||
|
if(pc.familyName[0])
|
|||
|
setCharmFamily( pc.ptAct, effectno);
|
|||
|
}else
|
|||
|
delCharmFamily( pc.ptAct);
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef _CHAR_MANOR_
|
|||
|
case 46:
|
|||
|
if(effectno >= 0){
|
|||
|
setCharmManor( pc.ptAct, effectno);
|
|||
|
}else
|
|||
|
delCharmManor( pc.ptAct);
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef _CHARTITLE_
|
|||
|
case 45:
|
|||
|
if(effectno >= 0){
|
|||
|
setCharmTitle(pc.ptAct, effectno);
|
|||
|
}else
|
|||
|
delCharmTitle(pc.ptAct);
|
|||
|
break;
|
|||
|
#endif
|
|||
|
case 31:
|
|||
|
#if 1
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
#else
|
|||
|
// ??????????????????
|
|||
|
if(partyModeFlag == 0 || (pc.status & CHR_STATUS_LEADER) != 0)
|
|||
|
{
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
}
|
|||
|
#endif
|
|||
|
setPcAction(ANIM_STAND);
|
|||
|
break;
|
|||
|
|
|||
|
// <20><>?<3F><>?
|
|||
|
case 30:
|
|||
|
setPcDir(dir);
|
|||
|
break;
|
|||
|
|
|||
|
// <20><>?
|
|||
|
case 1:
|
|||
|
setPcAction(ANIM_WALK);
|
|||
|
break;
|
|||
|
|
|||
|
// ??
|
|||
|
case 2:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_ATTACK);
|
|||
|
break;
|
|||
|
|
|||
|
// ???
|
|||
|
case 3:
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_THROW);
|
|||
|
break;
|
|||
|
|
|||
|
// ????
|
|||
|
case 4:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_DAMAGE);
|
|||
|
break;
|
|||
|
|
|||
|
// ?<3F><>
|
|||
|
case 5:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_DEAD);
|
|||
|
break;
|
|||
|
|
|||
|
// ?<3F><><EFBFBD><EFBFBD>?
|
|||
|
case 6:
|
|||
|
break;
|
|||
|
|
|||
|
// ????<3F><>?
|
|||
|
case 7:
|
|||
|
break;
|
|||
|
|
|||
|
// ?????
|
|||
|
case 8: /* UsedMagic */
|
|||
|
break;
|
|||
|
|
|||
|
// <20>X??
|
|||
|
case 10:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_DEAD);
|
|||
|
break;
|
|||
|
|
|||
|
// ??
|
|||
|
case 11:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_SIT);
|
|||
|
break;
|
|||
|
|
|||
|
// <20><>?<3F><>?
|
|||
|
case 12:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_HAND);
|
|||
|
break;
|
|||
|
|
|||
|
// ??
|
|||
|
case 13:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_HAPPY);
|
|||
|
break;
|
|||
|
|
|||
|
// <20>W?
|
|||
|
case 14:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_ANGRY);
|
|||
|
break;
|
|||
|
|
|||
|
// <20>v??
|
|||
|
case 15:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_SAD);
|
|||
|
break;
|
|||
|
|
|||
|
// ???
|
|||
|
case 16:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_GUARD);
|
|||
|
break;
|
|||
|
|
|||
|
// <20><>??<3F>h????
|
|||
|
case 17:
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_WALK);
|
|||
|
break;
|
|||
|
|
|||
|
// ????
|
|||
|
case 18:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_NOD);
|
|||
|
break;
|
|||
|
|
|||
|
// ??<3F>֢t???????
|
|||
|
case 19:
|
|||
|
//setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
setPcAction(ANIM_STAND);
|
|||
|
break;
|
|||
|
|
|||
|
// <20>P<EFBFBD>f<EFBFBD>ѩ<EFBFBD>
|
|||
|
case 20:
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
break;
|
|||
|
|
|||
|
// ????<3F>ѩ<EFBFBD>
|
|||
|
case 21:
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
if(effectno == 1)
|
|||
|
{
|
|||
|
// ???????<3F><><EFBFBD><EFBFBD>
|
|||
|
setPcLeader();
|
|||
|
#if 0
|
|||
|
if(pc.ptAct != NULL)
|
|||
|
{
|
|||
|
pc.ptAct->partyGx = -1;
|
|||
|
pc.ptAct->partyGy = -1;
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
// ???????<3F><>?
|
|||
|
delPcLeader();
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
// ?<3F>P<EFBFBD>ѩ<EFBFBD>
|
|||
|
case 22:
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
if(effectno == 1)
|
|||
|
{
|
|||
|
setPcWatch();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
delPcWatch();
|
|||
|
}
|
|||
|
break;
|
|||
|
|
|||
|
// ???????????<3F><><EFBFBD>q?<3F><>
|
|||
|
case 23:
|
|||
|
setPcNameColor(effectno);
|
|||
|
break;
|
|||
|
#ifdef _STREET_VENDOR
|
|||
|
case 41:
|
|||
|
{
|
|||
|
CHAREXTRA *ext;
|
|||
|
if(pc.ptAct == NULL) break;
|
|||
|
ext = (CHAREXTRA *)pc.ptAct->pYobi;
|
|||
|
if(ext->ptStreetVendor){
|
|||
|
DeathAction(ext->ptStreetVendor);
|
|||
|
ext->ptStreetVendor = NULL;
|
|||
|
}
|
|||
|
ext->ptStreetVendor = GetAction(PRIO_CHR,0);
|
|||
|
}
|
|||
|
break;
|
|||
|
case 42:
|
|||
|
{
|
|||
|
CHAREXTRA *ext;
|
|||
|
if(pc.ptAct == NULL) break;
|
|||
|
ext = (CHAREXTRA *)pc.ptAct->pYobi;
|
|||
|
if(ext->ptStreetVendor){
|
|||
|
DeathAction(ext->ptStreetVendor);
|
|||
|
ext->ptStreetVendor = NULL;
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef _ANGEL_SUMMON
|
|||
|
case 34:
|
|||
|
setPcWarpPoint(x, y);
|
|||
|
setPcDir(dir);
|
|||
|
if(effectno == 1)
|
|||
|
{
|
|||
|
setPcAngel();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
delPcAngel();
|
|||
|
}
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef _ITEM_FIREWORK
|
|||
|
case 51:
|
|||
|
{
|
|||
|
CHAREXTRA *ext;
|
|||
|
|
|||
|
if (pc.ptAct == NULL)
|
|||
|
break;
|
|||
|
ext = (CHAREXTRA *)pc.ptAct->pYobi;
|
|||
|
if (ext->pActFirework[0])
|
|||
|
{
|
|||
|
DeathAction(ext->pActFirework[0]);
|
|||
|
ext->pActFirework[0] = NULL;
|
|||
|
}
|
|||
|
if (ext->pActFirework[1])
|
|||
|
{
|
|||
|
DeathAction(ext->pActFirework[1]);
|
|||
|
ext->pActFirework[1] = NULL;
|
|||
|
}
|
|||
|
ext->pActFirework[0] = GetAction(PRIO_CHR, 0);
|
|||
|
ext->pActFirework[0]->damage = effectno; // <20><><EFBFBD><EFBFBD> damage <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> type (effectno = type)
|
|||
|
ext->pActFirework[0]->anim_chr_no = effectparam1;
|
|||
|
ext->pActFirework[0]->anim_no = ANIM_STAND;
|
|||
|
ext->pActFirework[0]->anim_ang = 1;
|
|||
|
ext->pActFirework[0]->dispPrio = DISP_PRIO_RESERVE;
|
|||
|
if (effectno == 3)
|
|||
|
{
|
|||
|
ext->pActFirework[0]->gx = pc.ptAct->gx + 3;
|
|||
|
ext->pActFirework[0]->gy = pc.ptAct->gy - 3;
|
|||
|
ext->pActFirework[0]->bufGx[0] = pc.ptAct->gx;
|
|||
|
ext->pActFirework[0]->bufGy[0] = pc.ptAct->gy;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ext->pActFirework[0]->gx = pc.ptAct->gx;
|
|||
|
ext->pActFirework[0]->gy = pc.ptAct->gy;
|
|||
|
}
|
|||
|
ext->pActFirework[0]->actNo = 0;
|
|||
|
}
|
|||
|
break;
|
|||
|
#endif
|
|||
|
#ifdef _NPC_MAGICCARD
|
|||
|
case 60:
|
|||
|
{
|
|||
|
CHAREXTRA *ext;
|
|||
|
int i;
|
|||
|
|
|||
|
if (pc.ptAct == NULL)
|
|||
|
break;
|
|||
|
ext = (CHAREXTRA *)pc.ptAct->pYobi;
|
|||
|
|
|||
|
for(i=0;i<4;i++){
|
|||
|
if(ext->pActMagiccard[i]){
|
|||
|
DeathAction(ext->pActMagiccard[i]);
|
|||
|
ext->pActMagiccard[i] = NULL;
|
|||
|
}
|
|||
|
}
|
|||
|
//changePcAct(x, y, dir, 60 , giver , actionNum , petaction)
|
|||
|
//changePcAct(int x, int y, int dir, int action,int effectno, int effectparam1, int effectparam2)
|
|||
|
|
|||
|
//effectno <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9><EFBFBD>ߵ<EFBFBD>λ<EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>
|
|||
|
if(effectparam2 == 3){ //ħ<><C4A7><EFBFBD><EFBFBD>
|
|||
|
ext->pActMagiccard[0] = GetAction(PRIO_CHR,0);
|
|||
|
ext->pActMagiccard[0]->anim_chr_no = effectparam1;
|
|||
|
ext->pActMagiccard[0]->dispPrio = DISP_PRIO_RESERVE;
|
|||
|
if(effectparam1 == 101120 || effectparam1 == 101628){
|
|||
|
ext->pActMagiccard[0]->gx = Positiontable[effectno].humanX+1 + x; //.magic1X;
|
|||
|
ext->pActMagiccard[0]->gy = Positiontable[effectno].humanY-1 + y; //.magic1Y;
|
|||
|
}else{
|
|||
|
ext->pActMagiccard[0]->gx = Positiontable[effectno].petX+1 + x;
|
|||
|
ext->pActMagiccard[0]->gy = Positiontable[effectno].petY-1 + y;
|
|||
|
}
|
|||
|
}else if(effectparam2 == 0){ //<2F><><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ext->pActMagiccard[0] = GetAction(PRIO_CHR,0);
|
|||
|
ext->pActMagiccard[0]->anim_chr_no = 101290;
|
|||
|
ext->pActMagiccard[0]->dispPrio = DISP_PRIO_RESERVE;
|
|||
|
ext->pActMagiccard[0]->gx = Positiontable[effectno].humanX+1 + x;
|
|||
|
ext->pActMagiccard[0]->gy = Positiontable[effectno].humanY-1 + y;
|
|||
|
}else{
|
|||
|
for(i=0;i<4;i++){
|
|||
|
ext->pActMagiccard[i] = GetAction(PRIO_CHR,0);
|
|||
|
if(i == 0){
|
|||
|
ext->pActMagiccard[i]->anim_chr_no = 101942;
|
|||
|
}else if(i == 3){
|
|||
|
ext->pActMagiccard[i]->anim_chr_no = 101943;
|
|||
|
}else{
|
|||
|
ext->pActMagiccard[i]->anim_chr_no = effectparam1;
|
|||
|
}
|
|||
|
ext->pActMagiccard[i]->gx = Positiontable[effectno].petX + x;
|
|||
|
ext->pActMagiccard[i]->gy = Positiontable[effectno].petY + y;
|
|||
|
ext->pActMagiccard[i]->dispPrio = DISP_PRIO_RESERVE;
|
|||
|
ext->pActMagiccard[i]->anim_ang = dir;//1; //<2F><><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
|
|||
|
ext->pActMagiccard[1]->anim_no = ANIM_STAND;
|
|||
|
|
|||
|
if(effectparam2 == 1) //<2F><><EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD>
|
|||
|
ext->pActMagiccard[2]->anim_no = ANIM_ATTACK;
|
|||
|
else if(effectparam2 == 2) //<2F><><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>
|
|||
|
ext->pActMagiccard[2]->anim_no = ANIM_GUARD;
|
|||
|
}
|
|||
|
#ifdef _MOVE_SCREEN
|
|||
|
if(pc.bMoveScreenMode)
|
|||
|
{
|
|||
|
for(i=0;i<4;i++){
|
|||
|
if(ext->pActMagiccard[i]){
|
|||
|
ext->pActMagiccard[i]->gx -= iScreenMoveX;
|
|||
|
ext->pActMagiccard[i]->gy -= iScreenMoveY;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|
|||
|
break;
|
|||
|
#endif
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ??<3F>ѩ<EFBFBD>???? /////////////////////////////////////////////////////////
|
|||
|
void clearPartyParam(void)
|
|||
|
{
|
|||
|
int i;
|
|||
|
#ifdef MAX_AIRPLANENUM
|
|||
|
for (i = 0; i < MAX_AIRPLANENUM; i++)
|
|||
|
#else
|
|||
|
for (i = 0; i < MAX_PARTY; i++)
|
|||
|
#endif
|
|||
|
{
|
|||
|
// ???????????????????????
|
|||
|
if(party[i].useFlag != 0)
|
|||
|
{
|
|||
|
if( party[i].id == pc.id)
|
|||
|
{
|
|||
|
// ????<3F>h??????????
|
|||
|
if(party[i].ptAct != NULL)
|
|||
|
{
|
|||
|
party[i].ptAct->bufCount = 0;
|
|||
|
}
|
|||
|
delPcParty();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
// ??????????<3F>\?????<3F>h????????
|
|||
|
if((pc.status & CHR_STATUS_LEADER) != 0
|
|||
|
&& party[i].ptAct != NULL)
|
|||
|
{
|
|||
|
party[i].ptAct->bufCount = 0;
|
|||
|
}
|
|||
|
delCharParty(party[i].ptAct);
|
|||
|
}
|
|||
|
}
|
|||
|
party[i].useFlag = 0;
|
|||
|
party[i].id = 0;
|
|||
|
party[i].ptAct = NULL;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
delPcLeader();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ??<3F>ѩ<EFBFBD>?ptAct?NULL?<3F>V????
|
|||
|
void clearPtActPartyParam(void)
|
|||
|
{
|
|||
|
int i;
|
|||
|
|
|||
|
#ifdef MAX_AIRPLANENUM
|
|||
|
for (i = 0; i < MAX_AIRPLANENUM; i++)
|
|||
|
#else
|
|||
|
for (i = 0; i < MAX_PARTY; i++)
|
|||
|
#endif
|
|||
|
{
|
|||
|
party[i].ptAct = NULL;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// ???????????<3F>@<40>e???????? /////////////////////////////
|
|||
|
int existCharacterListEntry(int index)
|
|||
|
{
|
|||
|
if(index < 0 || index >= MAXCHARACTER)
|
|||
|
return -1;
|
|||
|
|
|||
|
if(chartable[index].name[0] != '\0')
|
|||
|
{
|
|||
|
return 1;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return 0;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ???????<3F>i?<3F><>????????
|
|||
|
int cmpNameCharacterList(char *name)
|
|||
|
{
|
|||
|
int i;
|
|||
|
|
|||
|
for(i = 0; i < MAXCHARACTER; i++)
|
|||
|
{
|
|||
|
if(strcmp(name, chartable[i].name) == 0)
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
#ifdef _AIDENGLU_
|
|||
|
extern Landed PcLanded;
|
|||
|
#endif
|
|||
|
// ??????????<3F>@<40>e???????????<3F>t?????????????
|
|||
|
int setCharacterList(char *name, char *opt)
|
|||
|
{
|
|||
|
int index;
|
|||
|
|
|||
|
makeStringFromEscaped(name);
|
|||
|
makeStringFromEscaped(opt);
|
|||
|
|
|||
|
index = getIntegerToken(opt, '|', 1);
|
|||
|
|
|||
|
if(index < 0 || index >= MAXCHARACTER)
|
|||
|
return -1;
|
|||
|
#ifdef _AIDENGLU_
|
|||
|
memset(PcLanded.<EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[index],0,32);
|
|||
|
#endif
|
|||
|
memset(&chartable[index], 0, sizeof(CHARLISTTABLE));
|
|||
|
|
|||
|
if(strlen(name) <= CHAR_NAME_LEN)
|
|||
|
{
|
|||
|
strcpy(chartable[index].name, name);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
strcpy(chartable[index].name, "???");
|
|||
|
}
|
|||
|
chartable[index].faceGraNo = getIntegerToken(opt, '|', 2);
|
|||
|
chartable[index].level = getIntegerToken(opt, '|', 3);
|
|||
|
chartable[index].hp = getIntegerToken(opt, '|', 4);
|
|||
|
chartable[index].str = getIntegerToken(opt, '|', 5);
|
|||
|
chartable[index].def = getIntegerToken(opt, '|', 6);
|
|||
|
chartable[index].agi = getIntegerToken(opt, '|', 7);
|
|||
|
chartable[index].app = getIntegerToken(opt, '|', 8);
|
|||
|
chartable[index].dp = getIntegerToken(opt, '|', 9);
|
|||
|
chartable[index].attr[0] = getIntegerToken(opt, '|', 10)/10;
|
|||
|
chartable[index].attr[1] = getIntegerToken(opt, '|', 11)/10;
|
|||
|
chartable[index].attr[2] = getIntegerToken(opt, '|', 12)/10;
|
|||
|
chartable[index].attr[3] = getIntegerToken(opt, '|', 13)/10;
|
|||
|
chartable[index].login = getIntegerToken(opt, '|', 14);
|
|||
|
#ifdef _AIDENGLU_
|
|||
|
strcpy(PcLanded.<EFBFBD><EFBFBD>½<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[index],name);
|
|||
|
#endif
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ???????<3F><>?????
|
|||
|
// int index : ???????0 ~ 7
|
|||
|
int resetCharacterList(int index)
|
|||
|
{
|
|||
|
if(index < 0 || index >= MAXCHARACTER)
|
|||
|
return -1;
|
|||
|
|
|||
|
memset(&chartable[index], 0, sizeof(CHARLISTTABLE));
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ?????<3F><>? /////////////////////////////////////////////////////////
|
|||
|
void getItem(void)
|
|||
|
{
|
|||
|
float tmpDir;
|
|||
|
float tmpX, tmpY;
|
|||
|
int dir;
|
|||
|
static unsigned int piSendTime = 0;
|
|||
|
|
|||
|
// ?<3F><>???????????????<3F><>????????
|
|||
|
if(windowTypeWN == WINDOW_MESSAGETYPE_ITEMSHOPMENU
|
|||
|
|| windowTypeWN == WINDOW_MESSAGETYPE_ITEMSHOPMAIN
|
|||
|
|| windowTypeWN == WINDOW_MESSAGETYPE_LIMITITEMSHOPMAIN)
|
|||
|
return;
|
|||
|
|
|||
|
// <20>k<EFBFBD><6B><EFBFBD>I?<3F>K????<3F><>??????????????
|
|||
|
if(ABS(nowGx - mouseMapGx) > 1
|
|||
|
|| ABS(nowGy - mouseMapGy) > 1)
|
|||
|
return;
|
|||
|
|
|||
|
// <20>k<EFBFBD><6B><EFBFBD>I??????<3F><>???????????
|
|||
|
if(!checkCharObjPoint(mouseMapGx, mouseMapGy,
|
|||
|
CHAROBJ_TYPE_NPC|CHAROBJ_TYPE_ITEM|CHAROBJ_TYPE_MONEY))
|
|||
|
// CHAROBJ_TYPE_ITEM|CHAROBJ_TYPE_MONEY))
|
|||
|
return;
|
|||
|
|
|||
|
// ???????<3F><>??<3F><>??
|
|||
|
tmpX = (float)(mouseMapGx - nowGx);
|
|||
|
tmpY = (float)(mouseMapGy - nowGy);
|
|||
|
tmpDir = Atan(tmpX, tmpY) + 22.5F - 45.0F*3;
|
|||
|
AdjustDir(&tmpDir);
|
|||
|
dir = (int)(tmpDir/45);
|
|||
|
|
|||
|
// ?<3F><>?<3F><>
|
|||
|
if(piSendTime+FIELD_BTN_PUSH_WAIT < TimeGetTime())
|
|||
|
{
|
|||
|
// ??????
|
|||
|
if(bNewServer) {
|
|||
|
lssproto_PI_send(sockfd, nowGx, nowGy, dir);
|
|||
|
}
|
|||
|
else
|
|||
|
old_lssproto_PI_send(sockfd, nowGx, nowGy, dir);
|
|||
|
piSendTime = TimeGetTime();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#ifdef __TALK_TO_NPC
|
|||
|
|
|||
|
BOOL TalkToNPC(void)
|
|||
|
{
|
|||
|
float tmpDir;
|
|||
|
float tmpX, tmpY;
|
|||
|
int dir;
|
|||
|
static unsigned int talkSendTime = 0;
|
|||
|
if(windowTypeWN == WINDOW_MESSAGETYPE_ITEMSHOPMENU
|
|||
|
|| windowTypeWN == WINDOW_MESSAGETYPE_ITEMSHOPMAIN
|
|||
|
|| windowTypeWN == WINDOW_MESSAGETYPE_LIMITITEMSHOPMAIN)
|
|||
|
return FALSE;
|
|||
|
|
|||
|
if(nowVx != 0 || nowVy != 0)
|
|||
|
return FALSE;
|
|||
|
if(ABS(nowGx - mouseMapGx) > 2
|
|||
|
|| ABS(nowGy - mouseMapGy) > 2)
|
|||
|
return FALSE;
|
|||
|
if(!checkCharObjPoint(mouseMapGx, mouseMapGy, CHAROBJ_TYPE_NPC))
|
|||
|
return FALSE;
|
|||
|
tmpX = (float)(mouseMapGx - nowGx);
|
|||
|
tmpY = (float)(mouseMapGy - nowGy);
|
|||
|
tmpDir = Atan(tmpX, tmpY) + 22.5F;
|
|||
|
AdjustDir(&tmpDir);
|
|||
|
dir = (int)(tmpDir/45);
|
|||
|
if(talkSendTime+FIELD_BTN_PUSH_WAIT < TimeGetTime()){
|
|||
|
if(pc.ptAct->anim_ang != dir){
|
|||
|
char dir2[2];
|
|||
|
setPcDir(dir);
|
|||
|
|
|||
|
dir2[0] = cnvServDir(dir, 1);
|
|||
|
dir2[1] = '\0';
|
|||
|
|
|||
|
walkSendForServer(nowGx, nowGy, dir2);
|
|||
|
}
|
|||
|
char dest[1024], m[1024];
|
|||
|
extern STR_BUFFER chatRegistryStr[];
|
|||
|
if(chatRegistryStr[7].cnt > 0)
|
|||
|
makeEscapeString(chatRegistryStr[7].buffer, dest, sizeof(dest));
|
|||
|
else
|
|||
|
makeEscapeString("hi", dest, sizeof(dest));
|
|||
|
sprintf_s(m, "P|%s", dest);
|
|||
|
if(bNewServer)
|
|||
|
lssproto_TK_send(sockfd, nowGx, nowGy, m, MyChatBuffer.color, NowMaxVoice);
|
|||
|
else
|
|||
|
old_lssproto_TK_send(sockfd, nowGx, nowGy, m, MyChatBuffer.color, NowMaxVoice);
|
|||
|
talkSendTime = TimeGetTime();
|
|||
|
}
|
|||
|
return TRUE;
|
|||
|
}
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
// ?????<3F>V?<3F>v? /////////////////////////////////////////////////////
|
|||
|
void swapItem(int from, int to)
|
|||
|
{
|
|||
|
if(from < 0 || to < 0)
|
|||
|
return;
|
|||
|
// swapShort(&pc.item[from].useFlag, &pc.item[to].useFlag);
|
|||
|
swap(pc.item[from].useFlag, pc.item[to].useFlag);
|
|||
|
// swapString(pc.item[from].name, pc.item[to].name);
|
|||
|
swap(pc.item[from].name, pc.item[to].name);
|
|||
|
// swapString(pc.item[from].name2, pc.item[to].name2);
|
|||
|
swap(pc.item[from].name2, pc.item[to].name2);
|
|||
|
// swapString(pc.item[from].memo, pc.item[to].memo);
|
|||
|
swap(pc.item[from].memo, pc.item[to].memo);
|
|||
|
// swapInteger(&pc.item[from].color, &pc.item[to].color);
|
|||
|
swap(pc.item[from].color, pc.item[to].color);
|
|||
|
// swapInteger(&pc.item[from].graNo, &pc.item[to].graNo);
|
|||
|
swap(pc.item[from].graNo, pc.item[to].graNo);
|
|||
|
// swapInteger(&pc.item[from].level, &pc.item[to].level);
|
|||
|
swap(pc.item[from].level, pc.item[to].level);
|
|||
|
// swapShort(&pc.item[from].field, &pc.item[to].field);
|
|||
|
swap(pc.item[from].field, pc.item[to].field);
|
|||
|
// swapShort(&pc.item[from].target, &pc.item[to].target);
|
|||
|
swap(pc.item[from].target, pc.item[to].target);
|
|||
|
// swapShort(&pc.item[from].deadTargetFlag, &pc.item[to].deadTargetFlag);
|
|||
|
swap(pc.item[from].deadTargetFlag, pc.item[to].deadTargetFlag);
|
|||
|
// swapShort(&pc.item[from].sendFlag, &pc.item[to].sendFlag);
|
|||
|
swap(pc.item[from].sendFlag, pc.item[to].sendFlag);
|
|||
|
// swapString(pc.item[from].damage, pc.item[to].damage);
|
|||
|
swap(pc.item[from].damage, pc.item[to].damage);
|
|||
|
#ifdef _ITEM_PILENUMS
|
|||
|
// swapInteger(&pc.item[from].pile, &pc.item[to].pile);
|
|||
|
swap(pc.item[from].pile, pc.item[to].pile);
|
|||
|
#endif
|
|||
|
#ifdef _PET_ITEM
|
|||
|
swap(pc.item[from].type, pc.item[to].type);
|
|||
|
#endif
|
|||
|
#ifdef _ITEM_JIGSAW
|
|||
|
swap(pc.item[from].jigsaw, pc.item[to].jigsaw);
|
|||
|
#endif
|
|||
|
#ifdef _NPC_ITEMUP
|
|||
|
swap(pc.item[from].itemup, pc.item[to].itemup);
|
|||
|
#endif
|
|||
|
#ifdef _ITEM_COUNTDOWN
|
|||
|
swap(pc.item[from].counttime, pc.item[to].counttime);
|
|||
|
#endif
|
|||
|
}
|
|||
|
|
|||
|
// <20><>?<3F>k?<3F>V??
|
|||
|
/*void swapInteger(int *a, int *b)
|
|||
|
{
|
|||
|
int tmp;
|
|||
|
|
|||
|
tmp = *a;
|
|||
|
*a = *b;
|
|||
|
*b = tmp;
|
|||
|
}*/
|
|||
|
|
|||
|
|
|||
|
/*void swapShort(short *a, short *b)
|
|||
|
{
|
|||
|
short tmp;
|
|||
|
|
|||
|
tmp = *a;
|
|||
|
*a = *b;
|
|||
|
*b = tmp;
|
|||
|
}*/
|
|||
|
|
|||
|
|
|||
|
// <20><>???<3F>V?<3F>v??????255<35><35>????<3F><>???
|
|||
|
/*void swapString(char *a, char *b)
|
|||
|
{
|
|||
|
char tmp[256];
|
|||
|
|
|||
|
if(strlen(a) > 255 || strlen(b) > 255)
|
|||
|
return;
|
|||
|
|
|||
|
strcpy(tmp, a);
|
|||
|
strcpy(a, b);
|
|||
|
strcpy(b, tmp);
|
|||
|
}
|
|||
|
*/
|
|||
|
|
|||
|
// ?<3F><>????????? /////////////////////////////////////////////////
|
|||
|
BOOL lookAtAround(void)
|
|||
|
{
|
|||
|
float tmpDir;
|
|||
|
float tmpX, tmpY;
|
|||
|
int dir;
|
|||
|
static unsigned int lSendTime = 0;
|
|||
|
|
|||
|
// ?<3F><>???????????????????????
|
|||
|
if(windowTypeWN == WINDOW_MESSAGETYPE_ITEMSHOPMENU
|
|||
|
|| windowTypeWN == WINDOW_MESSAGETYPE_ITEMSHOPMAIN
|
|||
|
|| windowTypeWN == WINDOW_MESSAGETYPE_LIMITITEMSHOPMAIN)
|
|||
|
return FALSE;
|
|||
|
|
|||
|
// <20>k<EFBFBD><6B><EFBFBD>I?<3F>K????<3F><>??????????????
|
|||
|
if(ABS(nowGx - mouseMapGx) > 2
|
|||
|
|| ABS(nowGy - mouseMapGy) > 2)
|
|||
|
return FALSE;
|
|||
|
|
|||
|
// <20>k<EFBFBD><6B><EFBFBD>I??????<3F><>???????????
|
|||
|
if(!checkCharObjPoint(mouseMapGx, mouseMapGy, CHAROBJ_TYPE_LOOKAT))
|
|||
|
return FALSE;
|
|||
|
|
|||
|
// ???????<3F><>??<3F><>??
|
|||
|
tmpX = (float)(mouseMapGx - nowGx);
|
|||
|
tmpY = (float)(mouseMapGy - nowGy);
|
|||
|
if(tmpX == 0 && tmpY == 0) // ?<3F><><EFBFBD>Y?<3F><>?<3F><><EFBFBD><EFBFBD>?????????<3F><>??
|
|||
|
return FALSE;
|
|||
|
|
|||
|
tmpDir = Atan(tmpX, tmpY) + 22.5F - 45.0F*3;
|
|||
|
AdjustDir(&tmpDir);
|
|||
|
dir = (int)(tmpDir/45);
|
|||
|
|
|||
|
// ?<3F><>?<3F><>
|
|||
|
if(lSendTime+FIELD_BTN_PUSH_WAIT < TimeGetTime())
|
|||
|
{
|
|||
|
// ??????
|
|||
|
if(bNewServer)
|
|||
|
lssproto_L_send(sockfd, dir);
|
|||
|
else
|
|||
|
old_lssproto_L_send(sockfd, dir);
|
|||
|
lSendTime = TimeGetTime();
|
|||
|
}
|
|||
|
|
|||
|
return TRUE;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// ????????? /////////////////////////////////////////////////////
|
|||
|
BOOL addressBookFlag = FALSE;
|
|||
|
ACTION *ptActAddressBookWin = NULL;
|
|||
|
int addressBookX = 16;
|
|||
|
int addressBookY = 16;
|
|||
|
int addressBookPage = 0;
|
|||
|
ACTION *ptActAddressBookChar[MAX_ADR_BOOK_COUNT];
|
|||
|
|
|||
|
// <20>k<EFBFBD><6B>???<3F><>?????
|
|||
|
int addressBookSelectStrItem[1+3*MAX_ADR_BOOK_COUNT];
|
|||
|
// 0 ... <20><>??
|
|||
|
// n*3+1 ... ?<3F><>
|
|||
|
// n*3+2 ... <20><><EFBFBD><EFBFBD>
|
|||
|
// n*3+3 ... ??
|
|||
|
|
|||
|
|
|||
|
BOOL addressBookSendMsgFlag = FALSE;
|
|||
|
ACTION *ptActAddressBookSendMsgWin = NULL;
|
|||
|
|
|||
|
|
|||
|
void addressBookWindow1(void);
|
|||
|
|
|||
|
|
|||
|
// ???????????
|
|||
|
void initAddressBook(void)
|
|||
|
{
|
|||
|
int i;
|
|||
|
|
|||
|
addressBookFlag = FALSE;
|
|||
|
ptActAddressBookWin = NULL;
|
|||
|
memset(&ptActAddressBookChar, 0, sizeof(ptActAddressBookChar));
|
|||
|
addressBookPage = 0;
|
|||
|
for(i = 0; i < sizeof(addressBookSelectStrItem)/sizeof(int); i++)
|
|||
|
{
|
|||
|
addressBookSelectStrItem[i] = -2;
|
|||
|
}
|
|||
|
|
|||
|
addressBookSendMsgFlag = FALSE;
|
|||
|
ptActAddressBookSendMsgWin = NULL;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ?????????
|
|||
|
void addressBookProc(void)
|
|||
|
{
|
|||
|
int i;
|
|||
|
int no;
|
|||
|
|
|||
|
// ??????????
|
|||
|
if(addressBookFlag
|
|||
|
&& ptActAddressBookWin == NULL)
|
|||
|
{
|
|||
|
// ??????????????
|
|||
|
ptActAddressBookWin = MakeWindowDisp(addressBookX, addressBookY, 4, 8, NULL, 1);
|
|||
|
// ?<3F><>?????????
|
|||
|
for(i = 0; i < MAX_ADR_BOOK_COUNT; i++)
|
|||
|
{
|
|||
|
no = addressBookPage*MAX_ADR_BOOK_COUNT+i;
|
|||
|
|
|||
|
ptActAddressBookChar[i] = GetAction(PRIO_CHR, 0);
|
|||
|
if(ptActAddressBookChar[i] != NULL)
|
|||
|
{
|
|||
|
ptActAddressBookChar[i]->anim_chr_no = addressBook[no].graNo;
|
|||
|
ptActAddressBookChar[i]->atr = ACT_ATR_HIDE;
|
|||
|
ptActAddressBookChar[i]->anim_no = ANIM_STAND;
|
|||
|
ptActAddressBookChar[i]->dispPrio = DISP_PRIO_ITEM;
|
|||
|
ptActAddressBookChar[i]->x = addressBookX + 40;
|
|||
|
ptActAddressBookChar[i]->y = addressBookY + i * 110 + 80;
|
|||
|
pattern(ptActAddressBookChar[i], ANM_NOMAL_SPD, ANM_LOOP);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
// ????????<3F><>??
|
|||
|
else
|
|||
|
if(!addressBookFlag
|
|||
|
&& ptActAddressBookWin != NULL)
|
|||
|
{
|
|||
|
DeathAction(ptActAddressBookWin);
|
|||
|
ptActAddressBookWin = NULL;
|
|||
|
for(i = 0; i < MAX_ADR_BOOK_COUNT; i++)
|
|||
|
{
|
|||
|
if(ptActAddressBookChar[i] != NULL)
|
|||
|
{
|
|||
|
DeathAction(ptActAddressBookChar[i]);
|
|||
|
ptActAddressBookChar[i] = NULL;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
// ???????<3F><><EFBFBD><EFBFBD>
|
|||
|
else
|
|||
|
if(addressBookFlag
|
|||
|
&& ptActAddressBookWin != NULL)
|
|||
|
{
|
|||
|
addressBookWindow1();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// ???????<3F><><EFBFBD><EFBFBD>
|
|||
|
void addressBookWindow1(void)
|
|||
|
{
|
|||
|
int mode = 0;
|
|||
|
int i;
|
|||
|
int no;
|
|||
|
char msg[256];
|
|||
|
|
|||
|
// <20><>???<3F>k<EFBFBD><6B>??????????
|
|||
|
// ???????????????????
|
|||
|
if(mouse.onceState & MOUSE_LEFT_CRICK)
|
|||
|
{
|
|||
|
for(i = 0; i < sizeof(addressBookSelectStrItem)/sizeof(int); i++)
|
|||
|
{
|
|||
|
if(addressBookSelectStrItem[i] == HitFontNo)
|
|||
|
{
|
|||
|
mode = i + 1;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// <20><>????????????<3F><>??
|
|||
|
if(mode == 1)
|
|||
|
{
|
|||
|
addressBookFlag = FALSE;
|
|||
|
return;
|
|||
|
}
|
|||
|
// ?????????????????????
|
|||
|
else
|
|||
|
if((mode-2) < MAX_ADR_BOOK_COUNT*3
|
|||
|
&& ((mode-2) % 3) == 2)
|
|||
|
{
|
|||
|
if(bNewServer)
|
|||
|
lssproto_DAB_send(sockfd, addressBookPage*MAX_ADR_BOOK_COUNT+((mode-2)/3));
|
|||
|
else
|
|||
|
old_lssproto_DAB_send(sockfd, addressBookPage*MAX_ADR_BOOK_COUNT+((mode-2)/3));
|
|||
|
}
|
|||
|
|
|||
|
// ???????????<3F><>?????<3F><>?<3F><><EFBFBD><EFBFBD>
|
|||
|
if(ptActAddressBookWin->hp >= 1)
|
|||
|
{
|
|||
|
for(i = 0; i < MAX_ADR_BOOK_COUNT; i++)
|
|||
|
{
|
|||
|
no = addressBookPage*MAX_ADR_BOOK_COUNT+i;
|
|||
|
|
|||
|
if(ptActAddressBookChar[i] != NULL)
|
|||
|
{
|
|||
|
// <20><><EFBFBD>q?????????<3F>V???????
|
|||
|
if(strlen(addressBook[no].name) > 0)
|
|||
|
{
|
|||
|
// ??????<3F>k?????<3F>ѩ<EFBFBD><D1A9><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// ???<3F><><EFBFBD><EFBFBD>
|
|||
|
ptActAddressBookChar[i]->atr &= (~ACT_ATR_HIDE);
|
|||
|
ptActAddressBookChar[i]->anim_chr_no = addressBook[no].graNo;
|
|||
|
// <20><><EFBFBD>q<EFBFBD><71><EFBFBD><EFBFBD>
|
|||
|
sprintf_s(msg, "NAME. %s", addressBook[no].name);
|
|||
|
StockFontBuffer(addressBookX + 68, addressBookY + i * 110 + 28,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_WHITE, msg, 0);
|
|||
|
|
|||
|
// ???<3F><><EFBFBD><EFBFBD>
|
|||
|
sprintf_s(msg, "LV. %d", addressBook[no].level);
|
|||
|
StockFontBuffer(addressBookX + 68, addressBookY + i * 110 + 46,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_WHITE, msg, 0);
|
|||
|
// ?????<3F><><EFBFBD><EFBFBD>
|
|||
|
if(addressBook[i].onlineFlag != 0)
|
|||
|
{
|
|||
|
StockFontBuffer(addressBookX + 130, addressBookY + i * 110 + 46,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_WHITE, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 0);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
StockFontBuffer(addressBookX + 130, addressBookY + i * 110 + 46,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_GRAY, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 0);
|
|||
|
}
|
|||
|
// ?<3F><>???<3F><><EFBFBD><EFBFBD>
|
|||
|
addressBookSelectStrItem[i*3+1] =
|
|||
|
StockFontBuffer(addressBookX + 68, addressBookY + i * 110 + 64,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_YELLOW, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 2);
|
|||
|
// <20><><EFBFBD><EFBFBD>???<3F><><EFBFBD><EFBFBD>
|
|||
|
addressBookSelectStrItem[i*3+2] =
|
|||
|
StockFontBuffer(addressBookX + 112, addressBookY + i * 110 + 64,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_YELLOW, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 2);
|
|||
|
// ?????<3F><><EFBFBD><EFBFBD>
|
|||
|
addressBookSelectStrItem[i*3+3] =
|
|||
|
StockFontBuffer(addressBookX + 156, addressBookY + i * 110 + 64,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_YELLOW, "ɾ<EFBFBD><EFBFBD>", 2);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
ptActAddressBookChar[i]->atr |= ACT_ATR_HIDE;
|
|||
|
|
|||
|
ptActAddressBookChar[i]->anim_chr_no = 0;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
addressBookSelectStrItem[0] =
|
|||
|
StockFontBuffer(addressBookX + 56, addressBookY + 352,
|
|||
|
FONT_PRIO_FRONT, FONT_PAL_YELLOW, "<EFBFBD>ر<EFBFBD>", 2);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
int CHAR_getMaxHaveGold()
|
|||
|
{
|
|||
|
int MaxGold;
|
|||
|
#ifdef _FIX_MAXGOLD // WON ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǯ<EFBFBD><C7AE><EFBFBD><EFBFBD>
|
|||
|
int trans = pc.transmigration;
|
|||
|
MaxGold = 1000000 + trans*(1800000);
|
|||
|
#else
|
|||
|
MaxGold = MAX_GOLD;
|
|||
|
#endif
|
|||
|
return MaxGold;
|
|||
|
}
|