Register for your free account! | Forgot your password?

You last visited: Today at 06:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HOW TO][C++]ADD NEW ALIGNMENTS

Discussion on [HOW TO][C++]ADD NEW ALIGNMENTS within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 210
Join Date: Jul 2012
Posts: 22
Received Thanks: 11
[HOW TO][C++]ADD NEW ALIGNMENTS

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

Now how do it:
1. edit game source
open char_battle.cpp and find:

Quote:
int iAlignIndex;
and edit for example:

Quote:
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

Quote:
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:

Quote:
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

Quote:
m_iRealAlignment = MINMAX(-200000, m_iRealAlignment + iAmount, 200000);
and replace with this:

Quote:
m_iRealAlignment = MINMAX(-300000, m_iRealAlignment + iAmount, 300000);
now you can compile game!


2. edit binary:
open InstanceBase.h and find:

Quote:
TITLE_NUM = 9,
TITLE_NONE = 4,
and replace this:

Quote:
TITLE_NUM = 13,
TITLE_NUM = 6,
Now you can save and close InstanceBase.h.
Now open InstanceBase.cpp and find:

Quote:
UINT CInstanceBase::GetAlignmentGrade()
and edit for example this:

Quote:
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

Quote:
int CInstanceBase::GetAlignmentType()
and edit for example this:

Quote:
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:

Quote:
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:

Quote:
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:

Quote:
TITLE_COLOR_DICT
and edit this:

Quote:
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:

Quote:
COLOR_DICT
and edit this:

Quote:
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:

Quote:
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:

Quote:
PVP_LEVEL0
and edit PVP levels for example this:

Quote:
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.
mafianekcek is offline  
Thanks
10 Users
Old 04/04/2015, 23:50   #2
 
.T4Ump's Avatar
 
elite*gold: 0
Join Date: Oct 2013
Posts: 115
Received Thanks: 192
LOL SO HARD RLY HARD settings...Facepalm

And nice copy and paste
.T4Ump is offline  
Old 04/05/2015, 01:34   #3
 
BizepsSupportAccount's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 1,016
Received Thanks: 498
dat community anstatt sich zu bedanken..

nice rls
BizepsSupportAccount is offline  
Thanks
4 Users
Old 04/05/2015, 03:27   #4
 
Tuora's Avatar
 
elite*gold: 0
Join Date: Jun 2014
Posts: 1,045
Received Thanks: 955
habe ich bereits auf einem ausländischen Forum gesehen trotzdem danke für das Releasen
Tuora is offline  
Old 04/05/2015, 08:42   #5
 
.T4Ump's Avatar
 
elite*gold: 0
Join Date: Oct 2013
Posts: 115
Received Thanks: 192
Quote:
Originally Posted by ImTweet™ View Post
habe ich bereits auf einem ausländischen Forum gesehen trotzdem danke für das Releasen
I say copy + paste
.T4Ump is offline  
Old 04/05/2015, 10:00   #6
 
elite*gold: 260
Join Date: Jan 2013
Posts: 178
Received Thanks: 104
PHP Code:
TItemDropPenalty aItemDropPenalty_kor[9] =
{
    {   
0,   0,  0,  },
    {   
0,   0,  0,  },    
    {   
0,   0,  0,  },    
    {   
0,   0,  0,  },    
    {   
0,   0,  0,  },    
    {  
25,   1,  5,  },    
    {  
50,   210,  },    
    {  
75,   415,  },    
    { 
100,   820,  },    
}; 
PHP Code:
TItemDropPenalty table[iAlignIndex]; 
o.O

you should edit those too !!

or when you get a 1000 alignment your items will be dropped whenever you die.

so it's better to leave that as it is. it will do the job either ways.
PHP Code:
    if (GetRealAlignment() >= 120000)
        
iAlignIndex 0;
    else if (
GetRealAlignment() >= 80000)
        
iAlignIndex 1;
    else if (
GetRealAlignment() >= 40000)
        
iAlignIndex 2;
    else if (
GetRealAlignment() >= 10000)
        
iAlignIndex 3;
    else if (
GetRealAlignment() >= 0)
        
iAlignIndex 4;
    else if (
GetRealAlignment() > -40000)
        
iAlignIndex 5;
    else if (
GetRealAlignment() > -80000)
        
iAlignIndex 6;
    else if (
GetRealAlignment() > -120000)
        
iAlignIndex 7;
    else
        
iAlignIndex 8
Metin2 Team is offline  
Thanks
3 Users
Old 08/16/2019, 17:56   #7
 
elite*gold: 0
Join Date: Apr 2017
Posts: 1
Received Thanks: 0
how i can add bonuses to rank?
VqLxPompa is offline  
Old 03/21/2020, 21:02   #8
 
elite*gold: 0
Join Date: Feb 2020
Posts: 2
Received Thanks: 0
and what about this ? in localeinfy.py
Quote:
def GetAlignmentTitleName(alignment):
if alignment >= 12000:
return TITLE_NAME_LIST[0]
elif alignment >= 8000:
return TITLE_NAME_LIST[1]
elif alignment >= 4000:
return TITLE_NAME_LIST[2]
elif alignment >= 1000:
return TITLE_NAME_LIST[3]
elif alignment >= 0:
return TITLE_NAME_LIST[4]
elif alignment > -4000:
return TITLE_NAME_LIST[5]
elif alignment > -8000:
return TITLE_NAME_LIST[6]
elif alignment > -12000:
return TITLE_NAME_LIST[7]

return TITLE_NAME_LIST[8]
marten3365 is offline  
Old 03/29/2020, 14:59   #9
 
elite*gold: 0
Join Date: Jun 2012
Posts: 6
Received Thanks: 0
how do i add bonus to align and be visible on the client?
tarata12 is offline  
Reply

Tags
metin2


Similar Threads Similar Threads
Alignments Liste?
04/02/2013 - Infestation - 3 Replies
Hey, wollte mal fragen ob's irgendwo eine Alignment-Liste gibt? Und was man dafür machen muss um das Alignemnt zu bekommen. ;) mfg. Marci



All times are GMT +1. The time now is 06:40.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.