Jump to content
Sign in to follow this  

Load Monster Area Info - Error

Recommended Posts

Ir até ao ficheiro GameLib/MapOutdoorLoad.cpp


Procurar pela função:


bool CMapOutdoor::LoadMonsterAreaInfo()


Substitui-la por:


bool CMapOutdoor::LoadMonsterAreaInfo()


RemoveAllMonsterAreaInfo(); // Remove All Monster Info


char szFileName[256];

_snprintf(szFileName, sizeof(szFileName), "%s\\monsterareainfo.txt", GetMapDataDirectory().c_str());


LPCVOID pModelData;

CMappedFile File;


if (!CEterPackManager::Instance().Get(File, szFileName, &pModelData)) return false;


CMemoryTextFileLoader textFileLoader;

CTokenVector stTokenVector;


textFileLoader.Bind(File.Size(), pModelData);


for (DWORD i = 0; i < textFileLoader.GetLineCount(); ++i)


if (!textFileLoader.SplitLine(i, &stTokenVector))





// Start to read MonsterAreaInfo.txt

if (0 == stTokenVector[0].compare("m") || 0 == stTokenVector[0].compare("g"))


if (stTokenVector.size() < 11)


TraceError("CMapOutdoorAccessor::LoadMonsterAreaInfo Get MonsterInfo File Format ERROR! continue....");




CMonsterAreaInfo::EMonsterAreaInfoType eMonsterAreaInfoType;

if (0 == stTokenVector[0].compare("m"))


eMonsterAreaInfoType = CMonsterAreaInfo::MONSTERAREAINFOTYPE_MONSTER;


else if (0 == stTokenVector[0].compare("g"))


eMonsterAreaInfoType = CMonsterAreaInfo::MONSTERAREAINFOTYPE_GROUP;




TraceError("CMapOutdoorAccessor::LoadMonsterAreaInfo Get MonsterInfo Data ERROR! continue....");




const std::string & c_rstrOriginX = stTokenVector[1].c_str();

const std::string & c_rstrOriginY = stTokenVector[2].c_str();

const std::string & c_rstrSizeX = stTokenVector[3].c_str();

const std::string & c_rstrSizeY = stTokenVector[4].c_str();

const std::string & c_rstrZ = stTokenVector[5].c_str();

const std::string & c_rstrDir = stTokenVector[6].c_str();

const std::string & c_rstrTime = stTokenVector[7].c_str();

const std::string & c_rstrPercent = stTokenVector[8].c_str();

const std::string & c_rstrCount = stTokenVector[9].c_str();

const std::string & c_rstrVID = stTokenVector[10].c_str();


long lOriginX, lOriginY, lSizeX, lSizeY, lZ, lTime, lPercent;

CMonsterAreaInfo::EMonsterDir eMonsterDir;

DWORD dwMonsterCount;

DWORD dwMonsterVID;


lOriginX = atol(c_rstrOriginX.c_str());

lOriginY = atol(c_rstrOriginY.c_str());

lSizeX = atol(c_rstrSizeX.c_str());

lSizeY = atol(c_rstrSizeY.c_str());

lZ = atol(c_rstrZ.c_str());

eMonsterDir = (CMonsterAreaInfo::EMonsterDir) atoi(c_rstrDir.c_str());

lTime = atol(c_rstrTime.c_str());

lPercent = atol(c_rstrPercent.c_str());

dwMonsterCount = (DWORD) atoi(c_rstrCount.c_str());

dwMonsterVID = (DWORD) atoi(c_rstrVID.c_str());


CMonsterAreaInfo * pMonsterAreaInfo = AddMonsterAreaInfo(lOriginX, lOriginY, lSizeX, lSizeY);


if (CMonsterAreaInfo::MONSTERAREAINFOTYPE_MONSTER == eMonsterAreaInfoType)


else if (CMonsterAreaInfo::MONSTERAREAINFOTYPE_GROUP == eMonsterAreaInfoType)







return true;



By Ken

  • Upvote 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
You will be able to see content when you disable your adblocker and enable javascript.