ÇÖZÜLDÜ Merhaba Bow Duration 7000 Rpr Gelmiyor Nasıl düzen yardım isterim

DeaFSezo

KY Kıdemli Üye
Katılım
3 Kas 2022
Mesajlar
233
Tepkime puanı
42
Puanları
38
Merhaba Bow Duration 7000 Rpr Gelmiyor Nasıl düzen yardım isterim


 
Çözüm
Woreout mu neydi tam adı, şuanda pc de olmadığım için bilmiyorum ama sourcede bu kelimeyi arat, bu fonksiyon kıyafet, silah vs. için duration düşürme olayını yapan fonksiyon. İçeriğini kontrol edebilir, ve nerelerde çalıştırıldığına bakabilirsiniz.

Aakinci

Co-Admin
Premium Üye
KY Saygın Üye
KY YardımSever
KY Kod Editörü
Katılım
5 Tem 2021
Mesajlar
524
Çözümler
84
Tepkime puanı
250
Puanları
93
Yaş
32
Woreout mu neydi tam adı, şuanda pc de olmadığım için bilmiyorum ama sourcede bu kelimeyi arat, bu fonksiyon kıyafet, silah vs. için duration düşürme olayını yapan fonksiyon. İçeriğini kontrol edebilir, ve nerelerde çalıştırıldığına bakabilirsiniz.
 
Çözüm

DeaFSezo

KY Kıdemli Üye
Katılım
3 Kas 2022
Mesajlar
233
Tepkime puanı
42
Puanları
38
C++:
void CUser::ItemWoreOut(int type, int damage)

{

    static uint8 weaponsTypes[] = {RIGHTHAND, LEFTHAND};

    static uint8 armourTypes[] = {HEAD, BREAST, LEG, GLOVE, FOOT};

    static uint8 repairTypes[] = { RIGHTHAND, LEFTHAND, HEAD, BREAST, LEG, GLOVE, FOOT };

    uint8 totalSlots;

    int worerate;



    if (type == ACID_ALL)

    worerate = damage;

    else

    worerate = (int)sqrt(damage / 10.0f);



    if (worerate == 0) return;



    ASSERT(type == ATTACK || type == DEFENCE || type == REPAIR_ALL || type == ACID_ALL);



    // Inflict damage on equipped weapons.

    if (type == ATTACK)

        totalSlots = sizeof(weaponsTypes) / sizeof(*weaponsTypes); // use all the slots.

    // Inflict damage on equipped armour.

    else if (type == DEFENCE)

        totalSlots = sizeof(armourTypes) / sizeof(*armourTypes); // use all the slots.

    // Item repair all slots.

    else if (type == REPAIR_ALL)

        totalSlots = sizeof(repairTypes) / sizeof(*repairTypes);

    // Item acid all slots.

    else if (type == ACID_ALL)

        totalSlots = sizeof(armourTypes) / sizeof(*armourTypes);



    for (uint8 i = 0; i < totalSlots; i++)

    {

        uint8 slot;

        if (type == ATTACK)

            slot = weaponsTypes;

        else if (type == DEFENCE)

            slot = armourTypes;

        else if (type == REPAIR_ALL)

            slot = repairTypes;

        else

            slot = armourTypes;



        _ITEM_DATA * pItem = GetItem(slot);

        _ITEM_TABLE * pTable = nullptr;



        // Is a non-broken item equipped?

        if (pItem == nullptr

            || (pItem->sDuration <= 0 && type != REPAIR_ALL)

            // Does the item exist?

            || (pTable = g_pMain->GetItemPtr(pItem->nNum)) == nullptr

            // If it's in the left or righthand slot, is it a shield? (this doesn't apply to weapons)

            || (type == ATTACK

            && ((slot == LEFTHAND || slot == RIGHTHAND) && pTable->m_bSlot == ItemSlot1HLeftHand)))

            continue;



        if (type == REPAIR_ALL)

        {

            pItem->sDuration = pTable->m_sDuration;

            SendDurability(slot, pItem->sDuration);

            UserLookChange(slot, pItem->nNum, pItem->sDuration);

            SetUserAbility(true);

            continue;

        }



        int beforepercent = (int)((pItem->sDuration / (double)pTable->m_sDuration) * 100);

        int curpercent;



        if (worerate > pItem->sDuration)

            pItem->sDuration = 0;

        else

            pItem->sDuration -= worerate;



        if (m_sItemArray[slot].sDuration == 0)

        {

            SendDurability(slot, 0);

            SetUserAbility(false);

            SendItemMove(1);

            continue;

        }



        SendDurability(slot, pItem->sDuration);



        curpercent = (int)((pItem->sDuration / (double)pTable->m_sDuration) * 100);



        if ((curpercent / 5) != (beforepercent / 5))

        {

            if (curpercent >= 65 && curpercent < 70

                || curpercent >= 25 && curpercent < 30)

                UserLookChange(slot, pItem->nNum, pItem->sDuration);

        }

    }

}
 
Moderatör tarafında düzenlendi:

Aakinci

Co-Admin
Premium Üye
KY Saygın Üye
KY YardımSever
KY Kod Editörü
Katılım
5 Tem 2021
Mesajlar
524
Çözümler
84
Tepkime puanı
250
Puanları
93
Yaş
32
Hocam mesela executetype2 (tam isimleri bakamadigim için yazamıyorum) okçu skillerinin kullanıldığı yere ekleyebilirsin. Kullanıldığı başka yerlere bakıp örnek alarak
 

DeaFSezo

KY Kıdemli Üye
Katılım
3 Kas 2022
Mesajlar
233
Tepkime puanı
42
Puanları
38
@aakinci Ekledim Oldu Cok Teşekkürler

executetype2

kodu Ekledim
if (pSkillCaster->isPlayer())
TO_USER(pSkillCaster)->ItemWoreOut(ATTACK, damage);

fafqwq.png
 

Benzer konular

Reklam