[Paylaşım] Maden Drop & Exp Ayarlama ! 2017

'Kaynak Kod Paylaşımları' forumunda Jackson tarafından 26 Ocak 2015 tarihinde açılan konu

  1. Jackson

    Jackson New Member

    Sourceden "CUser::HandleMiningAttempt" aratıyorsunuz ve komple silip verdiklerimi ekliyorsunuz açıklamaları mevcut zaten...



    [hide]
    Kod:
    void CUser::HandleMiningAttempt(Packet & pkt)
    
    {
    
        if (!isMining())
    
            return;
    
    
    
        Packet result(WIZ_MINING, uint8(MiningAttempt));
    
        uint16 resultCode = MiningResultSuccess;
    
    
    
        // Do we have a pickaxe? Is it worn?
    
        _ITEM_DATA * pItem;
    
        _ITEM_TABLE * pTable = GetItemPrototype(RIGHTHAND, pItem);
    
        if (pItem == nullptr || pTable == nullptr
    
            || pItem->sDuration <= 0 // are we supposed to wear the pickaxe on use? Need to verify.
    
            || !pTable->isPickaxe())
    
            resultCode = MiningResultNotPickaxe;
    
    
    
        // Check to make sure we're not spamming the packet...
    
        if ((UNIXTIME - m_tLastMiningAttempt) < MINING_DELAY)
    
            resultCode = MiningResultMiningAlready; // as close an error as we're going to get...
    
    
    
        // Effect to show to clients
    
        uint16 sEffect = 0;
    
    
    
        // This is just a mock-up based on another codebase's implementation.
    
        // Need to log official data to get a proper idea of how it behaves, rate-wise,
    
        // so that we can then implement it more dynamically.
    
        if (resultCode == MiningResultSuccess)
    
        {
    
            int rate = myrand(1, 100), random = myrand(1, 10000);
    
    
    
            if (m_bPremiumType > 0)
    
            {
    
                rate += (rate / 100) * GetPremiumProperty(PremiumDropPercent);
    
                random += (rate / 100) * GetPremiumProperty(PremiumDropPercent);
    
            }
    
    
    
            if (pTable->m_iNum == GOLDEN_MATTOCK)
    
            {
    
                rate += (rate / 100) * 10;
    
                random += (random / 100) * 10;
    
            }
    
    
    
            if (rate > 100)
    
                rate = 100;
    
            if (random > 10000)
    
                random = 10000;
    
    
    
            if (rate <= 50 && random <= 5000)
    
            {
    
                if (pTable->m_iNum == MATTOCK) {//Normal Mattock ile verilicekler...
    
                    if(GetLevel() > 1 && GetLevel() < 10)
    
                    {
    
                        ExpChange(50);
    
                    } else if(GetLevel() > 10 && GetLevel() < 20) {
    
                        ExpChange(100);
    
                    } else if(GetLevel() > 20 && GetLevel() < 30) {
    
                        ExpChange(200);
    
                    } else if(GetLevel() > 30 && GetLevel() < 40) {
    
                        ExpChange(300);
    
                    } else if(GetLevel() > 40 && GetLevel() < 50) {
    
                        ExpChange(400);
    
                    } else if(GetLevel() > 50 && GetLevel() < 60) {
    
                        ExpChange(500);
    
                    } else if(GetLevel() > 60 && GetLevel() < 70) {
    
                        ExpChange(1000);
    
                    } else if(GetLevel() > 70 && GetLevel() <= 83) {
    
                        ExpChange(2000);
    
                    }
    
                } else if(pTable->m_iNum == GOLDEN_MATTOCK) {//Golden Mattock ile verilicekler.
    
                    if(GetLevel() > 1 && GetLevel() < 10)
    
                    {
    
                        ExpChange(100);
    
                    } else if(GetLevel() > 10 && GetLevel() < 20) {
    
                        ExpChange(200);
    
                    } else if(GetLevel() > 20 && GetLevel() < 30) {
    
                        ExpChange(300);
    
                    } else if(GetLevel() > 30 && GetLevel() < 40) {
    
                        ExpChange(400);
    
                    } else if(GetLevel() > 40 && GetLevel() < 50) {
    
                        ExpChange(500);
    
                    } else if(GetLevel() > 50 && GetLevel() < 60) {
    
                        ExpChange(600);
    
                    } else if(GetLevel() > 60 && GetLevel() < 70) {
    
                        ExpChange(1200);
    
                    } else if(GetLevel() > 70 && GetLevel() <= 83) {
    
                        ExpChange(2400);
    
                    }
    
                }
    
                sEffect = 13082; // "XP" effect
    
            }
    
            else if (rate >= 75 && rate <= 100 && random <= 10000)
    
            {
    
                if (pTable->m_iNum == MATTOCK) { //Normal Mattock İle Verilicekler
    
                    int MiningItemRandomGroup = 0;
    
                    srand((unsigned)time(0));
    
                    MiningItemRandomGroup = rand() % 10;
    
                    switch(MiningItemRandomGroup) {
    
                        case 1:
    
                            GiveItem(379021000); // Blessed Upgrade Scroll EKLİYORUZ...
    
                        break;
    
                        case 2:
    
                            GiveItem(379022000); // Blessed Enchant Scroll(STR) EKLİYORUZ...
    
                        break;
    
                        case 3:
    
                            GiveItem(37902300); // Blessed Immune Scroll EKLİYORUZ...
    
                        break;
    
                        case 4:
    
                            GiveItem(379024000); // Blessed Reduce Scroll EKLİYORUZ...
    
                        break;
    
                        case 5:
    
                            GiveItem(379025000); // Blessed Elemental Scroll EKLİYORUZ...
    
                        break;
    
                        case 6:
    
                            GiveItem(379030000); // Blessed Enchant Scroll(HP) EKLİYORUZ...
    
                        break;
    
                        case 7:
    
                            GiveItem(379031000); // Blessed Enchant Scroll(DEX) EKLİYORUZ...
    
                        break;
    
                        case 8:
    
                            GiveItem(379032000); // Blessed Enchant Scroll(INT) EKLİYORUZ...
    
                        break;
    
                        case 9:
    
                            GiveItem(379033000); // Blessed Enchant Scroll(MAGIC) EKLİYORUZ...
    
                        break;
    
                        case 10:
    
                            GiveItem(379067000); // Silver bar EKLİYORUZ...
    
                        break;
    
                        default:
    
                            GiveItem(389043000); // Sling Ekledik. Eğer Drop Vermesse Diye...
    
                        break;
    
                    }
    
                } else if(pTable->m_iNum == GOLDEN_MATTOCK) {// Golden Mattock ile verilicekler...
    
                    int MiningItemRandomGroup = 0;
    
                    srand((unsigned)time(0));
    
                    MiningItemRandomGroup = rand() % 10;
    
                    switch(MiningItemRandomGroup) {
    
                        case 1:
    
                            GiveItem(379021000); // Blessed Upgrade Scroll EKLİYORUZ...
    
                        break;
    
                        case 2:
    
                            GiveItem(379022000); // Blessed Enchant Scroll(STR) EKLİYORUZ...
    
                        break;
    
                        case 3:
    
                            GiveItem(37902300); // Blessed Immune Scroll EKLİYORUZ...
    
                        break;
    
                        case 4:
    
                            GiveItem(379024000); // Blessed Reduce Scroll EKLİYORUZ...
    
                        break;
    
                        case 5:
    
                            GiveItem(379025000); // Blessed Elemental Scroll EKLİYORUZ...
    
                        break;
    
                        case 6:
    
                            GiveItem(379030000); // Blessed Enchant Scroll(HP) EKLİYORUZ...
    
                        break;
    
                        case 7:
    
                            GiveItem(379031000); // Blessed Enchant Scroll(DEX) EKLİYORUZ...
    
                        break;
    
                        case 8:
    
                            GiveItem(379032000); // Blessed Enchant Scroll(INT) EKLİYORUZ...
    
                        break;
    
                        case 9:
    
                            GiveItem(379033000); // Blessed Enchant Scroll(MAGIC) EKLİYORUZ...
    
                        break;
    
                        case 10:
    
                            GiveItem(379068000); // Gold bar EKLİYORUZ...
    
                        break;
    
                        default:
    
                            GiveItem(389043000); // Sling Ekledik. Eğer Drop Vermesse Diye...
    
                        break;
    
                    }            
    
                }
    
    
    
                sEffect = 13081; // "Item" effect
    
            }
    
            else
    
            {
    
                /*resultCode = MiningResultNothingFound;*/ //Noting Found hatasını bitirdik.
    
            }
    
    
    
            m_tLastMiningAttempt = UNIXTIME;
    
        }
    
    
    
        result << resultCode << GetID() << sEffect;
    
    
    
        ItemWoreOut(ATTACK,100); 
    
    
    
        if (resultCode != MiningResultSuccess
    
            && resultCode != MiningResultNothingFound)
    
        {
    
            // Tell us the error first
    
            Send(&result);
    
    
    
            // and then tell the client to stop mining
    
            HandleMiningStop(pkt);
    
            return;
    
        }
    
    
    
        if(resultCode != MiningResultNothingFound)
    
            SendToRegion(&result);
    
        else if(resultCode == MiningResultNothingFound)
    
            Send(&result);
    
    }
    [/hide]
     
  2. hstsapi

    hstsapi New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    tyyyy
     
  3. chef

    chef Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    Sagol
     
  4. Terry

    Terry New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    Teşekkürler.Bilmeyenler için yararlı paylaşım.
     
  5. kosp51

    kosp51 New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    saol
     
  6. SexyPanda

    SexyPanda New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    sağol baskan
     
  7. rainboy

    rainboy New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    teşekürlerr
     
  8. jarmen

    jarmen New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    teşekürlerr
     
  9. Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    eyvalllahhh
     
  10. Christian

    Christian New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    thanksss
     
  11. mrsleke33

    mrsleke33 New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    teşekkürler
     
  12. albertgurkan

    albertgurkan New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    Tesekkurler!!
     
  13. Ruuuu

    Ruuuu New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    teşekkürler
     
  14. MrProper

    MrProper New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    tskler
     
  15. yigit0999

    yigit0999 New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    tyyyyyyyyyyyyyyyyyyyyyyyyy
     
  16. wiken

    wiken New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    teşekkürler
     
  17. endaxie31

    endaxie31 New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    teşkküeler
     
  18. enaz0369

    enaz0369 New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    rtygjughjhggfhgjhgjhgj
     
  19. venom

    venom New Member

    Cevap: [Paylaşım] Maden Drop & Exp Ayarlama !



    asdasfasgasgasgasgas
     
  20. Nikola

    Nikola New Member

Bu Sayfayı Paylaş