[18] [Load Atlas Mark Info] Official sistemler serisi

Kaptan Yosun

Moderatör
Moderatör
Geliştirici
Yardımsever Üye
Mesaj
1.427
Çözümler
53
Beğeni
2.214
Puan
1.839
Ticaret Puanı
0
Bu seride doğrudan Metin2'den tersine mühendislik(reverse engineering) ile sökülmüş veya Metin2'ye sağdık kalınarak yazılmış sistemleri paylaşacağım.
Sistemler 2014 yılında sızdırılan kraizy.tgz arşivindeki mainline için yazılmıştır. Siz başka server dosyaları kullanıyorsanız aradığınız bazı kodları bulamayabilir veya birtakım hatalarla karşılaşabilirsiniz.

Sistemi ilk paylaşan kişi metin2.dev'den 'dir.
Sistemi aldığım asıl konu:

18- Load Atlas Mark Info: Webzen'in Multi Dil sistemine hazırlık için değiştirdiği fonksiyonlardan biri. Orijinal yapıda oyuncu her login veya warp yaptığında Server, Client'e HEADER_GC_NPC_POSITION paketi gönderir ve Client NPC listesini Server'den çeker. Bu işlemi Server taraflı yapmak hem gereksiz bir paket alışverişi yapar hem de NPC adlarını tek dil olmaya zorlar. O yüzden NPC adlarını Client taraflı çekmek daha mantıklı.
Eski NPC pozisyon bilgisi:
Genişlet Daralt Kopyala
//num    type    x    y    표시텍스트
//type : "OPC", "OPCPVP", "OPCPVPSELF", "NPC", "MONSTER", "WARP", "WAYPOINT"
//---------------------------------------------------------------------------------------------------
0    WARP    147200    7300    "자양현"
1    WARP    13100    74600    "복정현"
2    WARP    64000    143600    "박라현"
Yeni NPC pozisyon bilgisi:
Genişlet Daralt Kopyala
#TokenIndex    PosX    PosY    NPCVnum
0    44100    3300    20081

Yeni fonksiyon bu şekildedir:
Client - UserInterface/PythonMiniMap.cpp:
Genişlet Daralt Kopyala
void CPythonMiniMap::__LoadAtlasMarkInfo()
{
    ClearAtlasMarkInfo();
    ClearGuildArea();

    CPythonBackground& rkBG=CPythonBackground::Instance();
    if (!rkBG.IsMapOutdoor())
        return;

    CMapOutdoor& rkMap=rkBG.GetMapOutdoorRef();

    // LOCALE
    char szAtlasMarkInfoFileName[64+1];
    _snprintf(szAtlasMarkInfoFileName, sizeof(szAtlasMarkInfoFileName), "%s/map/%s_point.txt", LocaleService_GetLocalePath(), rkMap.GetName().c_str());
    // END_OF_LOCALE

    CTokenVectorMap stTokenVectorMap;
    if (!LoadMultipleTextData(szAtlasMarkInfoFileName, stTokenVectorMap))
    {
        Tracef(" CPythonMiniMap::__LoadAtlasMarkInfo File Load %s ERROR\n", szAtlasMarkInfoFileName);
        return;
    }

#ifndef ENABLE_GF_ATLAS_MARK_INFO
    const std::string strType[TYPE_COUNT] = { "OPC", "OPCPVP", "OPCPVPSELF", "NPC", "MONSTER", "WARP", "WAYPOINT" };
#endif

    for (DWORD i = 0; i < stTokenVectorMap.size(); ++i)
    {
        char szMarkInfoName[32+1];
        _snprintf(szMarkInfoName, sizeof(szMarkInfoName), "%lu", i);

        if (stTokenVectorMap.end() == stTokenVectorMap.find(szMarkInfoName))
            continue;

        const CTokenVector & rVector = stTokenVectorMap[szMarkInfoName];

#ifdef ENABLE_GF_ATLAS_MARK_INFO
        const std::string& c_rstrPositionX = rVector[0].c_str();
        const std::string& c_rstrPositionY = rVector[1].c_str();
        const std::string& c_rstrVnum = rVector[2].c_str();
        const DWORD c_dwVnum = atoi(c_rstrVnum.c_str());

        const CPythonNonPlayer::TMobTable* c_pMobTable = CPythonNonPlayer::Instance().GetTable(c_dwVnum);
        if (c_pMobTable)
        {
            TAtlasMarkInfo aAtlasMarkInfo;
            aAtlasMarkInfo.m_fX = atof(c_rstrPositionX.c_str());
            aAtlasMarkInfo.m_fY = atof(c_rstrPositionY.c_str());
            aAtlasMarkInfo.m_strText = c_pMobTable->szLocaleName;
            if (c_pMobTable->bType == CActorInstance::TYPE_NPC)
                aAtlasMarkInfo.m_byType = TYPE_NPC;
            else if (c_pMobTable->bType == CActorInstance::TYPE_WARP)
            {
                aAtlasMarkInfo.m_byType = TYPE_WARP;
                int iPos = aAtlasMarkInfo.m_strText.find(" ");
                if (iPos >= 0)
                    aAtlasMarkInfo.m_strText[iPos] = 0;

            }
            else if (c_pMobTable->bType == CActorInstance::TYPE_STONE && c_dwVnum >= 20702 && c_dwVnum <= 20706)
                aAtlasMarkInfo.m_byType = TYPE_NPC;

            aAtlasMarkInfo.m_fScreenX = aAtlasMarkInfo.m_fX / m_fAtlasMaxX * m_fAtlasImageSizeX - (float)m_WhiteMark.GetWidth() / 2.0f;
            aAtlasMarkInfo.m_fScreenY = aAtlasMarkInfo.m_fY / m_fAtlasMaxY * m_fAtlasImageSizeY - (float)m_WhiteMark.GetHeight() / 2.0f;

            switch (aAtlasMarkInfo.m_byType)
            {
            case TYPE_NPC:
                m_AtlasNPCInfoVector.push_back(aAtlasMarkInfo);
                break;
            case TYPE_WARP:
                m_AtlasWarpInfoVector.push_back(aAtlasMarkInfo);
                break;
            }
        }
#else
        const std::string & c_rstrType = rVector[0].c_str();
        const std::string & c_rstrPositionX = rVector[1].c_str();
        const std::string & c_rstrPositionY = rVector[2].c_str();
        const std::string & c_rstrText = rVector[3].c_str();

        TAtlasMarkInfo aAtlasMarkInfo;
        //memset(&aAtlasMarkInfo, 0, sizeof(aAtlasMarkInfo));

        for ( int i = 0; i < TYPE_COUNT; ++i)
        {
            if (0 == c_rstrType.compare(strType[i]))
                aAtlasMarkInfo.m_byType = (BYTE)i;
        }
        aAtlasMarkInfo.m_fX = atof(c_rstrPositionX.c_str());
        aAtlasMarkInfo.m_fY = atof(c_rstrPositionY.c_str());
        aAtlasMarkInfo.m_strText = c_rstrText;

        aAtlasMarkInfo.m_fScreenX = aAtlasMarkInfo.m_fX / m_fAtlasMaxX * m_fAtlasImageSizeX - (float)m_WhiteMark.GetWidth() / 2.0f;
        aAtlasMarkInfo.m_fScreenY = aAtlasMarkInfo.m_fY / m_fAtlasMaxY * m_fAtlasImageSizeY - (float)m_WhiteMark.GetHeight() / 2.0f;

        switch(aAtlasMarkInfo.m_byType)
        {
            case TYPE_NPC:
                m_AtlasNPCInfoVector.push_back(aAtlasMarkInfo);
                break;
            case TYPE_WARP:
                m_AtlasWarpInfoVector.push_back(aAtlasMarkInfo);
                break;
        }
#endif
    }
}
Client - UserInterface/PythonMiniMap.cpp:
Genişlet Daralt Kopyala
Eğer yoksa dosyanın başına bunu da ekleyin:

#ifdef ENABLE_GF_ATLAS_MARK_INFO
#include "PythonNonPlayer.h"
#endif

Şimdi herhangi bir official unpack'ten locale/xx/map klasörünü sizinkiyle değiştirebilirsiniz.

Birkaç not:
  • Bu kod RecvNPCList fonksiyonu çalışıyorsa hiçbir şey değiştirmez. Çünkü HEADER_GC_NPC_POSITION paketi Client'e geldiği zaman, Client'in txt'den yüklediği vektörleri temizler.
  • Bu yüzden HEADER_GC_NPC_POSITION paketini ve ilgili fonksiyonları ServerSource ve ClientSource taraflarından kaldırmalısınız.
  • Bu paket olmadan Server tarafı atlaswindow ile ilgilenmeyecektir. Yani eğer Server'a yeni bir NPC veya Warp Portalı eklerseniz, bunu elle Client tarafındaki locale/xx/map/xx_point.txt içine de eklemelisiniz.

Ben bu sistemi definesiz ekliyorum ve map klasörünü her bir locale yolu içinde tekrar etmemek adına locale/common konumundan çektiriyorum. Eğer bunu benim nasıl eklediğimi ve HEADER_GC_NPC_POSITION paketi ve ilgili fonksiyonları nasıl kaldırdığımı merak ederseniz bu diff betiğini 'ye yükleyerek kontrol edebilirsiniz.
Diff:
Genişlet Daralt Kopyala
diff --git a/Client/Client/pack/locale/locale/common/map/map_a2_point.txt b/Client/Client/pack/locale/locale/common/map/map_a2_point.txt
new file mode 100644
index 0000000..c1d2851
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/map_a2_point.txt
@@ -0,0 +1,12 @@
+0    147200    7300    10007
+1    13100    74600    10009
+2    64000    143600    10011
+3    76700    79200    10013
+4    77000    73000    20353
+5    80000    90000    9012
+6    94500    76000    20356
+7    121900    51500    20097
+8    36200    46200    20098
+9    70600    114700    20099
+10    29500    144200    20091
+11    28200    145500    10077
diff --git a/Client/Client/pack/locale/locale/common/map/map_b2_point.txt b/Client/Client/pack/locale/locale/common/map/map_b2_point.txt
new file mode 100644
index 0000000..22c6217
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/map_b2_point.txt
@@ -0,0 +1,6 @@
+//num    type    x    y    표시텍스트
+//type : "OPC", "OPCPVP", "OPCPVPSELF", "NPC", "MONSTER", "WARP", "WAYPOINT"
+//---------------------------------------------------------------------------------------------------
+0    WARP    74600    143800    "복정현"
+1    WARP    141200    14200    "서한산"
+2    WARP    134700    138300    "도염화지"
diff --git a/Client/Client/pack/locale/locale/common/map/map_c2_point.txt b/Client/Client/pack/locale/locale/common/map/map_c2_point.txt
new file mode 100644
index 0000000..aaa958a
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/map_c2_point.txt
@@ -0,0 +1,6 @@
+//num    type    x    y    표시텍스트
+//type : "OPC", "OPCPVP", "OPCPVPSELF", "NPC", "MONSTER", "WARP", "WAYPOINT"
+//---------------------------------------------------------------------------------------------------
+0    WARP    140900    13900    "박라현"
+1    WARP    16500    133900    "영비사막"
+2    WARP    11200    10900    "서한산"
diff --git a/Client/Client/pack/locale/locale/common/map/map_n_snowm_01_point.txt b/Client/Client/pack/locale/locale/common/map/map_n_snowm_01_point.txt
new file mode 100644
index 0000000..0b97540
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/map_n_snowm_01_point.txt
@@ -0,0 +1,18 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    53900    142400    20097    1    1
+1    15600    70000    20098    1    1
+2    98500    13200    20099    1    1
+3    75200    141500    10007    1    1
+4    15600    28300    10009    1    1
+5    139200    15400    10011    1    1
+6    141300    145300    10026    1    1
+7    78000    62000    9012    1    6
+8    73400    10600    20395    1    15
+9    66800    9300    20419    1    15
+10    37400    141100    20359    1    19
+11    146300    51300    20359    1    19
+12    47500    50000    20359    1    19
+13    24300    142200    20371    1    19
+14    69400    13100    20392    1    19
+15    81200    11700    20393    1    19
+
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_a1_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_a1_point.txt
new file mode 100644
index 0000000..c7adf0b
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_a1_point.txt
@@ -0,0 +1,56 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    32500    40500    9009    0    0
+1    25100    87400    9009    0    0
+2    19500    93700    9009    0    0
+3    30400    118600    9009    0    0
+4    52500    114700    9009    0    0
+5    59100    116600    9009    0    0
+6    68000    37900    9009    0    0
+7    82100    29700    9009    0    0
+8    35400    32700    9009    0    0
+9    40500    7300    10001    1    1
+10    59600    55700    9001    1    2
+11    59600    60500    9002    1    2
+12    67800    56500    9003    1    3
+13    67400    60700    9005    1    4
+14    68100    60200    30308    1    5
+15    7600    60100    20009    1    6
+16    55500    62500    9012    1    6
+17    67200    55600    20016    1    7
+18    73100    65900    9009    1    8
+19    62200    51100    20001    1    10
+20    69500    65700    20018    1    11
+21    55500    53300    20421    1    11
+22    71300    60500    20011    1    11
+23    65200    47500    20503    1    12
+24    65900    47500    20504    1    12
+25    73200    48000    60003    1    13
+26    65500    64600    20095    1    13
+27    71800    57700    20349    1    14
+28    54000    50000    20470    1    15
+29    62300    63000    20008    1    19
+30    62900    47100    20023    1    19
+31    63300    62200    9006    1    19
+32    68700    47500    20002    1    19
+33    69800    51300    20003    1    19
+34    59700    51100    20005    1    19
+35    58200    57800    20006    1    19
+36    66500    63400    20429    1    19
+37    64700    58200    11000    1    19
+38    65700    61900    11001    1    19
+39    65300    50800    20041    1    19
+40    57300    53100    20355    1    19
+41    60500    66300    20354    1    19
+42    6000    111800    20358    1    19
+43    58200    34700    20357    1    19
+44    89600    61000    20084    1    19
+45    54500    39700    20086    1    19
+46    54500    41200    20087    1    19
+47    62200    55600    20300    1    18
+48    62500    55500    20301    1    18
+49    62900    55400    20302    1    18
+50    63300    55300    20303    1    18
+51    64400    55100    20304    1    18
+52    64700    55000    20305    1    18
+53    65100    54900    20306    1    18
+54    65400    54800    20307    1    18
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_a3_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_a3_point.txt
new file mode 100644
index 0000000..0046d17
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_a3_point.txt
@@ -0,0 +1,28 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    94800    80400    10002    1    1
+1    14500    82300    10020    1    1
+2    100200    56500    10067    1    1
+3    45000    60800    9001    1    2
+4    47100    60800    9002    1    2
+5    42200    60800    9003    1    3
+6    43000    57400    9005    1    4
+7    43500    58100    30308    1    5
+8    50000    57500    9012    1    6
+9    10600    14400    20009    1    6
+10    42300    61800    20016    1    7
+11    58200    56100    20015    1    9
+12    41900    56300    20022    1    11
+13    41500    63800    20017    1    11
+14    54800    58800    20349    1    14
+15    48700    66600    9006    1    19
+16    51600    57900    20010    1    19
+17    54100    62000    20020    1    19
+18    54900    56200    20012    1    19
+19    47500    68400    20014    1    19
+20    56400    60300    20019    1    19
+21    40800    58100    20021    1    19
+22    58300    58500    20024    1    19
+23    45800    63100    11000    1    19
+24    47800    63300    11001    1    19
+25    18000    60000    20042    1    19
+26    48100    29800    20364    1    19
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_b1_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_b1_point.txt
new file mode 100644
index 0000000..274142d
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_b1_point.txt
@@ -0,0 +1,53 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    74200    87900    9009    0    0
+1    20600    55200    9009    0    0
+2    21800    67900    9009    0    0
+3    22100    86500    9009    0    0
+4    23100    97600    9009    0    0
+5    23400    107700    9009    0    0
+6    87600    112700    10003    1    1
+7    67600    66200    9001    1    2
+8    67600    61700    9002    1    2
+9    59000    68900    9003    1    3
+10    60900    59600    9005    1    4
+11    61300    59300    30308    1    5
+12    90300    9400    20009    1    6
+13    51900    51200    9012    1    6
+14    59400    69200    20016    1    7
+15    67500    53900    9009    1    8
+16    66000    73400    20001    1    10
+17    67400    59000    20018    1    11
+18    65800    68300    20421    1    11
+19    65500    55300    20011    1    11
+20    70100    65400    20503    1    12
+21    69200    65300    20504    1    12
+22    68100    71700    60003    1    13
+23    61800    56200    20095    1    13
+24    54900    61000    20349    1    14
+25    68800    74800    20470    1    15
+26    65900    77200    20041    1    19
+27    86400    82300    20086    1    19
+28    85400    82700    20087    1    19
+29    77200    68200    20355    1    19
+30    55300    66300    20003    1    19
+31    57100    55800    20354    1    19
+32    25000    110400    20358    1    19
+33    61400    116700    20357    1    19
+34    89800    79700    20084    1    19
+35    58800    63300    9006    1    19
+36    58100    62000    20008    1    19
+37    68400    58400    20023    1    19
+38    55400    59700    20002    1    19
+39    70200    68600    20005    1    19
+40    71700    63300    20006    1    19
+41    62000    58000    20429    1    19
+42    63300    64000    11002    1    19
+43    62300    61700    11003    1    19
+44    62300    59400    20320    1    18
+45    62700    59400    20321    1    18
+46    63100    59500    20322    1    18
+47    63500    59500    20323    1    18
+48    64500    59500    20324    1    18
+49    64900    59500    20325    1    18
+50    65300    59500    20326    1    18
+51    65700    59500    20327    1    18
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_b3_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_b3_point.txt
new file mode 100644
index 0000000..20085d6
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_b3_point.txt
@@ -0,0 +1,28 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    10600    8800    10004    1    1
+1    13600    88000    10022    1    1
+2    59300    7100    10069    1    1
+3    44800    38700    9001    1    2
+4    46100    37400    9002    1    2
+5    38900    35600    9003    1    3
+6    47100    34700    9005    1    4
+7    47100    35400    30308    1    5
+8    76400    14400    20009    1    6
+9    34500    35500    9012    1    6
+10    39600    34400    20016    1    7
+11    46600    32100    20015    1    9
+12    44900    30300    20022    1    11
+13    37600    31800    20017    1    11
+14    44500    27600    20349    1    14
+15    41900    30900    9006    1    19
+16    39700    30200    20010    1    19
+17    40900    26800    20020    1    19
+18    40600    41900    20012    1    19
+19    38300    40000    20014    1    19
+20    48200    33000    20019    1    19
+21    37600    37800    20021    1    19
+22    48900    35500    20024    1    19
+23    43100    35700    11002    1    19
+24    41500    37000    11003    1    19
+25    62800    72300    20042    1    19
+26    80500    86500    20364    1    19
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_c1_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_c1_point.txt
new file mode 100644
index 0000000..0b0dba0
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_c1_point.txt
@@ -0,0 +1,54 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    73200    39000    9009    0    0
+1    77200    47200    9009    0    0
+2    76300    80900    9009    0    0
+3    77300    90500    9009    0    0
+4    71100    23400    9009    0    0
+5    38600    84900    9009    0    0
+6    81900    31500    9009    0    0
+7    13700    12600    10005    1    1
+8    43000    60700    9001    1    2
+9    40300    58600    9002    1    2
+10    38300    69300    9003    1    3
+11    31500    56000    9005    1    4
+12    31600    55400    30308    1    5
+13    13000    111100    20009    1    6
+14    43200    68500    9012    1    6
+15    39300    69200    20016    1    7
+16    42800    48000    9009    1    8
+17    29200    81200    20001    1    10
+18    46500    61200    20018    1    11
+19    32200    73400    20421    1    11
+20    42500    71600    20011    1    11
+21    30800    81200    20503    1    12
+22    31300    81200    20504    1    12
+23    41300    53900    60003    1    13
+24    47100    57600    20095    1    13
+25    39600    73500    20349    1    14
+26    34200    80000    20470    1    15
+27    32300    61700    20041    1    19
+28    44700    92800    20086    1    19
+29    45600    93600    20087    1    19
+30    34000    74700    20008    1    19
+31    45400    53000    20023    1    19
+32    34300    56000    20002    1    19
+33    37800    57700    20003    1    19
+34    41700    67100    9006    1    19
+35    28600    63900    20355    1    19
+36    46800    71400    20354    1    19
+37    77100    7800    20358    1    19
+38    11400    96000    20357    1    19
+39    28500    28500    20084    1    19
+40    29200    71800    20005    1    19
+41    33600    77000    20006    1    19
+42    37100    70300    20429    1    19
+43    38300    64000    11004    1    19
+44    36700    61700    11005    1    19
+45    44400    62300    20340    1    18
+46    44400    62700    20341    1    18
+47    44400    63100    20342    1    18
+48    44400    63500    20343    1    18
+49    44300    64400    20344    1    18
+50    44300    64800    20345    1    18
+51    44300    65200    20346    1    18
+52    44300    65600    20347    1    18
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_c3_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_c3_point.txt
new file mode 100644
index 0000000..620120b
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_c3_point.txt
@@ -0,0 +1,28 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    90100    15100    10006    1    1
+1    91400    90700    10024    1    1
+2    53500    4100    10071    1    1
+3    46000    46700    9001    1    2
+4    43500    46700    9002    1    2
+5    48400    38700    9003    1    3
+6    39400    39000    9005    1    4
+7    39400    40000    30308    1    5
+8    48000    35500    9012    1    6
+9    14200    89300    20009    1    6
+10    49100    39900    20016    1    7
+11    51500    32200    20015    1    9
+12    37000    47500    20022    1    11
+13    38400    45400    20017    1    11
+14    52700    37300    20349    1    14
+15    43300    37600    9006    1    19
+16    53700    42000    20010    1    19
+17    45100    33000    20020    1    19
+18    49300    33500    20012    1    19
+19    41100    33300    20014    1    19
+20    36600    38900    20019    1    19
+21    40300    48200    20021    1    19
+22    37200    36200    20024    1    19
+23    44200    41200    11004    1    19
+24    42000    41600    11005    1    19
+25    16700    22400    20042    1    19
+26    53500    89200    20364    1    19
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_n_desert_01_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_n_desert_01_point.txt
new file mode 100644
index 0000000..275042e
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_n_desert_01_point.txt
@@ -0,0 +1,12 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    101200    132900    10074    1    1
+1    83200    53100    10076    1    1
+2    10900    142600    10008    1    1
+3    14900    13500    10010    1    1
+4    139200    13500    10012    1    1
+5    142500    147700    10016    1    1
+6    147700    135700    10029    1    1
+7    42800    120800    20097    1    1
+8    29600    32800    20098    1    1
+9    121600    25900    20099    1    1
+10    92000    61000    9012    1    6
diff --git a/Client/Client/pack/locale/locale/common/map/metin2_map_n_flame_01_point.txt b/Client/Client/pack/locale/locale/common/map/metin2_map_n_flame_01_point.txt
new file mode 100644
index 0000000..87b2af5
--- /dev/null
+++ b/Client/Client/pack/locale/locale/common/map/metin2_map_n_flame_01_point.txt
@@ -0,0 +1,12 @@
+#index    x    y    npc_vnum    enable_helper    icon
+0    26800    85100    20097    1    1
+1    24800    85100    20098    1    1
+2    22800    85100    20099    1    1
+3    10300    144400    10008    1    1
+4    7600    6000    10010    1    1
+5    145800    75100    10012    1    1
+6    12000    73000    9012    1    6
+7    26000    92600    20394    1    15
+8    8300    85100    20419    1    15
+9    22700    73100    20391    1    19
+10    80600    69000    20435    1    19
diff --git a/Client/ClientSource/source/EterLib/NetStream.cpp b/Client/ClientSource/source/EterLib/NetStream.cpp
index 0681674..964849e 100644
--- a/Client/ClientSource/source/EterLib/NetStream.cpp
+++ b/Client/ClientSource/source/EterLib/NetStream.cpp
@@ -717,7 +717,6 @@ const char* GetRecvHeaderName (BYTE header)
         stringList[112] = "HEADER_GC_CHANGE_SKILL_GROUP";
         stringList[113] = "HEADER_GC_MAIN_CHARACTER_NEW";
         stringList[114] = "HEADER_GC_USE_POTION";
-        stringList[115] = "HEADER_GC_NPC_POSITION";
         stringList[117] = "HEADER_GC_CHARACTER_UPDATE2";
         stringList[118] = "HEADER_GC_LOGIN_KEY";
         stringList[119] = "HEADER_GC_REFINE_INFORMATION_NEW";
diff --git a/Client/ClientSource/source/UserInterface/Locale_inc.h b/Client/ClientSource/source/UserInterface/Locale_inc.h
index 7c3fd18..adea103 100644
--- a/Client/ClientSource/source/UserInterface/Locale_inc.h
+++ b/Client/ClientSource/source/UserInterface/Locale_inc.h
@@ -26,4 +26,7 @@ LOCALE_SERVICE_GLOBAL
 
 ~ Author: Owsap @ Metin2Dev
     * FOV_OPTION                       : Adjust Field-of-View in-game.
+
+~ Author: xP3NG3Rx @ Metin2Dev
+    * ATLAS_MARK_INFO                  : Pull NPC positions from Client instead of ServerFiles.
 */
diff --git a/Client/ClientSource/source/UserInterface/Packet.h b/Client/ClientSource/source/UserInterface/Packet.h
index 33539bd..b48dff3 100644
--- a/Client/ClientSource/source/UserInterface/Packet.h
+++ b/Client/ClientSource/source/UserInterface/Packet.h
@@ -260,7 +260,6 @@ enum
     #endif
 
     HEADER_GC_SEPCIAL_EFFECT                    = 114,
-    HEADER_GC_NPC_POSITION                        = 115,
 
     HEADER_GC_CHARACTER_UPDATE2                 = 117,
     HEADER_GC_LOGIN_KEY                         = 118,
diff --git a/Client/ClientSource/source/UserInterface/PythonMiniMap.cpp b/Client/ClientSource/source/UserInterface/PythonMiniMap.cpp
index df32a1e..67c2541 100644
--- a/Client/ClientSource/source/UserInterface/PythonMiniMap.cpp
+++ b/Client/ClientSource/source/UserInterface/PythonMiniMap.cpp
@@ -17,6 +17,10 @@
 # include "PythonApplication.h"
 /* ---- END OF FOV_OPTION ---- */
 
+/* ---- ATLAS_MARK_INFO ---- */
+#include "PythonNonPlayer.h"
+/* ---- END OF ATLAS_MARK_INFO ---- */
+
 void CPythonMiniMap::AddObserver (DWORD dwVID, float fSrcX, float fSrcY)
 {
     std::map<DWORD, SObserver>::iterator f = m_kMap_dwVID_kObserver.find (dwVID);
@@ -922,7 +926,7 @@ void CPythonMiniMap::__LoadAtlasMarkInfo()
 
     // LOCALE
     char szAtlasMarkInfoFileName[64 + 1];
-    _snprintf (szAtlasMarkInfoFileName, sizeof (szAtlasMarkInfoFileName), "%s/map/%s_point.txt", LocaleService_GetLocalePath(), rkMap.GetName().c_str());
+    _snprintf (szAtlasMarkInfoFileName, sizeof (szAtlasMarkInfoFileName), "locale/common/map/%s_point.txt", rkMap.GetName().c_str());
     // END_OF_LOCALE
 
     CTokenVectorMap stTokenVectorMap;
@@ -933,8 +937,6 @@ void CPythonMiniMap::__LoadAtlasMarkInfo()
         return;
     }
 
-    const std::string strType[TYPE_COUNT] = { "OPC", "OPCPVP", "OPCPVPSELF", "NPC", "MONSTER", "WARP", "WAYPOINT" };
-
     for (DWORD i = 0; i < stTokenVectorMap.size(); ++i)
     {
         char szMarkInfoName[32 + 1];
@@ -947,36 +949,46 @@ void CPythonMiniMap::__LoadAtlasMarkInfo()
 
         const CTokenVector & rVector = stTokenVectorMap[szMarkInfoName];
 
-        const std::string & c_rstrType = rVector[0].c_str();
-        const std::string & c_rstrPositionX = rVector[1].c_str();
-        const std::string & c_rstrPositionY = rVector[2].c_str();
-        const std::string & c_rstrText = rVector[3].c_str();
-
-        TAtlasMarkInfo aAtlasMarkInfo;
+        /* ---- ATLAS_MARK_INFO ---- */
+        const std::string& c_rstrPositionX = rVector[0].c_str();
+        const std::string& c_rstrPositionY = rVector[1].c_str();
+        const std::string& c_rstrVnum = rVector[2].c_str();
+        const DWORD c_dwVnum = atoi(c_rstrVnum.c_str());
 
-        for (int i = 0; i < TYPE_COUNT; ++i)
+        const CPythonNonPlayer::TMobTable* c_pMobTable = CPythonNonPlayer::Instance().GetTable(c_dwVnum);
+        if (c_pMobTable)
         {
-            if (0 == c_rstrType.compare (strType[i]))
+            TAtlasMarkInfo aAtlasMarkInfo;
+            aAtlasMarkInfo.m_fX = atof(c_rstrPositionX.c_str());
+            aAtlasMarkInfo.m_fY = atof(c_rstrPositionY.c_str());
+            aAtlasMarkInfo.m_strText = c_pMobTable->szLocaleName;
+            if (c_pMobTable->bType == CActorInstance::TYPE_NPC)
+                aAtlasMarkInfo.m_byType = TYPE_NPC;
+            else if (c_pMobTable->bType == CActorInstance::TYPE_WARP)
             {
-                aAtlasMarkInfo.m_byType = (BYTE)i;
+                aAtlasMarkInfo.m_byType = TYPE_WARP;
+                int iPos = aAtlasMarkInfo.m_strText.find(" ");
+                if (iPos >= 0)
+                    aAtlasMarkInfo.m_strText[iPos] = 0;
+
             }
-        }
-        aAtlasMarkInfo.m_fX = atof (c_rstrPositionX.c_str());
-        aAtlasMarkInfo.m_fY = atof (c_rstrPositionY.c_str());
-        aAtlasMarkInfo.m_strText = c_rstrText;
+            else if (c_pMobTable->bType == CActorInstance::TYPE_STONE && c_dwVnum >= 20702 && c_dwVnum <= 20706)
+                aAtlasMarkInfo.m_byType = TYPE_NPC;
 
-        aAtlasMarkInfo.m_fScreenX = aAtlasMarkInfo.m_fX / m_fAtlasMaxX * m_fAtlasImageSizeX - (float)m_WhiteMark.GetWidth() / 2.0f;
-        aAtlasMarkInfo.m_fScreenY = aAtlasMarkInfo.m_fY / m_fAtlasMaxY * m_fAtlasImageSizeY - (float)m_WhiteMark.GetHeight() / 2.0f;
+            aAtlasMarkInfo.m_fScreenX = aAtlasMarkInfo.m_fX / m_fAtlasMaxX * m_fAtlasImageSizeX - (float)m_WhiteMark.GetWidth() / 2.0f;
+            aAtlasMarkInfo.m_fScreenY = aAtlasMarkInfo.m_fY / m_fAtlasMaxY * m_fAtlasImageSizeY - (float)m_WhiteMark.GetHeight() / 2.0f;
 
-        switch (aAtlasMarkInfo.m_byType)
-        {
+            switch (aAtlasMarkInfo.m_byType)
+            {
             case TYPE_NPC:
-                m_AtlasNPCInfoVector.push_back (aAtlasMarkInfo);
+                m_AtlasNPCInfoVector.push_back(aAtlasMarkInfo);
                 break;
             case TYPE_WARP:
-                m_AtlasWarpInfoVector.push_back (aAtlasMarkInfo);
+                m_AtlasWarpInfoVector.push_back(aAtlasMarkInfo);
                 break;
+            }
         }
+        /* ---- END OF ATLAS_MARK_INFO ---- */
     }
 }
 
diff --git a/Client/ClientSource/source/UserInterface/PythonNetworkStream.cpp b/Client/ClientSource/source/UserInterface/PythonNetworkStream.cpp
index f7c14f0..ed1374a 100644
--- a/Client/ClientSource/source/UserInterface/PythonNetworkStream.cpp
+++ b/Client/ClientSource/source/UserInterface/PythonNetworkStream.cpp
@@ -142,7 +142,6 @@ class CMainPacketHeaderMap : public CNetworkPacketHeaderMap
             Set (HEADER_GC_REFINE_INFORMATION, CNetworkPacketHeaderMap::TPacketType (sizeof (TPacketGCRefineInformation), STATIC_SIZE_PACKET));
             Set (HEADER_GC_REFINE_INFORMATION_NEW, CNetworkPacketHeaderMap::TPacketType (sizeof (TPacketGCRefineInformationNew), STATIC_SIZE_PACKET));
             Set (HEADER_GC_SEPCIAL_EFFECT, CNetworkPacketHeaderMap::TPacketType (sizeof (TPacketGCSpecialEffect), STATIC_SIZE_PACKET));
-            Set (HEADER_GC_NPC_POSITION, CNetworkPacketHeaderMap::TPacketType (sizeof (TPacketGCNPCPosition), DYNAMIC_SIZE_PACKET));
             Set (HEADER_GC_CHANGE_NAME, CNetworkPacketHeaderMap::TPacketType (sizeof (TPacketGCChangeName), STATIC_SIZE_PACKET));
 
             Set (HEADER_GC_LOGIN_KEY, CNetworkPacketHeaderMap::TPacketType (sizeof (TPacketGCLoginKey), STATIC_SIZE_PACKET));
diff --git a/Client/ClientSource/source/UserInterface/PythonNetworkStream.h b/Client/ClientSource/source/UserInterface/PythonNetworkStream.h
index a82e670..09e8616 100644
--- a/Client/ClientSource/source/UserInterface/PythonNetworkStream.h
+++ b/Client/ClientSource/source/UserInterface/PythonNetworkStream.h
@@ -535,7 +535,6 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
         bool RecvDragonSoulRefine();
 
         // MiniMap Info
-        bool RecvNPCList();
         bool RecvLandPacket();
         bool RecvTargetCreatePacket();
         bool RecvTargetCreatePacketNew();
diff --git a/Client/ClientSource/source/UserInterface/PythonNetworkStreamPhaseGame.cpp b/Client/ClientSource/source/UserInterface/PythonNetworkStreamPhaseGame.cpp
index 7c84dca..17bef94 100644
--- a/Client/ClientSource/source/UserInterface/PythonNetworkStreamPhaseGame.cpp
+++ b/Client/ClientSource/source/UserInterface/PythonNetworkStreamPhaseGame.cpp
@@ -519,10 +519,6 @@ void CPythonNetworkStream::GamePhase()
                 ret = RecvSpecialEffect();
                 break;
 
-            case HEADER_GC_NPC_POSITION:
-                ret = RecvNPCList();
-                break;
-
             case HEADER_GC_CHANNEL:
                 ret = RecvChannelPacket();
                 break;
@@ -4539,32 +4535,6 @@ bool CPythonNetworkStream::RecvRefineInformationPacketNew()
     return true;
 }
 
-bool CPythonNetworkStream::RecvNPCList()
-{
-    TPacketGCNPCPosition kNPCPosition;
-    if (!Recv (sizeof (kNPCPosition), &kNPCPosition))
-    {
-        return false;
-    }
-
-    assert (int (kNPCPosition.size) - sizeof (kNPCPosition) == kNPCPosition.count * sizeof (TNPCPosition) && "HEADER_GC_NPC_POSITION");
-
-    CPythonMiniMap::Instance().ClearAtlasMarkInfo();
-
-    for (int i = 0; i < kNPCPosition.count; ++i)
-    {
-        TNPCPosition NPCPosition;
-        if (!Recv (sizeof (TNPCPosition), &NPCPosition))
-        {
-            return false;
-        }
-
-        CPythonMiniMap::Instance().RegisterAtlasMark (NPCPosition.bType, NPCPosition.name, NPCPosition.x, NPCPosition.y);
-    }
-
-    return true;
-}
-
 bool CPythonNetworkStream::__SendCRCReportPacket()
 {
     /*
diff --git a/Server/ServerSource/game/src/input_login.cpp b/Server/ServerSource/game/src/input_login.cpp
index 685a96f..a13f781 100644
--- a/Server/ServerSource/game/src/input_login.cpp
+++ b/Server/ServerSource/game/src/input_login.cpp
@@ -536,7 +536,6 @@ void CInputLogin::Entergame (LPDESC d, const char* data)
     // 캐릭터를 맵에 추가
     ch->Show (ch->GetMapIndex(), pos.x, pos.y, pos.z);
 
-    SECTREE_MANAGER::instance().SendNPCPosition (ch);
     ch->ReviveInvisible (5);
 
     d->SetPhase (PHASE_GAME);
diff --git a/Server/ServerSource/game/src/packet.h b/Server/ServerSource/game/src/packet.h
index c18f33f..8489c30 100644
--- a/Server/ServerSource/game/src/packet.h
+++ b/Server/ServerSource/game/src/packet.h
@@ -218,8 +218,6 @@ enum
     //    HEADER_GC_USE_POTION            = 114,
     HEADER_GC_SEPCIAL_EFFECT        = 114,
 
-    HEADER_GC_NPC_POSITION            = 115,
-
     HEADER_GC_LOGIN_KEY                = 118,
     HEADER_GC_REFINE_INFORMATION        = 119,
     HEADER_GC_CHANNEL                = 121,
diff --git a/Server/ServerSource/game/src/sectree_manager.cpp b/Server/ServerSource/game/src/sectree_manager.cpp
index 5dacc7d..ebd1754 100644
--- a/Server/ServerSource/game/src/sectree_manager.cpp
+++ b/Server/ServerSource/game/src/sectree_manager.cpp
@@ -1149,53 +1149,6 @@ TAreaMap& SECTREE_MANAGER::GetDungeonArea (long lMapIndex)
     return it->second;
 }
 
-void SECTREE_MANAGER::SendNPCPosition (LPCHARACTER ch)
-{
-    LPDESC d = ch->GetDesc();
-    if (!d)
-    {
-        return;
-    }
-
-    long lMapIndex = ch->GetMapIndex();
-
-    if (m_mapNPCPosition[lMapIndex].empty())
-    {
-        return;
-    }
-
-    TEMP_BUFFER buf;
-    TPacketGCNPCPosition p;
-    p.header = HEADER_GC_NPC_POSITION;
-    p.count = m_mapNPCPosition[lMapIndex].size();
-
-    TNPCPosition np;
-
-    // TODO m_mapNPCPosition[lMapIndex] 를 보내주세요
-    itertype (m_mapNPCPosition[lMapIndex]) it;
-
-    for (it = m_mapNPCPosition[lMapIndex].begin(); it != m_mapNPCPosition[lMapIndex].end(); ++it)
-    {
-        np.bType = it->bType;
-        strlcpy (np.name, it->name, sizeof (np.name));
-        np.x = it->x;
-        np.y = it->y;
-        buf.write (&np, sizeof (np));
-    }
-
-    p.size = sizeof (p) + buf.size();
-
-    if (buf.size())
-    {
-        d->BufferedPacket (&p, sizeof (TPacketGCNPCPosition));
-        d->Packet (buf.read_peek(), buf.size());
-    }
-    else
-    {
-        d->Packet (&p, sizeof (TPacketGCNPCPosition));
-    }
-}
-
 void SECTREE_MANAGER::InsertNPCPosition (long lMapIndex, BYTE bType, const char* szName, long x, long y)
 {
     m_mapNPCPosition[lMapIndex].push_back (npc_info (bType, szName, x, y));
diff --git a/Server/ServerSource/game/src/sectree_manager.h b/Server/ServerSource/game/src/sectree_manager.h
index ea8acff..a55aec0 100644
--- a/Server/ServerSource/game/src/sectree_manager.h
+++ b/Server/ServerSource/game/src/sectree_manager.h
@@ -156,7 +156,6 @@ class SECTREE_MANAGER : public singleton<SECTREE_MANAGER>
         void        DestroyPrivateMap (long lMapIndex);
 
         TAreaMap&    GetDungeonArea (long lMapIndex);
-        void        SendNPCPosition (LPCHARACTER ch);
         void        InsertNPCPosition (long lMapIndex, BYTE bType, const char* szName, long x, long y);
 
         BYTE        GetEmpireFromMapIndex (long lMapIndex);
 
Son düzenleme:
Geri
Üst