Jump to content

Level in Exchange / Trade


Recommended Posts

M2 Download Center

This is the hidden content, please
( 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()
 
3) Ready. Now you have level in trade. An example:
 
Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 8
  • Good 2
  • Love 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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Premium

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 by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

 

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 by Metin2 Dev
Core X - External 2 Internal
  • Love 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

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.