Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
211 lines
8.3 KiB
C++
211 lines
8.3 KiB
C++
// CharacterControl.h: interface for the CCharacterControl class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#if !defined(AFX_CHARACTERCONTROL_H__E5DF7481_5D2B_4E51_B47A_951185AFB01D__INCLUDED_)
|
||
#define AFX_CHARACTERCONTROL_H__E5DF7481_5D2B_4E51_B47A_951185AFB01D__INCLUDED_
|
||
|
||
#if _MSC_VER > 1000
|
||
#pragma once
|
||
#endif // _MSC_VER > 1000
|
||
|
||
#define CT_PC 0
|
||
#define CT_NPC 1
|
||
#define CT_MONSTER 2
|
||
|
||
#define TARGET_SELF 10001
|
||
#define TARGET_SELECTCHAR 10000
|
||
|
||
#include "Creature.h"
|
||
#include "CreatureSize.h"
|
||
#include "List.h"
|
||
#include "CameraControl.h"
|
||
#include "..\\Effect\\CEffscript.h"
|
||
#include "CCameraScript.h"
|
||
|
||
|
||
extern CCameraScript *g_CameraScript;
|
||
extern int MAXCHRLOAD;
|
||
|
||
class CCharacterControl
|
||
{
|
||
class CAttackedNode
|
||
{
|
||
public:
|
||
DWORD m_dwSrcChrID, m_dwTarChrID;
|
||
unsigned long m_dwWeaponType;
|
||
};
|
||
public:
|
||
bool CheckCharacterListIn(CZ3DGeneralChrModel *pChr) { return true;}
|
||
|
||
char * GetCreatureName(unsigned long dwChrID);
|
||
void InitGlobalAction(void);
|
||
BOOL GetAttacking(void);
|
||
BOOL CheckMonsterForward(void);
|
||
void MakeVisualAttackInfo();
|
||
CTexture *m_SimpleHumanTexture[4];
|
||
void UnloadCash(CZ3DGeneralChrModel *pChrmodel);
|
||
void GetSendCharacterChatList(List<DWORD> &SendCharacterList);
|
||
void GetSendCharacterList(List<DWORD> &SendCharacterList);
|
||
void MakeAttackInfo(DWORD dwEnemyChrID);
|
||
void PlaySound(int nMethod,vector3 vecPos);
|
||
BOOL m_bCharacterTargetNear;
|
||
DWORD m_nSelectItem;
|
||
void PlayerProcessOperation(BOOL bKeyAble);
|
||
void SetDirectionforMouse(vector3 &vecDirection);
|
||
// CEffScript *m_pCharacterSelectEff;
|
||
// CEffScript *m_pEnemyCharacterSelectEff;
|
||
// CEffScript *m_pEnemyAttackEff;
|
||
bool m_bSkillAttack;
|
||
|
||
long m_lAutoRunCounter;
|
||
unsigned long m_dwAutoTargetID;
|
||
bool m_bAutoTargetAttack;
|
||
CCreature * GetCreature(CZ3DGeneralChrModel *pChrmodel);
|
||
void MouseClickModeSelfCharacterUpdate(BOOL bKeyAble, BOOL bEdge, int MouseX, int MouseY);
|
||
vector3 m_vecClickPos;
|
||
bool m_bClickMove;
|
||
bool m_bClickAttack;
|
||
DWORD m_dwClickModeAttackTargetID;
|
||
void CheckCameraShakeTiming();
|
||
void CheckAttackedTiming();
|
||
List<CAttackedNode> m_AttackedList;
|
||
void RegistAttacked(DWORD dwSrcChrID,DWORD dwTarChrID, unsigned long dwWeaponType = 0);
|
||
void MakeAttacked(DWORD dwChrID, unsigned long dwWeaponType);
|
||
bool MakeSkillAttackInfo(unsigned long dwTargetID, unsigned short wSkill = 0, unsigned char cSkillLock = 0, unsigned char cSkillLevel = 0, unsigned char cAtCount = 1);
|
||
vector3 *GetFindChrPos(unsigned long dwChrID);
|
||
bool m_bClientUsed;
|
||
CCameraControl m_Camera;
|
||
void MouseModeChange();
|
||
////////////// Network Bind Function ///////////////
|
||
static vector3 (*GetMonsterMinBox)(unsigned long dwChrID);
|
||
static vector3 (*GetMonsterMaxBox)(unsigned long dwChrID);
|
||
static bool (*IsExistToList)(unsigned short List_In, DWORD CharID_In);
|
||
static bool (*CharAddressRequireInfo)(DWORD SenderID_In, DWORD CharID_In);
|
||
static BOOL (*SendMovingPacket)(unsigned long dwUpperAni, unsigned long dwLowerAni, float fDir, vector3 &vecMove);
|
||
static BOOL (*SendCharRespawn)(unsigned long dwChrID);
|
||
static BOOL (*SendMoveUpdatePacket)(float fDir, vector3 &vecPosition);
|
||
static BOOL (*SendCharAttack)(vector3 &vecPos, float fDir, unsigned short wType, unsigned char cSkillLock, unsigned char cSkillLevel, unsigned char cAtCount, unsigned short wDefenserNum, unsigned long dwDefenser[10]);
|
||
static void (*PickItem)(DWORD nItemID);
|
||
////////////////////////////////////////////////////
|
||
//static void SetSlideValue(CEffScript *,CEffScript::CEffExt6 );
|
||
static void (*SetChangeWeapon)(BOOL bChangeWeapon);
|
||
static void (*SetAutoRun)(BOOL bAutoRun);
|
||
static BOOL (*GetAutoRun)(void);
|
||
static char *(*GetMotionSheet)(char *strWeaponName, char *strShieldName, unsigned short wClass);
|
||
static unsigned long (*GetWeaponType)(char *strWeaponName);
|
||
static void (*CheckTargetforSkill)(unsigned long &dwTargetID, BOOL bCheckLength);
|
||
static BOOL (*CheckSkillStart)(BOOL bDown);
|
||
static BOOL (*CheckStillCasting)(unsigned long &dwFunction);
|
||
static void (*ChangeWeapon)(void);
|
||
static void (*SetKillCounter)(long lKillCounter);
|
||
void WrapSendCharAttack(vector3 &vecPos, float fDir, unsigned short wAtType, unsigned char cSkillLock, unsigned char cSkillLevel, unsigned char cAtCount, unsigned short wDefenserNum,unsigned long lpAtNode[10]);
|
||
void WrapSendMoveUpdatePacket(float fDir,vector3 vecPos);
|
||
void WrapSendCharRespawn(DWORD dwChrID);
|
||
void WrapSendMovingPacket(DWORD dwUpperAction,DWORD dwLowerAction,float fDir,vector3 vecPos);
|
||
CCreatureSize m_CreatureSize; // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
CCreature * GetCreature(unsigned long dwChrID);
|
||
unsigned long GetClientType(unsigned long dwChrID, BOOL bNation = FALSE);
|
||
void UpdateMonster(unsigned long cChr, float fUpdateTime);
|
||
void UpdatePlayer(unsigned long cChr, float fUpdateTime);
|
||
BOOL GetIsExistChar(unsigned long dwChrID);
|
||
void AddActionData(unsigned long dwChrID, unsigned long dwUpperAni, unsigned long dwLowerAni, float fDirection, vector3 &vecNextPosition, float fVec = 0.0f, unsigned short wAniNum = 0, unsigned long dwFrame = 0);
|
||
void Create(void);
|
||
class ChrCashNode
|
||
{
|
||
public:
|
||
CZ3DGeneralChrModel *m_lpChrModel;
|
||
char m_strGCMDSName[MAX_PATH];
|
||
int m_nUsedChrID;
|
||
};
|
||
BOOL m_bSkillExecuted;
|
||
unsigned long m_dwStartSkillTick;
|
||
unsigned long m_dwCastingSkillTick;
|
||
unsigned long m_dwCastingSkillGrade;
|
||
bool m_bAttackMode;
|
||
List<CCreature *> m_lstCharData; // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||
List<ChrCashNode> m_ChrCashList; // ij<><C4B3> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ
|
||
int m_nFocusCharacter; // <20>ڽ<EFBFBD><DABD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD>
|
||
int m_nChrAction;
|
||
//float m_fCameraRotY, m_fCameraRotX;
|
||
//float m_fInterCharacterCamera;
|
||
int m_nChrCounter;
|
||
vector3 m_vecPrePosition; // <20>ڽ<EFBFBD><DABD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ġ(NPC <20>Ÿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||
unsigned long m_dwMaxCombo; // <20>ڽ<EFBFBD><DABD><EFBFBD> <20><> <20><EFBFBD><DEBA><EFBFBD>
|
||
BOOL m_bAttackable;
|
||
|
||
CEffScript *m_lpDuelReady;
|
||
CEffScript *m_lpButtonNormal;
|
||
BOOL m_bComboSuccess;
|
||
|
||
unsigned long m_dwPreDuelTargetID;
|
||
unsigned long m_dwDuelTargetID;
|
||
|
||
unsigned long m_dwRunFactorTimer;
|
||
unsigned long m_dwNormalTargetMonsterID;
|
||
unsigned long m_dwNormalTargetID;
|
||
unsigned long m_dwSpecialTargetID;
|
||
BOOL m_bAttackResult;
|
||
|
||
float m_fRunSpeed;
|
||
float m_fWalkSpeed;
|
||
|
||
float m_fSkillLength;
|
||
|
||
int m_nCharMovingPacketTimerID;
|
||
int m_nCharMoveUpdatePacketTimerID;
|
||
int m_SkillAttackValue; //Skill <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ٲ<EFBFBD><D9B2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD>
|
||
|
||
//static bool m_bSlide;
|
||
//static CEffScript::CEffExt6 m_SlideValue;
|
||
unsigned long m_dwSlideTick;
|
||
//static CEffScript *m_SlideEffect;
|
||
|
||
static char m_WCharMotion[50];
|
||
CEffScript *m_Effect;
|
||
char m_TextEsf[256];
|
||
char m_TextEsfInterface[256];
|
||
|
||
CCharacterControl();
|
||
~CCharacterControl();
|
||
|
||
void DeleteAllCharacter(void);
|
||
|
||
void SetCamera(int dx = 0, int dy = 0, int dz = 0);
|
||
void MakeShake(int nChrID);
|
||
bool MakeAttackInfo(unsigned short wSkill = 0, unsigned char cSkillLock = 0, unsigned char cSkillLevel = 0, unsigned char cAtCount = 1, float fAttackAngle=0.0f,float fAttackRate=0.0f, BOOL bAngle = TRUE);
|
||
|
||
// void SetAction(int nActionType, int nAction);
|
||
void SetShape(CZ3DGeneralChrModel* pChrmodel, char strShape[15][256]);
|
||
|
||
int AddCharacter(unsigned long dwChrID, const char *strName, char *strGCMDSName, vector3 vecChrPos, float fDirection);
|
||
int AddCharacter(unsigned long dwChrID, unsigned char cNation, const char *strName, char *strGCMDSName, char *strFaceType, char *strHairStyle, vector3 vecChrPos, float fDirection, char strShape[15][256]);
|
||
int AddCharacter(unsigned long dwChrID, vector3 vecChrPos);
|
||
CZ3DGeneralChrModel* AllocCharacter(char *strGCMDSName, char *strFaceType, char *strHairStyle, int nChrID, char strShape[15][256]);
|
||
void UnLoadChr(unsigned long dwUID);
|
||
|
||
void MouseMove(int MouseX, int MouseY);
|
||
|
||
unsigned long GetScreenPosChr(POINT &Point, int nMode = 0, float fLength = 0);
|
||
|
||
int m_MouseClickMode;
|
||
|
||
int m_nCameraAnimation;
|
||
|
||
void Update(float fUpdateTime);
|
||
void UpdateSelfCharacter(BOOL bKeyAble = TRUE, BOOL bEdge = FALSE, int MouseX=0,int MouseY=0);
|
||
void SelfCharacterUpdate();
|
||
void Render(LPDIRECT3DDEVICE8 pd3dDevice);
|
||
|
||
/////////// Monster
|
||
void MonsterEffectProcess(int iChracter,char *strFilename,int iEffectValue = 1);
|
||
////////////
|
||
|
||
//void PlaySlide();
|
||
//void RenderSlide(float beforex,float beforey,float beforez,float nowx,float nowy,float nowz,float unitsize);
|
||
|
||
|
||
};
|
||
|
||
#endif // !defined(AFX_CHARACTERCONTROL_H__E5DF7481_5D2B_4E51_B47A_951185AFB01D__INCLUDED_)
|