387 lines
13 KiB
C++
387 lines
13 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
//다른 Player들의 상태 관장
|
|
|
|
//#include <vector>
|
|
#include <Windows.h>
|
|
#include <toolkit/khash.h>
|
|
#include "KSortVector.h"
|
|
#include "GameDefine.h"
|
|
|
|
class SGameAvatarEx;
|
|
class SGameObject;
|
|
|
|
class SCommandSystem
|
|
{
|
|
public:
|
|
SCommandSystem( class K3DRenderDeviceDX *pRenderDevice, class SGame* pGame );
|
|
~SCommandSystem();
|
|
|
|
void SetMouseOverItem( AR_HANDLE handle ) { m_hMouseOverItem = handle; }
|
|
AR_HANDLE GetMouseOverItem() { return m_hMouseOverItem; }
|
|
int GetCretureNameID( AR_HANDLE handle );
|
|
int GetMonsterNameID( AR_HANDLE handle );
|
|
|
|
void SetArObject( struct ArcadiaClient * pArObject ) { m_pArObject = pArObject; }
|
|
|
|
void Render( unsigned long uRenderBitVector, class KViewportObject** ppViewportList, int nViewportCount );
|
|
void Process( DWORD dwTime );
|
|
|
|
/// 온갖 메세지~
|
|
void ProcMsgAtStatic( struct SGameMessage * );
|
|
/// 그림자 끄고 켜려고 만들어 놨는데.. 이제 의미 없을듯..
|
|
void SetSkyType( DWORD dwSkyType );
|
|
|
|
//=================================================================================================================
|
|
/// 가까운 거리의 특정 Object 얻기
|
|
SGameAvatarEx * GetObject( int nType, K3DVector & pos, float & fDist, int nItemType = -1, float fLimitDistance = 9999.f ); // sonador #2.1.2.4.3 9999.f
|
|
SGameObject * GetObject( AR_HANDLE objHandle );
|
|
SGameAvatarEx * GetAvatar( AR_HANDLE objHandle );
|
|
SGameAvatarEx * GetPickObject( K3DVector &vNear, K3DVector &vFar, BOOL bLocal = FALSE );
|
|
void getOtherObjectList(std::vector<SGameAvatarEx*>& objList); /// 2011.08.17 - prodongi
|
|
|
|
/// LocalPlayer 얻기
|
|
SGameAvatarEx * GetLocalPlayer();
|
|
/// Local Creature 얻기
|
|
SGameAvatarEx * GetLocalCreature( AR_HANDLE objHandle );
|
|
|
|
SGameAvatarEx * GetTransportCreatureObject( AR_HANDLE objHandle );
|
|
|
|
SGameAvatarEx* GetObjectFromLeaveList( AR_HANDLE arHandle );
|
|
|
|
BOOL IsSelectCreature() { return m_nCreatureSelect<0 ? FALSE : TRUE; }
|
|
int GetSelectCreatureIndex() { return m_nCreatureSelect; }
|
|
SGameAvatarEx * GetSelectCreature();
|
|
|
|
/// 현재 주위 오브젝트 들이 모두 Load 되면 true;
|
|
bool IsActivated();
|
|
void AddAction( struct SGameMessage* pMsg );
|
|
|
|
void GetItemObjects_For_PetAutoGather( const K3DVector& center, float fLimitRange, std::vector<SGameAvatarEx*>& vecResult, const K3DVector& dist_pos, std::vector<float>& vecDist, int nMaxCount );
|
|
|
|
//=================================================================================================================
|
|
/// 자신이 알아서 Leave
|
|
void onLeave ( AR_HANDLE handle, BOOL bEffect = FALSE );
|
|
|
|
//=================================================================================================================
|
|
/// 높이 재설정
|
|
void SetHeight();
|
|
void DropItem( AR_HANDLE item_handle );
|
|
|
|
/// Leave List 삭제
|
|
void SetArrangeObject();
|
|
//=================================================================================================================
|
|
SGameAvatarEx * GetNextTarget( float fMaxLen, bool bIsResetTargetList );
|
|
|
|
void RemoveAllReservationObject();
|
|
void RemoveReservationObject( bool bCastingCancel = false );
|
|
|
|
//static void SetAvatarVisRange(float fRange)
|
|
//{
|
|
// m_fAvatarVisRange = fRange;
|
|
//}
|
|
|
|
/// 감점 표현 handle == 0 이면, 모든 플레이어 적용
|
|
void PlayerEmotion( AR_HANDLE handel, int nEmotionID );
|
|
|
|
void SetAvatarVisRange(float fRange)
|
|
{
|
|
m_fAvatarVisRange = fRange;
|
|
}
|
|
|
|
void AddRidingObject( AR_HANDLE hMaster, AR_HANDLE hCreature, bool bMount );
|
|
void DeleteRidingObject( AR_HANDLE hMaster, AR_HANDLE hCreature );
|
|
void FindRidingObject();
|
|
void ResetFailAddCreature();
|
|
|
|
int OnAddOtherEffect( int nFxID, struct OtherFxData* fxdata );
|
|
void SetNextStepOtherEffect( int nFxID );
|
|
void SetNextStepOtherEffect( AR_HANDLE hHandle, int nFxType, bool bCheckTargetHandle = false );
|
|
void EndOtherEffect( int nFxID );
|
|
void EndOtherEffect( AR_HANDLE hHandle, int nFxType, bool bCheckTargetHandle = false );
|
|
|
|
void SetCircleShadowEnable(bool bEnable);
|
|
bool GetCircleShadowEnable() { return m_bCircleShadowEnable; }
|
|
|
|
void SetLightmapEnable(bool bEnable);
|
|
bool GetLightmapEnable();
|
|
|
|
// TODO : 테스트가 끝나면 protected:로 선언한다
|
|
void OnMsgAddOtherEffect( SGameMessage* pGameMsg );
|
|
|
|
void SetEffectSpeed( float fSpeed );
|
|
|
|
void MoveImpossibleMsg();
|
|
|
|
//==== 테스트용 더미 크리처
|
|
void AddDummyNpc( int nContentID );
|
|
void AddDummySummon( int nContentID );
|
|
void AddDummyMob( int nContentID );
|
|
void AddDummyMobCirclePos( int nContentID, int nPosCnt, float fLength );
|
|
void AddDummyMobRandomPos( int nContentID, int nPosCnt, float fLength );
|
|
SGameAvatarEx* AddDummy( int nContentID, int nObjType );
|
|
void LeaveDummyCreature( SGameAvatarEx* pDummyCreature );
|
|
void SetDummyCreatureSpeed( SGameAvatarEx* pDummyCreature, float fSpeed );
|
|
void SetDummyCreaturePlayRate( SGameAvatarEx* pDummyCreature, float fPlayRate );
|
|
void SetDummyCreatureSpeedWithPlayRate( SGameAvatarEx* pDummyCreature, float fPlayRate );
|
|
void SetDummyCreatureMode( SGameAvatarEx* pDummyCreature, int nMode );
|
|
void MoveDummyCreature( SGameAvatarEx* pDummyCreature, K3DVector & res );
|
|
void CheatWhirlWindSkill();
|
|
void CheatLightningSkill();
|
|
void CheatHealingWaveSkill();
|
|
void CheatBlessingHammerSkill();
|
|
//테스트용 더미 크리처 ====//
|
|
|
|
void DeleteRenderBooth();
|
|
void ActivateStateEffect();
|
|
void RefreshStateEffect( SGameAvatarEx* pAvatar );
|
|
|
|
void LeaveTransportCreature( AR_HANDLE hCreature, bool bWithArObj = true );
|
|
|
|
void refreshWinkAllPlayerObj();
|
|
void OnWarp();
|
|
|
|
void ActivatePendLoadingListByMove( SGameAvatarEx* pAvatar );
|
|
void ActivatePendLoadingList( int nRender, bool bGetOutTown = false );
|
|
|
|
/// 2011.01.20 - prodongi
|
|
bool getIsTaming() const { return m_isTaming; }
|
|
void setIsTaming(bool taming) { m_isTaming = taming; }
|
|
protected:
|
|
|
|
void Init();
|
|
void Destroy();
|
|
|
|
float GetNameAlpha( float fLen );
|
|
|
|
void OnMsgResult ( struct SMSG_RESULT* pMsg );
|
|
|
|
//World 에 있던 것들////////////////////////////////////////////////////
|
|
//일반 행동
|
|
void OnMsgMove ( struct SMSG_MOVE* pMsg );
|
|
void OnMsgRegionAck( struct SMSG_REGION_ACK* pMsg );
|
|
void OnMsgLeave ( struct SMSG_LEAVE* pMsg );
|
|
void OnMsgEnter ( struct SMSG_ENTER* pMsg );
|
|
void OnMsgLogin ( struct SMSG_LOGIN* pMsg );
|
|
void OnMsgAttack ( struct SMSG_ATTACK* pMsg );
|
|
void OnMsgAttackDouble( struct SMSG_ATTACK_DOUBLE* pMsg );
|
|
|
|
void OnMsgKMove(struct SMSG_KMOVE* msg);
|
|
|
|
void OnMsgHairInfo( struct SMSG_HAIR_INFO* pMsg );
|
|
// 2010.05.19 - prodongi
|
|
void OnMsgHideEquipInfo(struct SMSG_HIDE_EQUIP_INFO* pMsg);
|
|
|
|
void OnMsgHideEquipFlag(struct SMSG_HIDE_EQUIP_INFO * pMsg);
|
|
|
|
|
|
void OnAttack( SGameAvatarEx * pAttack, SGameAvatarEx * pTarget, AR_HANDLE hAttack , AR_HANDLE hTarget, struct SGameMessage * pMsg );
|
|
|
|
void OnMsgChatting ( struct SMSG_CHATTING* pMsg );
|
|
|
|
void OnMsgMount( struct SMSG_MOUNT_SUMMON* pMsg );
|
|
void OnMsgUnMount( struct SMSG_UNMOUNT_SUMMON* pMsg );
|
|
|
|
void OnMount( const struct StateInfoEx* pStateInfoEx, SGameAvatarEx* pPlayer, bool bWithEffect = true );
|
|
void OnUnMount( const struct StateInfoEx* pStateInfoEx, SGameAvatarEx* pPlayer, bool bForceUnMount = false );
|
|
|
|
////Item
|
|
void OnMsgBoothName ( struct SMSG_BOOTH_NAME* pMsg );
|
|
void OnMsgTakeResult( struct SMSG_ITEM_TAKE* pMsg );
|
|
void OnMsgDropResult( struct SMSG_ITEM_DROP* pMsg );
|
|
void OnMsgWearInfo ( struct SMSG_ITEM_WEAR* pMsg );
|
|
void OnMsgInventory ( struct SMSG_ITEM_INVEN* pMsg );
|
|
void OnMsgTakeItemResult( struct SMSG_TAKE_ITEM_RESULT* pMsg );
|
|
|
|
void OnMsgDropInfo ( struct SMSG_ITEM_DROP_INFO* pMsg );
|
|
|
|
void OnMsgStatusChange( struct SMSG_STATUS_CHANGE* pMsg );
|
|
void OnMsgRegenHPMP ( struct SMSG_REGEN_HPMP* pMsg );
|
|
void OnMsgHPMP ( struct SMSG_HPMP* pMsg );
|
|
void OnMsgExpUpdate ( struct SMSG_EXP_UPDATE* pMsg );
|
|
void OnMsgLevelUpdate ( struct SMSG_LEVEL_UPDATE* pMsg );
|
|
void OnMsgBoothClosed ( struct SMSG_BOOTH_CLOSED * );
|
|
|
|
void OnMsgState ( struct SMSG_STATE* pGameMsg );
|
|
void OnMsgProperty ( struct SMSG_PROPERTY* pGameMsg );
|
|
|
|
void OnMsgItemResult ( struct SMSG_USE_ITEM_RESULT* pMsg );
|
|
|
|
void OnTamingInfo ( struct SMSG_TAMING_INFO* pGameMsg);
|
|
|
|
void RefresItemWear ( struct SMSG_ITEM_WEAR* pMsg );
|
|
|
|
/// Skill, Spell, Cmd
|
|
void OnMsgSkillEvent ( struct SMSG_SKILL_EVENT* pMsg ); //스킬
|
|
// void OnMsgSkillEffect( struct SMSG_SKILL_EFFECT*pMsg ); //스킬 사용 후 범위 데미지 온다.
|
|
void OnMsgCmd ( struct SMSG_CMD_RESULT* pMsg ); //명령
|
|
|
|
////Cheating
|
|
void OnMsgWarp( struct SCMSG_WARP* pMsg ); //Warp
|
|
|
|
void OnMsgEmotion( struct SMSG_EMOTION* );
|
|
|
|
// void OnMsgAddOtherEffect( SGameMessage* pGameMsg );
|
|
|
|
void OnMsgAddForceSphere( struct SMSG_ENERGY* pMsg );
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
//Enter Object
|
|
/// 플레이어
|
|
void AddPlayer ( struct SMSG_ENTER* );
|
|
/// 몹
|
|
void AddMob ( struct SMSG_ENTER* );
|
|
/// NPC
|
|
void AddNPC ( struct SMSG_ENTER* );
|
|
/// 아이템
|
|
void AddItem ( struct SMSG_ENTER* );
|
|
/// 크리쳐
|
|
void AddCreature ( struct SMSG_ENTER* );
|
|
/// Skill Prop
|
|
void AddSkillProp ( struct SMSG_ENTER* );
|
|
/// 퀘스트 프랍
|
|
void AddFieldQuestProp( struct SMSG_ENTER* );
|
|
|
|
//! add new pet when enter message has arrived
|
|
void AddPet ( struct SMSG_ENTER* ); //PET // sonador 10.2.1 팻 시스템 구현
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
////
|
|
void AddTransportCreature( struct SMSG_ENTER* pMsg, SGameAvatarEx* pPlayer );
|
|
|
|
public: // 2011.03.10 - servantes
|
|
void InsertAvatarEX(AR_HANDLE handle, SGameAvatarEx* pAvatar, bool bIsTransportCreature = false );
|
|
void InsertPendLoading( SGameAvatarEx* pAvatar );
|
|
void InsertGameAvatarExToOtherObjectVector(SGameAvatarEx* pAvatar) { m_svObject.insert( pAvatar ); }
|
|
void DeleteAvatar(AR_HANDLE handle);
|
|
|
|
protected:
|
|
//Msg Event Process
|
|
/// 아이템 Use
|
|
void OnMsgItemUse();
|
|
/// 아이템 Drop
|
|
void OnMsgItemDrop();
|
|
/// 이동
|
|
void OnMsgMove();
|
|
|
|
void DisplayNamePanel( SGameAvatarEx* pAvatar );
|
|
void SetPlayerAndCreaturePosition( SMSG_UNMOUNT_SUMMON* pMsg );
|
|
void addCustomBlock(class SGameFieldQuestProp* prop);
|
|
void delCustomBlock(AR_HANDLE handle);
|
|
|
|
class STargetMgr* m_pTargetMgr; ///< 자동 타겟 관리자
|
|
|
|
/// 삭제용 벡터
|
|
struct SGameAvatarExTag
|
|
{
|
|
SGameAvatarExTag( SGameAvatarEx * _ptr, DWORD _dwTime ) : ptr( _ptr ), dwTime( _dwTime ), bNotUse( false )
|
|
{
|
|
}
|
|
|
|
SGameAvatarEx * ptr;
|
|
DWORD dwTime;
|
|
bool bNotUse;
|
|
};
|
|
|
|
KHash< struct SGameAvatarExTag*, hashPr_mod_basic<AR_HANDLE> > m_hashLeaveList;
|
|
|
|
// std::vector< struct SGameAvatarExTag > m_vLeaveList; //
|
|
|
|
KHash< SGameAvatarEx *, hashPr_mod_basic<AR_HANDLE> > m_hashObject;
|
|
KSortVector< SGameAvatarEx* > m_svObject;
|
|
/// 랜더링 순서 생김에 따라, 플레이어와 그외로 나누어짐.
|
|
KSortVector< SGameAvatarEx* > m_svPlayerObject;
|
|
/// 랜더링 순서 생김에 따라, 플레이어와 그외로 나누어짐.
|
|
KSortVector< SGameAvatarEx* > m_svOtherObject;
|
|
KSortVector< SGameAvatarEx* > m_svRecongnizeMobObject;
|
|
|
|
std::vector< AR_HANDLE > m_svReservationObject; ///< 삭제가 잠시 보류된 오브젝트
|
|
|
|
KHash< SGameAvatarEx *, hashPr_mod_basic<AR_HANDLE> > m_hashTransportCreatureObject;
|
|
KSortVector< SGameAvatarEx* > m_svTransportCreatureObject;
|
|
|
|
KHash< SGameAvatarEx *, hashPr_mod_basic<AR_HANDLE> > m_hashPendingObjList;
|
|
|
|
AR_HANDLE m_LocalHandle;
|
|
|
|
struct DROP_INFO
|
|
{
|
|
AR_HANDLE item_handle;
|
|
AR_HANDLE mob_handle;
|
|
};
|
|
|
|
std::vector< DROP_INFO > m_vMobDropItemList; ///< 몬스터의 Drop Item List
|
|
|
|
struct RIDING_INFO
|
|
{
|
|
enum MOUNT_TYPE
|
|
{
|
|
MOUNT_CREATURE_TYPE = 0,
|
|
UNMOUNT_CREATURE_TYPE,
|
|
MOUNT_TYPE_MAX,
|
|
};
|
|
|
|
RIDING_INFO()
|
|
{
|
|
player_handle = 0;
|
|
creature_handle = 0;
|
|
mount_type = MOUNT_TYPE_MAX;
|
|
dwLeftTime = 0;
|
|
}
|
|
|
|
AR_HANDLE player_handle;
|
|
AR_HANDLE creature_handle;
|
|
MOUNT_TYPE mount_type;
|
|
DWORD dwLeftTime;
|
|
};
|
|
|
|
struct ENTER_CREATURE_FAIL
|
|
{
|
|
ENTER_CREATURE_FAIL(AR_HANDLE Creature=0, AR_HANDLE Master=0): hCreature(Creature), hMaster(Master) {}
|
|
AR_HANDLE hCreature;
|
|
AR_HANDLE hMaster;
|
|
};
|
|
|
|
std::vector< RIDING_INFO > m_svRidingObject; ///< 로딩때문에 라이딩 실패한 정보를 저장한다
|
|
std::vector< ENTER_CREATURE_FAIL > m_FailAddCreatureList; ///< 크리처가 먼저 엔터되고 플레이어가 나중에 엔터되기 때문에 proccess에서 플레이어에 쎄팅해준다.
|
|
|
|
class SGameActionMgr* m_pActionMgr;
|
|
|
|
struct ArcadiaClient* m_pArObject;
|
|
|
|
|
|
class SGameOtherEffectMng* m_pOtherEffecMgr;
|
|
|
|
//Render 부수적인 것들
|
|
class K3DRenderDeviceDX* m_pRenderDevice;
|
|
class SGame* m_pGame;
|
|
|
|
//소환수 관련
|
|
int m_nCreatureSelect; ///< 선택된 크리쳐 인덱스
|
|
int m_nCreatureCount; ///< 나의 크리쳐 수
|
|
|
|
std::vector< SGameAvatarEx * > m_vLocalCreature; ///< 내 소환수 포인터
|
|
|
|
DWORD m_dwTime;
|
|
DWORD m_pPrevBoothProcTime;
|
|
DWORD m_dwLocalCreaturePrcessTime;
|
|
|
|
DWORD m_dwCheckTime;
|
|
|
|
//static float m_fAvatarVisRange;
|
|
float m_fAvatarVisRange;
|
|
bool m_bDestroy;
|
|
|
|
bool m_bCircleShadowEnable;
|
|
AR_HANDLE m_hMouseOverItem;
|
|
|
|
/// 2011.01.20 - prodongi
|
|
bool m_isTaming;
|
|
|
|
public:
|
|
bool IsTarget();
|
|
};
|