in pythonplayersettingsmodule.cpp search const bool CPlayerSettingsModule::LoadGameSound() and under add:
const bool CPlayerSettingsModule::LoadGameNPC()
{
using namespace boost::algorithm;
CMappedFile file;
const VOID* pvData;
if (!CEterPackManager::Instance().Get(file, NPC_LIST_FILE_NAME, &pvData))
{
TraceError("CPythonPlayerSettingsModule::LoadGameNPC(fileName=%s) - Load Error", NPC_LIST_FILE_NAME);
return false;
}
CMemoryTextFileLoader fileLoader;
fileLoader.Bind(file.Size(), pvData);
CTokenVector kTokenVector;
for (size_t i = 0; i < fileLoader.GetLineCount(); ++i)
{
if (!fileLoader.SplitLineByTab(i, &kTokenVector))
continue;
const uint32_t& vnum = atoi(kTokenVector[0].c_str());
std::string& name = kTokenVector[1];
trim(name);
if (vnum)
{
CRaceManager::Instance().RegisterRaceName(vnum, name.c_str());
}
else
{
std::string& src = kTokenVector[2];
trim(src);
CRaceManager::Instance().RegisterRaceSrcName(name.c_str(), src.c_str());
}
}
return true;
}
search cpsmLoadGameSkill and under add:
PyObject* cpsmLoadGameNPC(PyObject* poSelf, PyObject* poArgs)
{
CPlayerSettingsModule::LoadGameNPC();
return Py_BuildNone();
}
search { "LoadGameSkill", cpsmLoadGameSkill, METH_VARARGS }, and add under:
{ "LoadGameNPC", cpsmLoadGameNPC, METH_VARARGS },
in pythonplayersettingsmodule.h search #pragma once and under add:
static const char* NPC_LIST_FILE_NAME = "npclist.txt";
search const static bool LoadGameSound(); and under add:
const static bool LoadGameNPC();
in root playersetingmodule.py searh def __LoadGameNPC(): and replace:
def __LoadGameNPC():
if app.ENABLE_CPP_PSM:
cpsm.LoadGameNPC()
else:
## paste your code here
pass
update npclist.txt