402 lines
9.3 KiB
C++
402 lines
9.3 KiB
C++
|
|
#pragma once
|
|
|
|
//#include <string>
|
|
//#include <vector>
|
|
#include "Enc.h"
|
|
#include "K3DTypes.h"
|
|
#include "MonsterBase.h"
|
|
#include "SLog.h"
|
|
#include "SStringDB.h"
|
|
|
|
using std::string;
|
|
using std::vector;
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 소환수 DB
|
|
//////////////////////////////////////////////////////////////////////////
|
|
struct _SUMMON_INFO_FILE_CLIENT : public _SUMMON_INFO_FILE
|
|
{
|
|
ENC_INT real_uid;
|
|
int nPrev_Evolve_target; // 이전 진화 단계
|
|
};
|
|
|
|
|
|
namespace nsCreatureDB
|
|
{
|
|
static const string EVOLUTION_FORM_ICON_FILE_NAME_NORMAL( "common_mark_creature_evolution_01" ); // 크리쳐 진화 단계 아이콘 파일 이름 ( 보통 )
|
|
static const string EVOLUTION_FORM_ICON_FILE_NAME_GROWUP( "common_mark_creature_evolution_02" ); // 크리쳐 진화 단계 아이콘 파일 이름 ( 성장형 )
|
|
static const string EVOLUTION_FORM_ICON_FILE_NAME_EVOLVE( "common_mark_creature_evolution_03" ); // 크리쳐 진화 단계 아이콘 파일 이름 ( 진화형 )
|
|
};
|
|
|
|
using namespace nsCreatureDB;
|
|
|
|
class SCreatureDB
|
|
{
|
|
public:
|
|
|
|
enum
|
|
{
|
|
FORM_NORMAL = 1,
|
|
FORM_GROWUP = 2,
|
|
FORM_EVOLVE = 3,
|
|
};
|
|
|
|
enum EVOLUTION_LV
|
|
{
|
|
EVOLUTION_LV1 = 0,
|
|
EVOLUTION_LV2 = 50,
|
|
EVOLUTION_LV3 = 100,
|
|
};
|
|
|
|
SCreatureDB( void );
|
|
~SCreatureDB( void );
|
|
|
|
|
|
inline _SUMMON_INFO_FILE* GetCreatureData( ENC_INT nCreatureID )
|
|
{
|
|
return GetCreatureClientData( nCreatureID );
|
|
}
|
|
|
|
inline const char * GetCobFileName( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->model;
|
|
|
|
return "";
|
|
}
|
|
|
|
inline float GetSize( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->size;
|
|
|
|
return 1.f;
|
|
}
|
|
|
|
inline float GetScale( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->scale;
|
|
|
|
return 1.f;
|
|
}
|
|
|
|
inline int GetSlantType( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->slant_type;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetTextID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->name_id;
|
|
|
|
return -1;
|
|
}
|
|
|
|
inline int GetTextNameID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->text_name_id;
|
|
|
|
return -1;
|
|
}
|
|
|
|
inline int GetTextFeatureID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->text_feature_id;
|
|
|
|
return -1;
|
|
}
|
|
|
|
inline const char * GetIconName( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->face_file_name;
|
|
|
|
return "NotFound";
|
|
}
|
|
|
|
inline int GetFaceID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->nFaceID;
|
|
|
|
return -1;
|
|
}
|
|
|
|
inline char GetRate( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->rate;
|
|
|
|
return 0;
|
|
}
|
|
|
|
std::string GetRateString( const BYTE byRank )
|
|
{
|
|
std::string strRate( "" );
|
|
|
|
switch( byRank )
|
|
{
|
|
case SummonBase::RATE_BASIC: strRate.append( S( 7223 ) /*베이직 크리쳐*/ ); break;
|
|
case SummonBase::RATE_NORMAL_BASIC: strRate.append( S( 7224 ) /*노말 베이직*/ ); break;
|
|
case SummonBase::RATE_SPECIAL_BASIC: strRate.append( S( 7225 ) /*스페셜 베이직*/ ); break;
|
|
case SummonBase::RATE_NORMAL_RARE: strRate.append( S( 7226 ) /*노말 레어*/ ); break;
|
|
case SummonBase::RATE_SPECIAL_RARE: strRate.append( S( 7227 ) /*스페셜 레어*/ ); break;
|
|
case SummonBase::RATE_UNIQUE: strRate.append( S( 7228 ) /*유니크*/ ); break;
|
|
|
|
// AziaMafia Pet Rarity
|
|
case SummonBase::RATE_VERACRUZ: strRate.append(S(2110000000) ); break;
|
|
case SummonBase::RATE_PHANTOM: strRate.append(S(2110000001) ); break;
|
|
case SummonBase::RATE_AURA: strRate.append(S(2110000002) ); break;
|
|
case SummonBase::RATE_SHINNY: strRate.append(S(2110000003) ); break;
|
|
case SummonBase::RATE_GALAXY: strRate.append(S(2110000004) ); break;
|
|
|
|
default:
|
|
{
|
|
SDEBUGLOG( "[Summon DB] Unknown creature grade. - [%u]", byRank );
|
|
assert( NULL );
|
|
}
|
|
break;
|
|
}
|
|
|
|
return strRate;
|
|
}
|
|
|
|
inline int GetMotionSpeed( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->nAttack_motion_speed;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetMagicType( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->magic_type;
|
|
|
|
return 0; //무속성
|
|
}
|
|
|
|
inline K3DVertex GetSummonCameraPos( ENC_INT nMonsterID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData(nMonsterID);
|
|
if( pCreature )
|
|
{
|
|
return K3DVertex( (K3DVALUE)pCreature->nCamera_x, (K3DVALUE)pCreature->nCamera_y, (K3DVALUE)pCreature->nCamera_z );
|
|
}
|
|
|
|
return K3DVertex(0,-8,1);
|
|
}
|
|
|
|
inline bool IsPossibilityCreatureMount( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData(nCreatureID);
|
|
if( pCreature != NULL )
|
|
{
|
|
if( pCreature->is_riding_only > 0 )
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
inline char GetIsRidingOnly( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData(nCreatureID);
|
|
if( pCreature != NULL )
|
|
{
|
|
return pCreature->is_riding_only;
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
|
|
|
|
inline int GetRidingMotionType( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
{
|
|
return pCreature->riding_motion_type;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetWalkType( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature ) return pCreature->walk_type;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetEvolutionForm( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature ) return pCreature->nForm;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline string GetEvolutionFormIconFileName( ENC_INT nCreatureID )
|
|
{
|
|
string strEvolutionFormIconFileName( "" );
|
|
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
{
|
|
switch( pCreature->nForm )
|
|
{
|
|
case FORM_NORMAL:
|
|
strEvolutionFormIconFileName = EVOLUTION_FORM_ICON_FILE_NAME_NORMAL;
|
|
break;
|
|
case FORM_GROWUP:
|
|
strEvolutionFormIconFileName = EVOLUTION_FORM_ICON_FILE_NAME_GROWUP;
|
|
break;
|
|
case FORM_EVOLVE:
|
|
strEvolutionFormIconFileName = EVOLUTION_FORM_ICON_FILE_NAME_EVOLVE;
|
|
break;
|
|
default:
|
|
{
|
|
SDEBUGLOG( "[소환수 DB] 알수 없는 크리쳐 진화 단계 입니다. - [%u]", pCreature->nForm );
|
|
assert( NULL );
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SDEBUGLOG( "[소환수 DB] 알수 없는 크리쳐 입니다. - [%u]", nCreatureID.value() );
|
|
assert( NULL );
|
|
}
|
|
|
|
return strEvolutionFormIconFileName;
|
|
}
|
|
|
|
inline string GetEvolutionFormString( ENC_INT nCreatureID )
|
|
{
|
|
string strEvolutionForm( "" );
|
|
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
{
|
|
switch( pCreature->nForm )
|
|
{
|
|
case FORM_NORMAL:
|
|
strEvolutionForm = S( 90 ); // Basic
|
|
break;
|
|
case FORM_GROWUP:
|
|
strEvolutionForm = S( 91); // Mid
|
|
break;
|
|
case FORM_EVOLVE:
|
|
strEvolutionForm = S( 92 ); // Adv
|
|
break;
|
|
default:
|
|
{
|
|
SDEBUGLOG( "[Summoned Creature DB] Unknown creature evolution stage. - [%u]", pCreature->nForm );
|
|
assert( NULL );
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SDEBUGLOG( "[소환수 DB] 알수 없는 크리쳐 입니다. - [%u]", nCreatureID.value() );
|
|
assert( NULL );
|
|
}
|
|
|
|
return strEvolutionForm;
|
|
}
|
|
|
|
inline int GetSpeciesID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature ) return pCreature->speceis_id;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetAffiliationID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature ) return pCreature->affiliation_id;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetAffiliationDetailID( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature ) return pCreature->affiliationDetail_id;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline int GetColor( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE* pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature ) return pCreature->color_id;
|
|
|
|
return 0;
|
|
}
|
|
|
|
inline const char * GetIllustImgName( ENC_INT nCreatureID )
|
|
{
|
|
_SUMMON_INFO_FILE * pCreature = GetCreatureData( nCreatureID );
|
|
if( pCreature )
|
|
return pCreature->illust_file_name;
|
|
|
|
return "game_image_card_empty.jpg";
|
|
}
|
|
|
|
/// 이전 진화 단계 코드 얻기(현재 단계 포함)
|
|
void GetEvolveID( const int nCreatureID, std::vector<int> & vIDList );
|
|
|
|
protected:
|
|
void Init();
|
|
void Destroy();
|
|
|
|
void Load();
|
|
|
|
inline _SUMMON_INFO_FILE_CLIENT* GetCreatureClientData( ENC_INT nCreatureID )
|
|
{
|
|
auto pos = m_mapCreatureList.find( nCreatureID );
|
|
if( pos != m_mapCreatureList.end() )
|
|
{
|
|
return pos->second;
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
std::map< int, struct _SUMMON_INFO_FILE_CLIENT* > m_mapCreatureList;
|
|
|
|
public:
|
|
static SCreatureDB* m_pThis;
|
|
|
|
};
|
|
|
|
SCreatureDB & GetCreatureDB(); |