Çözüldü Canavarlardan/Bosslardan/Metinlerden düşen eşyalarda 6. 7. efsun olabilme şansı

  • Konuyu açan Konuyu açan Tengrist
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 3
  • Gösterim Gösterim 150
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

Tengrist

MT Üye
MT Üye
Mesaj
651
Çözümler
25
Beğeni
481
Puan
809
Ticaret Puanı
0
arkadaşlar klasik mt2de hatırlarsınız 2000hpli ayakkabı düşürünce 2010 civarları baya sevinirdik kendi oyun yapıma da uygun olarak 6. veya hem 6 hem 7. veya 6. 7. efsun ekli olmadan itemlerin slotlardan düşmesini istiyorum bu mevzuyu nasıl ayarlayabilirim eğer biliyorsanız düşen itemin 1-4 efsunlu düşebilme şansının olduğu src'deki kısım neresi oralara bakıp kendim bir şeyler denemeye çalışabilirim, saygılar şimdiden.
 
Çözüm
Selamlar, efsunlu eşyaların düşmesini sağlayan kod bloğu burasıdır, gerekli oynamaları yaparsanız rastgele efsunlar ile eşyaların düşme ihtimalini ve efsun sayısını arttırabilirsiniz;

item.cpp / Serverside

C++:
Genişlet Daralt Kopyala
void CItem::AlterToMagicItem() // Chance to drop enchanted items. - [MT2Dev Note] - 25/05/2023
{
    int idx = GetAttributeSetIndex();
    if (idx < 0)
    {
        return;
    }

    // Type Appeariance Second Third
    // Weapon   50        20     5
    // Armor    30        15     3
    // Other    20        10     2

    int iSecondPct; // Drop with 2 Bonus.
    int iThirdPct;  // Drop with 3 Bonus.

    switch (GetType())
    {
        case ITEM_WEAPON:        // Weapons.
            iSecondPct = 20;     // 2 Bonus...
arkadaşlar klasik mt2de hatırlarsınız 2000hpli ayakkabı düşürünce 2010 civarları baya sevinirdik kendi oyun yapıma da uygun olarak 6. veya hem 6 hem 7. veya 6. 7. efsun ekli olmadan itemlerin slotlardan düşmesini istiyorum bu mevzuyu nasıl ayarlayabilirim eğer biliyorsanız düşen itemin 1-4 efsunlu düşebilme şansının olduğu src'deki kısım neresi oralara bakıp kendim bir şeyler denemeye çalışabilirim, saygılar şimdiden.
bence mob dropu takip edersen bulursun. mob dropta item düşürebiliyoruz ya o itemin efsunlu düşme şansı da ordan ayarlanıyordur belki.

edit1:

ya da item oluştururkende rastgele efsunla geldiği için cmddeki do_item fonksiyonunu da inceleyebilirsin. orda da efsun ile ilgili bir şans ayarı olmalı.
 
Selamlar, efsunlu eşyaların düşmesini sağlayan kod bloğu burasıdır, gerekli oynamaları yaparsanız rastgele efsunlar ile eşyaların düşme ihtimalini ve efsun sayısını arttırabilirsiniz;

item.cpp / Serverside

C++:
Genişlet Daralt Kopyala
void CItem::AlterToMagicItem() // Chance to drop enchanted items. - [MT2Dev Note] - 25/05/2023
{
    int idx = GetAttributeSetIndex();
    if (idx < 0)
    {
        return;
    }

    // Type Appeariance Second Third
    // Weapon   50        20     5
    // Armor    30        15     3
    // Other    20        10     2

    int iSecondPct; // Drop with 2 Bonus.
    int iThirdPct;  // Drop with 3 Bonus.

    switch (GetType())
    {
        case ITEM_WEAPON:        // Weapons.
            iSecondPct = 20;     // 2 Bonus drop chance %20.
            iThirdPct  = 5;      // 3 Bonus drop chance %5.
            break;

        case ITEM_ARMOR:
        case ITEM_COSTUME:
            if (GetSubType() == ARMOR_BODY) // Armors.
            {
                iSecondPct = 15; // 2 Bonus drop chance %15.
                iThirdPct  = 3;  // 3 Bonus drop chance %3.
            }
            else                 // Others.
            {
                iSecondPct = 10; // 2 Bonus drop chance %10.
                iThirdPct  = 2;  // 3 Bonus drop chance %2.
            }
            break;

        default:
            return;
    }

    // %100 chance for one good attribute. - [Ymir Dev Note]
    PutAttribute (aiItemMagicAttributePercentHigh);

    // Info: Bonus 1 will always drop with PercentHigh, Bonus 2 and 3 will most likely come with PercentLow. - [MT2Dev Note] - 25/05/2023
    if (number (1, 100) <= iSecondPct)
    {
        PutAttribute (aiItemMagicAttributePercentLow);
    }

    if (number (1, 100) <= iThirdPct)
    {
        PutAttribute (aiItemMagicAttributePercentLow);
    }
}
 
Çözüm
Selamlar, efsunlu eşyaların düşmesini sağlayan kod bloğu burasıdır, gerekli oynamaları yaparsanız rastgele efsunlar ile eşyaların düşme ihtimalini ve efsun sayısını arttırabilirsiniz;

item.cpp / Serverside

C++:
Genişlet Daralt Kopyala
void CItem::AlterToMagicItem() // Chance to drop enchanted items. - [MT2Dev Note] - 25/05/2023
{
    int idx = GetAttributeSetIndex();
    if (idx < 0)
    {
        return;
    }

    // Type Appeariance Second Third
    // Weapon   50        20     5
    // Armor    30        15     3
    // Other    20        10     2

    int iSecondPct; // Drop with 2 Bonus.
    int iThirdPct;  // Drop with 3 Bonus.

    switch (GetType())
    {
        case ITEM_WEAPON:        // Weapons.
            iSecondPct = 20;     // 2 Bonus drop chance %20.
            iThirdPct  = 5;      // 3 Bonus drop chance %5.
            break;

        case ITEM_ARMOR:
        case ITEM_COSTUME:
            if (GetSubType() == ARMOR_BODY) // Armors.
            {
                iSecondPct = 15; // 2 Bonus drop chance %15.
                iThirdPct  = 3;  // 3 Bonus drop chance %3.
            }
            else                 // Others.
            {
                iSecondPct = 10; // 2 Bonus drop chance %10.
                iThirdPct  = 2;  // 3 Bonus drop chance %2.
            }
            break;

        default:
            return;
    }

    // %100 chance for one good attribute. - [Ymir Dev Note]
    PutAttribute (aiItemMagicAttributePercentHigh);

    // Info: Bonus 1 will always drop with PercentHigh, Bonus 2 and 3 will most likely come with PercentLow. - [MT2Dev Note] - 25/05/2023
    if (number (1, 100) <= iSecondPct)
    {
        PutAttribute (aiItemMagicAttributePercentLow);
    }

    if (number (1, 100) <= iThirdPct)
    {
        PutAttribute (aiItemMagicAttributePercentLow);
    }
}
Çok teşekkür ederim hocam
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Üst