Best Studio 1
Best Studio
mannaxxx 1
mannaxxx
Agora Metin2 1
Agora Metin2
[DEV]AB 1
[DEV]AB
Sevdamsın 1
Sevdamsın
TuZaKK 1
TuZaKK
kaptanmikro1 1
kaptanmikro1
farkmt2official 2
farkmt2official
kralhakan2009 1
kralhakan2009
Vahsi Uzman 1
Vahsi Uzman
Bvural41 1
Bvural41
Hikaye Ekle

Mini Haritada istediğiniz yere ışınlanın

5.00 yıldız(lar) 1 Değerlendirme Değerlendirenler

Türkiye'de ilk Mobil & PC Aynı Anda Metin2 Oyna. Triarchonline kalıcı ve uzun ömürlü yapısı ile 24 Temmuz'da açılıyor. | 1-99 Mobil Metin2 Triarch HEMEN TIKLA!

sağolasın abi eline sağlık. sabitteki Official item_proto ve mob_proto konusunada bir baksan güncel protoları açmıyorda
 
Oyuna girişte oyuncuların yerlerini görebilmek için SendNPCPosition fonksiyonunu aşağıdaki gibi değişebilirsiniz. Sadece gmler görebilir, oyuncunun direk x,y koordinatlarını alacak fonksiyonu bulamadığım için aşağıdaki gibi yaptım.

0ac754a656.png


C++:
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));
    }
    
    
    if (ch->IsGM())
    {
        const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();

        for (itertype(c_ref_set) it2 = c_ref_set.begin(); it2 != c_ref_set.end(); ++it2)
        {
            LPCHARACTER pkChar = (*it2)->GetCharacter();
            if (!pkChar)
                continue;
                
            if (pkChar->GetMapIndex() == lMapIndex && pkChar->GetPlayerID() != ch->GetPlayerID())
            {
                PIXEL_POSITION posBase;
                if (!SECTREE_MANAGER::instance().GetMapBasePositionByMapIndex(ch->GetMapIndex(), posBase))
                {
                    continue;
                }
                DWORD mapX = posBase.x;
                DWORD mapY = posBase.y;
                const PIXEL_POSITION & vpos = pkChar->GetXYZ();
                DWORD playerX = vpos.x;
                DWORD playerY = vpos.y;
                DWORD finalX = (playerX- mapX)/100;
                DWORD finalY = (playerY- mapY)/100;
                finalX *= 100;
                finalY *= 100;
                np.bType = 1;
                strlcpy(np.name, pkChar->GetName(), sizeof(np.name));
                np.x = finalX;
                np.y = finalY;
                p.count += 1;
                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));
}
 
Oyuna girişte oyuncuların yerlerini görebilmek için SendNPCPosition fonksiyonunu aşağıdaki gibi değişebilirsiniz. Sadece gmler görebilir, oyuncunun direk x,y koordinatlarını alacak fonksiyonu bulamadığım için aşağıdaki gibi yaptım.

0ac754a656.png


C++:
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));
    }
   
   
    if (ch->IsGM())
    {
        const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();

        for (itertype(c_ref_set) it2 = c_ref_set.begin(); it2 != c_ref_set.end(); ++it2)
        {
            LPCHARACTER pkChar = (*it2)->GetCharacter();
            if (!pkChar)
                continue;
               
            if (pkChar->GetMapIndex() == lMapIndex && pkChar->GetPlayerID() != ch->GetPlayerID())
            {
                PIXEL_POSITION posBase;
                if (!SECTREE_MANAGER::instance().GetMapBasePositionByMapIndex(ch->GetMapIndex(), posBase))
                {
                    continue;
                }
                DWORD mapX = posBase.x;
                DWORD mapY = posBase.y;
                const PIXEL_POSITION & vpos = pkChar->GetXYZ();
                DWORD playerX = vpos.x;
                DWORD playerY = vpos.y;
                DWORD finalX = (playerX- mapX)/100;
                DWORD finalY = (playerY- mapY)/100;
                finalX *= 100;
                finalY *= 100;
                np.bType = 1;
                strlcpy(np.name, pkChar->GetName(), sizeof(np.name));
                np.x = finalX;
                np.y = finalY;
                p.count += 1;
                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));
}
783f14c1-8639-43d9-b359-63cdadadeec3.jpg
 
Oyuna girişte oyuncuların yerlerini görebilmek için SendNPCPosition fonksiyonunu aşağıdaki gibi değişebilirsiniz. Sadece gmler görebilir, oyuncunun direk x,y koordinatlarını alacak fonksiyonu bulamadığım için aşağıdaki gibi yaptım.

0ac754a656.png


C++:
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));
    }
  
  
    if (ch->IsGM())
    {
        const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();

        for (itertype(c_ref_set) it2 = c_ref_set.begin(); it2 != c_ref_set.end(); ++it2)
        {
            LPCHARACTER pkChar = (*it2)->GetCharacter();
            if (!pkChar)
                continue;
              
            if (pkChar->GetMapIndex() == lMapIndex && pkChar->GetPlayerID() != ch->GetPlayerID())
            {
                PIXEL_POSITION posBase;
                if (!SECTREE_MANAGER::instance().GetMapBasePositionByMapIndex(ch->GetMapIndex(), posBase))
                {
                    continue;
                }
                DWORD mapX = posBase.x;
                DWORD mapY = posBase.y;
                const PIXEL_POSITION & vpos = pkChar->GetXYZ();
                DWORD playerX = vpos.x;
                DWORD playerY = vpos.y;
                DWORD finalX = (playerX- mapX)/100;
                DWORD finalY = (playerY- mapY)/100;
                finalX *= 100;
                finalY *= 100;
                np.bType = 1;
                strlcpy(np.name, pkChar->GetName(), sizeof(np.name));
                np.x = finalX;
                np.y = finalY;
                p.count += 1;
                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));
}
nerede değişiklik yapacaklarını bilmeyenler

sectree_manager.cpp------------->burada dğişiklik yapacaklar
 
Oyuna girişte oyuncuların yerlerini görebilmek için SendNPCPosition fonksiyonunu aşağıdaki gibi değişebilirsiniz. Sadece gmler görebilir, oyuncunun direk x,y koordinatlarını alacak fonksiyonu bulamadığım için aşağıdaki gibi yaptım.

0ac754a656.png


C++:
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));
    }
   
   
    if (ch->IsGM())
    {
        const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();

        for (itertype(c_ref_set) it2 = c_ref_set.begin(); it2 != c_ref_set.end(); ++it2)
        {
            LPCHARACTER pkChar = (*it2)->GetCharacter();
            if (!pkChar)
                continue;
               
            if (pkChar->GetMapIndex() == lMapIndex && pkChar->GetPlayerID() != ch->GetPlayerID())
            {
                PIXEL_POSITION posBase;
                if (!SECTREE_MANAGER::instance().GetMapBasePositionByMapIndex(ch->GetMapIndex(), posBase))
                {
                    continue;
                }
                DWORD mapX = posBase.x;
                DWORD mapY = posBase.y;
                const PIXEL_POSITION & vpos = pkChar->GetXYZ();
                DWORD playerX = vpos.x;
                DWORD playerY = vpos.y;
                DWORD finalX = (playerX- mapX)/100;
                DWORD finalY = (playerY- mapY)/100;
                finalX *= 100;
                finalY *= 100;
                np.bType = 1;
                strlcpy(np.name, pkChar->GetName(), sizeof(np.name));
                np.x = finalX;
                np.y = finalY;
                p.count += 1;
                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));
}

sadece oyuna ilk girişteki konumları gösteriyor yalnız herhangi bir update'i yok yani oyuncu hareket ettiğinde minimapteki konumu değişmiyor kullanacaklar için belirteyim.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst