#include "StdAfx.h" #include "SkillScript.h" #include "FileLoader.h" #include "Tokenizer.h" #include "DramaturgyManager.h" #include "GameResourceManager.h" cSkillScript* cSkillScript::mpSkillScript = NULL; cSkillScript::cSkillScript(void) { /// ½Ì±ÛÅæ mpSkillScript = this; } bool cSkillScript::Init() { Release(); /// ½ºÅ³ ½ºÅ©¸³Æ® ·Îµå if( !PlayerSkillScriptLoad() ) { assert(NULL); return false; } /// ½ºÅ³ ½ºÅ©¸³Æ® ·Îµå if( !MonsterSkillScriptLoad() ) { assert(NULL); return false; } if( !PlayerSkillStepLoad() ) { assert(NULL); return false; } if( DRAMATURGYMAN->Init() == false ) { assert(0); return false; } if( !InfluenceLoad() ) { assert(NULL); return false; } ///// ½ºÅ³ ½ºÅ©¸³Æ® ·Îµå //if( !PlayerSkillJobScriptLoad() ) //{ // assert(NULL); // return false; //} //PlayerFreeSkillList(); return true; } void cSkillScript::Release() { cSkillHashMap::cIterator iter; for(iter = mPlayerSkillInfoMap.Begin() ; iter != mPlayerSkillInfoMap.End() ; ++iter) { delete (sPlayerSkillBaseInfo*)(*iter).mSecond; } mPlayerSkillInfoMap.Clear(); /// ¸ó½ºÅÍ ±âº»½ºÅ³ Á¤º¸ »èÁ¦ for( iter = mMonsterBaseSkillMap.Begin(); iter != mMonsterBaseSkillMap.End(); ++iter ) { delete (cArray*)iter->mSecond; } mMonsterBaseSkillMap.Clear(); /// ¿¤¸®Æ®(º¸½º)¸ó½ºÅÍ Æ¯¼ö ½ºÅ³ Á¤º¸ »èÁ¦ for( iter = mMonsterEliteSkillMap.Begin(); iter != mMonsterEliteSkillMap.End(); ++iter ) { delete (cArray*)iter->mSecond; } mMonsterEliteSkillMap.Clear(); /// Àüü½ºÅ³ Á¤º¸ »èÁ¦ for( iter = mMonsterSkillTotalMap.Begin(); iter != mMonsterSkillTotalMap.End(); ++iter ) { delete (sMonsterSkillScript*)iter->mSecond; } mMonsterSkillTotalMap.Clear(); for( iter = mInfluenceMap.Begin() ; iter != mInfluenceMap.End() ; ++iter ) { delete (sInfluenceScript*)(*iter).mSecond; } mInfluenceMap.Clear(); for( iter = mSkillJobMap.Begin() ; iter != mSkillJobMap.End() ; ++iter ) { delete (tArray*)(*iter).mSecond; } mSkillJobMap.Clear(); for( iter = mFreeSkillMap.Begin() ; iter != mFreeSkillMap.End() ; ++iter ) { delete (tArray*)(*iter).mSecond; } mFreeSkillMap.Clear(); } void cSkillScript::PlayerFreeSkillList() { cSkillHashMap::cIterator i = mPlayerSkillInfoMap.Begin(); cSkillHashMap::cIterator iend = mPlayerSkillInfoMap.End(); /// Áö±Þ¿ë ½ºÅ³ for( ; i!=iend; i++ ) { sPlayerSkillBaseInfo* info = (sPlayerSkillBaseInfo*)(*i).mSecond; unsigned long idx = (unsigned long)(*i).mFirst; if( idx <= 100 ) continue; if( info ) { if( info->mpSetpInfoArray[0].mPlayerLevel == 0 ) { if( info->mpSetpInfoArray[0].mJobType == 0 ) { /// ¸ðµç Á÷¾÷¿¡ Áö±ÞÇÒ ¸ñ·Ï tArray* p = (tArray*)mFreeSkillMap.GetAt(0); if( p == 0 ) { p = new tArray; mFreeSkillMap.Insert( 0, p ); } p->PushBack( (*i).mFirst ); } else { /// ƯÁ¤ Á÷¾÷¿¡ Áö±ÞÇÒ ¸ñ·Ï tArray* pArray = GetPlayerSkillJob( info->mpSetpInfoArray[0].mJobType ); for( unsigned int ui=0; uiGetSize(); ui++ ) { tArray* p = (tArray*)mFreeSkillMap.GetAt( (*pArray)[ui] ); if( p == 0 ) { p = new tArray; mFreeSkillMap.Insert( (*pArray)[ui], p ); } p->PushBack( (*i).mFirst ); } } } } } /// } bool cSkillScript::PlayerSkillScriptLoad() { cFileLoader loader; cString pathName = "./Script/Resource/SkillList_PC.txt"; if( loader.Open( pathName, true ) == false ) { assert( 0 && "failed to load SkillList_PC.txt" ); return false; } cTokenizer tokenizer( loader.GetBufferPtr(), loader.GetSize(), " \t\r\n", pathName.Cstr() ); cString str; sPlayerSkillBaseInfo* pSkillInfo = 0; while( tokenizer.IsEnd() == false ) { pSkillInfo = new sPlayerSkillBaseInfo; /// ½ºÅ³ Á¾·ùIdx if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mSkillIdx = str.ToInt(); /// ½ºÅ³ À̸§Idx if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mNameIdx = str.ToInt(); /// ½ºÅ³ ¾ÆÀÌÄÜIdx if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mIconIdx = str.ToInt(); /// ½Àµæ,»ç¿ë Á¾Á· if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mRace = static_cast(str.ToInt()); /// Á÷¾÷ ´Ü°è if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mJobStep = static_cast(str.ToInt()); /// ½ºÅ³½ÀµæÁ¶°Ç - ÃÑ»ç¿ë SP¾ç if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mBeforeReqSP = str.ToInt(); /// ½ºÅ³»ç¿ëÁ¶°Ç - ÇÊ¿äÀåºñ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mUseEquipment = static_cast(str.ToInt()); /// ½ºÅ³»ç¿ëÁ¶°Ç - ij¸¯ÅÍ»óÅ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mUseState = static_cast(str.ToInt()); /// ½ºÅ³»ç¿ëÁ¶°Ç - ij¸¯ÅÍ»óÅ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mUseItem = str.ToInt(); /// ºÐ·ù - ½ºÅ³ »ç¿ë ÇüÅ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mType = static_cast(str.ToInt()); /// ½ºÅ³À¯Çü - ¼Ó¼º if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mAttributeType = static_cast(str.ToInt()); /// ½ÃÀüÀ¯Çü if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mShotType = static_cast(str.ToInt()); /// ¹üÀ§¹æ½Ä - ½ºÅ³ »ç¿ë½Ã ±âÁØÀÇ ¹üÀ§ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mBoundType = static_cast(str.ToInt()); /// È¿°úÀû¿ëŸ°Ù - ¹üÀ§¾È¿¡¼­ È¿°ú¸¦ Àû¿ë¹Þ´Â ´ë»ó if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyType = static_cast(str.ToInt()); /// Ÿ°ÙÀ̰ɸ°È¿°ú if( tokenizer.GetNext( &str ) == false ) { goto ERR; } /// skip /// ½ºÅ³À¯Çü - »çÁ¤°Å¸® if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mRangeType = static_cast(str.ToInt()); /// ±Û·Î¹úÄðŸÀÓ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mIsGlobalCoolTime = str.ToInt() == 0 ? false : true; /// ±×·ìÄðŸÀÓ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mGroupCoolTimeIdx = str.ToInt(); /// º¸°ü¼Ò ÀúÀå if( mPlayerSkillInfoMap.Insert( pSkillInfo->mSkillIdx, pSkillInfo ) == false ) { assert(0); goto ERR; } } return true; ERR: delete pSkillInfo; return false; } bool cSkillScript::PlayerSkillStepLoad() { cFileLoader loader; cString pathName = "./Script/Resource/SkillList_Sub.txt"; if( loader.Open( pathName, true ) == false ) { assert( 0 && "failed to load SkillList_Sub.txt" ); return false; } cTokenizer tokenizer( loader.GetBufferPtr(), loader.GetSize(), " \t\r\n", pathName.Cstr() ); cString str; unsigned long skillIdx = ULONG_MAX; unsigned char step; sPlayerSkillStepInfo stepArray[50] = {0,}; unsigned char stepCount = 0; unsigned long currentSkillIdx = ULONG_MAX; while( tokenizer.IsEnd() == false ) { /// ½ºÅ³ Á¾·ùIdx if( tokenizer.GetNext( &str ) == false ) { return false; } skillIdx = str.ToInt(); if( currentSkillIdx != ULONG_MAX && (currentSkillIdx != skillIdx) ) { /// Áö±Ý±îÁö ½×ÀÎ Á¤º¸¸¦ ¼ÂÆÃÇÑ´Ù. assert(stepCount); assert(stepCount<50); sPlayerSkillBaseInfo* pSkillInfo = GetPlayerSkillInfo( currentSkillIdx ); if( pSkillInfo == 0 ) { assert(0); return false; } /// ÀоîµéÀÎ Á¤º¸¸¦ ¼ÂÆÃÇÑ´Ù. pSkillInfo->mpSetpInfoArray = new sPlayerSkillStepInfo[stepCount]; ::memcpy( pSkillInfo->mpSetpInfoArray, stepArray, sizeof(sPlayerSkillStepInfo)*stepCount); pSkillInfo->mStepCount = stepCount; /// Á¤º¸ ÃʱâÈ­ stepCount = 0; } currentSkillIdx = skillIdx; stepCount++; /// ½ºÅ³ ´Ü°è if( tokenizer.GetNext( &str ) == false ) { return false; } step = static_cast(str.ToInt()); /// ÅøÆÁIndex if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mToolTipIdx = str.ToInt(); /// SPÇʿ䰪 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mRequireSP = static_cast(str.ToInt()); /// Á÷¾÷ Index if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mJobType = static_cast(str.ToInt()); /// ij¸¯ÅÍ ÇÊ¿äLv if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mPlayerLevel = static_cast(str.ToInt()); /// ½ºÅ³½ÀµæÁ¶°Ç1 - Çʿ佺ųidx if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mLearnSkillIdx1 = str.ToInt(); /// ½ºÅ³½ÀµæÁ¶°Ç1 - ½ºÅ³ÇÊ¿ä´Ü°è if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mLearnSkillStep1 = static_cast(str.ToInt()); /// ½ºÅ³½ÀµæÁ¶°Ç2 - Çʿ佺ųidx if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mLearnSkillIdx2 = str.ToInt(); /// ½ºÅ³½ÀµæÁ¶°Ç2 - ½ºÅ³ÇÊ¿ä´Ü°è if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mLearnSkillStep2 = static_cast(str.ToInt()); /// ¼Ò¸ð±Ý¾× if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mUseMoney = str.ToInt(); /// »óżöÄ¡°ª if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mUseStateValue = static_cast(str.ToInt()); /// ¼Ò¸ðMP°ª if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mUseMP = str.ToInt(); /// ¼Ò¸ðMP(%) if( tokenizer.GetNext( &str ) == false ) { return false; } /// skip /// ¼Ò¸ðHP°ª if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mUseHP = str.ToInt(); /// ¼Ò¸ð¾ÆÀÌÅÛ°³¼ö if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mUseItemCount = static_cast(str.ToInt()); /// »ç°Å¸® if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mTargetDist = static_cast(str.ToInt()); /// ij½ºÆÃ½Ã°£ if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mCastingTime = str.ToInt(); /// ÄðŸÀÓ if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mCoolTime = str.ToInt(); /// ¹üÀ§°Å¸®1 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mBoundDist1 = static_cast(str.ToInt()); /// ¹üÀ§°Å¸®2 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mBoundDist2 = static_cast(str.ToInt()); /// Àû¿ëÀοø if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mApplyCnt = static_cast(str.ToInt()); /// °íÀ¯¸íÁß·ü if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mAccuracyValue = static_cast(str.ToInt()); /// °íÀ¯Å©¸®Æ¼Äà if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mCriticalValue = static_cast(str.ToInt()); /// °íÀ¯ ¾î±×·Î ¼öÄ¡ if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mDistressValue = str.ToInt(); /// Àû¿ë°ª type1 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mApplyValueType1 = static_cast(str.ToInt()); /// Àû¿ë°ª1 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mApplyValue1 = str.ToInt(); /// Àû¿ë°ª type2 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mApplyValueType2 = static_cast(str.ToInt()); /// Àû¿ë°ª2 if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mApplyValue2 = str.ToInt(); /// ¹ßµ¿ if( tokenizer.GetNext( &str ) == false ) { return false; } /// skip /// È¿°ú Index if( tokenizer.GetNext( &str ) == false ) { return false; } stepArray[step].mInfulenceIdx = str.ToInt(); if( tokenizer.IsEnd() ) { /// Áö±Ý±îÁö ½×ÀÎ Á¤º¸¸¦ ¼ÂÆÃÇÑ´Ù. assert(stepCount); assert(stepCount<50); sPlayerSkillBaseInfo* pSkillInfo = GetPlayerSkillInfo( currentSkillIdx ); if( pSkillInfo == 0 ) { assert(0); return false; } /// ÀоîµéÀÎ Á¤º¸¸¦ ¼ÂÆÃÇÑ´Ù. pSkillInfo->mpSetpInfoArray = new sPlayerSkillStepInfo[stepCount]; ::memcpy( pSkillInfo->mpSetpInfoArray, stepArray, sizeof(sPlayerSkillStepInfo)*stepCount); pSkillInfo->mStepCount = stepCount; /// Á¤º¸ ÃʱâÈ­ stepCount = 0; } } return true; } bool cSkillScript::InfluenceLoad() { /// ±âÁ¸ µ¥ÀÌÅÍ Á¦°Å cSkillHashMap::cIterator iter; for( iter = mInfluenceMap.Begin() ; iter != mInfluenceMap.End() ; ++iter ) { delete (sInfluenceScript*)(*iter).mSecond; } mInfluenceMap.Clear(); /// ·Îµå.. cFileLoader loader; cString pathName = "./Script/Resource/SkillList_Effect.txt"; if( loader.Open( pathName, true ) == false ) { assert( 0 && "failed to load SkillList_Effect.txt" ); return false; } cTokenizer tokenizer( loader.GetBufferPtr(), loader.GetSize(), " \t\r\n", pathName.Cstr() ); cString str; while( tokenizer.IsEnd() == false ) { /// È¿°úIdx if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long influenceIdx = str.ToInt(); ///¿¬ÃâÆÄÀϸí if( tokenizer.GetNext( &str ) == false ) { return false; } cString dramaturgyFile = str; /// À̸§Idx if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long nameidx = str.ToInt(); /// È¿°ú¾ÆÀÌÄÜIdx if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long iconIdx = str.ToInt(); /// ÅøÆÁÈ¿°úIdx if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long toolTipIdx = str.ToInt(); /// ¼Ó¼º if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned char type = static_cast(str.ToInt()); /// µµÆ® ¼Ó¼º if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned char dotType = (unsigned char)str.ToInt(); /// Áö¼Ó µµÆ® if( tokenizer.GetNext( &str ) == false ) { return false; } /// skip /// ºÐ·ù if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long typeDetail = str.ToInt(); /// Á״°æ¿ì È¿°ú Á¦°Å if( tokenizer.GetNext( &str ) == false ) { return false; } bool dieDelete = str.ToInt() == 0 ? true : false; /// È¿·Â ±×·ì if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long groupIdx = str.ToInt(); /// È¿·Â if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long groupOrder = str.ToInt(); /// Áߺ¹ºÒ°¡±×·ì if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long notOverlapGroupIdx = static_cast(str.ToInt()); /// ´ÙÁßÁߺ¹ºÒ°¡ if( tokenizer.GetNext( &str ) == false ) { return false; } /// skip /// ½Ã°£ ¼Ó¼º if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned char timeType = (unsigned char)str.ToInt(); /// Áö¼Ó(ä³Î¸µ)½Ã°£ if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long continuanceTime = str.ToInt(); /// ¹ßµ¿È®·ü if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned char activityPer = static_cast(str.ToInt()); /// Áö¼ÓÈ¿°ú¹øÈ£1 if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned short statusPlusIdx1 = static_cast(str.ToInt()); /// ½Ã°£1 if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long time1 = str.ToInt(); /// È¿°ú°ª1 if( tokenizer.GetNext( &str ) == false ) { return false; } long value1 = str.ToInt(); /// Áö¼ÓÈ¿°ú¹øÈ£2 if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned short statusPlusIdx2 = static_cast(str.ToInt()); /// ½Ã°£2 if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long time2 = str.ToInt(); /// È¿°ú°ª2 if( tokenizer.GetNext( &str ) == false ) { return false; } long value2 = str.ToInt(); /// Áö¼ÓÈ¿°ú¹øÈ£3 if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned short statusPlusIdx3 = static_cast(str.ToInt()); /// È¿°ú°ª3 if( tokenizer.GetNext( &str ) == false ) { return false; } long value3 = str.ToInt(); sInfluenceScript* pInfluence = new sInfluenceScript; pInfluence->mInfluenceIdx = influenceIdx; pInfluence->mDramaturgyFile = dramaturgyFile; pInfluence->mNameidx = nameidx; pInfluence->mIconIdx = iconIdx; pInfluence->mToolTipIdx = toolTipIdx; pInfluence->mType = type; pInfluence->mDotType = dotType; pInfluence->mTypeDetail = typeDetail; pInfluence->mDieDelete = dieDelete; pInfluence->mGroupIdx = groupIdx; pInfluence->mGroupOrder = groupOrder; pInfluence->mNotOverlapGroupIdx = notOverlapGroupIdx; pInfluence->mTimeType = timeType; pInfluence->mContinuanceTime = continuanceTime; pInfluence->mActivityPer = activityPer; pInfluence->mStatusPlusIdx1 = statusPlusIdx1; pInfluence->mTime1 = time1; pInfluence->mValue1 = value1; pInfluence->mStatusPlusIdx2 = statusPlusIdx2; pInfluence->mTime2 = time2; pInfluence->mValue2 = value2; pInfluence->mStatusPlusIdx3 = statusPlusIdx3; pInfluence->mValue3 = value3; if( !mInfluenceMap.Insert( influenceIdx, pInfluence ) ) { assert(0); return false; } // ÀÌ·± ÄÚµå ¸¸µéÁö ¾Êµµ·Ï °øÀ¯ °¡´ÉÇÑ ºÎºÐ¸¸ Common¿¡ ³ÖÀ¸¼¼¿ä /// ¿¬Ãâ ÆÄÀÏ¿¡ ´ëÇÑ ·Îµå DRAMATURGYMAN->LoadInfluenceDrama( pInfluence->mInfluenceIdx, pInfluence->mDramaturgyFile, false ); } return true; } bool cSkillScript::PlayerSkillJobScriptLoad() { cFileLoader loader; cString pathName = "./Script/Resource/SkillList_Class.txt"; if( loader.Open( pathName, true ) == false ) { assert( 0 && "failed to load SkillList_Class.txt" ); return false; } cTokenizer tokenizer( loader.GetBufferPtr(), loader.GetSize(), " \t\r\n", pathName.Cstr() ); cString str; tArray *pJobArry; while( tokenizer.IsEnd() == false ) { /// Á÷¾÷Idx if( tokenizer.GetNext( &str ) == false ) { return false; } unsigned long jobIdx = str.ToInt(); /// Á÷¾÷ÄÚµå1 if( tokenizer.GetNext( &str ) == false ) { return false; } ePLAYER_JOB jobCode1 = static_cast(str.ToInt()); /// Á÷¾÷ÄÚµå2 if( tokenizer.GetNext( &str ) == false ) { return false; } ePLAYER_JOB jobCode2 = static_cast(str.ToInt()); /// Á÷¾÷ÄÚµå3 if( tokenizer.GetNext( &str ) == false ) { return false; } ePLAYER_JOB jobCode3 = static_cast(str.ToInt()); pJobArry = new tArray; /// ¹è¿­¿¡ °ªÀ» ³ÖÀ½ if( jobCode1 != 0 ) pJobArry->PushBack( static_cast(jobCode1) ); if( jobCode2 != 0 ) pJobArry->PushBack( static_cast(jobCode2) ); if( jobCode3 != 0 ) pJobArry->PushBack( static_cast(jobCode3) ); if( !mSkillJobMap.Insert( jobIdx, pJobArry ) ) { return false; } } return true; } bool cSkillScript::MonsterSkillScriptLoad() { cFileLoader loader; cString pathName = "./Script/Resource/SkillList_Mon.txt"; if( loader.Open( pathName, true ) == false ) { assert( 0 && "failed to load SkillList_Mon.txt" ); return false; } cTokenizer tokenizer( loader.GetBufferPtr(), loader.GetSize(), " \t\r\n", pathName.Cstr() ); cString str; sMonsterSkillScript* pSkillInfo; while( tokenizer.IsEnd() == false ) { pSkillInfo = new sMonsterSkillScript; /// ¸ó½ºÅÍIdx if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mMonsterIdx = str.ToInt(); /// °ø°Ý¹æ½Ä if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mAttackType = (eMONSTERATTACK_TYPE)str.ToInt(); /// Drama file if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mDramaFile = str; /// ÅøÆÁIdx if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mToolTipIdx = str.ToInt(); /// ½ºÅ³ ºÐ·ù if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mType = (eMONSTERSKILLTYPE)str.ToInt(); /// ¼Ó¼ºÀ¯Çü if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mAttributeType = (eATTRIBUTETYPE)str.ToInt(); /// °Å¸®À¯Çü if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mRangeType = (eRANGETYPE)str.ToInt(); /// °ø°Ý·Â(¼Ò) if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mMinAttackValue = str.ToInt(); /// °ø°Ý·Â(´ë) if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mMaxAttackValue = str.ToInt(); /// °íÀ¯¸íÁß·ü if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mAccuracyValue = (unsigned short)str.ToInt(); /// °íÀ¯Å©¸®Æ¼Äà if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mCriticalValue = (unsigned short)str.ToInt(); /// »ç¿ëÁ¶°Ç(HP) if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mUseHPCheck = (eMONSTERHPCHECK)str.ToInt(); /// »ç¿ëÁ¶°Ç(¼Ò¸ðMP) if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mUseMP = str.ToInt(); /// »ç°Å¸® if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mTargetDist = (float)str.ToInt(); /// °ø°Ý¼Óµµ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mAttackSpd = str.ToInt(); /// ÄðŸÀÓ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mCoolTime = str.ToInt(); /// »ç¿ëÈ®·ü if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mSkillUsePer = (unsigned char)str.ToInt(); /// ½ÃÀüÀ¯Çü if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mShotType = (eMONSTERSHOTTYPE)str.ToInt(); /// ¹üÀ§¹æ½Ä if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mBoundType = (eBOUNDTYPE)str.ToInt(); /// ¹üÀ§°Å¸®1 if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mBoundDist1 = (unsigned short)str.ToInt(); /// ¹üÀ§°Å¸®2 if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mBoundDist2 = (unsigned short)str.ToInt(); /// Àû¿ëÀοø if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyCnt = (unsigned char)str.ToInt(); /// È¿°úÀû¿ëŸ°Ù if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyType = (eAPPLYTYPE)str.ToInt(); /// ij½ºÆÃ½Ã°£ if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mCastingTime = str.ToInt(); /// È¿°ú¹øÈ£1 if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyValueType1 = (unsigned short)str.ToInt(); /// È¿°ú°ª1 if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyValue1 = str.ToInt(); /// È¿°ú¹øÈ£2 if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyValueType2 = (unsigned short)str.ToInt(); /// È¿°ú°ª2 if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mApplyValue2 = str.ToInt(); /// È¿°úIdx if( tokenizer.GetNext( &str ) == false ) { goto ERR; } pSkillInfo->mInfulenceIdx = str.ToInt(); /// ¹ßµ¿È¿°úÀ妽º if( tokenizer.GetNext( &str ) == false ) { goto ERR; } /// skip /// ¸ó½ºÅÍ ½ºÅ³ À妽º »ý¼º - ¸ó½ºÅÍŬ·¡½ºÀ妽º * 100 + °ø°ÝŸÀÔ unsigned long monSkillIdx = pSkillInfo->mMonsterIdx * 100 + pSkillInfo->mAttackType; /// Àüü ½ºÅ³ ¸®½ºÆ®¿¡ ´ã´Â´Ù. if( mMonsterSkillTotalMap.Insert( monSkillIdx, pSkillInfo ) == false ) { assert(0); return false; } if( pSkillInfo->mAttackType < eMONSTERATTACK_MAX ) { /// ±âº» ½ºÅ³ 5°³¿¡´ëÇÑ Á¤º¸¸¦ ´ã´Â´Ù. cArray* pMonsterSkillAry = (cArray*)mMonsterBaseSkillMap.GetAt( pSkillInfo->mMonsterIdx ); if( pMonsterSkillAry == NULL ) { pMonsterSkillAry = new cArray; if( mMonsterBaseSkillMap.Insert( pSkillInfo->mMonsterIdx, pMonsterSkillAry ) == false) { assert(NULL); return false; } } pMonsterSkillAry->PushBack( pSkillInfo ); } else { /// ¿¤¸®Æ®(º¸½º) Ư¼ö ½ºÅ³ Á¤º¸±â·Ï cArray* pEliteSkillAry = (cArray*)mMonsterEliteSkillMap.GetAt( pSkillInfo->mMonsterIdx ); if( pEliteSkillAry == NULL ) { pEliteSkillAry = new cArray; if( mMonsterEliteSkillMap.Insert( pSkillInfo->mMonsterIdx, pEliteSkillAry ) == false) { assert(NULL); return false; } } pEliteSkillAry->PushBack( pSkillInfo ); } } return true; ERR: delete pSkillInfo; return false; } sPlayerSkillBaseInfo* cSkillScript::GetPlayerSkillInfo( unsigned long skillNumber ) { sPlayerSkillBaseInfo* pSkillInfo = NULL; cSkillHashMap::cIterator start = mPlayerSkillInfoMap.Find( skillNumber ); cSkillHashMap::cIterator end = mPlayerSkillInfoMap.End(); if( start == end ) { return NULL; } pSkillInfo = (sPlayerSkillBaseInfo*)((*start).mSecond); if( pSkillInfo == NULL ) { assert(NULL); return NULL; } return pSkillInfo; } sMonsterSkillScript* cSkillScript::GetMonsterSkillInfo( unsigned long monsterClassIdx, eMONSTERATTACK_TYPE attackType ) { unsigned long skillIdx = monsterClassIdx*100 + attackType; return (sMonsterSkillScript*)mMonsterSkillTotalMap.GetAt( skillIdx ); } cSkillHashMap* cSkillScript::GetMonsterSkillTotalMap() { return &mMonsterSkillTotalMap; } void* cSkillScript::GetMonsterBaseSkillArr( unsigned long monsterClassIdx ) { return mMonsterBaseSkillMap.GetAt( monsterClassIdx ); } void* cSkillScript::GetMonsterEliteSkillArr( unsigned long monsterClassIdx ) { return mMonsterEliteSkillMap.GetAt( monsterClassIdx ); } tArray* cSkillScript::GetPlayerSkillJob( unsigned long jobIdx ) { return (tArray*)mSkillJobMap.GetAt( jobIdx ); } sInfluenceScript* cSkillScript::GetInfluenceInfo( unsigned long influenceClassIdx ) { return (sInfluenceScript*)mInfluenceMap.GetAt( influenceClassIdx ); } bool cSkillScript::IsCastSkill( unsigned long skillIdx, unsigned long skillStep ) { sPlayerSkillBaseInfo* pInfo = GetPlayerSkillInfo( skillIdx ); if( pInfo ) { if( pInfo->mStepCount <= skillStep ) return false; sPlayerSkillStepInfo step = pInfo->mpSetpInfoArray[skillStep]; if( step.mCastingTime > 0.0f ) return true; } return false; }