Adrian1428 31 Posted March 24, 2015 Share Posted March 24, 2015 I want to add level in trade , I edited PythonExchange.cpp / .h and PythonExchangeModule.cpp ( i added m_victim.level etc) but unsuccessfully. I want someone to tell me how to do reading level to m_victim like to m_victim.name. Thanks in advance. Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 25, 2015 Author Share Posted March 25, 2015 up... Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 25, 2015 Author Share Posted March 25, 2015 up... Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 26, 2015 Author Share Posted March 26, 2015 Even someone explain to me what to do .... Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted March 26, 2015 Premium Share Posted March 26, 2015 There's a file shared on epvp about level in trade, but it's a little bit bugged. Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 26, 2015 Author Share Posted March 26, 2015 There's a file shared on epvp about level in trade, but it's a little bit bugged. I need function in c ++ for target level. Like this but for level: char * CPythonExchange::GetNameFromTarget() { return m_victim.name; } I tried this: DWORD CPythonExchange::GetLevelFromTarget() { return m_victim.level; ( and m_victim.dwLevel ) } I defined all stuff needed( in PythonExchange.cpp /PythonExchange.h and PythonExchangeModule.cpp) for this new exchange function but not work. In exchange dialog appear 0 . Link to comment Share on other sites More sharing options...
Premium Galet 509 Posted March 26, 2015 Premium Share Posted March 26, 2015 Martysama could help you I think, he made a new function in his sources if I remember well Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 26, 2015 Author Share Posted March 26, 2015 Martysama could help you I think, he made a new function in his sources if I remember well He sells the source I don't think he can help me for free. Can someone give me a hit here. Link to comment Share on other sites More sharing options...
Premium Solution Istny 79 Posted March 27, 2015 Premium Solution Share Posted March 27, 2015 In InstanceBase.cpp add const char * CInstanceBase::GetLevelString() { char * str = new char[3]; sprintf(str,"%d",m_dwLevel); return str; } in InstanceBase.h add const char * GetLevelString(); Next in PythonNetworkStreamPhaseGame.cpp add in "if (pCharacterInstance){}" CPythonExchange::Instance().SetTargetLevel(pCharacterInstance->GetLevelString()); Open PythonExchange.cpp and add void CPythonExchange::SetTargetLevel(const char *name) { strncpy(m_victim.level, name, 3); } char * CPythonExchange::GetLevelFromTarget() { return m_victim.level; } In PythonExchange.h inside "typedef struct trade{}" add char level[3]; elsewhere in PythonExchange.h add too void SetTargetLevel(const char *name); char *GetLevelFromTarget(); In PythonExchangeModule.cpp add inside "static PyMethodDef s_methods[] = {}" {"GetLevelFromTarget", exchangeGetLevelFromTarget, METH_VARARGS}, elsewhere in this file add to PyObject * exchangeGetLevelFromTarget(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("s", CPythonExchange::Instance().GetLevelFromTarget()); } Finally in python you can use exchange.GetLevelFromTarget() 7 Link to comment Share on other sites More sharing options...
Adrian1428 31 Posted March 27, 2015 Author Share Posted March 27, 2015 In InstanceBase.cpp add const char * CInstanceBase::GetLevelString() { char * str = new char[3]; sprintf(str,"%d",m_dwLevel); return str; } in InstanceBase.h add const char * GetLevelString(); Next in PythonNetworkStreamPhaseGame.cpp add in "if (pCharacterInstance){}" CPythonExchange::Instance().SetTargetLevel(pCharacterInstance->GetLevelString()); Open PythonExchange.cpp and add void CPythonExchange::SetTargetLevel(const char *name) { strncpy(m_victim.level, name, 3); } char * CPythonExchange::GetLevelFromTarget() { return m_victim.level; } In PythonExchange.h inside "typedef struct trade{}" add char level[3]; elsewhere in PythonExchange.h add too void SetTargetLevel(const char *name); char *GetLevelFromTarget(); In PythonExchangeModule.cpp add inside "static PyMethodDef s_methods[] = {}" {"GetLevelFromTarget", exchangeGetLevelFromTarget, METH_VARARGS}, elsewhere in this file add to PyObject * exchangeGetLevelFromTarget(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("s", CPythonExchange::Instance().GetLevelFromTarget()); } Finally in python you can use exchange.GetLevelFromTarget() Thanks. Many thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now