Çözüldü kadim efsun 4 ve 5.efsun sorunu

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ı.

serversoftware

Hosting Firma Yetkilisi
Firma Yetkilisi - YS-V
Üye
Merhabalar, kadim efsun sistemi başarılı bir şekilde eklendi ama 4. Ve 5. Efsun aynı seçildiğinde aynı efsunu ekliyor

27665_acbbe734e7011006bfd544a175eae407.jpg


Sorunu nasıl çözebiliriz?
 
Çözüm
konuya 5sn bakınca görebiliyorum siz nasıl göremediniz acaba?

Hata sebebi;
69b83379d628642623b4128ab682ac78.png

Çözümü;

arat : if (item->GetAttributeType(i) == attrtype4 && i != 3)

değiştir : if (item->GetAttributeType(i) == attrtype4 && i != 4)

hocam zaten doğru bir şekildeymiş bizim cmd_general.cpp ?

Sorunu çözdüm, aynı sorunu yaşayan arkadaşlar kodunu şöyle güncellesin.

Sorun Çözümü:
#ifdef WJ_ELDER_ATTRIBUTE_SYSTEM
ACMD(do_add_new_attribute)
{
    std::vector<std::string> vecArgs;
    split_argument(argument,vecArgs);
    
    if (vecArgs.size() < 7)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_UNKNOWN_ARGUMENT"));
        return;
    }
    
    int sourceItemPos, targetItemPos...
konuya 5sn bakınca görebiliyorum siz nasıl göremediniz acaba?

Hata sebebi;
69b83379d628642623b4128ab682ac78.png

Çözümü;

arat : if (item->GetAttributeType(i) == attrtype4 && i != 3)

değiştir : if (item->GetAttributeType(i) == attrtype4 && i != 4)

hocam zaten doğru bir şekildeymiş bizim cmd_general.cpp ?

Sorunu çözdüm, aynı sorunu yaşayan arkadaşlar kodunu şöyle güncellesin.

Sorun Çözümü:
#ifdef WJ_ELDER_ATTRIBUTE_SYSTEM
ACMD(do_add_new_attribute)
{
    std::vector<std::string> vecArgs;
    split_argument(argument,vecArgs);
    
    if (vecArgs.size() < 7)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_UNKNOWN_ARGUMENT"));
        return;
    }
    
    int sourceItemPos, targetItemPos, attrtype0, attrtype1, attrtype2, attrtype3, attrtype4;
    // int targetItemPos;
    // int attrtype0;
    // int attrtype1;
    // int attrtype2;
    // int attrtype3;
        
    str_to_number(sourceItemPos, vecArgs[1].c_str());
    str_to_number(targetItemPos, vecArgs[2].c_str());
    str_to_number(attrtype0, vecArgs[3].c_str());
    str_to_number(attrtype1, vecArgs[4].c_str());
    str_to_number(attrtype2, vecArgs[5].c_str());
    str_to_number(attrtype3, vecArgs[6].c_str());
    str_to_number(attrtype4, vecArgs[7].c_str());
    
    LPITEM item = ch->GetInventoryItem(targetItemPos);
    
    if (!item)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_CANNOT_FIND_ITEM"));
        return;
    }
    
    if (item->GetType() != ITEM_WEAPON && item->GetType() != ITEM_ARMOR)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_COSTUME"));
        return;
    }
    
    if (item->IsEquipped())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_EQUIPPED"));
        return;
    }
    
    if (item->IsExchanging())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_EXCHANGING"));
        return;
    }

    if (ch->CountSpecifyItem(71051) < 1)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_ENOUGH_NEW_ATTRIBUTE"));
        return;
    }
    
    TItemTable const * pProto = item->GetProto();
    
    bool addontype = false;
    if (pProto && pProto->sAddonType)
        addontype = true;
    
    int attrtype0prob = number(1,5), attrtype1prob = number(1,5), attrtype2prob = number(1,5), attrtype3prob = number(1,5), attrtype4prob = number(1,5);
    
    bool error = false;
    if (addontype == false)
    {
        if (attrtype0 == attrtype1 || attrtype0 == attrtype2 || attrtype0 == attrtype3 || attrtype0 == attrtype4 ||
            attrtype1 == attrtype2 || attrtype1 == attrtype3 || attrtype1 == attrtype4 ||
            attrtype2 == attrtype3 || attrtype2 == attrtype4 ||
            attrtype3 == attrtype4 ||
            item->GetAttributeType(0) == attrtype0 || item->GetAttributeType(1) == attrtype0 || item->GetAttributeType(2) == attrtype0 || item->GetAttributeType(3) == attrtype0 || item->GetAttributeType(4) == attrtype0 ||
            item->GetAttributeType(0) == attrtype1 || item->GetAttributeType(1) == attrtype1 || item->GetAttributeType(2) == attrtype1 || item->GetAttributeType(3) == attrtype1 || item->GetAttributeType(4) == attrtype1 ||
            item->GetAttributeType(0) == attrtype2 || item->GetAttributeType(1) == attrtype2 || item->GetAttributeType(2) == attrtype2 || item->GetAttributeType(3) == attrtype2 || item->GetAttributeType(4) == attrtype2 ||
            item->GetAttributeType(0) == attrtype3 || item->GetAttributeType(1) == attrtype3 || item->GetAttributeType(2) == attrtype3 || item->GetAttributeType(3) == attrtype3 || item->GetAttributeType(4) == attrtype3 ||
            item->GetAttributeType(0) == attrtype4 || item->GetAttributeType(1) == attrtype4 || item->GetAttributeType(2) == attrtype4 || item->GetAttributeType(3) == attrtype4 || item->GetAttributeType(4) == attrtype4)
            error = true;
    }
    else
    {
        if (attrtype0 == attrtype1 || attrtype0 == attrtype2 || attrtype0 == attrtype3 || attrtype0 == attrtype4 ||
            attrtype1 == attrtype2 || attrtype1 == attrtype3 || attrtype1 == attrtype4 ||
            attrtype2 == attrtype3 || attrtype2 == attrtype4 ||
            attrtype3 == attrtype4 ||
            item->GetAttributeType(2) == attrtype0 || item->GetAttributeType(3) == attrtype0 || item->GetAttributeType(4) == attrtype0 ||
            item->GetAttributeType(2) == attrtype1 || item->GetAttributeType(3) == attrtype1 || item->GetAttributeType(4) == attrtype1 ||
            item->GetAttributeType(2) == attrtype2 || item->GetAttributeType(3) == attrtype2 || item->GetAttributeType(4) == attrtype2 ||
            item->GetAttributeType(2) == attrtype3 || item->GetAttributeType(3) == attrtype3 || item->GetAttributeType(4) == attrtype3 ||
            item->GetAttributeType(2) == attrtype4 || item->GetAttributeType(3) == attrtype4 || item->GetAttributeType(4) == attrtype4)
            error = true;
    }
    
    if (error)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_ERROR"));
        return;
    }
    
    if (addontype == false)
    {
        item->AddNewAttr(0, attrtype0, attrtype0prob);
        item->AddNewAttr(1, attrtype1, attrtype1prob);
        item->AddNewAttr(2, attrtype2, attrtype2prob);
        item->AddNewAttr(3, attrtype3, attrtype3prob);
        item->AddNewAttr(4, attrtype4, attrtype4prob);
    }
    else
    {   
        int oldattr5type = item->GetAttributeType(5), oldattr5value = item->GetAttributeValue(5);

        item->RemoveAttributeAt(0);
        item->RemoveAttributeAt(1);   
        item->ApplyAddon(100);
        item->ChangeAttribute();
        item->AddNewAttr(2, attrtype0, attrtype0prob);
        item->AddNewAttr(3, attrtype1, attrtype1prob);
        item->AddNewAttr(4, oldattr5type, oldattr5value);

        if (item->GetAttributeType(1) != 71)
        {
            if (item->GetAttributeType(0) != 72)
            {
                item->SetForceAttribute(0, 72, 13);
                item->SetForceAttribute(1, 71, 1);
            }
            else
                item->SetForceAttribute(1, 71, -1);
        }               
    }
    
    ch->RemoveSpecifyItem(71051, 1);
    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_SUCCESS_ATTR"));
}
#endif
 
Son düzenleme:
Çözüm
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri