186 lines
5.5 KiB
C++
186 lines
5.5 KiB
C++
#pragma once
|
|
|
|
#include "SGameCreature.h"
|
|
|
|
class KSeqAvatar;
|
|
|
|
class SGameLocalCreature : public SGameCreature
|
|
{
|
|
private:
|
|
enum CREATURE_STATE
|
|
{
|
|
STATE_NSTANDBY = 0,
|
|
STATE_STANDBY,
|
|
STATE_RECALL_COUNTDOWN,
|
|
};
|
|
|
|
enum CREATURE_BATTLE_MODE
|
|
{
|
|
BATTLE_MODE_OFF = 0,
|
|
BATTLE_MODE_ON,
|
|
};
|
|
|
|
enum CREATE_DISTANCE_TYPE
|
|
{
|
|
DISTANCE_3 = 3 * GameRule::DEFAULT_UNIT_SIZE,
|
|
DISTANCE_15 = 15 * GameRule::DEFAULT_UNIT_SIZE,
|
|
DISTANCE_50 = 50 * GameRule::DEFAULT_UNIT_SIZE,
|
|
DISTANCE_150 = 150 * GameRule::DEFAULT_UNIT_SIZE,
|
|
};
|
|
public:
|
|
SGameLocalCreature( int nCreatureID, unsigned char ucEnhance );
|
|
virtual ~SGameLocalCreature();
|
|
|
|
/// Local 계열만
|
|
virtual void OnInput( class SGameInput * pInput );
|
|
|
|
virtual bool Process( DWORD dwTime, unsigned long uProcessBitVector=0 );
|
|
|
|
/// Idle 상태일때만 방향 설정
|
|
virtual void SetViewVectorStateIdle( const K3DVector &tpos );
|
|
|
|
virtual void CheckPrevState();
|
|
|
|
/// 주인님 설정
|
|
virtual void SetMaster( AR_HANDLE hMaster, SGameAvatarEx * pMaster );
|
|
virtual AR_HANDLE GetMaster() { return m_hMaster; }
|
|
/// 타겟 몬스터 설정
|
|
virtual void SetTargetMonster( AR_HANDLE hMonster );
|
|
/// Shift로 크리처 이동명령을 내리면 이동후 대기 상태로 전환된다
|
|
virtual void SetHold();
|
|
virtual void SetUnHold();
|
|
/// 소환수의 가장 적절한 포지션을 구한다
|
|
virtual void SetBestPosition( bool bImmediately = false );
|
|
virtual void SetBestPositionEx( bool bImmediately = false );
|
|
bool GetCreaturePosition( K3DVector* pOut );
|
|
|
|
/// 역소환 될경우 남아있는 소환수 위치를 다시 설정한다
|
|
virtual void AddNLeaveSummon();
|
|
|
|
/// 스크립 명령
|
|
virtual void CmdIdle();
|
|
virtual void CmdMove();
|
|
virtual void CmdAttack();
|
|
virtual void CmdStandBy();
|
|
|
|
/// 테이머를 기준으로 왼쪽이나 오른쪽으로 따라다닐지 결정
|
|
void SetMoveLeft() { m_fLeftNRight = -1.0f; }
|
|
void SetMoveRight(){ m_fLeftNRight = 1.0f; }
|
|
|
|
float GetCreatureLeftORRightPos() { return m_fLeftNRight; }
|
|
|
|
/// 크리처 BackDown
|
|
void CreatureBackDownSpeedOfPlayer();
|
|
void CreatureBackDownSpeedOfCreature();
|
|
|
|
void SetCreatureBattleModeOff();
|
|
void SetCreatureBattleModeOn();
|
|
|
|
int GetCreatureBattleMode() { return m_nCreatureMode; }
|
|
|
|
bool CheckState();
|
|
bool IsStandbyState();
|
|
|
|
virtual bool IsRotation() { return m_bUseRot; }
|
|
|
|
virtual void Dead( void );
|
|
|
|
/// 서버에 명령어 송신
|
|
virtual void ReqTakeItem( AR_HANDLE handle );
|
|
virtual void ReqMove( AR_HANDLE handle, const ArPosition & target, bool bSpeedSync = true, bool bChase = false );
|
|
virtual void ReqAttack( AR_HANDLE target ); // target == 0 공격 중지 요청
|
|
virtual void ReqCast( AR_HANDLE target, int nSkillID, int nSkillLv, K3DVector const& targetPos ); /// 2010.10.14 - prodongi
|
|
virtual void ReqCancelAction();
|
|
virtual void ReqThrow( AR_HANDLE target, AR_HANDLE itemhandle );
|
|
virtual void ReqSit();
|
|
virtual void ReqStandUp();
|
|
virtual void ReqNormal();
|
|
virtual void ReqBattle();
|
|
|
|
static void SetIdleProcess( bool bFlag ) { s_bIdleProc = bFlag; }
|
|
|
|
AR_UNIT GetSize( SGameObject *pObject );
|
|
bool Deactivate();
|
|
|
|
protected:
|
|
static bool s_bIdleProc;
|
|
|
|
virtual const char* getClassName() { return "SGameLocalCreature"; } ///< Property Set
|
|
void CheckCurrentState();
|
|
|
|
bool NeedNewDetourPoint();
|
|
|
|
bool CheckDistance( CREATE_DISTANCE_TYPE nType, SGameAvatarEx* pTarget );
|
|
|
|
DWORD m_dwTryMoveTime;
|
|
|
|
DWORD m_dwUpdateTime; ///< 서버 업데이트 시간
|
|
|
|
//크리쳐만 사용
|
|
class SGameAvatarEx * m_pMasterPlayer; ///< 주인님
|
|
AR_HANDLE m_hMaster; ///< 주인님 핸들
|
|
K3DVector m_vMasterLastPos; // 주인님의 마지막 좌표
|
|
AR_HANDLE m_hTargetMonster;
|
|
|
|
float m_fLeftNRight;
|
|
|
|
DWORD m_dwCallScriptTime;
|
|
DWORD m_dwBeginScriptTime;
|
|
|
|
CREATURE_STATE m_nCreatureState; ///< 크리처 상태
|
|
CREATURE_BATTLE_MODE m_nCreatureMode; ///< 크리처 전투 모드인가 비 전투 모드인가
|
|
|
|
DWORD m_dwFindDetour;
|
|
DWORD m_dwFindDetourTick;
|
|
|
|
AR_UNIT m_arMasterSize;
|
|
AR_UNIT m_arMySize;
|
|
|
|
DWORD m_dwEscHitTime;
|
|
byte m_EscHitCount;
|
|
|
|
bool m_bDeadDialog;
|
|
DWORD m_dwDeadDialogTime;
|
|
};
|
|
|
|
class SGameCreatureForTransport : public SGameCreature
|
|
{
|
|
private:
|
|
class SGameAvatarEx * m_pMasterPlayer; ///< 주인님
|
|
AR_HANDLE m_hMaster; ///< 주인님 핸들
|
|
public:
|
|
//주인님 설정
|
|
virtual void SetMaster( AR_HANDLE hMaster, SGameAvatarEx * pMaster );
|
|
void OnChangeState( SObjectState::ID stateid, const SStateInfo &info );
|
|
virtual void SetViewVectorStateIdle( const K3DVector &tpos );
|
|
public:
|
|
virtual bool Process( DWORD time, unsigned long uProcessBitVector=0 );
|
|
public:
|
|
SGameCreatureForTransport( int nCreatureID, unsigned char ucEnhance );
|
|
virtual ~SGameCreatureForTransport();
|
|
};
|
|
|
|
class SGameDummyCreature : public SGameCreature
|
|
{
|
|
private:
|
|
float m_fSpeed;
|
|
int m_nMode;
|
|
|
|
public:
|
|
bool IsDummyCreature() { return true; }
|
|
void OnChangeState( SObjectState::ID stateid, const SStateInfo &info );
|
|
public:
|
|
void SetDummyCreatureSpeed( float fSpeed );
|
|
void SetDummyCreatureSpeedWithPlayRate( float fPerSpeed );
|
|
void SetDummyCreaturePlayRate( float fPerPlayRate );
|
|
void SetDummyCreatureMode( int nMode );
|
|
void SetDBData();
|
|
public:
|
|
float GetDummyCreatureSpeed() { return m_fSpeed; }
|
|
float GetCalcMoveSpeed( float fPerSpeed );
|
|
float GetCalcPlayRate( float fPerPlayRate );
|
|
float GetPlayRatePercentage( float fSpeed );
|
|
public:
|
|
SGameDummyCreature( int nCreatureID, unsigned char ucEnhance );
|
|
virtual ~SGameDummyCreature();
|
|
}; |