1426 lines
50 KiB
C++
1426 lines
50 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "K3DBound.h"
|
|
#include "KSortVector.h"
|
|
#include "sgameobject.h"
|
|
|
|
#include "SGameAniType.h"
|
|
#include "SEventKeyRes.h"
|
|
#include "KThreadLoader.h"
|
|
|
|
#include "SGameUISyncMng.h"
|
|
|
|
#include "GameDefine.h"
|
|
#include <functional>
|
|
#include "Enc.h"
|
|
|
|
class KSeqAvatarEx;
|
|
class SStateSlot;
|
|
|
|
template< typename T >
|
|
struct lessByGetName
|
|
{
|
|
bool operator()( T* a, T* b )
|
|
{
|
|
return stricmp( a->GetName().c_str(), b->GetName().c_str() ) < 0;
|
|
}
|
|
};
|
|
|
|
|
|
typedef KEventKeyRes<Key_EVENT_NEW> _KEY_EVENT_RES;
|
|
//typedef KSortVector< _KEY_EVENT_RES*, lessByGetName< _KEY_EVENT_RES > > KSVEC_KEVENT_RES;
|
|
typedef KHash<_KEY_EVENT_RES*, hashPr_string_nocase> KSVEC_KEVENT_RES;
|
|
|
|
typedef std::vector<::SStateSlot*> vec_state_slot;
|
|
typedef std::vector<::SStateSlot*>::iterator iterator_state_slot;
|
|
|
|
typedef std::vector<struct COBSET *> vec_cobset;
|
|
typedef std::vector<struct COBSET *>::iterator iterator_cobset;
|
|
|
|
struct EVENT_SET
|
|
{
|
|
EVENT_SET()
|
|
{
|
|
pCurEvent00_effect = NULL;
|
|
pCurEvent00_sound = NULL;
|
|
pCurEvent00_motion_effect = NULL;
|
|
pCurEvent01 = NULL;
|
|
pCurEvent02 = NULL;
|
|
pCurEvent03 = NULL;
|
|
pCurEvent04 = NULL;
|
|
pCurEvent05 = NULL;
|
|
pCurEvent06 = NULL;
|
|
};
|
|
|
|
void event_clear()
|
|
{
|
|
SAFE_DELETE( pCurEvent00_effect );
|
|
SAFE_DELETE( pCurEvent00_sound );
|
|
SAFE_DELETE( pCurEvent00_motion_effect );
|
|
SAFE_DELETE( pCurEvent01 );
|
|
SAFE_DELETE( pCurEvent02 );
|
|
SAFE_DELETE( pCurEvent03 );
|
|
SAFE_DELETE( pCurEvent04 );
|
|
SAFE_DELETE( pCurEvent05 );
|
|
SAFE_DELETE( pCurEvent06 );
|
|
}
|
|
|
|
_KEY_EVENT_RES* pCurEvent00_effect;
|
|
_KEY_EVENT_RES* pCurEvent00_sound;
|
|
_KEY_EVENT_RES* pCurEvent00_motion_effect;
|
|
_KEY_EVENT_RES* pCurEvent01;
|
|
_KEY_EVENT_RES* pCurEvent02;
|
|
_KEY_EVENT_RES* pCurEvent03;
|
|
_KEY_EVENT_RES* pCurEvent04;
|
|
_KEY_EVENT_RES* pCurEvent05;
|
|
_KEY_EVENT_RES* pCurEvent06;
|
|
};
|
|
|
|
|
|
const int c_nMaxCashState = 3;
|
|
const int c_nCashStateId[c_nMaxCashState] = {9004,9005,9006};
|
|
|
|
// 010.04.22 Structure to store hair data for loading the hair model in a thread - prodongi
|
|
struct sHairThreadData
|
|
{
|
|
sHairThreadData() : m_isRecv(false) {}
|
|
// @brief Set to true when SMSG_HAIR_INFO is received
|
|
bool m_isRecv;
|
|
int m_hairId;
|
|
int m_hairColorIndex;
|
|
unsigned int m_hairColorRgb;
|
|
};
|
|
struct SMSG_HAIR_INFO;
|
|
|
|
|
|
const float FREQ_MOVE_LIMIT = 2.51f; ///< TODO : 로컬 속성으로 빼자
|
|
|
|
class SGameAvatarEx : public SGameObject
|
|
{
|
|
public:
|
|
SGameAvatarEx( ENC_INT nContentID = 0 );
|
|
virtual ~SGameAvatarEx();
|
|
|
|
int m_nEnergy;
|
|
|
|
K3DVector m_vArrowPos;
|
|
bool m_bArrowTrail;
|
|
bool m_bBowClass;
|
|
//========================================================
|
|
//모든 아바타 사용
|
|
//애니메이션 및 보여지는 것들
|
|
virtual bool Initialize( class K3DRenderDeviceDX *pDevice );
|
|
virtual void Destroy();
|
|
|
|
virtual bool Activate();
|
|
virtual bool IsInit();
|
|
|
|
virtual void DropSound() {};
|
|
|
|
virtual void SetMountMode() {};
|
|
virtual void SetAttackMode() {};
|
|
virtual void SetNormalMode() {};
|
|
|
|
virtual bool Process( DWORD time, unsigned long uProcessBitVector=0 );
|
|
virtual bool Render( unsigned long uRenderBitVector, class KViewportObject** ppViewportList, int nViewportCount);
|
|
/// 2012.03.29 셀렉트용 렌더링 - prodongi
|
|
virtual bool renderSelect(unsigned long uRenderBitVector, class KViewportObject** ppViewportList, int nViewportCount);
|
|
|
|
virtual void *Perform( KID id, KArg& msg );
|
|
|
|
virtual void resetPending_poslist(){};
|
|
virtual void ResetActivateSkillTime(){};
|
|
void *Perform( int nAniIndex, KID id, KArg& msg );
|
|
void *Perform( int nAniIndex, int nMeshIndex, KID id, KArg& msg );
|
|
|
|
void ProcMsgAtStatic( struct SGameMessage * pMsg );
|
|
|
|
void SetHairColorIndex(int nIndex);
|
|
// 2010.04.22 - prodongi
|
|
void SetHairColorRGB(unsigned int hairColor);
|
|
|
|
void SetSkinColorized( const DWORD& color, const int& nMode, const DWORD& hairColor );
|
|
void RefreshSkinColorized();
|
|
|
|
DWORD GetSkinColor( void ) { return m_dwSkinColor; }
|
|
void SetSkinColor( DWORD dwSkinColor ) { m_dwSkinColor = dwSkinColor; }
|
|
|
|
virtual void reqKMove(AR_HANDLE handle, const K3DVector & target, bool bSpeedSync = true, bool bChase = false ) {}
|
|
virtual void addKMoveTargetList(K3DVector const& /*targetPos*/) {}
|
|
virtual bool isKMoveTargetList(std::vector<ArPosition> const& /*targetPosList*/) const { return false; }
|
|
virtual void eraseKMoveTargetList(std::vector<ArPosition> const& targetPosList) {}
|
|
virtual void clearMoveTargetList() {}
|
|
|
|
//========================================================
|
|
//모든 아바타 사용
|
|
//플레이어만 쓰는 경우
|
|
//Animation 관련
|
|
virtual float Attack( AR_HANDLE target, K3DVector tpos, DWORD dwAttackRate, int nAttackIndex = 0 );
|
|
virtual void Damage() {}
|
|
virtual void Default( bool bForce=false ){} ///< 기본 대기
|
|
virtual void Default3(){} ///< 전투 대기
|
|
// virtual void MDefault(){} //마운트 상태 대기
|
|
virtual void Walk( bool bLoop = false ) {}
|
|
virtual void Run( bool bAutoRun = false, int nAniType = ANI_RUN ){}
|
|
virtual void Rush( int nAniType = ANI_RUN, float fPlayRate = 4.8f * 3.0f /*기본 3배속*/ ) {}
|
|
virtual ANI_LIST_EX GetDefaultAnimation();
|
|
|
|
float GetAttackSpeed( DWORD attack_speed );
|
|
|
|
/// 앉은 상태 및 앉기 일어서기 등 에니 처리
|
|
virtual void SitProcess( int nAniType, int nType = SEQTYPE_NORMAL ) {}
|
|
/// 일어 스다
|
|
virtual void StandUp( DWORD time = 0 ){}
|
|
|
|
// Raise hand
|
|
virtual void Cast01() {}
|
|
// Gather
|
|
virtual void Cast02(bool bLoop=true) {}
|
|
virtual void Fire( int nAniID ) {}
|
|
|
|
/// 던지기
|
|
virtual void Throw() {}
|
|
/// 줍기
|
|
virtual void PickUp() {}
|
|
virtual void PickUpEx() {}
|
|
|
|
/// 워프 꼬이는 것 때문에, 임시 사용..
|
|
void AllWorkEnd();
|
|
|
|
virtual void ThreadNPlayAnimation( KSeqAvatarEx* pSeqAvatarEx, int nType , int nAniType = SEQTYPE_NORMAL, float fPlayRate = 4.8f );
|
|
|
|
//
|
|
virtual void NPlayAnimation( int nType , int nAniType = SEQTYPE_NORMAL, float fPlayRate = 4.8f );
|
|
virtual void NPlayOverride( int nType , float fPlayRate = 4.8f );
|
|
|
|
float GetCurPlayRate() { return m_fCurPlayRate; }
|
|
|
|
/// 현재 Animation 의 ID
|
|
int GetCurrAnimationID();
|
|
|
|
bool IsPlaying();
|
|
// int GetAnimationType();
|
|
|
|
void RefreshEffectPos( KSeqAvatarEx* pSeqAvatarEx );
|
|
|
|
//========================================================
|
|
//모든 아바타 사용
|
|
//재질 관련 사운드 지원
|
|
///현재 장착하고 있는 아이템 클래스 얻기
|
|
virtual int GetItemClass();
|
|
/// 재질
|
|
virtual int GetMaterial();
|
|
/// 이동 타입
|
|
virtual int GetMovingType();
|
|
|
|
virtual void SetViewVectorAngle( float fAngle ) {};
|
|
/// 방향 설정
|
|
virtual void SetViewVector( const K3DVector &tpos );
|
|
/// 방향
|
|
virtual const K3DVector & GetViewVector();
|
|
|
|
/// Picking
|
|
virtual bool CheckCollision( const K3DVector &nv, const K3DVector &fv );
|
|
/// for 2nd picking attempt - by Tyburn
|
|
virtual bool RelaxedCheckCollision( const K3DVector &nv, const K3DVector &fv, K3DVALUE threshold );
|
|
|
|
virtual bool IsLoadComplete();
|
|
|
|
/// 투명도
|
|
void SetVisibility( float fVisibility );
|
|
/// 가시거리 안 or 밖
|
|
void SetVisible( bool bVisible);
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//프로퍼티
|
|
//로컬 플레이어, 로컬 소환수, 소환수, 플레이어, 몬스터, NPC
|
|
// 2010.07.16 - prodongi
|
|
virtual void SetHP( int nHP, bool IsEnter = false );
|
|
void SetMaxHP( int nMaxHP );
|
|
|
|
void SetMP( int nMP );
|
|
void SetMaxMP( int nMaxMP );
|
|
|
|
void SetSex( int nSex );
|
|
void SetRace( int nRace );
|
|
|
|
void SetFaceID( int nFaceID );
|
|
void SetHairID( int nHairID );
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//AvatarEx 내부 사용 용
|
|
void SetInnSex( int nSex );
|
|
void SetInnRace( int nRace );
|
|
void SetInnFaceID( int nFaceID );
|
|
void SetInnHairID( int nHairID );
|
|
void SetInnObjType( unsigned char ObjType );
|
|
|
|
int GetInnSex();
|
|
int GetInnRace();
|
|
int GetInnFace();
|
|
int GetInnHair();
|
|
unsigned char GetInnObjType();
|
|
ENC_INT GetInnContentID();
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
void AddExp( __int64 nExp );
|
|
void AddJP( __int64 nJp );
|
|
|
|
int GetHP();
|
|
int GetMP();
|
|
int GetMaxHP();
|
|
int GetMaxMP();
|
|
__int64 GetJP(); /// 2011.04.29 int->__int64 - prodongi
|
|
int GetPercentEXP();
|
|
|
|
virtual void SetStatus( unsigned status );
|
|
/// 상태:앉기,서기,테이밍
|
|
int GetStatus();
|
|
|
|
//로컬 플레이어, 로컬 소환수
|
|
void SetStat( struct SMSG_STAT_INFO * pStat );
|
|
int SetLevel( int nLevel );
|
|
int SetJobLevel( int nJobLevel );
|
|
/// 2011.07.11 - prodongi
|
|
void SetJobID(int id);
|
|
bool IsMasterClass(int id);
|
|
|
|
int GetLevel();
|
|
int GetSex();
|
|
int GetJobLevel();
|
|
|
|
int GetRace();
|
|
int GetJobID();
|
|
|
|
int GetFace();
|
|
int GetHair();
|
|
|
|
__int64 GetEXP();
|
|
|
|
/// 소환수, 플레이어, 몬스터, NPC
|
|
ENC_INT GetContentID();
|
|
|
|
//========================================================
|
|
// Use all avatars
|
|
bool IsLive();
|
|
void SetObjType( unsigned char ObjType );
|
|
unsigned char GetObjType();
|
|
const char * GetName();
|
|
void SetName( const char* szName );
|
|
|
|
bool IsLocalPlayer();
|
|
bool IsLocalCreature();
|
|
bool IsLocalPet();
|
|
|
|
/// Clip Test 결과
|
|
bool IsRender();
|
|
|
|
virtual AR_UNIT GetAttackRange();
|
|
float GetDBAttackRange();
|
|
|
|
bool IsMoving();
|
|
bool isKMoving() const { return m_isKMoving; }
|
|
void setKMoving(bool moving) { m_isKMoving = moving; }
|
|
int getKMoveType() const { return m_kmoveType; }
|
|
void setKMoveType(int type) { m_kmoveType = type; }
|
|
float getKMoveDir() const { return m_kmoveDir; }
|
|
unsigned char getSpeed() ;
|
|
unsigned char getMovingSpeed();
|
|
/// GetCurPos()는 캐릭터 방향을 바꿔버리기 때문에 순수하게 현재 위치를 구하는 함수를 추가함
|
|
K3DVector getMyPos();
|
|
|
|
/// GetCurPos()함수에서 방향을 체크해서 방향을 바꿔버리기 때문에 함수명을 거기에 맞게 수정함 - prodongi
|
|
K3DVector GetCurPosWithChangeDir();
|
|
K3DVector & GetNextPos();
|
|
|
|
DWORD GetAniTime();
|
|
void SetAnimationPos(int nPosFlag);
|
|
void SetRenderFlag( int nRenderIndex );
|
|
|
|
virtual void ClipTest( struct K3DVector * pFrustum );
|
|
void SetShadowRenderFlag( BOOL bShadowRenderFlag );
|
|
|
|
class KSeqAvatarEx * GetSeqForm();
|
|
void DestroySeqAvatar();
|
|
|
|
void EvolutionSummon( struct SMSG_SUMMON_EVOLUTION* pMsg );
|
|
|
|
bool IsAniLock() { return m_bLockAni; }
|
|
|
|
|
|
DWORD getCurrentTime() { return m_dwTime; }
|
|
|
|
|
|
//========================================================
|
|
//모든 아바타 사용
|
|
//현재 애니메이션 이벤트 얻기
|
|
void GetCurSeqEvent( EVENT_SET & event_set );
|
|
|
|
struct WEAR_DATA
|
|
{
|
|
std::string strFileName;
|
|
int nItemClass;
|
|
int nWearType;
|
|
int nItemLevel;
|
|
int nItemCode;
|
|
int nItemEnhanceLevel;
|
|
unsigned char cElementalEffect;
|
|
|
|
///////////////////////////
|
|
//치장용
|
|
bool bWithDecoItem;
|
|
std::string strDecoFileName;
|
|
int nDecoItemCode;
|
|
int nDecoItemClass;
|
|
/** 0 == 기존 모델을 삭제하고 해당 부위에 치장 아이템으로 교체
|
|
1 == 기존 모델을 유지하면서 해당 부위에 치장 아이템 붙이기 */
|
|
bool bAttachDecoItem;
|
|
|
|
std::string strTextureName;
|
|
/// 2011.06.11 mantis 13327 - prodongi
|
|
std::string strDecoTextureName;
|
|
int nAppearanceItemCode; // 2012. 7. 24 - marine 형상변환
|
|
// 2011.04.13 mantis 0012655 - servantes
|
|
void clear()
|
|
{
|
|
strFileName = "";
|
|
strDecoFileName = "";
|
|
strTextureName = "";
|
|
|
|
nItemClass = 0;
|
|
nWearType = 0;
|
|
nItemLevel = 0;
|
|
nItemCode = 0;
|
|
nItemEnhanceLevel = 0;
|
|
cElementalEffect = 0;
|
|
bWithDecoItem = 0;
|
|
nDecoItemCode = 0;
|
|
nDecoItemClass = 0;
|
|
nAppearanceItemCode = 0;
|
|
}
|
|
|
|
WEAR_DATA() : bWithDecoItem(false)
|
|
, nDecoItemCode( 0 )
|
|
, nDecoItemClass( 0 )
|
|
, bAttachDecoItem( false )
|
|
, nAppearanceItemCode( 0 ) // 2012. 7. 24 - marine 형상변환
|
|
{}
|
|
};
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
//로컬 플레이어, 다른 플레이어 사용
|
|
virtual void RefreshItemWear( class KSeqAvatarEx * pAvatarEx /*const char * pFileName, int nItemClass, int nWearType*/ ) {} //Item Wear Info
|
|
|
|
virtual void RefreshItemWearEx( class KSeqAvatarEx * pAvatarEx, std::vector< WEAR_DATA >& wearlist ) {}
|
|
|
|
void AddThreadItemWear( WEAR_DATA& WearData )
|
|
{
|
|
m_vWearList_Thread.push_back( WearData );
|
|
}
|
|
// 2010.08.12 - prodongi
|
|
//virtual void SetCreature(AR_HANDLE hMaster) {}
|
|
virtual void SetCreature(AR_HANDLE hCreature, bool enter) {}
|
|
|
|
/// 다른 플레이어가 소환한 소환수
|
|
virtual AR_HANDLE GetCreature() { return 0; }
|
|
/// 다른 플레이어의 소환수 용
|
|
virtual AR_HANDLE GetMaster() { return 0; }
|
|
|
|
//로컬 소환수 사용
|
|
/// 주인님 설정
|
|
virtual void SetMaster( AR_HANDLE hMaster, SGameAvatarEx * pMaster ) {}
|
|
virtual void SetTargetMonster( AR_HANDLE hMonster ) {}
|
|
virtual void SetHold() {}
|
|
virtual void SetUnHold() {}
|
|
virtual void SetBestPosition( bool bImmediately = false ) {}
|
|
virtual void SetMoveLeft() {}
|
|
virtual void SetMoveRight() {}
|
|
/// 역소환되면 위치 설정
|
|
virtual void AddNLeaveSummon() {}
|
|
virtual void CreatureBackDownSpeedOfPlayer() {}
|
|
virtual void CreatureBackDownSpeedOfCreature() {}
|
|
virtual void CmdIdle() {}
|
|
virtual void CmdMove() {}
|
|
virtual void CmdAttack() {}
|
|
virtual void CmdStandBy() {}
|
|
virtual float GetCreatureLeftORRightPos() { assert( 0 ); return 0.f; }
|
|
virtual void SetCreatureBattleModeOff() {}
|
|
virtual void SetCreatureBattleModeOn() {}
|
|
|
|
virtual int GetCreatureBattleMode() { assert( 0 ); return 0; }
|
|
|
|
|
|
/// 몬스터 사용
|
|
/// 떨굴 Item 핸들
|
|
virtual void SetDropItemInfo( AR_HANDLE itemhandle ) {}
|
|
|
|
//========================================================
|
|
//로컬 플레이어
|
|
virtual void SetItemCodeLevel( int nIndex, ItemBase::ItemCode code, int nLevel ) {}
|
|
virtual ItemBase::ItemCode GetItemCode( int nIndex ) { return -1; }
|
|
virtual int GetItemLevel( int nIndex ) { return -1; }
|
|
virtual ItemBase::ItemClass GetItemClass( int nIndex ) { return ItemBase::CLASS_ETC; }
|
|
|
|
//========================================================
|
|
// Relevant only for local player and local creature
|
|
// User input (keyboard, mouse)
|
|
virtual void OnInput( class SGameInput * pInput ) {};
|
|
/// 사용자 입력 응답(Server)
|
|
virtual void OnNetInput( struct SGameMessage * pMsg ) {};
|
|
/// state
|
|
virtual void OnChangeState( SObjectState::ID stateid, const SStateInfo &info ) {};
|
|
|
|
//각 아바타들 사용
|
|
void SetAniLock( bool bLock );
|
|
bool GetAniLock() { return m_bLockAni; }
|
|
|
|
//========================================================
|
|
//몬스터, 크리처 사용. 플레이어도 사용 할 수 있음
|
|
void SetAttackAniLock( bool bLock );
|
|
bool GetAttackAniLock() { return m_bLockAttackAni; }
|
|
|
|
//========================================================
|
|
//로컬 플레이어, 로컬 크리쳐만 상관 있다.
|
|
//Send Net Msg
|
|
virtual void ReqTakeItem( AR_HANDLE handle ) { assert( 0 && "Should not be called"); }
|
|
virtual void ReqMove ( AR_HANDLE handle, const ArPosition & target, bool bSpeedSync = true, bool bChase = false ) { assert( 0 && "Should not be called"); }
|
|
virtual void ReqAttack ( AR_HANDLE target ) { assert( 0 && "Should not be called"); } // target == 0 공격 중지 요청
|
|
/// 2010.10.14 - prodongi
|
|
virtual void ReqCast ( AR_HANDLE target, int nSkillID, int nSkillLv, K3DVector const& targetPos ) { assert( 0 && "Should not be called"); }
|
|
virtual void ReqCancelAction() { assert( 0 && "Should not be called"); }
|
|
virtual void ReqThrow ( AR_HANDLE target, AR_HANDLE itemhandle ) { assert( 0 && "Should not be called"); }
|
|
virtual void ReqSit () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqStandUp () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqNormal () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqBattle () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqMount () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqUnMount () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqEmotion () { assert( 0 && "Should not be called"); }
|
|
virtual void ReqUseItem ( AR_HANDLE hTargetHandle, AR_HANDLE hItemHandle, int nSkillID, AR_HANDLE hItemUseTargetHandle, const char* lpText ) { assert( 0 && "Should not be called"); }
|
|
|
|
static void SetRenderCube( bool bRenderCube )
|
|
{
|
|
m_sCubeRender = bRenderCube;
|
|
}
|
|
|
|
static void ToggleMoveSound()
|
|
{
|
|
m_sMoveSound = !m_sMoveSound;
|
|
}
|
|
|
|
static void SetMoveSound( bool bValue )
|
|
{
|
|
m_sMoveSound = bValue;
|
|
}
|
|
|
|
static void SetEnhanceTest( bool bValue )
|
|
{
|
|
m_sEnhanceTest = bValue;
|
|
}
|
|
|
|
//스킬을 사용 하기 전에 설정 한다.
|
|
//애니 메이션 관리 기능 추가..
|
|
void StartUseSkill( int nSkillID );
|
|
void EndUseSkill( int nSkillID );
|
|
|
|
virtual bool IsUseSkill_complete() { return false; }
|
|
|
|
virtual const char * GetCobFileName();
|
|
|
|
/// 전상태를 체크해서 자동 공격 여부 서버에 알리기
|
|
virtual void CheckPrevState() {}
|
|
|
|
/** 공격중 캔슬이 됐다면 m_idPrevState는 STATE_ATTACK로 되있기 때문에 STATE_IDLE로 바꿔준다
|
|
공격중 캔슬이 됐고 스킬 사용후에 자동 공격을 하면 안되기 때문이다( 공격중에 스킬을 사용한 후에 자동공격이 되야한다 ) */
|
|
void SetDefaultPrevState() { m_pStateVM->SetDefaultPrevState(); }
|
|
|
|
/// 현재 캐스트 및 활 조준/쏘기 중인지 체크
|
|
bool IsCasting() { if( m_pStateVM == NULL ) return false;
|
|
return m_pStateVM->IsCasting(); }
|
|
/// 현재 공격 중인가
|
|
bool IsAttack() { if( m_pStateVM == NULL ) return false;
|
|
return m_pStateVM->IsAttack(); }
|
|
/// 현재 Mount상태인가
|
|
bool IsMount() { if( m_pStateVM == NULL ) return false;
|
|
return m_pStateVM->IsMount(); }
|
|
/// 현재 Mode가 Mount인가?
|
|
bool IsMountMode() { if( m_pStateVM == NULL ) return false;
|
|
return m_pStateVM->IsMountMode(); }
|
|
|
|
/// 캐릭터가 가만히 서있을 경우에만 가능한 행동을 체크한다
|
|
bool CheckAllState();
|
|
|
|
//
|
|
virtual void SetWayPointList( K3DVector* pWayPointList, int nWayPointSize ) {}
|
|
virtual void ClearWayPointList() {}
|
|
|
|
struct RiderCreatureInfo
|
|
{
|
|
AR_HANDLE m_hRider; ///< 라이더 핸들 ( 탑승 완료 됐을때 변경됨 )
|
|
int m_nRidePos; ///< 라이딩 위치
|
|
int m_nRideType;
|
|
bool m_bIsTransportCreature;
|
|
AR_HANDLE m_hTransport; ///< 탑승 명령이 오면 바로 변경됨
|
|
|
|
RiderCreatureInfo( AR_HANDLE hRider, int nRidePos, int nRideType = 2, bool bIsTransportCreature = false ) : m_hRider( hRider )
|
|
, m_nRidePos( nRidePos )
|
|
, m_nRideType( nRideType )
|
|
, m_bIsTransportCreature( bIsTransportCreature )
|
|
, m_hTransport( 0 )
|
|
{
|
|
}
|
|
|
|
RiderCreatureInfo()
|
|
{
|
|
Reset();
|
|
}
|
|
|
|
void Reset()
|
|
{
|
|
m_hRider = 0;
|
|
m_nRidePos = -1;
|
|
m_nRideType = 2;
|
|
m_bIsTransportCreature = false;
|
|
m_hTransport = 0;
|
|
}
|
|
|
|
bool IsTransportCreature() { return m_bIsTransportCreature; }
|
|
|
|
AR_HANDLE GetCreatureMountHandle() { return m_hRider; }
|
|
int GetRideType() const { return m_nRideType; } // sonador #2.1.6
|
|
|
|
void SetTransportHandle( AR_HANDLE handle ) { m_hTransport = handle; }
|
|
AR_HANDLE GetTransportHandle() { return m_hTransport; }
|
|
};
|
|
|
|
enum
|
|
{
|
|
RIDE_NONE_TYPE = 0,
|
|
RIDE_LOW_TYPE,
|
|
RIDE_HIGH_TYPE,
|
|
RIDE_QILIN_TYPE, // #2.1.6 sonador
|
|
RIDE_WHITE_TYPE, // #2.1.14
|
|
RIDE_UNICORN_TYPE, // #2.1.14
|
|
RIDE_BEAKHO_TYPE, /// 2011.02.08 - prodongi
|
|
};
|
|
|
|
AR_HANDLE GetCreatureMountHandle() { return m_RiderCreatureInfo.GetCreatureMountHandle(); }
|
|
void SetRiderCreatureInfo( RiderCreatureInfo* pInfo = NULL );
|
|
|
|
void SetTransportCreatureHandle( AR_HANDLE handle ) { m_RiderCreatureInfo.SetTransportHandle( handle ); }
|
|
AR_HANDLE GetTransportCreatureHandle() { return m_RiderCreatureInfo.GetTransportHandle(); }
|
|
|
|
int GetRideType() const { return m_RiderCreatureInfo.GetRideType(); } // sonador #2.1.6
|
|
|
|
class KEventPointSeq* GetSaddleEffectPos();
|
|
|
|
//올라타거나 내려올때 크리처를 플레이어 방향으로 돌린다
|
|
/// 소환수 용
|
|
virtual void SetViewVectorStateIdle( const K3DVector &tpos ) {}
|
|
/// 소환수 용
|
|
virtual void SetViewVectorForMount( const K3DVector &tpos ) {}
|
|
/// 플레이어 용
|
|
virtual void SetDefaultView() {}
|
|
|
|
void SetMotionBlend( bool bIsBlend );
|
|
|
|
void SetIng( bool bIng ) { m_bIng = bIng; }
|
|
bool IsIng() { return m_bIng; }
|
|
|
|
void SetReservation( bool bReservation ){ m_bReservation = bReservation; }
|
|
bool IsReservation() { return m_bReservation; }
|
|
|
|
void SetWeaponInfo( KSeqAvatarEx * pAvatarEx, WEAR_DATA& WearData, const char* pEventFileName );
|
|
int AddWeaponEnhanceEffect( int nWeaponEffectPos, struct EnhanceFX* pEnhanceFx, int nItemClass );
|
|
|
|
void HideWeapon( BOOL bHide );
|
|
void RefreshDeform();
|
|
|
|
void ActivateForceSphere();
|
|
void ActivateCircleShadow();
|
|
void DeActivateCircleShadow();
|
|
void OnMsgForceSphere( int nForceSphereSize );
|
|
/// 치트용
|
|
void AddForceSphere();
|
|
/// 치트용
|
|
void UseForceSphere();
|
|
|
|
/// NPC용
|
|
virtual void SetNpcTargetHandle( AR_HANDLE hTarget ) {}
|
|
|
|
typedef std::vector< X2D::Point<int> > PATH;
|
|
bool CollisionToLine( const K3DVector& vStart, const K3DVector& vEnd );
|
|
void FindDetour(const K3DVertex& vEnd, bool bRestraint, bool bChase);
|
|
void EraseDetour();
|
|
bool MoveDetour(K3DVertex& vtMovePos);
|
|
bool IsMovingDetour();
|
|
bool IsChasing();
|
|
size_t GetDetourSize();
|
|
bool GetDetourPoint(size_t index, int& x, int& y);
|
|
ArPosition* GetAllDetourPoint();
|
|
int GetAllDetourPointSize();
|
|
size_t GetDetourStep();
|
|
|
|
virtual bool IsRotation() { assert( 0 ); return false; }
|
|
|
|
void SetCurrState( SObjectState::ID state ) { m_CurrState = state; }
|
|
SObjectState::ID GetCurrState() { return m_CurrState; }
|
|
AR_HANDLE GetCurrTarget() { return m_CurrTarget; }
|
|
void SetCurrTarget( AR_HANDLE target ) { m_CurrTarget = target; }
|
|
|
|
ItemBase::ItemClass GetLeftWeaponInfo() { return (ItemBase::ItemClass)m_itemClass[ItemBase::WEAR_LEFTHAND]; }
|
|
ItemBase::ItemClass GetRightWeaponInfo() { return (ItemBase::ItemClass)m_itemClass[ItemBase::WEAR_RIGHTHAND]; }
|
|
|
|
void AddUISyncData( UI_SYNC_INFO & uisyncinfo );
|
|
struct UI_SYNC_DATA* GetUISyncData();
|
|
void SetUISyncData( UI_SYNC_INFO::TARGET_INFO & target_info );
|
|
|
|
/// id애니메이션의 길이를 리턴한다. 플레이속도조절에 이용. (꼼수지만.. ) by 정동섭 / 찾을수없으면 -1리턴
|
|
virtual int GetAnimationLength( int ani_id );
|
|
|
|
/// 애니메이션이 존재하는지 체크 2009.4.3 by 정동섭
|
|
virtual bool ExistAnimation( int ani_id);
|
|
/// 죽는 애니메이션으로 들어간다. 그것뿐.
|
|
virtual void EnterDeadAnimation();
|
|
// 2010.07.16 - prodongi
|
|
virtual void Dead();
|
|
bool IsDead() const { return m_bIsDead; }
|
|
|
|
void SetTerrainPickPos( K3DVector* vPick );
|
|
K3DVector* GetTerrainPickPos();
|
|
|
|
/*
|
|
2012.03.29 아래의 코드는 전혀 의미 없는 코드인데, 현재 맨티스에서 확인이 되지 않아 제대로 동작하는지는 모르겠다.
|
|
우선은 아무런 보고가 없기 때문에 그냥 두고 나중에 문제가 생기면 주석을 참조 바람.
|
|
원래의 코드는 ClearThreadLoadWear() { m_vWearList_Thread.erase( m_vWearList_Thread.begin(), m_vWearList_Thread.end() ); } 이다.
|
|
- prodongi
|
|
*/
|
|
// 2011.04.13 mantis 0012655 - servantes
|
|
void ClearThreadLoadWear()
|
|
{
|
|
for( unsigned int i(0); m_vWearList_Thread.size()>i; ++i )
|
|
{
|
|
WEAR_DATA wdata = m_vWearList_Thread[i];
|
|
wdata.clear();
|
|
}
|
|
}
|
|
|
|
const K3DMatrix* GetEventPointMatrix( int nEffectPos );
|
|
const K3DMatrix* GetEventPointAttachMatrix( int nEffectPos );
|
|
|
|
int GetWeaponLength(int itemCode);
|
|
|
|
const K3DMatrix* GetWeaponEventPointMatrix( int nWeaponEffectPos, int nEventPointPos );
|
|
const K3DMatrix* GetWeaponEventPointAttachMatrix( int nWeaponEffectPos, int nEventPointPos );
|
|
const K3DMatrix* GetWeaponEventPointParentMatrix( int nWeaponEffectPos, int nEventPointPos );
|
|
bool GetWeaponEventPoint( int nWeaponEffectPos );
|
|
|
|
void GetCurrentAnimationInfo( int & nBoneCnt, DWORD & dwMinTime, DWORD & dwMaxTime, DWORD & dwCurAniTime );
|
|
|
|
/// 스킬 사용 중 인가?
|
|
bool IsUsingSkill();
|
|
bool IsAttackingByBow();
|
|
bool IsAttacking();
|
|
|
|
void LeaveData();
|
|
virtual bool Deactivate();
|
|
|
|
float GetTargetRoll() { return m_fTargetRoll; }
|
|
float GetPresentRoll(){ return m_fPresentRoll; }
|
|
|
|
virtual void setCameraRoll(float angle);
|
|
|
|
virtual bool MotionCancel() { assert(0); return false; }
|
|
|
|
//마운트 상태냐 ( 플레이어만 해당됨 )
|
|
virtual bool IsStateRide() { return false; }
|
|
virtual void AvatarClipTestByCreature( struct K3DVector *pFrustum ){}
|
|
virtual void AvatarRotationByCreature(){}
|
|
virtual SGameAvatarEx* GetRiderCreatureObject( bool bOnlyTransportCreature = false ) { return NULL; }
|
|
|
|
virtual void SetEnhanceCheatLevel( int nLevel ){}
|
|
virtual int GetEnhanceCheatLevel() { return 0; }
|
|
|
|
bool GetVisible() { return m_bVisible; }
|
|
float GetVisibility() { return m_fVisibility; }
|
|
|
|
|
|
/// 무기 잔상 표시 on/off
|
|
bool GetRightWeaponTrailStatus() { return m_bUseRightWeaponTrail; }
|
|
/// 무기 잔상 표시 on/off
|
|
bool GetLeftWeaponTrailStatus() { return m_bUseLeftWeaponTrail; }
|
|
/// 무기 잔상 표시 on/off
|
|
void SetRightWeaponTrailStatus(bool bUse) { m_bUseRightWeaponTrail=bUse; }
|
|
/// 무기 잔상 표시 on/off
|
|
void SetLeftWeaponTrailStatus(bool bUse) { m_bUseLeftWeaponTrail=bUse; }
|
|
|
|
/// 무기 잔상 render object
|
|
class SGameFxSwordSlash * GetRightWeaponTrailRenderer() { return m_pWeaponTrailRight; }
|
|
/// 무기 잔상 render object
|
|
class SGameFxSwordSlash * GetLeftWeaponTrailRenderer() { return m_pWeaponTrailLeft; }
|
|
|
|
void SetVisibleWeaponTrail( bool bVisible );
|
|
|
|
//// 무기 강화 effect
|
|
//void setWeaponPowerupFx(int partNo, class SGameFxWeaponPowerup *newFX, bool deleteOldFx=true);
|
|
// // 오른손/왼손에 FX클래스를 붙인다
|
|
// // partNo : MPART_R_WEAPON or MPART_L_WEAPON
|
|
// // newFX : 새 FX클래스. NULL이면 삭제
|
|
// // deleteOldFx : 이전 FX클래스를 delete하느냐 마느냐
|
|
// // Note : 기본적으로 setWeaponPowerupFx(MPART_R_WEAPON, new SGameWeaponPowerup_Level1()); <- 이렇게 사용되는것이 정상
|
|
//class SGameFxWeaponPowerup * getWeaponPowerupFx(int partNo);
|
|
|
|
//void updateWeaponPowerupMesh(int partNo, bool forceUpdateNow=false);
|
|
// // 현재 무기 mesh로부터 powerup효과 메쉬를 build한다
|
|
// // partNo : MPART_R_WEAPON or MPART_L_WEAPON
|
|
// // Note : resource에서 mesh가 delayed-loading되는 경우가 있으므로, 실제로는 flag만 세우고, 나중에 updateWeaponPowerupMesh()이 call된다
|
|
// // 단 forceUpdateNow==true인 경우에는 즉시 업데이트한다. 콘솔에서 파라미터 조절할 때 사용한다
|
|
|
|
//void clearWeaponPowerupMesh(int partNo);
|
|
// // powerup효과 FX메쉬를 지운다
|
|
|
|
|
|
void ActivateTerrainDegree();
|
|
void DeActivateTerrainDegree();
|
|
bool IsActivateTerrainDegree() { return m_bActivateTerrainDegree; }
|
|
void StandingDegree();
|
|
void StandingDegreeForMount();
|
|
|
|
float GetCurAngleX();
|
|
float GetCurAngleY();
|
|
|
|
virtual bool IsDummyCreature() { return false; }
|
|
|
|
void ActivateFxSwordSlash();
|
|
void ActivateLeftWeaponTrail() { m_bActLeftWeaponTrail = true; } // sonador 10.6.1 무기 강화 이펙트 추가 지원
|
|
void ActivateRightWeaponTrail() { m_bActRightWeaponTrail = true; }
|
|
|
|
const float* GetSelectCube() { return m_fSelcube; }
|
|
|
|
void FindMotionAddOnFx();
|
|
void FindMotionAddOnFx( Key_EVENT_NEW* pKey1 );
|
|
|
|
bool CurrentlyAnimationIsMount();
|
|
bool CurrentlyAnimationIsUnMount();
|
|
bool CurrentlyAnimationIsMDef(); // sonador #2.1.6
|
|
bool CurrentlyAnimationIsMRun();
|
|
bool CurrentlyAnimationIsMWalk(); // sonador #2.1.6
|
|
bool CurrentlyAnimationIsAttack();
|
|
bool CurrentlyAnimationIsDamage();
|
|
|
|
virtual void SetCreatureMountType( int nRideType ) { assert(0); }
|
|
virtual int GetCreatureMountType() const { assert(0); return 0; } // sonador #2.1.6
|
|
virtual bool IsHighMountType() { assert(0); return false; }
|
|
virtual int GetPlayerMDefAniID() const { assert( 0 ); return 0; } // sonador #2.1.6
|
|
virtual int GetPlayerMWalkAniID() const { assert( 0 ); return 0; } // sonador #2.1.6
|
|
virtual int GetPlayerMRunAniID() const { assert( 0 ); return 0; } // sonador #2.1.6
|
|
|
|
void FindNewEvent();
|
|
|
|
/// 강화 이펙트 테스트
|
|
void AddMorphMesh( class KMsgSET_MORPHMESH* pMsg );
|
|
|
|
/// 석화
|
|
void SetFixTexture( class KMsgSET_FIXTEXTURE* pMsg );
|
|
|
|
//---------------------------------
|
|
//쓰레드 로딩
|
|
static void BeginAvatarLoadingThread();
|
|
static void EndAvatarLoadingThread();
|
|
void StartThreadLoading() { m_bIsThreadLoading = true; }
|
|
void PendLoading();
|
|
bool IsThreadPendLoading() { return m_bIsThreadPending; }
|
|
bool IsThreadLoading();
|
|
|
|
void SetPendLoading( bool bPend ) { m_bPendLoading = bPend; }
|
|
bool IsPendLoading() { return m_bPendLoading; }
|
|
//---------------------------------
|
|
|
|
void ClearPendingNextState();
|
|
|
|
//Warp 중 이동 막기 위해
|
|
void InputFreezing();
|
|
void InputThawing();
|
|
|
|
|
|
bool IsLoopMotion( int nAniType );
|
|
|
|
void UpdateDisguiseState();
|
|
void SetDisguise( ::SStateSlot* pState, bool bLastDisguese = false );
|
|
void CheckDisguise();
|
|
/// 2011.07.28 redmine #16797 - prodongi
|
|
bool Disguise( unsigned int stateHandle, ENC_INT nContentID, bool bIsSummon = false, int disguiseEnhance = 0 ); // 2.1.16 변신 효과 중첩시 아바타 사라지는 오류 수정
|
|
virtual void UnDisguise( unsigned int stateHandle = 0 );
|
|
void InfoRemoveForDisguise();
|
|
|
|
bool SetFrame( int nFrame );
|
|
|
|
void ActivateFxSwordSlashForSkill();
|
|
void DeActivateFxSwordSlashForSkill();
|
|
bool SetFxSwordSlashDBData(class SGameFxSwordSlash* pFxSwordSlash, int nItemCode, int nEnhanceLevel);
|
|
|
|
void UnMountFallUnSummon();
|
|
|
|
bool IsWorkListEmpty() { return m_vWorkList.empty(); }
|
|
|
|
KSeqAvatarEx* LoadCob( vec_cobset * pCobList );
|
|
public:
|
|
enum FLAG_STATE
|
|
{
|
|
FLAG_STATE_NONE = 1 << 0, ///< 기본 상태
|
|
FLAG_STATE_PETRIFY = 1 << 1, ///< 석화 상태
|
|
FLAG_STATE_HIDING = 1 << 2, ///< 은신 상태
|
|
FLAG_STATE_DETECT_HIDING = 1 << 3, ///< 은신 발견 상태
|
|
FLAG_STATE_RESURRECTION = 1 << 4, ///< 부활 상태
|
|
FLAG_STATE_SLEEP = 1 << 5, ///< 수면
|
|
FLAG_STATE_STUN = 1 << 6, ///< 스턴
|
|
FLAG_STATE_FEAR = 1 << 7, ///< 공포
|
|
FLAG_STATE_FROZEN = 1 << 8, ///< 빙결
|
|
FLAG_STATE_HOLD = 1 << 9,
|
|
};
|
|
|
|
void SetHidingVisiblity( float fVisibility );
|
|
float GetHidingVisiblity() { return m_fHidingVisiblity; }
|
|
|
|
void SetHidingDetectRange( float fDetectRange ) { m_fHidingDetectRange = fDetectRange; }
|
|
float GetHidingDetectRange() { return m_fHidingDetectRange; }
|
|
|
|
void AddStateFlag( FLAG_STATE nFlag )
|
|
{
|
|
if( !(m_nStateFlag & nFlag) )
|
|
m_nStateFlag += nFlag;
|
|
}
|
|
void RemoveStateFlag( FLAG_STATE nFlag )
|
|
{
|
|
if( m_nStateFlag & nFlag )
|
|
m_nStateFlag -= nFlag;
|
|
}
|
|
unsigned int GetStateFlag() { return m_nStateFlag; }
|
|
|
|
vec_state_slot& GetCashStateList() { return m_vecCashStateList; };
|
|
vec_state_slot& GetPositiveStateList() { return m_vecPositiveList; };
|
|
vec_state_slot& GetNegativeStateList() { return m_vecNegativeList; };
|
|
void GetAllStateList( vec_state_slot& rStateList, bool bAddCashState );
|
|
|
|
void UpdateState( struct SMSG_STATE* pMsg );
|
|
void AddState( SMSG_STATE* pMsg );
|
|
void DeleteState( SMSG_STATE* pMsg );
|
|
void OutputAddStateSystemMsg( SMSG_STATE* pMsg );
|
|
void OutputDeleteStateSystemMsg( SMSG_STATE* pMsg, int nLv );
|
|
::SStateSlot* GetOldStateInfo( SMSG_STATE* pMsg, int& nOutPos );
|
|
::SStateSlot* GetOldCashStateInfo( SMSG_STATE* pMsg, int& nOutPos );
|
|
::SStateSlot* AddStateInfo( SMSG_STATE* pMsg, int & nIndex );
|
|
int DeleteStateInfo( AR_HANDLE hTarget, AR_HANDLE hState, unsigned int state_code );
|
|
void StateProcess( DWORD dwTime );
|
|
void clearAllState();
|
|
|
|
bool IsCashState( unsigned int state_code );
|
|
/// 2011.01.14 - prodongi
|
|
bool isMarkState(unsigned int sate_code) const;
|
|
struct StateInfoEx* GetStateDBInfo(vec_state_slot const& stateList, enum STATE_TYPE nType);
|
|
vec_state_slot const& getMarkStateList() { return m_vecMarkStateList; };
|
|
|
|
bool HaveCashState() { return !m_vecCashStateList.empty(); }
|
|
bool HavePositiveState() { return !m_vecPositiveList.empty(); }
|
|
bool HaveNegativeState() { return !m_vecNegativeList.empty(); }
|
|
bool HaveState( bool bAddCashState );
|
|
|
|
bool IsEqualState( ::SStateSlot* pInfo, SMSG_STATE* pMsg );
|
|
bool IsEqualState( ::SStateSlot* pInfo, AR_HANDLE hTarget, AR_HANDLE hState, unsigned int state_code );
|
|
|
|
virtual void AddMeshPart( ANIPART nAniPart, MPART nMeshPart, const char* szMeshFileName ) { assert( false ); }
|
|
virtual void AddDecoMeshPart( ANIPART nAniPart, MDECOPART nDecoMeshPart, const char* szMeshFileName ) { assert( false ); }
|
|
virtual void AddAttachItemPart( ANIPART nAniPart, ATTACH nAttachPart, const char* szMeshFileName ) { assert( false ); }
|
|
|
|
bool CurrentlyAnimationIsLoopWrap();
|
|
int GetCurrentlyAniType() { return m_nCurPlayType; }
|
|
|
|
void SetSkinDiffuse( KColor & diffuse );
|
|
void RefreshItemWear();
|
|
|
|
virtual bool IsActivateBattleInArena() { return false; }
|
|
virtual void SetActivateBattleInArena( bool bActivate ) { assert( false ); }
|
|
|
|
void refreshWinkByOption();
|
|
|
|
virtual void ReInitialize();
|
|
|
|
struct StateInfoEx* GetStateDBInfo( enum STATE_TYPE nType );
|
|
virtual void SetRunNWalkAniSpeed( struct _MONSTER_INFO_FILE* pMonsterInfo ) { assert(false); }
|
|
virtual void SetRunNWalkAniSpeed( struct _SUMMON_INFO_FILE* pSummonInfo ) { assert(false); }
|
|
|
|
void RefreshAllStateEffect();
|
|
void RemoveAllStateEffect();
|
|
|
|
void _RefreshTextureGroup( int texture_group_index, vec_cobset* pCobSet );
|
|
virtual void RefreshTextureGroup( vec_cobset* pCobSet ) { return; }
|
|
|
|
void MakeRamadanWearItemList();
|
|
void LoadingCore(class KSeqAvatarEx * pSeqAvatar, int nObjType, vec_cobset* pCobList, std::vector< WEAR_DATA >& wearlist); // 메쉬, 애니 로딩
|
|
void ReloadWearListFileName( std::vector<WEAR_DATA>& wearList );
|
|
|
|
AR_TIME GetLastWeaponSwapTime() { return LastWeaponSwapTime; }; // Fraun weapon swap exploit fix 8/19/2025
|
|
void SetLastWeaponSwapTime(AR_TIME NewTime); // Fraun weapon swap exploit fix 8/19/2025
|
|
|
|
private:
|
|
::SStateSlot* GetStateInfo(vec_state_slot const& stateList, SMSG_STATE* pMsg, int& nOutPos);
|
|
|
|
protected:
|
|
volatile int m_nFirst;
|
|
volatile int m_nIsRefreshAni;
|
|
KSeqAvatarEx * m_pThreadAvatarEx;
|
|
|
|
struct WEAPON_ENHANCE_EFFECT
|
|
{
|
|
WEAPON_ENHANCE_EFFECT() : weardatainfo(false),
|
|
strEventFileName("")
|
|
{}
|
|
|
|
WEAR_DATA weardata;
|
|
std::string strEventFileName;
|
|
bool weardatainfo;
|
|
};
|
|
|
|
void DeleteReqPoint();
|
|
|
|
void LoadUseAnimation( KSeqAvatarEx * pSeqAvatarEx );
|
|
void RefreshAni();
|
|
|
|
void SetWeaponEnhanceFx( int* nItemCode, bool bHide );
|
|
void ResetWeaponEVPMatrix( int nAnyPart );
|
|
bool RefreshWeaponEffectPos( KSeqAvatarEx * pSeqAvatarEx, int nWeaponEffectPos );
|
|
void LoadEnhanceEffect( KSeqAvatarEx * pAvatarEx, WEAPON_ENHANCE_EFFECT* pWeaponEnFx, int nEffectPart );
|
|
void Armed( KSeqAvatarEx * pAvatarEx, int* nItemCode, int nAnyPart, int nEffectPos, WEAPON_ENHANCE_EFFECT* pWeaponEnFx, int nWeaponEffectPos );
|
|
void UnArmed( int* nItemCode );
|
|
|
|
virtual void AvatarRotationProcess( DWORD time );
|
|
|
|
bool _playAnimation( KSeqAvatarEx* pSeqAvatarEx, const char * pAniKey, int nAniType = SEQTYPE_NORMAL, float fPlayRate = 4.8f );
|
|
|
|
int CheckWorkDel( std::vector< class SGameWork* > & worklist );
|
|
|
|
// virtual void PlayOverride( int nType , float fPlayRate = 4.8f );
|
|
|
|
const char * GetEffectPosName( std::string & strName );
|
|
|
|
const char * GetAniKey( int nObjType, int nAniIndex, bool bOnlyGetAniKey = false );
|
|
|
|
// 쓰레드 로딩
|
|
//---------------------------------
|
|
static unsigned int __stdcall avatar_loader( void* pArg );
|
|
static volatile bool s_bStopThread;
|
|
volatile bool m_bIsThreadLoading;
|
|
volatile bool m_bIsThreadPending;
|
|
|
|
void addToLoadingList();
|
|
void removeFromLoadingList();
|
|
|
|
bool doLoading();
|
|
//---------------------------------
|
|
|
|
void _renderThread();
|
|
void _renderAvatar( unsigned long uRenderBitVector, class KViewportObject** ppViewportList, int nViewportCount );
|
|
void _renderEffectLoading();
|
|
void _renderEtc( unsigned long uRenderBitVector, class KViewportObject** ppViewportList, int nViewportCount );
|
|
|
|
void _checkPetrify();
|
|
|
|
//========================================================
|
|
/// 몬스터 사용
|
|
virtual void ItemDrop() {};
|
|
|
|
//각 아바타들 사용
|
|
void LoadPlayerCOBSet( vec_cobset* pSet, KSeqAvatarEx *pSeqAvatar );
|
|
void LoadMonsterCOBSet( vec_cobset* pSet, KSeqAvatarEx *pSeqAvatar );
|
|
|
|
void LoadNpcCOBSet( vec_cobset* pSet, KSeqAvatarEx *pSeqAvatar );
|
|
|
|
void AddMesh( KSeqAvatarEx *pSeqAvatar, COBSET * pCob, int nMeshPart );
|
|
void AddCommonMesh( KSeqAvatarEx *pSeqAvatar, COBSET * pCob, int nMeshPart, bool bIsNpc = false );
|
|
|
|
KSeqAvatarEx* LoadCOBSet( vec_cobset* pSet );
|
|
void LoadEvent( COBSET * pCob );
|
|
|
|
//각 아바타들 사용
|
|
/// 일반 공격
|
|
void OnAttack( const SStateInfo &info );
|
|
/// 활 공격
|
|
void OnAttackBow( const SStateInfo &info );
|
|
/// 활 공격
|
|
void OnAttackCrossBow( const SStateInfo &info );
|
|
void _processDef();
|
|
/// true 이면 Dead
|
|
bool _damage();
|
|
|
|
void AttachAnimation( KSeqAvatarEx * pAvatarEx );
|
|
|
|
void SetMotionEventHandle( const char * pAni, struct _CHARACTER_MOTION* pMotionInfo, std::vector< Key_EVENT_NEW > &eventlist, KSVEC_KEVENT_RES & svHandleList );
|
|
void AddEvent( std::vector< Key_EVENT_NEW > & eventlist, int nEventID, int nTiming );
|
|
void FindEventList( const char * pAni, _KEY_EVENT_RES * & pCurEventHandle, KSVEC_KEVENT_RES & svEventList );
|
|
void _processEvent( _KEY_EVENT_RES * pEventHandle, DWORD dwAniTime );
|
|
void SetEventHandleNull();
|
|
void SetEventHandleInit();
|
|
void DeleteEvent( KSVEC_KEVENT_RES & svEventList );
|
|
|
|
void SetEventData( const char* szAniName );
|
|
|
|
void CheckStateSkill();
|
|
|
|
void refreshWink( KSeqAvatarEx* pSeqAvatar );
|
|
|
|
|
|
|
|
////--- 무기 강화 이펙트 관련
|
|
//bool rebuildWeaponPowerupMesh(int partNo); // partNo : MPART_R_WEAPON or MPART_L_WEAPON
|
|
// // 무기 강화 이펙트 mesh를 original model로부터 buildup
|
|
// // update에 성공하면 true
|
|
|
|
//void deleteWeaponPowerupMesh(int partNo); // partNo : MPART_R_WEAPON or MPART_L_WEAPON
|
|
// // 무기 강화 이펙트 mesh를 delete
|
|
|
|
//void processWeaponPowerupMeshRebuild(); // Mesh rebuild main
|
|
|
|
// std::vector< int > m_vUseAniClass;
|
|
|
|
class KSeqAvatarEx * m_pSeqAvatar; // Render Object
|
|
int m_nProcess_state; ///< Animation 상태
|
|
// int m_nCurAniType; //종류
|
|
|
|
int m_nNewCurAniType; ///< 종류
|
|
|
|
bool m_bIsTryPlayAni; ///< Play Ani 실패시 재시도 함.
|
|
int m_nCurPlayType; ///< Play 종류
|
|
float m_fCurPlayRate; ///< fPlayRate
|
|
int m_nAniClass; ///< 기본, 양손, 창 등등등
|
|
bool m_bLockAni; ///< Ani Lock
|
|
|
|
int m_nThreadAniClass; ///< 기본, 양손, 창 등등등
|
|
|
|
bool m_bThreadUseRightWeaponTrail; ///< 오른손 무기 궤적 사용?
|
|
bool m_bThreadUseLeftWeaponTrail; ///< 왼손 무기 궤적 사용?
|
|
|
|
bool m_bLockAttackAni; ///< Attack Ani Lock 공격 중일때 Lock 걸림
|
|
|
|
XFlag<int> m_xRenderFlag; ///< 각종 Render Flag
|
|
|
|
//Local Player 인가?
|
|
bool m_bLocal;
|
|
bool m_bLocalCreature;
|
|
bool m_bLocalPet;
|
|
|
|
float fTargetRoll;
|
|
|
|
int m_itemClass[ItemBase::MAX_ITEM_WEAR]; // Equipped items
|
|
|
|
DWORD m_dwTime; // Time
|
|
protected:
|
|
DWORD m_dwStartTime; // Start time, used for opacity calculations
|
|
DWORD m_dwCheckTime; // Status effect update time
|
|
|
|
AR_TIME LastWeaponSwapTime; // Fraun weapon swap exploit fix 8/19/2025
|
|
|
|
float m_fVisibility; // Opacity
|
|
|
|
static bool m_sCubeRender; // Cube render
|
|
static bool m_sMoveSound;
|
|
|
|
static bool m_sEnhanceTest;
|
|
|
|
// KSVEC_KEVENT_RES m_Test;
|
|
_KEY_EVENT_RES* m_pCurEventHandle00_effect;
|
|
KSVEC_KEVENT_RES m_svEventHandle00_effectList;///< 기본 핸들
|
|
_KEY_EVENT_RES* m_pCurEventHandle00_sound;
|
|
KSVEC_KEVENT_RES m_svEventHandle00_soundList; ///< 기본 핸들
|
|
_KEY_EVENT_RES* m_pCurEventHandle00_motion_effect;
|
|
KSVEC_KEVENT_RES m_svEventHandle00_motion_effect; ///< 기본 핸들
|
|
_KEY_EVENT_RES* m_pCurEventHandle01;
|
|
KSVEC_KEVENT_RES m_svEventHandle01_List; ///< 이벤트 핸들 1
|
|
_KEY_EVENT_RES* m_pCurEventHandle02;
|
|
KSVEC_KEVENT_RES m_svEventHandle02_List; ///< 이벤트 핸들 2
|
|
_KEY_EVENT_RES* m_pCurEventHandle03;
|
|
KSVEC_KEVENT_RES m_svEventHandle03_List; ///< 이벤트 핸들 3
|
|
_KEY_EVENT_RES* m_pCurEventHandle04;
|
|
KSVEC_KEVENT_RES m_svEventHandle04_List; ///< 이벤트 핸들 4
|
|
_KEY_EVENT_RES* m_pCurEventHandle05;
|
|
KSVEC_KEVENT_RES m_svEventHandle05_List; ///< 이벤트 핸들 5
|
|
_KEY_EVENT_RES* m_pCurEventHandle06;
|
|
KSVEC_KEVENT_RES m_svEventHandle06_List; ///< 이벤트 핸들 6
|
|
|
|
|
|
std::vector< class SGameWork* > m_vAttackEventList; ///< 일반 공격
|
|
|
|
std::vector< class SGameWork* > m_vCastSkillList; ///< 스킬 Cast 연출
|
|
std::vector< class SGameWork* > m_vFireSkillList; ///< 스킬 Fire 연출
|
|
|
|
std::vector< class SGameWork* > m_vSkillEventList; ///< 스킬
|
|
|
|
vec_state_slot m_vecCashStateList; ///< 현재 상태 이상 리스트(유료템관련/Pc방,시크루트)
|
|
vec_state_slot m_vecPositiveList; ///< 현재 상태 이상 리스트(강화)
|
|
vec_state_slot m_vecNegativeList; ///< 현재 상태 이상 리스트(저주)
|
|
vec_state_slot m_vecMarkStateList; /// 2011.01.14 pvp/pk/pc방 - prodongi
|
|
|
|
class SAvatarProperty * m_pProperty; // Game Content
|
|
|
|
|
|
public:
|
|
SAvatarProperty* GetAvatarProperty() { return m_pProperty; } ///< 게임 컨텐츠 //2011.01.10
|
|
class SObjectStateMachine * m_pStateVM;
|
|
protected:
|
|
|
|
K3DVector m_vView;
|
|
K3DVector m_vCheckPos;
|
|
|
|
K3DVector m_vNextPos;
|
|
|
|
std::string m_strFileName;
|
|
std::string m_strTemp;
|
|
|
|
unsigned char m_speed; ///< speed
|
|
|
|
K3DVector m_vTargetPos; ///< 이동 위치
|
|
K3DVector m_vTracePos[3]; ///< 이동 위치
|
|
int m_nTraceIdx;
|
|
|
|
std::vector<int> m_vCastEffect; ///< 캐스팅 Effect ID List;
|
|
|
|
AR_HANDLE m_hCreature; ///< 소환한 크리처 핸들
|
|
// 2010.08.12 - prodongi
|
|
AR_HANDLE m_hCreatureTemp; /// 이체 소환후 바로 해제할때 m_hCreature를 세팅해 주기 위해서
|
|
|
|
RiderCreatureInfo m_RiderCreatureInfo;
|
|
|
|
DWORD m_dwSkinColor;
|
|
|
|
DWORD m_dwHairColor;
|
|
int m_nHairColorIndex;
|
|
|
|
class KEventPointSeq * m_pSeqRideLink; ///< 라이딩 안장 위치
|
|
|
|
bool m_bIng; ///< 뭔가를 하는중이다...
|
|
|
|
K3DBoundRotCube sel_normal_cube; //
|
|
|
|
float m_fSelcube[6];
|
|
float m_fDeadcube[6];
|
|
// float m_fCollidecube[6];
|
|
|
|
std::string m_strAttackAniKey;
|
|
std::string m_strAniKey;
|
|
|
|
std::vector< WEAR_DATA > m_vWearList;
|
|
std::vector< WEAR_DATA > m_vWearListForRefresh;
|
|
std::vector< WEAR_DATA > m_vWearList_Thread; ///< ThreadLoading 시에 사용
|
|
std::vector< WEAR_DATA > m_vWearList_ramadan; // 라마단 복장 리스트
|
|
|
|
bool m_bReservation;
|
|
|
|
bool m_bVisible;
|
|
bool m_bPrevVisible;
|
|
|
|
int m_nLeftHandWeaponCode[3];
|
|
int m_nRightHandWeaponCode[3];
|
|
int m_nTwoHandWeaponCode[3];
|
|
|
|
PATH m_vDetourPath;
|
|
bool m_bIsMovingDetour;
|
|
bool m_bIsChasing;
|
|
bool m_bRefreshDetour;
|
|
size_t m_unDetourStep;
|
|
|
|
SObjectState::ID m_CurrState;
|
|
AR_HANDLE m_CurrTarget;
|
|
|
|
unsigned char m_nWeaponSwing_RepeatMotion; ///< 3분할 이상 연타 모션 현재 아이디
|
|
|
|
struct UI_SYNC_DATA* m_pUISyncData;
|
|
|
|
bool m_bIsDead;
|
|
public:
|
|
DWORD m_dwPrevTime;
|
|
float m_fTargetRoll;
|
|
float m_fPresentRoll;
|
|
bool m_bUseRot;
|
|
K3DVector m_vTempView;
|
|
|
|
unsigned short m_nAttackIndex;
|
|
K3DVector m_vTerrainPickPos;
|
|
|
|
K3DMatrix m_matEVPMatrix[EFFECT_POS_MAX]; ///< 이벤트 포인트 매트릭스
|
|
K3DMatrix m_matEVPAttachMatrix[EFFECT_POS_MAX]; ///< 본매트릭스
|
|
bool m_bEVPAttachMatrix[EFFECT_POS_MAX];
|
|
KEventPointSeq* m_pEvpSequencer[EFFECT_POS_MAX];
|
|
|
|
K3DMatrix m_matWeaponEVPMatrix[EFFECT_POS_WEAPON_MAX][EFFECT_POS_WEAPON_EP_MAX];
|
|
K3DMatrix m_matWeaponEVPAttachMatrix[EFFECT_POS_WEAPON_MAX][EFFECT_POS_WEAPON_EP_MAX];
|
|
K3DMatrix m_matWeaponEVPParentMatrix[EFFECT_POS_WEAPON_MAX][EFFECT_POS_WEAPON_EP_MAX];
|
|
bool m_bWeaponEVPMatrix[EFFECT_POS_WEAPON_MAX];
|
|
KEventPointSeq* m_pWeaponEvpSequencer[EFFECT_POS_WEAPON_MAX][EFFECT_POS_WEAPON_EP_MAX]; ///< Left_Hand, Righ_Hand, Two_Hand = 3, StartPoint, EndPoint = 2
|
|
|
|
WEAPON_ENHANCE_EFFECT m_WeaponEnhanceFx[EFFECT_POS_WEAPON_MAX]; ///< 무기 로딩이 안됐을때 정보를 저장해 뒀다 로딩 끝나면 처리
|
|
|
|
|
|
std::vector< ArPosition * > m_vReqPoint;
|
|
|
|
// 무기 잔상 표시용 변수들
|
|
class BoneRecorder * m_pBoneRecorder; ///< 무기 궤적 recorder
|
|
|
|
bool m_bActRightWeaponTrail; ///< 검광 활설화 유무
|
|
bool m_bActLeftWeaponTrail; ///< 검광 활설화 유무
|
|
bool m_bUseRightWeaponTrail; ///< 오른손 무기 궤적 사용?
|
|
bool m_bUseLeftWeaponTrail; ///< 왼손 무기 궤적 사용?
|
|
|
|
class SGameFxSwordSlash * m_pWeaponTrailRight; ///< 오른손 무기 궤적 object
|
|
class SGameFxSwordSlash * m_pWeaponTrailLeft; ///< 오른손 무기 궤적 object
|
|
|
|
|
|
//// 무기 강화 이펙트용
|
|
//class SGameFxWeaponPowerup *m_pWeaponPowerupRight; // 오른손 무기 강화 이펙트 (NULL이면 이펙트 표시 없음)
|
|
//class SGameFxWeaponPowerup *m_pWeaponPowerupLeft; // 왼손 무기 강화 이펙트
|
|
|
|
|
|
enum {
|
|
UPDATE_NONE=0 ///< no update
|
|
, UPDATE_REBUILD ///< rebuild polygon
|
|
, UPDATE_DELETE ///< remove polygon
|
|
};
|
|
//int m_nUpdatePowerupRight; // m_pWeaponPowerupRight->init()을 실행할지 여부. UPDATE_xxx
|
|
//int m_nUpdatePowerupLeft; // weapon mesh가 delayed load되는 경우가 있으므로 flag화
|
|
|
|
//bool m_bUpdatePowerupSwitch; // Thread loading의 최후에 true로 세팅; 이것만으로는 loading이 완전하지 않은 경우가 있으므로, 이 플래그를 체크 && 무기 vertex/index buffer!=NULL인 경우에 fx mesh를 update한다
|
|
|
|
|
|
|
|
class SGameAvatarAddOnMgr* m_pAddOnMgr; ///< Avatar addon manager : 각종 렌더링 효과를 list관리
|
|
|
|
bool m_bActivateTerrainDegree;
|
|
class SGameAvatarTerrainDegree* m_pTerrainDegree;
|
|
K3DVector m_vTerrainNormal;
|
|
|
|
bool m_bPlayOverride;
|
|
|
|
bool m_bRefreshInven;
|
|
|
|
char m_cPrevAttackIndex;
|
|
|
|
////////////////////////////////////////////////////
|
|
/// 변장용
|
|
enum DISGUISE_STATE
|
|
{
|
|
NONE_DISGUISE = 0, ///< 원 상태
|
|
PROG_DISGUISE, ///< 변장 중
|
|
REMO_DISGUISE, ///< 변장 해제 중
|
|
STAT_DISGUISE, ///< 변장 상태
|
|
};
|
|
|
|
// 2.1.16 변신 효과 중첩시 아바타 사라지는 오류 수정
|
|
class DisguiseStack* m_pDisguiseStack;
|
|
std::deque< unsigned int > m_UndisguiseStateHandleQueue;
|
|
DISGUISE_STATE m_nDisguise;
|
|
|
|
//class KSeqAvatarEx * m_pDisguiseSeqAvatar;
|
|
//float m_fDisguiseSize;
|
|
//float m_fDisguiseScale;
|
|
std::string m_strBackupName;
|
|
|
|
std::list<int> m_DisguiseList;
|
|
bool IsLastDisguise();
|
|
void AddDisguiseID( int nDisguiseId );
|
|
void DeleteDisguiseID( int nDisguiseId );
|
|
////////////////////////////////////////////////////
|
|
|
|
//스킬 용 잔상
|
|
bool m_bActRightSwordSlashForSkill;
|
|
bool m_bActLeftSwordSlashForSkill;
|
|
|
|
class SGameFxSwordSlash * m_pRightSwordSlashForSkill;
|
|
class SGameFxSwordSlash * m_pLeftSwordSlashForSkill;
|
|
|
|
int m_nSwordSlashForSkillMotion;
|
|
///////////////////////////////////////////////////
|
|
|
|
unsigned int m_nStateFlag;
|
|
float m_fHidingVisiblity;
|
|
float m_fHidingDetectRange;
|
|
|
|
bool m_bFootsteps;
|
|
KColor m_SkinDiffuse;
|
|
|
|
bool m_bPendLoading; ///< 게임 옵션 체크로 변한다
|
|
|
|
float m_fScaleAdjustDest;
|
|
float m_fScaleAdjustPrev;
|
|
int m_nScaleAdjustStartTime;
|
|
float m_fOriginalSelCubeHeight;
|
|
float m_fScaleAdjust;
|
|
|
|
int m_nFadeOutStartTime;
|
|
int m_nFadeOutDuration;
|
|
|
|
|
|
|
|
public:
|
|
float GetAdjustedScale() { return m_fScaleAdjust; }
|
|
void SetFadeOut(int nDuration) { m_nFadeOutDuration = nDuration; m_nFadeOutStartTime = GetSafeTickCount(); }
|
|
|
|
|
|
//데스매치 안에 있는 영역인지 체크
|
|
bool IsInDeathMatch();
|
|
bool IsInBearroad();
|
|
bool IsInBearroadLobby();
|
|
|
|
void SetRefreshAni(){
|
|
m_bRefreshInven = true;
|
|
}
|
|
|
|
public:
|
|
/// @brief 2010.04.22 - prodongi
|
|
void setHairThreadData(SMSG_HAIR_INFO* msg);
|
|
void SetReloadWearListFileName( bool bReload ) { m_bIsReloadWearListFileName = bReload; }
|
|
|
|
private:
|
|
/// @brief 2010.04.22 - prodongi
|
|
//std::string const& getDecoTextureName() const { return m_decoTextureName; }
|
|
//void setDecoTextureName(std::string const& decoTextureName) { m_decoTextureName = decoTextureName; }
|
|
void procHairThreadData();
|
|
void doLoadingHair(KSeqAvatarEx* avatar);
|
|
float getNoneDisguiseScale() const { return m_noneDisguiseScale; } /// 2011.04.29 - prodongi
|
|
public:
|
|
// 2010.05.19 - prodongi
|
|
unsigned int getHideEquipInfo() const { return m_hideEquipInfo; }
|
|
void setHideEquipInfo(unsigned int flag) { m_hideEquipInfo = flag; }
|
|
bool isHideEquipInfo(unsigned int flag) { return (m_hideEquipInfo & flag) == 0 ? false : true; }
|
|
// 2010.06.18 - prodongi
|
|
void setDecoIndex(int index) { m_decoIndex = index; }
|
|
int getDecoIndex() const { return m_decoIndex; }
|
|
// 2010.06.18 - prodongi
|
|
void getDecoTexName(std::string& texName);
|
|
|
|
// gmpbigsun( 2012_1128 ) : MTE
|
|
void EnableMTE( bool bEnable, const char* szFileName = NULL );
|
|
|
|
protected:
|
|
void beginScaling(float& scale, K3DMatrix& oldTM); /// 2011.04.20 - prodongi
|
|
void endScaling(float scale, K3DMatrix const& oldTM); /// 2011.04.20 - prodongi
|
|
|
|
private:
|
|
|
|
sHairThreadData m_hairThreadData;
|
|
unsigned int m_hideEquipInfo;
|
|
int m_decoIndex;
|
|
float m_noneDisguiseScale; // 2011.04.29 변신 전의 스케일 - prodongi
|
|
int m_disguiseEnhance; // 2011.07.28 redmine #16797 변신할 크리처의 강화 정보 - prodongi
|
|
bool m_bIsReloadWearListFileName; // Check if the costume file name needs to be refreshed
|
|
|
|
protected:
|
|
bool m_syncCamRoll; /// 2011.04.21 - prodongi
|
|
float m_kmoveDir; /// 캐릭터가 실제로 이동하는 방향
|
|
int m_kmoveType; /// 캐릭터의 이동 방향에 대한 타입(left | right | up | down)
|
|
bool m_isKMoving;
|
|
};
|
|
|
|
extern unsigned int g_pEnhanceColor[26][4];
|
|
void _EnhanceColorReload();
|
|
|