Files
Client/GameTools/GLOBALSCRIPT/Creature/CreatureStructure.h
LGram16 dd97ddec92 Restructure repository to include all source folders
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>
2025-11-29 20:17:20 +09:00

139 lines
3.8 KiB
C

#ifndef _CREATURE_STRUCTURE_H_
#define _CREATURE_STRUCTURE_H_
#include <winsock2.h>
#include <windows.h>
#include <cmath>
#include <DB/DBDefine.h>
// 전방 참조
struct CreatureStatus;
struct CharacterStatus;
// 맵 이동 정보
struct Position
{
float m_fPointX; // Point X 좌표
float m_fPointY; // Point Y 좌표
float m_fPointZ; // Point Z 좌표
inline Position();
inline Position(const POS& Pos);
inline Position(const Position& Pos);
inline Position(float fPointX, float fPointY, float fPointZ);
inline unsigned int GetDistance(const Position& rhs) const
{
return (unsigned int)sqrt((m_fPointX - rhs.m_fPointX) * (m_fPointX - rhs.m_fPointX) +
(m_fPointY - rhs.m_fPointY) * (m_fPointY - rhs.m_fPointY) +
(m_fPointZ - rhs.m_fPointZ) * (m_fPointZ - rhs.m_fPointZ));
}
};
typedef Position* LPPosition;
inline Position::Position()
: m_fPointX(0.0f), m_fPointY(0.0f), m_fPointZ(0.0f) { }
inline Position::Position(const POS& Pos)
: m_fPointX(Pos.fPointX), m_fPointY(Pos.fPointY), m_fPointZ(Pos.fPointZ) { }
inline Position::Position(const Position& Pos)
: m_fPointX(Pos.m_fPointX), m_fPointY(Pos.m_fPointY), m_fPointZ(Pos.m_fPointZ) { }
inline Position::Position(float fPointX, float fPointY, float fPointZ)
: m_fPointX(fPointX), m_fPointY(fPointY), m_fPointZ(fPointZ) { }
// 동작 정보
struct MotionInfo
{
float m_fDirection; // 바라보는 방향
float m_fVelocity; // 속도
unsigned short m_wAction; // 취하는 행동
unsigned long m_dwFrame; // 모션 프레임 ( 몬스터, NPC가 사용 )
MotionInfo();
};
typedef MotionInfo* LPMotionInfo;
// 캐릭터 스테이터스 정보.
struct StatusInfo
{
enum {
ATTRIBUTE_FIRE = 0,
ATTRIBUTE_LIGHTNING = 1,
ATTRIBUTE_COLD = 2,
ATTRIBUTE_DRAIN = 3,
ATTRIBUTE_POISON = 4,
MAX_ATTRIBUTE_NUM = 5
};
short m_nCriticalType; // 크리티컬 타입 ( 추가 효과 타입 ex> 검 - 블리딩, 도끼 - 방어율 저하, 둔기 - 스턴 ... )
short m_nCriticalPercentage; // 크리티컬 확률
short m_nMinDamage; // 최소 대미지
short m_nMaxDamage; // 최대 대미지
float m_fDRC; // DRC
short m_nOffenceRevision; // 공격 보정값.
short m_nDefence; // 방어력.
short m_nDefenceRevision; // 방어 보정값.
short m_nMagicResistance; // 마법 저항력
short m_nBlockingPercentage; // 블록율
short m_nAttackSpeed; // 공격 속도.
short m_nMoveSpeed; // 이동 속도.
short m_nAttackRange; // 공격 거리. // 단위 = cm
short m_nRangeAttackDistance; // 장거리 공격 거리. // 단위 = m
unsigned short m_nMaxHP; // 최대 HP양
unsigned short m_nMaxMP; // 최대 MP양
short m_nHPRegenAmount; // 일정 시간당 HP의 Regen 양
short m_nMPRegenAmount; // 일정 시간당 MP의 Regen 양
short m_nWeaponAttributeLevel[MAX_ATTRIBUTE_NUM]; // 무기 속성 레벨
short m_nAttributeResistance[MAX_ATTRIBUTE_NUM]; // 속성 저항 레벨
StatusInfo(); // 생성자.
#ifndef _RYL_GAME_CLIENT_
bool CalculateStatus(const CharacterStatus& characterStatus,
const unsigned short nLevel, const unsigned short nClass, unsigned char cUsingWeaponType);
#endif
};
typedef StatusInfo* LPStatusInfo;
#pragma pack(8)
//------------------------------------------------------------------------------------
// TODO : memory alignment 주의할 것.
// : 4byte단위로 alignment 가 되도록 할 것.
// : 메모리 부족시에는 크기가 많이 필요 없는 멤버는 short등으로 줄일 것.
struct CreatureStatus
{
// 무기나 도구에 의해서 영향을 받은 능력치를 저장 ( 게임상에서 모든 계산은 이것으로 함 )
__int64 m_nExp; // 사람인 경우는 자신의 경험점, 몬스터인 경우는 나누어 줄 경험점.
int m_nLevel; // 레벨
unsigned short m_nNowHP; // 현재 HP
unsigned short m_nNowMP; // 현재 MP, 몬스터의 경우는 무조건 최대값으로 초기화.
StatusInfo m_StatusInfo; // 대부분의 정보가 이곳에 있음.
CreatureStatus();
CreatureStatus(CHAR_INFOST& characterDBData);
void Init(CHAR_INFOST& characterDBData);
};
typedef CreatureStatus* LPCreatureStatus;
#pragma pack()
#endif