Jump to content

New Limit Alignments


Recommended Posts

Hello. He wants to add a new alignments, in a sense, add new and change the value of acquiring them.
I did like this topic then edytowałego it under him.
https://metin2dev.org/board/index.php?/topic/6311-how-toadd-new-alignments/
It edited the:
 

Spoiler

    if (GetRealAlignment() >= 2500000)
        iAlignIndex = 0;
    else if (GetRealAlignment() >= 2000000)
        iAlignIndex = 1;
    else if (GetRealAlignment() >= 1500000)
        iAlignIndex = 2;
    else if (GetRealAlignment() >= 1000000)
        iAlignIndex = 3;
    else if (GetRealAlignment() >= 7500000)
        iAlignIndex = 4;
    else if (GetRealAlignment() >= 500000)
        iAlignIndex = 5;
    else if (GetRealAlignment() >= 250000)
        iAlignIndex = 6;
    else if (GetRealAlignment() >= 40000)
        iAlignIndex = 7;
    else if (GetRealAlignment() >= 10)
        iAlignIndex = 8;
    else if (GetRealAlignment() == 0)
        iAlignIndex = 9;
    else if (GetRealAlignment() > -40000)
        iAlignIndex = 10;
    else if (GetRealAlignment() > -250000)
        iAlignIndex = 11;
    else if (GetRealAlignment() > -500000)
        iAlignIndex = 12;
    else if (GetRealAlignment() > -750000)
        iAlignIndex = 13;
    else if (GetRealAlignment() > -1000000)
        iAlignIndex = 14;
    else if (GetRealAlignment() > -1500000)
        iAlignIndex = 15;
    else if (GetRealAlignment() > -2000000)
        iAlignIndex = 16;
    else if (GetRealAlignment() > -2500000)
        iAlignIndex = 17;
    else
        iAlignIndex = 18;

                        if (g_iUseLocale && pkKiller->GetParty())
                        {
                            FPartyAlignmentCompute f(-300000, pkKiller->GetX(), pkKiller->GetY());
                            pkKiller->GetParty()->ForEachOnlineMember(f);

                            if (f.m_iCount == 0)
                                pkKiller->UpdateAlignment(-300000);
                            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(-300000);

m_iRealAlignment = MINMAX(-3000000, m_iRealAlignment + iAmount, 3000000);

            TITLE_NUM                = 19,
            TITLE_NONE                = 9,

UINT CInstanceBase::GetAlignmentGrade()
{
    if (m_sAlignment >= 250000)
        return 0;
    else if (m_sAlignment >= 200000)
        return 1;
    else if (m_sAlignment >= 150000)
        return 2;
    else if (m_sAlignment >= 100000)
        return 3;
    else if (m_sAlignment >= 75000)
        return 4;
    else if (m_sAlignment >= 50000)
        return 5;
    else if (m_sAlignment >= 25000)
        return 6;
    else if (m_sAlignment >= 4000)
        return 7;
    else if (m_sAlignment >= 1)
        return 8;
    else if (m_sAlignment == 0)
        return 9;
    else if (m_sAlignment > -4000)
        return 10;
    else if (m_sAlignment > -25000)
        return 11;
    else if (m_sAlignment > -50000)
        return 12;
    else if (m_sAlignment > -75000)
        return 13;
    else if (m_sAlignment > -100000)
        return 14;
    else if (m_sAlignment > -150000)
        return 15;
    else if (m_sAlignment > -200000)
        return 16;
    else if (m_sAlignment > -250000)
        return 17;

    return 18;
}

 

int CInstanceBase::GetAlignmentType()
{
    switch (GetAlignmentGrade())
    {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        {
            return ALIGNMENT_TYPE_WHITE;
            break;
        }

        case 9:
        {
            return ALIGNMENT_TYPE_NORMAL;
            break;
        }

        case 10:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
        case 16:
        case 17:
        {
            return ALIGNMENT_TYPE_DARK;
            break;
        }
    }
}

 

def GetAlignmentTitleName(alignment):
    if alignment >= 250000:
        return TITLE_NAME_LIST[0]
    elif alignment >= 200000:
        return TITLE_NAME_LIST[1]
    elif alignment >= 150000:
        return TITLE_NAME_LIST[2]
    elif alignment >= 100000:
        return TITLE_NAME_LIST[3]
    elif alignment >= 750000:
        return TITLE_NAME_LIST[4]
    elif alignment >= 50000:
        return TITLE_NAME_LIST[5]
    elif alignment >= 25000:
        return TITLE_NAME_LIST[6]
    elif alignment >= 4000:
        return TITLE_NAME_LIST[7]
    elif alignment >= 1:
        return TITLE_NAME_LIST[8]
    elif alignment == 0:
        return TITLE_NAME_LIST[9]
    elif alignment > -4000:
        return TITLE_NAME_LIST[10]
    elif alignment > -25000:
        return TITLE_NAME_LIST[11]
    elif alignment > -50000:
        return TITLE_NAME_LIST[12]
    elif alignment > -75000:
        return TITLE_NAME_LIST[13]
    elif alignment > -100000:
        return TITLE_NAME_LIST[14]
    elif alignment > -150000:
        return TITLE_NAME_LIST[15]
    elif alignment > -200000:
        return TITLE_NAME_LIST[16]
    elif alignment > -250000:
        return TITLE_NAME_LIST[17]

    return TITLE_NAME_LIST[18]

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, PVP_LEVEL13, PVP_LEVEL14, PVP_LEVEL15, PVP_LEVEL16, PVP_LEVEL17, )


        TITLE_COLOR_DICT = (    colorInfo.TITLE_RGB_GOOD_9,
                                colorInfo.TITLE_RGB_GOOD_8,
                                colorInfo.TITLE_RGB_GOOD_7,
                                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,
                                colorInfo.TITLE_RGB_EVIL_7,
                                colorInfo.TITLE_RGB_EVIL_8,    )

PVP_LEVEL0    Legendarny
PVP_LEVEL1    Mistyczny
PVP_LEVEL2    Magiczny
PVP_LEVEL3    Mistrzowski
PVP_LEVEL4    Rycerski
PVP_LEVEL5    Szlachetny
PVP_LEVEL6    Dobry
PVP_LEVEL7    Przyjazny
PVP_LEVEL8    Nowicjusz
PVP_LEVEL9    Neutralny (NEUTRAL = 9!!! xd)
PVP_LEVEL10    Agresywny
PVP_LEVEL11    Dokuczliwy
PVP_LEVEL12    Nieuczciwy
PVP_LEVEL13    Złośliwy
PVP_LEVEL14    Wściekły
PVP_LEVEL15    Okrutny
PVP_LEVEL16    Parszywy
PVP_LEVEL17    Bezczelny

 

A problem I have one that reads the value of short rather than long or int as I change here ss what I mean:

/set [T]Kronzu align 327670

a14a469b73497.jpg

/set [T]Kronzu align 327680

3a7adf6f4d106.jpg

/set [T]Kronzu align 3000000
i got: -27680
/set [T]Kronzu align -3000000
i got: 27680

Anyone know how to fix it? How to change this short more?

int in 16bit  -215÷ 215 - 1, czyli przedział [-32768, 32767]
int in 32bit  -231÷ 231 - 1, czyli przedział [-2147483648, 2147483647]

on packet.h
short    sAlignment;
to
int    sAlignment;
In: packet_char_additional_info and packet_update_char client <=> server and no work.

Instancebase.h
short    m_sAlignment;
to
int    m_sAlignment;


NetworkActorManager.h
short    m_sAlignment;
to
int    m_sAlignment;

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.