Çözüldü Kadim Efsun Küresi

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

beqkral

MT Üye
MT Üye
Mesaj
192
Çözümler
14
Beğeni
49
Puan
464
Ticaret Puanı
0
Merhabalar ,
Kadim efsun nesnesi ve kadim efsun küresi sistemini kullanıyorum.

Kadim efsun küresi ile 5.efsun sırasına hiç bir efsunun full oranı gelmiyor örneğin ;
kılıç savunması maks oran 15 ama hiç bir şekilde gelmiyor 15 oranı hep 2 3 8 gibi geliyor.
1000 adet atmama rağmen
efsun tablosuda şöyle :
1629824392310.png


@Whistle
 
Çözüm
Sorun çözüldü arkadaşlar ,
item_attribute.cpp dosyasında
1629841125688.png



C++:
void CItem::AddAttribute()
{
    static const int aiItemAddAttributePercent[ITEM_ATTRIBUTE_MAX_LEVEL] =
    {
        45 , 25 , 15 , 10 , 5
    };

    if (GetAttributeCount() < MAX_NORM_ATTR_NUM)
        PutAttribute(aiItemAddAttributePercent);
}

Bu kodda 45 ,25 ,15 , 10 ,5 gibi değerlerle ilgili son 2 sayı 0dı o yüzden level 4 ve 5 gelmiyordu bunları toplamı 100 olucak şekilde ayarlayabilirsiniz.
RESIST_SWORD -> Prob -> 100 yapıp tekrar atmayı dener misin? Eğer yine full oran gelmiyorsa eklediğin kodlarla ilgili bir sorun olabilir. MySQL'dan lv5 kısmını alamıyor olabilirsin. Eklediğin kodları kontrol etmende fayda var.

Örnek veriyorum;

xxxx[0,1,2,3] şeklinde olabilir bunun xxxx[0,1,2,3,4] şeklinde olması gerekebilir.

Diğer bir sorun ise efsun botunun kodlarına da bakmanda fayda var. Sadece 5. efsun.

Prob nedir? Prob o efsunun o iteme gelme şansıdır. 100 yaparsan 100% ihtimalle o efsun iteme gelir.
 
RESIST_SWORD -> Prob -> 100 yapıp tekrar atmayı dener misin? Eğer yine full oran gelmiyorsa eklediğin kodlarla ilgili bir sorun olabilir. MySQL'dan lv5 kısmını alamıyor olabilirsin. Eklediğin kodları kontrol etmende fayda var.

Örnek veriyorum;

xxxx[0,1,2,3] şeklinde olabilir bunun xxxx[0,1,2,3,4] şeklinde olması gerekebilir.

Diğer bir sorun ise efsun botunun kodlarına da bakmanda fayda var. Sadece 5. efsun.

Prob nedir? Prob o efsunun o iteme gelme şansıdır. 100 yaparsan 100% ihtimalle o efsun iteme gelir.
Maks level3 değere kadar geliyor. nereden kontrol edebilirim bu oranı
 
Maks level3 değere kadar geliyor. nereden kontrol edebilirim bu oranı

Dediğim gibi eklediğin kodlara bakmalısın. Açtığın konuya göre bu forumda ki kimse bir nokta atışı yapamaz. Kısacası MySQL tablosunu paylaşmanın hiçbir önemi yok, önemli olan eklediğin kodlar. Onları da sen kontrol edeceksin.
 
RESIST_SWORD -> Prob -> 100 yapıp tekrar atmayı dener misin? Eğer yine full oran gelmiyorsa eklediğin kodlarla ilgili bir sorun olabilir. MySQL'dan lv5 kısmını alamıyor olabilirsin. Eklediğin kodları kontrol etmende fayda var.

Örnek veriyorum;

xxxx[0,1,2,3] şeklinde olabilir bunun xxxx[0,1,2,3,4] şeklinde olması gerekebilir.

Diğer bir sorun ise efsun botunun kodlarına da bakmanda fayda var. Sadece 5. efsun.

Prob nedir? Prob o efsunun o iteme gelme şansıdır. 100 yaparsan 100% ihtimalle o efsun iteme gelir.
Efsun botu yok ayrıca , kadim küre ile atıyorum
Dediğim gibi eklediğin kodlara bakmalısın. Açtığın konuya göre bu forumda ki kimse bir nokta atışı yapamaz. Kısacası MySQL tablosunu paylaşmanın hiçbir önemi yok, önemli olan eklediğin kodlar. Onları da sen kontrol edeceksin.
cmd_general.cpp (do_add_new):
ACMD(do_add_new_attribute)
{
    std::vector<std::string> vecArgs;
    split_argument(argument,vecArgs);
    
    if (vecArgs.size() < 6)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("NEW_ATTRIBUTE_UNKNOWN_ARGUMENT"));
        return;
    }

    if (ch->GetExchange() || ch->GetMyShop() || ch->GetOfflineShop() || ch->IsCubeOpen() || ch->IsOpenSafebox() || ch->GetShop())
    {
        ch->ChatPacket(CHAT_TYPE_INFO, "KadimPencereleriKapat");
        return;
    }


    int sourceItemPos, targetItemPos, attrtype0, attrtype1, attrtype2, attrtype3;
    // 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());
    
    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);
    // int attrtype1prob = number(1,5);
    // int attrtype2prob = number(1,5);
    // int attrtype3prob = number(1,5);
    
    bool error = false;
    if (addontype == false)
    {
        if (attrtype0 == attrtype1 || attrtype0 == attrtype2 || attrtype0 == attrtype3 || attrtype0 == item->GetAttributeType(4))
            error = true;
        if (attrtype1 == attrtype0 || attrtype1 == attrtype2 || attrtype1 == attrtype3 || attrtype1 == item->GetAttributeType(4))
            error = true;
        if (attrtype2 == attrtype0 || attrtype2 == attrtype0 || attrtype2 == attrtype3 || attrtype2 == item->GetAttributeType(4))
            error = true;
        if (attrtype3 == attrtype0 || attrtype3 == attrtype1 || attrtype3 == attrtype2 || attrtype3 == item->GetAttributeType(4))
            error = true;
        if (item->GetAttributeType(4) == attrtype0 || item->GetAttributeType(4) == attrtype1 || item->GetAttributeType(4) == attrtype2 || item->GetAttributeType(4) == attrtype3)
            error = true;
    }
    else
    {
        if (attrtype0 == attrtype1 || attrtype0 == item->GetAttributeType(4))
            error = true;
        if (attrtype1 == attrtype0 || attrtype1 == item->GetAttributeType(4))
            error = true;
    }

    for (int i=0; i < 4; ++i)
    {
        if (addontype == false)
        {
            if (item->GetAttributeType(i) == attrtype0 && i != 0)
                error = true;
            if (item->GetAttributeType(i) == attrtype1 && i != 1)
                error = true;
            if (item->GetAttributeType(i) == attrtype2 && i != 2)
                error = true;
            if (item->GetAttributeType(i) == attrtype3 && i != 3)
                error = true;
        }
        else
        {
            if (item->GetAttributeType(i+2) == attrtype0 && i != 0)
                error = true;
            if (item->GetAttributeType(i+2) == attrtype1 && i != 1)
                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);
    }
    else
    {   
        int oldattr5type = item->GetAttributeType(4), oldattr5value = item->GetAttributeValue(4);
        // int oldattr5value = item->GetAttributeValue(4);

        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
 
Sorun çözüldü arkadaşlar ,
item_attribute.cpp dosyasında
1629841125688.png



C++:
void CItem::AddAttribute()
{
    static const int aiItemAddAttributePercent[ITEM_ATTRIBUTE_MAX_LEVEL] =
    {
        45 , 25 , 15 , 10 , 5
    };

    if (GetAttributeCount() < MAX_NORM_ATTR_NUM)
        PutAttribute(aiItemAddAttributePercent);
}

Bu kodda 45 ,25 ,15 , 10 ,5 gibi değerlerle ilgili son 2 sayı 0dı o yüzden level 4 ve 5 gelmiyordu bunları toplamı 100 olucak şekilde ayarlayabilirsiniz.
 
Çözüm
Sorun çözüldü arkadaşlar ,
item_attribute.cpp dosyasında
7827 eklentisini görüntüle


C++:
void CItem::AddAttribute()
{
    static const int aiItemAddAttributePercent[ITEM_ATTRIBUTE_MAX_LEVEL] =
    {
        45 , 25 , 15 , 10 , 5
    };

    if (GetAttributeCount() < MAX_NORM_ATTR_NUM)
        PutAttribute(aiItemAddAttributePercent);
}

Bu kodda 45 ,25 ,15 , 10 ,5 gibi değerlerle ilgili son 2 sayı 0dı o yüzden level 4 ve 5 gelmiyordu bunları toplamı 100 olucak şekilde ayarlayabilirsiniz.

Bende yarım saattir attığın kodda bir hata arıyorum. Bak ufak bir dikkatsizlik ve bizim görmediğimiz kodlar nereleri değiştiriyor.
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst