Jump to content

Add New Alignments


Recommended Posts

Hi all.Today i work and tested how to add new alignments :D
Now i finish it and create instructions for you.

Now how do it:
1. edit game source
open char_battle.cpp and find:
 
int iAlignIndex;
 
and edit for example:
 
if (GetRealAlignment() == 300000)
iAlignIndex = 0;
else if (GetRealAlignment() >= 200000)
iAlignIndex = 1;
else if (GetRealAlignment() >= 120000)
iAlignIndex = 2;
else if (GetRealAlignment() >= 80000)
iAlignIndex = 3;
else if (GetRealAlignment() >= 40000)
iAlignIndex = 4;
else if (GetRealAlignment() >= 10000)
iAlignIndex = 5;
else if (GetRealAlignment() >= 0)
iAlignIndex = 6;
else if (GetRealAlignment() > -40000)
iAlignIndex = 7;
else if (GetRealAlignment() > -80000)
iAlignIndex = 8;
else if (GetRealAlignment() > -120000)
iAlignIndex = 9;
else if (GetRealAlignment() > -200000)
iAlignIndex = 10;
else if (GetRealAlignment() > -250000)
iAlignIndex = 11;
else
iAlignIndex = 12;
 
now find
 
FPartyAlignmentCompute f(-20000, pkKiller->GetX(), pkKiller->GetY());
pkKiller->GetParty()->ForEachOnlineMember(f);


if (f.m_iCount == 0)
pkKiller->UpdateAlignment(-20000);
else
{
sys_log(0, "ALIGNMENT PARTY count %d amount %d", f.m_iCount, f.m_iAmount);


f.m_iStep = 1;
pkKiller->GetParty()->ForEachOnlineMember(f);
}
}
else
pkKiller->UpdateAlignment(-20000);
 
and replace with this:
 
FPartyAlignmentCompute f(-30000, pkKiller->GetX(), pkKiller->GetY());
pkKiller->GetParty()->ForEachOnlineMember(f);


if (f.m_iCount == 0)
pkKiller->UpdateAlignment(-30000);
else
{
sys_log(0, "ALIGNMENT PARTY count %d amount %d", f.m_iCount, f.m_iAmount);


f.m_iStep = 1;
pkKiller->GetParty()->ForEachOnlineMember(f);
}
}
else
pkKiller->UpdateAlignment(-30000);
 
now find
 
m_iRealAlignment = MINMAX(-200000, m_iRealAlignment + iAmount, 200000);
 
and replace with this:
 
m_iRealAlignment = MINMAX(-300000, m_iRealAlignment + iAmount, 300000);
 
now you can compile game!
 
 
2. edit binary:
open InstanceBase.h and find:
 
TITLE_NUM = 9,
TITLE_NONE = 4,
 
and replace this:
 
TITLE_NUM = 13,
TITLE_NUM = 6,
 
Now you can save and close InstanceBase.h.
Now open InstanceBase.cpp and find:
 
UINT CInstanceBase::GetAlignmentGrade()
 
and edit for example this:
 
UINT CInstanceBase::GetAlignmentGrade()
{
if (m_sAlignment == 30000)
return 0;
else if (m_sAlignment >= 20000)
return 1;
else if (m_sAlignment >= 12000)
return 2;
else if (m_sAlignment >= 8000)
return 3;
else if (m_sAlignment >= 4000)
return 4;
else if (m_sAlignment >= 1000)
return 5;
else if (m_sAlignment >= 0)
return 6;
else if (m_sAlignment > -4000)
return 7;
else if (m_sAlignment > -8000)
return 8;
else if (m_sAlignment > -12000)
return 9;
else if (m_sAlignment > -20000)
return 10;
else if (m_sAlignment > -25000)
return 11;


return 12;
}
 
now find 
 
int CInstanceBase::GetAlignmentType()
 
and edit for example this:
 
int CInstanceBase::GetAlignmentType()
{
switch (GetAlignmentGrade())
{
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
{
return ALIGNMENT_TYPE_WHITE;
break;
}


case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
{
return ALIGNMENT_TYPE_DARK;
break;
}


case 6:
{
return ALIGNMENT_TYPE_NORMAL;
break;
}
}
}
 
now you can save and close InstanceBase.cpp and Build binari.
 
3. edit client
Extract root files and open locale.py
now find this:
 
TITLE_NAME_LIST = ( PVP_LEVEL0, PVP_LEVEL1, PVP_LEVEL2, PVP_LEVEL3, PVP_LEVEL4, PVP_LEVEL5, PVP_LEVEL6, PVP_LEVEL7, PVP_LEVEL8, )
 
and replace with this:
 
TITLE_NAME_LIST = ( PVP_LEVEL0, PVP_LEVEL1, PVP_LEVEL2, PVP_LEVEL3, PVP_LEVEL4, PVP_LEVEL5, PVP_LEVEL6, PVP_LEVEL7, PVP_LEVEL8, PVP_LEVEL9, PVP_LEVEL10, PVP_LEVEL11, PVP_LEVEL12, )
 
now you can save locale.py and open introloading.py
find this:
 
TITLE_COLOR_DICT
 
and edit this:
 
TITLE_COLOR_DICT = ( 
colorInfo.TITLE_RGB_GOOD_6,
colorInfo.TITLE_RGB_GOOD_5,
colorInfo.TITLE_RGB_GOOD_4,
colorInfo.TITLE_RGB_GOOD_3,
colorInfo.TITLE_RGB_GOOD_2,
colorInfo.TITLE_RGB_GOOD_1,
colorInfo.TITLE_RGB_NORMAL,
colorInfo.TITLE_RGB_EVIL_1,
colorInfo.TITLE_RGB_EVIL_2,
colorInfo.TITLE_RGB_EVIL_3,
colorInfo.TITLE_RGB_EVIL_4,
colorInfo.TITLE_RGB_EVIL_5,
colorInfo.TITLE_RGB_EVIL_6,
)
 
now you can save introloading.py and open uicharacter.py
find this:
 
COLOR_DICT
 
and edit this:
 
COLOR_DICT = {
0 : colorInfo.TITLE_RGB_GOOD_6,
1 : colorInfo.TITLE_RGB_GOOD_5,
2 : colorInfo.TITLE_RGB_GOOD_4,
3 : colorInfo.TITLE_RGB_GOOD_3,
4 : colorInfo.TITLE_RGB_GOOD_2,
5 : colorInfo.TITLE_RGB_GOOD_1,
6 : colorInfo.TITLE_RGB_NORMAL,
7 : colorInfo.TITLE_RGB_EVIL_1,
8 : colorInfo.TITLE_RGB_EVIL_2,
9 : colorInfo.TITLE_RGB_EVIL_3,
10 : colorInfo.TITLE_RGB_EVIL_4,
11 : colorInfo.TITLE_RGB_EVIL_5,
12 : colorInfo.TITLE_RGB_EVIL_6, 
}
 
now you can save uicharacter.py and open colorinfo.py and add this:
 
TITLE_RGB_GOOD_6 = (255, 215,   0)
TITLE_RGB_GOOD_5 = (  0, 159,   0)
TITLE_RGB_EVIL_5 = (127,  32,   0)
TITLE_RGB_EVIL_6 = ( 48,   0,   0)
 
save and you can compile root.
 
now you extract locale and open locale_game.txt
find:
 
PVP_LEVEL0
 
and edit PVP levels for example this:
 
PVP_LEVEL0 King
PVP_LEVEL1 Machr
PVP_LEVEL2 Rytířský
PVP_LEVEL3 Vznešený
PVP_LEVEL4 Dobrý
PVP_LEVEL5 Přátelský
PVP_LEVEL6 Neutrální
PVP_LEVEL7 Agresivní
PVP_LEVEL8 Úskočný
PVP_LEVEL9 Zlomyslný
PVP_LEVEL10 Krutý
PVP_LEVEL11 Chudák
PVP_LEVEL12 Ubožák
 
save and compile locale.
 
This is all. GOOD LUCK!
PS: sorry for my bad english.
  • Metin2 Dev 1
  • Love 6
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 1 month later...
  • 2 weeks later...

Hello i all edited, i have max alignment 100 000, yea i changed data type, but there is one problem, when i change 

TITLE_NAME_LIST  

in localeinfo.py, from 8 to 26 (my PVP_LEVEL is 26 max) , and pack root, my client give me this error

 

err.jpg

 

 

 

FIXED!!!

Edited by fenixplayscz
Fixed
Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...
  • Bronze

char_item.cpp:


search: if (GetAlignment() == 200000)

change with:

if (GetAlignment() == 300000)

 

search:

if (200000 - GetAlignment() < val * 10)

change with:

if (300000 - GetAlignment() < val * 10)

 

search: val = (200000 - GetAlignment()) / 10;

 

change with:

val = (300000 - GetAlignment()) / 10;

Link to comment
Share on other sites

  • 3 months later...
On 5/1/2016 at 7:09 PM, asterix2 said:

char_item.cpp:


search: if (GetAlignment() == 200000)

change with:

if (GetAlignment() == 300000)

 

search:

if (200000 - GetAlignment() < val * 10)

change with:

if (300000 - GetAlignment() < val * 10)

 

search: val = (200000 - GetAlignment()) / 10;

 

change with:

val = (300000 - GetAlignment()) / 10;

And what will you do when you need more than 33k or 1kk alignment?

Link to comment
Share on other sites

  • 6 months later...
  • 2 years later...

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.