Jump to content
Forgot your email address? ×
×
×
  • Create New...

Level in Exchange / Trade


Recommended Posts

M2 Download Center

Hidden Content

    Give reaction to this post to see the hidden content.
( 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:
 
  • Metin2 Dev 1
  • Love 3

"Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch"

Link to comment
  • 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:

 

http://postimg.org/image/oj7cnvbu9/

 

 

Consider using [ code ] tag next time.

Care to Python tabulation.

Nice tutorial, anyway.

Link to comment

 

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:

 

http://postimg.org/image/oj7cnvbu9/

 

 

Consider using [ code ] tag next time.

Care to Python tabulation.

Nice tutorial, anyway.

 

I'll do that..  :) Thanks

  • Love 1

"Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch"

Link to comment

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

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.