AlexxD 123 Posted April 25, 2015 Share Posted April 25, 2015 (edited) M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) 1) First part, Client Binary. UserInterface folder: 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{}", after char name[CHARACTER_NAME_MAX_LEN + 1]; add: char level[3]; elsewhere in PythonExchange.h add after: void SetElkMode(bool value); add this: void SetTargetLevel(const char *name); char *GetLevelFromTarget(); In PythonExchangeModule.cpp add after: {"isTrading", exchangeisTrading, METH_VARARGS}, put: {"GetLevelFromTarget", exchangeGetLevelFromTarget, METH_VARARGS}, After: PyObject * exchangeGetElkMode(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("b", CPythonExchange::Instance().GetElkMode()); } add: PyObject * exchangeGetLevelFromTarget(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("s", CPythonExchange::Instance().GetLevelFromTarget()); } Binary part is ready. 2) Python part now. Decrypt root with EterNexus or anything else you want and in: uiexchange.py, find this; def OpenDialog(self): and replace all what's in there and put this: def OpenDialog(self): self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (exchange.GetNameFromTarget() + "(" + (exchange.GetLevelFromTarget() + ")"))) self.AcceptButton.Enable() self.AcceptButton.SetUp() self.Show() http://pastebin.com/2G1xhUej 3) Ready. Now you have level in trade. An example: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/ Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 8 3 4 "Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch" Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted April 25, 2015 Premium Share Posted April 25, 2015 (edited) 1) First part, Client Binary. UserInterface folder: 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 { ... } after char name[CHARACTER_NAME_MAX_LEN + 1]; add: char level[3]; elsewhere in PythonExchange.h after: void SetElkMode(bool value); add this: void SetTargetLevel(const char *name); char *GetLevelFromTarget(); In PythonExchangeModule.cpp after: {"isTrading", exchangeisTrading, METH_VARARGS}, put: {"GetLevelFromTarget", exchangeGetLevelFromTarget, METH_VARARGS}, After: PyObject * exchangeGetElkMode(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("b", CPythonExchange::Instance().GetElkMode()); } add: PyObject * exchangeGetLevelFromTarget(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("s", CPythonExchange::Instance().GetLevelFromTarget()); } Binary part is ready. 2) Python part now. Decrypt root with EterNexus or anything else you want and in: uiexchange.py, find this: def OpenDialog(self): and replace all what's in there and put this: def OpenDialog(self): self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (exchange.GetNameFromTarget() + " " + "(" + (exchange.GetLevelFromTarget() + ")"))) self.AcceptButton.Enable() self.AcceptButton.SetUp() self.Show() 3) Ready. Now you have level in trade. An example: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/ Consider using [ code ] tag next time. Care to Python tabulation. Nice tutorial, anyway. Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium V0iĐ 114 Posted April 25, 2015 Premium Share Posted April 25, 2015 Hmm... I think have seen somewhere: But thank you! Link to comment Share on other sites More sharing options...
AlexxD 123 Posted April 25, 2015 Author Share Posted April 25, 2015 (edited) 1) First part, Client Binary. UserInterface folder: 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 { ... } after char name[CHARACTER_NAME_MAX_LEN + 1]; add: char level[3]; elsewhere in PythonExchange.h after: void SetElkMode(bool value); add this: void SetTargetLevel(const char *name); char *GetLevelFromTarget(); In PythonExchangeModule.cpp after: {"isTrading", exchangeisTrading, METH_VARARGS}, put: {"GetLevelFromTarget", exchangeGetLevelFromTarget, METH_VARARGS}, After: PyObject * exchangeGetElkMode(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("b", CPythonExchange::Instance().GetElkMode()); } add: PyObject * exchangeGetLevelFromTarget(PyObject * poTarget, PyObject * poArgs) { return Py_BuildValue("s", CPythonExchange::Instance().GetLevelFromTarget()); } Binary part is ready. 2) Python part now. Decrypt root with EterNexus or anything else you want and in: uiexchange.py, find this: def OpenDialog(self): and replace all what's in there and put this: def OpenDialog(self): self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (exchange.GetNameFromTarget() + " " + "(" + (exchange.GetLevelFromTarget() + ")"))) self.AcceptButton.Enable() self.AcceptButton.SetUp() self.Show() 3) Ready. Now you have level in trade. An example: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif/ Consider using [ code ] tag next time. Care to Python tabulation. Nice tutorial, anyway. I'll do that.. Thanks Edited September 11, 2022 by Metin2 Dev Core X - External 2 Internal 1 "Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch" Link to comment Share on other sites More sharing options...
Recommended Posts