Yardım Yere düşen yanglar hakkında

  • Konuyu açan Konuyu açan DarkNight
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 13
  • Gösterim Gösterim 84
Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

DarkNight

Üye
Üye
Mesaj
153
Çözümler
8
Beğeni
36
Puan
454
Ticaret Puanı
0
Güzide forumun değerli üyeleri kıymetli dostlarım, şöyle ki moblardan ve metinden düşen yanglar sağa sola çok dağıldığı için direkt envantere gelmesini istiyorum. Bu konunun sağlıklı ve olması gereken çözümü nedir acaba?
 
Çözüm
C++:
Genişlet Daralt Kopyala
//service.h aç müsait bir yere ekle: #define ENABLE_DROP_GOLD

// char_battle.cpp aç -> Arat: void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
 
// Komple kod bloğunu değiştir:

void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // 제3의 손
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- 돈 드롭 확률 계산 ----------
    //
    int iGoldPercent =...
char_battle.cpp de RewardGold fonksiyonu var onun içine bak oraya pointchange ile point_gold ekle düşen gold değişkeni vs. vardır 2. Argümanada onu eklersin.
 
C++:
Genişlet Daralt Kopyala
//service.h aç müsait bir yere ekle: #define ENABLE_DROP_GOLD

// char_battle.cpp aç -> Arat: void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
 
// Komple kod bloğunu değiştir:

void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // 제3의 손
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- 돈 드롭 확률 계산 ----------
    //
    int iGoldPercent = MobRankStats[GetMobRank()].iGoldPercent;

    if (pkAttacker->IsPC())
        iGoldPercent = iGoldPercent * (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD_DROP)) / 100;

    if (pkAttacker->GetPoint(POINT_MALL_GOLDBONUS))
        iGoldPercent += (iGoldPercent * pkAttacker->GetPoint(POINT_MALL_GOLDBONUS) / 100);

    iGoldPercent = iGoldPercent * CHARACTER_MANAGER::instance().GetMobGoldDropRate(pkAttacker) / 100;

    // ADD_PREMIUM
    if (pkAttacker->GetPremiumRemainSeconds(PREMIUM_GOLD) > 0 ||
        pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_LUCKY_GOLD))
        iGoldPercent += iGoldPercent;
    // END_OF_ADD_PREMIUM

    if (iGoldPercent > 100)
        iGoldPercent = 100;

    int iPercent;

    if (GetMobRank() >= MOB_RANK_BOSS)
        iPercent = ((iGoldPercent * PERCENT_LVDELTA_BOSS(pkAttacker->GetLevel(), GetLevel())) / 100);
    else
        iPercent = ((iGoldPercent * PERCENT_LVDELTA(pkAttacker->GetLevel(), GetLevel())) / 100);
    //int iPercent = CALCULATE_VALUE_LVDELTA(pkAttacker->GetLevel(), GetLevel(), iGoldPercent);

    if (number(1, 100) > iPercent)
        return;

    int iGoldMultipler = GetGoldMultipler();

    if (1 == number(1, 50000)) // 1/50000 확률로 돈이 10배
        iGoldMultipler *= 10;
    else if (1 == number(1, 10000)) // 1/10000 확률로 돈이 5배
        iGoldMultipler *= 5;

    // 개인 적용
    if (pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
        if (number(1, 100) <= pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
            iGoldMultipler *= 2;

    //
    // --------- 돈 드롭 배수 결정 ----------
    //
    if (test_server)
        pkAttacker->ChatPacket(CHAT_TYPE_PARTY, "gold_mul %d rate %d", iGoldMultipler, CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker));

    //
    // --------- 실제 드롭 처리 -------------
    //
    LPITEM item;

    int iGold10DropPct = 100;
    iGold10DropPct = (iGold10DropPct * 100) / (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD10_DROP));

    // MOB_RANK가 BOSS보다 높으면 무조건 돈폭탄
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10; // 1% 확률로 돈 10배

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

            if (test_server)
            {
                sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
                sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
            }

            // NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음

#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#else
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    // 1% 확률로 돈을 10개 떨어 뜨린다. (10배 드롭임)
    else if (1 == number(1, iGold10DropPct))
    {
        //
        // 돈 폭탄식 드롭
        //
        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#else
            // NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    else
    {
        //
        // 일반적인 방식의 돈 드롭
        //
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3 && !LC_IsYMIR())
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            iTotalGold += iGold; // Total gold

            for (int i = 0; i < iSplitCount; ++i)
            {
                if (isAutoLoot)
                {
                    pkAttacker->GiveGold(iGold / iSplitCount);
                }
#ifdef ENABLE_DROP_GOLD
                pkAttacker->PointChange(POINT_GOLD, iGold / iSplitCount, false);
#else
                else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#endif
            }
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
 
Çözüm
C++:
Genişlet Daralt Kopyala
//service.h aç müsait bir yere ekle: #define ENABLE_DROP_GOLD

// char_battle.cpp aç -> Arat: void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
 
// Komple kod bloğunu değiştir:

void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // 제3의 손
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- 돈 드롭 확률 계산 ----------
    //
    int iGoldPercent = MobRankStats[GetMobRank()].iGoldPercent;

    if (pkAttacker->IsPC())
        iGoldPercent = iGoldPercent * (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD_DROP)) / 100;

    if (pkAttacker->GetPoint(POINT_MALL_GOLDBONUS))
        iGoldPercent += (iGoldPercent * pkAttacker->GetPoint(POINT_MALL_GOLDBONUS) / 100);

    iGoldPercent = iGoldPercent * CHARACTER_MANAGER::instance().GetMobGoldDropRate(pkAttacker) / 100;

    // ADD_PREMIUM
    if (pkAttacker->GetPremiumRemainSeconds(PREMIUM_GOLD) > 0 ||
        pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_LUCKY_GOLD))
        iGoldPercent += iGoldPercent;
    // END_OF_ADD_PREMIUM

    if (iGoldPercent > 100)
        iGoldPercent = 100;

    int iPercent;

    if (GetMobRank() >= MOB_RANK_BOSS)
        iPercent = ((iGoldPercent * PERCENT_LVDELTA_BOSS(pkAttacker->GetLevel(), GetLevel())) / 100);
    else
        iPercent = ((iGoldPercent * PERCENT_LVDELTA(pkAttacker->GetLevel(), GetLevel())) / 100);
    //int iPercent = CALCULATE_VALUE_LVDELTA(pkAttacker->GetLevel(), GetLevel(), iGoldPercent);

    if (number(1, 100) > iPercent)
        return;

    int iGoldMultipler = GetGoldMultipler();

    if (1 == number(1, 50000)) // 1/50000 확률로 돈이 10배
        iGoldMultipler *= 10;
    else if (1 == number(1, 10000)) // 1/10000 확률로 돈이 5배
        iGoldMultipler *= 5;

    // 개인 적용
    if (pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
        if (number(1, 100) <= pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
            iGoldMultipler *= 2;

    //
    // --------- 돈 드롭 배수 결정 ----------
    //
    if (test_server)
        pkAttacker->ChatPacket(CHAT_TYPE_PARTY, "gold_mul %d rate %d", iGoldMultipler, CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker));

    //
    // --------- 실제 드롭 처리 -------------
    //
    LPITEM item;

    int iGold10DropPct = 100;
    iGold10DropPct = (iGold10DropPct * 100) / (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD10_DROP));

    // MOB_RANK가 BOSS보다 높으면 무조건 돈폭탄
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10; // 1% 확률로 돈 10배

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

            if (test_server)
            {
                sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
                sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
            }

            // NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음

#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#else
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    // 1% 확률로 돈을 10개 떨어 뜨린다. (10배 드롭임)
    else if (1 == number(1, iGold10DropPct))
    {
        //
        // 돈 폭탄식 드롭
        //
        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#else
            // NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    else
    {
        //
        // 일반적인 방식의 돈 드롭
        //
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3 && !LC_IsYMIR())
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            iTotalGold += iGold; // Total gold

            for (int i = 0; i < iSplitCount; ++i)
            {
                if (isAutoLoot)
                {
                    pkAttacker->GiveGold(iGold / iSplitCount);
                }
#ifdef ENABLE_DROP_GOLD
                pkAttacker->PointChange(POINT_GOLD, iGold / iSplitCount, false);
#else
                else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#endif
            }
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
bende bu kod bloğu içinde battle pass defineleri var atsam yardımcı olur musunuz
 
C++:
Genişlet Daralt Kopyala
void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
         pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // Á¦3ÀÇ ¼Õ
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- µ· µå·Ó È®·ü °è»ê ----------
    //
    int iGoldPercent = MobRankStats[GetMobRank()].iGoldPercent;

    if (pkAttacker->IsPC())
        iGoldPercent = iGoldPercent * (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD_DROP)) / 100;

    if (pkAttacker->GetPoint(POINT_MALL_GOLDBONUS))
        iGoldPercent += (iGoldPercent * pkAttacker->GetPoint(POINT_MALL_GOLDBONUS) / 100);

    iGoldPercent = iGoldPercent * CHARACTER_MANAGER::instance().GetMobGoldDropRate(pkAttacker) / 100;

    // ADD_PREMIUM
    if (pkAttacker->GetPremiumRemainSeconds(PREMIUM_GOLD) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_LUCKY_GOLD))
        iGoldPercent += iGoldPercent;
    // END_OF_ADD_PREMIUM

    if (iGoldPercent > 100)
        iGoldPercent = 100;

    int iPercent;

    if (GetMobRank() >= MOB_RANK_BOSS)
        iPercent = ((iGoldPercent * PERCENT_LVDELTA_BOSS(pkAttacker->GetLevel(), GetLevel())) / 100);
    else
        iPercent = ((iGoldPercent * PERCENT_LVDELTA(pkAttacker->GetLevel(), GetLevel())) / 100);
    //int iPercent = CALCULATE_VALUE_LVDELTA(pkAttacker->GetLevel(), GetLevel(), iGoldPercent);

    if (number(1, 100) > iPercent)
        return;

    int iGoldMultipler = GetGoldMultipler();

    if (1 == number(1, 50000)) // 1/50000 È®·ü·Î µ·ÀÌ 10¹è
        iGoldMultipler *= 10;
    else if (1 == number(1, 10000)) // 1/10000 È®·ü·Î µ·ÀÌ 5¹è
        iGoldMultipler *= 5;

    // °³ÀÎ Àû¿ë
    if (pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
        if (number(1, 100) <= pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
            iGoldMultipler *= 2;

    //
    // --------- µ· µå·Ó ¹è¼ö °áÁ¤ ----------
    //
    if (test_server)
        pkAttacker->ChatPacket(CHAT_TYPE_PARTY, "gold_mul %d rate %d", iGoldMultipler, CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker));

    //
    // --------- ½ÇÁ¦ µå·Ó ó¸® -------------
    //
    LPITEM item;

    int iGold10DropPct = 100;
    iGold10DropPct = (iGold10DropPct * 100) / (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD10_DROP));

    // MOB_RANK°¡ BOSSº¸´Ù ³ôÀ¸¸é ¹«Á¶°Ç µ·Æøź
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10; // 1% È®·ü·Î µ· 10¹è

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue ;
            }

            if (test_server)
            {
                sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
                sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
            }

            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
        }
    }
    // 1% È®·ü·Î µ·À» 10°³ ¶³¾î ¶ß¸°´Ù. (10¹è µå·ÓÀÓ)
    else if (1 == number(1, iGold10DropPct))
    {
        //
        // µ· Æøź½Ä µå·Ó
        //
        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
        }
    }
    else
    {
        //
        // ÀϹÝÀûÀÎ ¹æ½ÄÀÇ µ· µå·Ó
        //
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3 && !LC_IsYMIR())
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            iTotalGold += iGold; // Total gold

            for (int i = 0; i < iSplitCount; ++i)
            {
                if (isAutoLoot)
                {
#ifdef ENABLE_BATTLE_PASS
                    if (!pkAttacker->v_counts.empty())
                    {
                        for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                        {
                            if (pkAttacker->missions_bp[i].type == 9){ pkAttacker->DoMission(i, iGold / iSplitCount); }
                        }
                    }
#endif
                    pkAttacker->GiveGold(iGold / iSplitCount);
                }
                else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
            }
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
 
C++:
Genişlet Daralt Kopyala
void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
         pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // Á¦3ÀÇ ¼Õ
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- µ· µå·Ó È®·ü °è»ê ----------
    //
    int iGoldPercent = MobRankStats[GetMobRank()].iGoldPercent;

    if (pkAttacker->IsPC())
        iGoldPercent = iGoldPercent * (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD_DROP)) / 100;

    if (pkAttacker->GetPoint(POINT_MALL_GOLDBONUS))
        iGoldPercent += (iGoldPercent * pkAttacker->GetPoint(POINT_MALL_GOLDBONUS) / 100);

    iGoldPercent = iGoldPercent * CHARACTER_MANAGER::instance().GetMobGoldDropRate(pkAttacker) / 100;

    // ADD_PREMIUM
    if (pkAttacker->GetPremiumRemainSeconds(PREMIUM_GOLD) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_LUCKY_GOLD))
        iGoldPercent += iGoldPercent;
    // END_OF_ADD_PREMIUM

    if (iGoldPercent > 100)
        iGoldPercent = 100;

    int iPercent;

    if (GetMobRank() >= MOB_RANK_BOSS)
        iPercent = ((iGoldPercent * PERCENT_LVDELTA_BOSS(pkAttacker->GetLevel(), GetLevel())) / 100);
    else
        iPercent = ((iGoldPercent * PERCENT_LVDELTA(pkAttacker->GetLevel(), GetLevel())) / 100);
    //int iPercent = CALCULATE_VALUE_LVDELTA(pkAttacker->GetLevel(), GetLevel(), iGoldPercent);

    if (number(1, 100) > iPercent)
        return;

    int iGoldMultipler = GetGoldMultipler();

    if (1 == number(1, 50000)) // 1/50000 È®·ü·Î µ·ÀÌ 10¹è
        iGoldMultipler *= 10;
    else if (1 == number(1, 10000)) // 1/10000 È®·ü·Î µ·ÀÌ 5¹è
        iGoldMultipler *= 5;

    // °³ÀÎ Àû¿ë
    if (pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
        if (number(1, 100) <= pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
            iGoldMultipler *= 2;

    //
    // --------- µ· µå·Ó ¹è¼ö °áÁ¤ ----------
    //
    if (test_server)
        pkAttacker->ChatPacket(CHAT_TYPE_PARTY, "gold_mul %d rate %d", iGoldMultipler, CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker));

    //
    // --------- ½ÇÁ¦ µå·Ó ó¸® -------------
    //
    LPITEM item;

    int iGold10DropPct = 100;
    iGold10DropPct = (iGold10DropPct * 100) / (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD10_DROP));

    // MOB_RANK°¡ BOSSº¸´Ù ³ôÀ¸¸é ¹«Á¶°Ç µ·Æøź
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10; // 1% È®·ü·Î µ· 10¹è

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue ;
            }

            if (test_server)
            {
                sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
                sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
            }

            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#else
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    // 1% È®·ü·Î µ·À» 10°³ ¶³¾î ¶ß¸°´Ù. (10¹è µå·ÓÀÓ)
    else if (1 == number(1, iGold10DropPct))
    {
        //
        // µ· Æøź½Ä µå·Ó
        //
        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#ifdef ENABLE_BATTLE_PASS
            if (!pkAttacker->v_counts.empty())
            {
                for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                {
                    if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                }
            }
#endif
#else
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    else
    {
        //
        // ÀϹÝÀûÀÎ ¹æ½ÄÀÇ µ· µå·Ó
        //
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3 && !LC_IsYMIR())
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            iTotalGold += iGold; // Total gold

            for (int i = 0; i < iSplitCount; ++i)
            {
                if (isAutoLoot)
                {
#ifdef ENABLE_BATTLE_PASS
                    if (!pkAttacker->v_counts.empty())
                    {
                        for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                        {
                            if (pkAttacker->missions_bp[i].type == 9){ pkAttacker->DoMission(i, iGold / iSplitCount); }
                        }
                    }
#endif
                    pkAttacker->GiveGold(iGold / iSplitCount);
                }
#ifdef ENABLE_DROP_GOLD
                pkAttacker->PointChange(POINT_GOLD, iGold / iSplitCount, false);
#else
                else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#endif
            }
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
şu şekilde bir dener misin battle pass görevlerini de test et bakalım anormallik oluşucak mı
service.h dosyasına #define ENABLE_DROP_GOLD eklemeyi unutma
 
C++:
Genişlet Daralt Kopyala
#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#ifdef ENABLE_BATTLE_PASS
            if (!pkAttacker->v_counts.empty())
            {
                for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                {
                    if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                }
            }
#endif
#else
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif

Hocam bu doğru bi kullanım mı bilmediim için soruyorum, bir ifdefin endifi gelmeden araya farklı bir ifdef endif girmesi sıkıntı çıkarır mı
 
C++:
Genişlet Daralt Kopyala
#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#ifdef ENABLE_BATTLE_PASS
            if (!pkAttacker->v_counts.empty())
            {
                for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                {
                    if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                }
            }
#endif
#else
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif

Hocam bu doğru bi kullanım mı bilmediim için soruyorum, bir ifdefin endifi gelmeden araya farklı bir ifdef endif girmesi sıkıntı çıkarır mı
Çıkarmaz o sistem aktifse o if bloğuna giriyor zaten 2 sistemde aktifse if bloğunun içerisindeki kodlar çalışır
 
Çıkarmaz o sistem aktifse o if bloğuna giriyor zaten 2 sistemde aktifse if bloğunun içerisindeki kodlar çalışır
Eklemeyi yaptım çalışıyor ancak grup kurulu iken normalde yere düşen yangı grup üyesi sayısına bölüp envantere alması gerekirken sadece slot veya metin kesen çara yang gidiyor, gruptaki diğer karaktere yang gitmiyor
 
Eklemeyi yaptım çalışıyor ancak grup kurulu iken normalde yere düşen yangı grup üyesi sayısına bölüp envantere alması gerekirken sadece slot veya metin kesen çara yang gidiyor, gruptaki diğer karaktere yang gitmiyor
C++:
Genişlet Daralt Kopyala
void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
         pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // Á¦3ÀÇ ¼Õ
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- µ· µå·Ó È®·ü °è»ê ----------
    //
    int iGoldPercent = MobRankStats[GetMobRank()].iGoldPercent;

    if (pkAttacker->IsPC())
        iGoldPercent = iGoldPercent * (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD_DROP)) / 100;

    if (pkAttacker->GetPoint(POINT_MALL_GOLDBONUS))
        iGoldPercent += (iGoldPercent * pkAttacker->GetPoint(POINT_MALL_GOLDBONUS) / 100);

    iGoldPercent = iGoldPercent * CHARACTER_MANAGER::instance().GetMobGoldDropRate(pkAttacker) / 100;

    // ADD_PREMIUM
    if (pkAttacker->GetPremiumRemainSeconds(PREMIUM_GOLD) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_LUCKY_GOLD))
        iGoldPercent += iGoldPercent;
    // END_OF_ADD_PREMIUM

    if (iGoldPercent > 100)
        iGoldPercent = 100;

    int iPercent;

    if (GetMobRank() >= MOB_RANK_BOSS)
        iPercent = ((iGoldPercent * PERCENT_LVDELTA_BOSS(pkAttacker->GetLevel(), GetLevel())) / 100);
    else
        iPercent = ((iGoldPercent * PERCENT_LVDELTA(pkAttacker->GetLevel(), GetLevel())) / 100);
    //int iPercent = CALCULATE_VALUE_LVDELTA(pkAttacker->GetLevel(), GetLevel(), iGoldPercent);

    if (number(1, 100) > iPercent)
        return;

    int iGoldMultipler = GetGoldMultipler();

    if (1 == number(1, 50000)) // 1/50000 È®·ü·Î µ·ÀÌ 10¹è
        iGoldMultipler *= 10;
    else if (1 == number(1, 10000)) // 1/10000 È®·ü·Î µ·ÀÌ 5¹è
        iGoldMultipler *= 5;

    // °³ÀÎ Àû¿ë
    if (pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
        if (number(1, 100) <= pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
            iGoldMultipler *= 2;

    //
    // --------- µ· µå·Ó ¹è¼ö °áÁ¤ ----------
    //
    if (test_server)
        pkAttacker->ChatPacket(CHAT_TYPE_PARTY, "gold_mul %d rate %d", iGoldMultipler, CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker));

    //
    // --------- ½ÇÁ¦ µå·Ó ó¸® -------------
    //
    LPITEM item;

    int iGold10DropPct = 100;
    iGold10DropPct = (iGold10DropPct * 100) / (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD10_DROP));

    // MOB_RANK°¡ BOSSº¸´Ù ³ôÀ¸¸é ¹«Á¶°Ç µ·Æøź
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10; // 1% È®·ü·Î µ· 10¹è

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue ;
            }

            if (test_server)
            {
                sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
                sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
            }

            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
#ifdef ENABLE_DROP_GOLD
            if ((item = ITEM_MANAGER::instance().AutoGiveItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#else
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    // 1% È®·ü·Î µ·À» 10°³ ¶³¾î ¶ß¸°´Ù. (10¹è µå·ÓÀÓ)
    else if (1 == number(1, iGold10DropPct))
    {
        //
        // µ· Æøź½Ä µå·Ó
        //
        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

#ifdef ENABLE_DROP_GOLD
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().AutoGiveItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#else
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    else
    {
        //
        // ÀϹÝÀûÀÎ ¹æ½ÄÀÇ µ· µå·Ó
        //
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3 && !LC_IsYMIR())
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            iTotalGold += iGold; // Total gold

            for (int i = 0; i < iSplitCount; ++i)
            {
                if (isAutoLoot)
                {
#ifdef ENABLE_BATTLE_PASS
                    if (!pkAttacker->v_counts.empty())
                    {
                        for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                        {
                            if (pkAttacker->missions_bp[i].type == 9){ pkAttacker->DoMission(i, iGold / iSplitCount); }
                        }
                    }
#endif
                    pkAttacker->GiveGold(iGold / iSplitCount);
                }
#ifdef ENABLE_DROP_GOLD
                else if ((item = ITEM_MANAGER::instance().AutoGiveItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#else
                else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#endif
            }
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
Şu şekilde bir denermisin tekrar bakalım düzelicekmi
 
C++:
Genişlet Daralt Kopyala
void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
{
    // ADD_PREMIUM
    bool isAutoLoot =
        (pkAttacker->GetPremiumRemainSeconds(PREMIUM_AUTOLOOT) > 0 ||
         pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_AUTOLOOT))
        ? true : false; // Á¦3ÀÇ ¼Õ
    // END_OF_ADD_PREMIUM

    PIXEL_POSITION pos;

    if (!isAutoLoot)
        if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
            return;

    int iTotalGold = 0;
    //
    // --------- µ· µå·Ó È®·ü °è»ê ----------
    //
    int iGoldPercent = MobRankStats[GetMobRank()].iGoldPercent;

    if (pkAttacker->IsPC())
        iGoldPercent = iGoldPercent * (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD_DROP)) / 100;

    if (pkAttacker->GetPoint(POINT_MALL_GOLDBONUS))
        iGoldPercent += (iGoldPercent * pkAttacker->GetPoint(POINT_MALL_GOLDBONUS) / 100);

    iGoldPercent = iGoldPercent * CHARACTER_MANAGER::instance().GetMobGoldDropRate(pkAttacker) / 100;

    // ADD_PREMIUM
    if (pkAttacker->GetPremiumRemainSeconds(PREMIUM_GOLD) > 0 ||
            pkAttacker->IsEquipUniqueGroup(UNIQUE_GROUP_LUCKY_GOLD))
        iGoldPercent += iGoldPercent;
    // END_OF_ADD_PREMIUM

    if (iGoldPercent > 100)
        iGoldPercent = 100;

    int iPercent;

    if (GetMobRank() >= MOB_RANK_BOSS)
        iPercent = ((iGoldPercent * PERCENT_LVDELTA_BOSS(pkAttacker->GetLevel(), GetLevel())) / 100);
    else
        iPercent = ((iGoldPercent * PERCENT_LVDELTA(pkAttacker->GetLevel(), GetLevel())) / 100);
    //int iPercent = CALCULATE_VALUE_LVDELTA(pkAttacker->GetLevel(), GetLevel(), iGoldPercent);

    if (number(1, 100) > iPercent)
        return;

    int iGoldMultipler = GetGoldMultipler();

    if (1 == number(1, 50000)) // 1/50000 È®·ü·Î µ·ÀÌ 10¹è
        iGoldMultipler *= 10;
    else if (1 == number(1, 10000)) // 1/10000 È®·ü·Î µ·ÀÌ 5¹è
        iGoldMultipler *= 5;

    // °³ÀÎ Àû¿ë
    if (pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
        if (number(1, 100) <= pkAttacker->GetPoint(POINT_GOLD_DOUBLE_BONUS))
            iGoldMultipler *= 2;

    //
    // --------- µ· µå·Ó ¹è¼ö °áÁ¤ ----------
    //
    if (test_server)
        pkAttacker->ChatPacket(CHAT_TYPE_PARTY, "gold_mul %d rate %d", iGoldMultipler, CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker));

    //
    // --------- ½ÇÁ¦ µå·Ó ó¸® -------------
    //
    LPITEM item;

    int iGold10DropPct = 100;
    iGold10DropPct = (iGold10DropPct * 100) / (100 + CPrivManager::instance().GetPriv(pkAttacker, PRIV_GOLD10_DROP));

    // MOB_RANK°¡ BOSSº¸´Ù ³ôÀ¸¸é ¹«Á¶°Ç µ·Æøź
    if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    {
        if (1 == number(1, iGold10DropPct))
            iGoldMultipler *= 10; // 1% È®·ü·Î µ· 10¹è

        int iSplitCount = number(25, 35);

        for (int i = 0; i < iSplitCount; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
            if (test_server)
                sys_log(0, "iGold %d", iGold);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue ;
            }

            if (test_server)
            {
                sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
                sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
            }

            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
#ifdef ENABLE_DROP_GOLD
            if ((item = ITEM_MANAGER::instance().AutoGiveItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#else
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
                pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);

                item->AddToGround(GetMapIndex(), pos);
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    // 1% È®·ü·Î µ·À» 10°³ ¶³¾î ¶ß¸°´Ù. (10¹è µå·ÓÀÓ)
    else if (1 == number(1, iGold10DropPct))
    {
        //
        // µ· Æøź½Ä µå·Ó
        //
        for (int i = 0; i < 10; ++i)
        {
            int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
            iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
            iGold *= iGoldMultipler;

            if (iGold == 0)
            {
                continue;
            }

#ifdef ENABLE_DROP_GOLD
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().AutoGiveItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#else
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
        }
    }
    else
    {
        //
        // ÀϹÝÀûÀÎ ¹æ½ÄÀÇ µ· µå·Ó
        //
        int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
        iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
        iGold *= iGoldMultipler;

        int iSplitCount;

        if (iGold >= 3 && !LC_IsYMIR())
            iSplitCount = number(1, 3);
        else if (GetMobRank() >= MOB_RANK_BOSS)
        {
            iSplitCount = number(3, 10);

            if ((iGold / iSplitCount) == 0)
                iSplitCount = 1;
        }
        else
            iSplitCount = 1;

        if (iGold != 0)
        {
            iTotalGold += iGold; // Total gold

            for (int i = 0; i < iSplitCount; ++i)
            {
                if (isAutoLoot)
                {
#ifdef ENABLE_BATTLE_PASS
                    if (!pkAttacker->v_counts.empty())
                    {
                        for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                        {
                            if (pkAttacker->missions_bp[i].type == 9){ pkAttacker->DoMission(i, iGold / iSplitCount); }
                        }
                    }
#endif
                    pkAttacker->GiveGold(iGold / iSplitCount);
                }
#ifdef ENABLE_DROP_GOLD
                else if ((item = ITEM_MANAGER::instance().AutoGiveItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#else
                else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
                {
                    pos.x = GetX() + (number(-7, 7) * 20);
                    pos.y = GetY() + (number(-7, 7) * 20);

                    item->AddToGround(GetMapIndex(), pos);
                    item->StartDestroyEvent();
                }
#endif
            }
        }
    }

    DBManager::instance().SendMoneyLog(MONEY_LOG_MONSTER, GetRaceNum(), iTotalGold);
}
Şu şekilde bir denermisin tekrar bakalım düzelicekmi
1731176711964.webp
 
C++:
Genişlet Daralt Kopyala
#ifdef ENABLE_DROP_GOLD
            pkAttacker->PointChange(POINT_GOLD, iGold, false);
            iTotalGold += iGold; // Total gold
#ifdef ENABLE_BATTLE_PASS
            if (!pkAttacker->v_counts.empty())
            {
                for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                {
                    if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                }
            }
#endif
#else
            // NOTE: µ· ÆøźÀº Á¦ 3ÀÇ ¼Õ 󸮸¦ ÇÏÁö ¾ÊÀ½
            if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
            {
                pos.x = GetX() + (number(-7, 7) * 20);
                pos.y = GetY() + (number(-7, 7) * 20);

                item->AddToGround(GetMapIndex(), pos);
#ifdef ENABLE_BATTLE_PASS
                if (!pkAttacker->v_counts.empty())
                {
                    for (int i = 0; i<pkAttacker->missions_bp.size(); ++i)
                    {
                        if (pkAttacker->missions_bp[i].type == 10 && item->GetVnum() == pkAttacker->missions_bp[i].vnum){ pkAttacker->DoMission(i, 1); }
                    }
                }
#endif
                item->StartDestroyEvent();

                iTotalGold += iGold; // Total gold
            }
#endif
Bu yapıdan devam et grup işini çözebilecek bir arkadaş varsa yardımcı olsun orayı bende anlamadım :(
 
Geri
Üst