Metin2 Başlangıçta İtemler Giyili Ve Efsunlu Gelsin

  • Konuyu açan Konuyu açan Darklovers
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 4
  • Gösterim Gösterim 471

Darklovers

Bayrakları bayrak yapan üstündeki kandır.
MT Üye
Mesaj
234
Çözümler
14
Beğeni
632
Puan
839
Ticaret Puanı
0
Yeni Karakter Yaratınca Belirlenen Karakterlere İstediğiniz itemi , Efsunu ve taşı Giyi Şekilde verebilirsin

input_db.cpp:
Genişlet Daralt Kopyala
//YOKSA EKLE :
extern bool RaceToJob(unsigned race, unsigned *ret_job);

//ARA :
void CInputDB::PlayerCreateSuccess(LPDESC d, const char * data)

//DEĞİŞTİR :
void CInputDB::PlayerCreateSuccess(LPDESC d, const char * data)
{
    if (!d)
        return;

    TPacketDGCreateSuccess * pPacketDB = (TPacketDGCreateSuccess *)data;

    if (pPacketDB->bAccountCharacterIndex >= PLAYER_PER_ACCOUNT)
    {
        d->Packet(encode_byte(HEADER_GC_CHARACTER_CREATE_FAILURE), 1);
        return;
    }

    long lIndex = 0;

    if (!CMapLocation::instance().Get(pPacketDB->player.x,
        pPacketDB->player.y,
        lIndex,
        pPacketDB->player.lAddr,
        pPacketDB->player.wPort))
    {
        sys_err("InputDB::PlayerCreateSuccess: cannot find server for mapindex %d %d x %d (name %s)",
            lIndex,
            pPacketDB->player.x,
            pPacketDB->player.y,
            pPacketDB->player.szName);
    }

    TAccountTable & r_Tab = d->GetAccountTable();
    r_Tab.players[pPacketDB->bAccountCharacterIndex] = pPacketDB->player;

    TPacketGCPlayerCreateSuccess pack;

    pack.header = HEADER_GC_CHARACTER_CREATE_SUCCESS;
    pack.bAccountCharacterIndex = pPacketDB->bAccountCharacterIndex;
    pack.player = pPacketDB->player;

    d->Packet(&pack, sizeof(TPacketGCPlayerCreateSuccess));

    TPlayerItem t;
    memset(&t, 0, sizeof(t));

    t.owner = r_Tab.players[pPacketDB->bAccountCharacterIndex].dwID;

    struct SInitialItem
    {
        BYTE window;
        BYTE pos;
        DWORD count;

        DWORD dwVnum;

        long socket0;
        long socket1;
        long socket2;

        long attr0_type;
        long attr0_value;

        long attr1_type;
        long attr1_value;

        long attr2_type;
        long attr2_value;

        long attr3_type;
        long attr3_value;

        long attr4_type;
        long attr4_value;

        long attr5_type;
        long attr5_value;

        long attr6_type;
        long attr6_value;
    };

    const int MAX_INITIAL_ITEM = 17;

    static SInitialItem initialItems[JOB_MAX_NUM][MAX_INITIAL_ITEM] =
    {
        {
            //WARRIOR
            {EQUIPMENT, WEAR_BODY, 1, 11209, 28442, 28443, 28438, APPLY_DEX, 15, APPLY_MAX_HP, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Zirh
            {EQUIPMENT, WEAR_HEAD, 1, 12209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kask
            {EQUIPMENT, WEAR_FOOTS, 1, 15009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Ayakkabi
            {EQUIPMENT, WEAR_WRIST, 1, 14009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Bileklik
            {EQUIPMENT, WEAR_WEAPON, 1, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},        // Silah
            {EQUIPMENT, WEAR_NECK, 1, 16009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kolye
            {EQUIPMENT, WEAR_EAR, 1, 17009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},        // Kupe
            {EQUIPMENT, WEAR_SHIELD, 1, 13009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kalkan

            {INVENTORY, 0, 1, 50053, 0, 0, 0},                // Asker At Kitabi
            {INVENTORY, 1, 1, 72701, 0, 0, 1800},            // Ruzgarin Ayakkabileri
            {INVENTORY, 2, 1, 72726, 0, 0, 10000000},        // Gunes Ozutu (O)
            {INVENTORY, 3, 1, 72730, 0, 0, 1000000},        // Ay Ozutu (O)
            {INVENTORY, 4, 15, 27104, 0, 0, 50},            // Mor iksir (O)
            {INVENTORY, 5, 15, 27111, 0, 0, 50},            // Yesil iksir (O)
        },

        {
            //ASSASSIN
            {EQUIPMENT, WEAR_BODY, 1, 11409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Zirh
            {EQUIPMENT, WEAR_HEAD, 1, 12349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kask
            {EQUIPMENT, WEAR_FOOTS, 1, 15009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Ayakkabi
            {EQUIPMENT, WEAR_WRIST, 1, 14009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Bileklik
            {EQUIPMENT, WEAR_WEAPON, 1, 1009 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Silah
            {EQUIPMENT, WEAR_NECK, 1, 16009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kolye
            {EQUIPMENT, WEAR_EAR, 1, 17009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},        // Kupe
            {EQUIPMENT, WEAR_SHIELD, 1, 13009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kalkan

            {INVENTORY, 0, 1, 50053, 0, 0, 0},                // Asker At Kitabi
            {INVENTORY, 1, 1, 72701, 0, 0, 1800},            // Ruzgarin Ayakkabileri
            {INVENTORY, 2, 1, 72726, 0, 0, 10000000},        // Gunes Ozutu (O)
            {INVENTORY, 3, 1, 72730, 0, 0, 1000000},        // Ay Ozutu (O)
            {INVENTORY, 4, 15, 27104, 0, 0, 50},            // Mor iksir (O)
            {INVENTORY, 5, 15, 27111, 0, 0, 50},            // Yesil iksir (O)
        },

        {
            //SURA
            {EQUIPMENT, WEAR_BODY, 1, 11609, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Zirh
            {EQUIPMENT, WEAR_HEAD, 1, 12489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kask
            {EQUIPMENT, WEAR_FOOTS, 1, 15009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Ayakkabi
            {EQUIPMENT, WEAR_WRIST, 1, 14009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Bileklik
            {EQUIPMENT, WEAR_WEAPON, 1, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},        // Silah
            {EQUIPMENT, WEAR_NECK, 1, 16009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kolye
            {EQUIPMENT, WEAR_EAR, 1, 17009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},        // Kupe
            {EQUIPMENT, WEAR_SHIELD, 1, 13009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kalkan

            {INVENTORY, 0, 1, 50053, 0, 0, 0},                // Asker At Kitabi
            {INVENTORY, 1, 1, 72701, 0, 0, 1800},            // Ruzgarin Ayakkabileri
            {INVENTORY, 2, 1, 72726, 0, 0, 10000000},        // Gunes Ozutu (O)
            {INVENTORY, 3, 1, 72730, 0, 0, 1000000},        // Ay Ozutu (O)
            {INVENTORY, 4, 15, 27104, 0, 0, 50},            // Mor iksir (O)
            {INVENTORY, 5, 15, 27111, 0, 0, 50},            // Yesil iksir (O)
        },

        {
            //SHAMAN
            {EQUIPMENT, WEAR_BODY, 1, 11809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Zirh
            {EQUIPMENT, WEAR_HEAD, 1, 12629, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kask
            {EQUIPMENT, WEAR_FOOTS, 1, 15009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Ayakkabi
            {EQUIPMENT, WEAR_WRIST, 1, 14009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Bileklik
            {EQUIPMENT, WEAR_WEAPON, 1, 7009 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Silah
            {EQUIPMENT, WEAR_NECK, 1, 16009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kolye
            {EQUIPMENT, WEAR_EAR, 1, 17009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},        // Kupe
            {EQUIPMENT, WEAR_SHIELD, 1, 13009, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},    // Kalkan

            {INVENTORY, 0, 1, 50053, 0, 0, 0},                // Asker At Kitabi
            {INVENTORY, 1, 1, 72701, 0, 0, 1800},            // Ruzgarin Ayakkabileri
            {INVENTORY, 2, 1, 72726, 0, 0, 10000000},        // Gunes Ozutu (O)
            {INVENTORY, 3, 1, 72730, 0, 0, 1000000},        // Ay Ozutu (O)
            {INVENTORY, 4, 15, 27104, 0, 0, 50},            // Mor iksir (O)
            {INVENTORY, 5, 15, 27111, 0, 0, 50},            // Yesil iksir (O)
        },
    };

    unsigned job = pPacketDB->player.byJob;
    RaceToJob(job, &job);

    for (int i = 0; i < MAX_INITIAL_ITEM; i++)
    {
        if (initialItems[job][i].dwVnum == 0)
            continue;

        t.id                = ITEM_MANAGER::instance().GetNewID();
        t.window            = initialItems[job][i].window;
        t.pos                = initialItems[job][i].pos;
        t.count                = initialItems[job][i].count;
        t.vnum                = initialItems[job][i].dwVnum;

        t.alSockets[0]        = initialItems[job][i].socket0;
        t.alSockets[1]        = initialItems[job][i].socket1;
        t.alSockets[2]        = initialItems[job][i].socket2;

        t.aAttr[0].bType    = initialItems[job][i].attr0_type;
        t.aAttr[0].sValue    = initialItems[job][i].attr0_value;

        t.aAttr[1].bType    = initialItems[job][i].attr1_type;
        t.aAttr[1].sValue    = initialItems[job][i].attr1_value;

        t.aAttr[2].bType    = initialItems[job][i].attr2_type;
        t.aAttr[2].sValue    = initialItems[job][i].attr2_value;

        t.aAttr[3].bType    = initialItems[job][i].attr3_type;
        t.aAttr[3].sValue    = initialItems[job][i].attr3_value;

        t.aAttr[4].bType    = initialItems[job][i].attr4_type;
        t.aAttr[4].sValue    = initialItems[job][i].attr4_value;

        t.aAttr[5].bType    = initialItems[job][i].attr5_type;
        t.aAttr[5].sValue    = initialItems[job][i].attr5_value;

        t.aAttr[6].bType    = initialItems[job][i].attr6_type;
        t.aAttr[6].sValue    = initialItems[job][i].attr6_value;

        db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_SAVE, 0, sizeof(TPlayerItem));
        db_clientdesc->Packet(&t, sizeof(TPlayerItem));
    }

    LogManager::instance().CharLog(pack.player.dwID, 0, 0, 0, "CREATE PLAYER", "", d->GetHostName());
}
 
Paylaşım için teşekkürler hocam
 
Teşekkürler, extradan sourceden başlangıçta becerileri master ya da p verme yapıabilinir mi questi kullanmadan?
 
Geri
Üst