noisiv 1
noisiv
Manwe Work 1
Manwe Work
Agora Metin2 1
Agora Metin2
Bvural41 1
Bvural41
onur akbaş 1
onur akbaş
IronTalonX 1
IronTalonX
D 1
delimuratt
berzahx 1
berzahx
PrimeAC 1
PrimeAC
DEVLOPER 1
DEVLOPER
ShadowFon 1
ShadowFon
mavzermete 1
mavzermete
Hikaye Ekle

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

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

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. 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