//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 =...
bu kadarına aklım ermiyor girip bakayım da ne yapacağım konusunda ilim tahsil etmedim ağamchar_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.
//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 musunuzC++://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); }
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);
}
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);
}
#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
Çıkarmaz o sistem aktifse o if bloğuna giriyor zaten 2 sistemde aktifse if bloğunun içerisindeki kodlar çalışırC++:#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ı
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Çı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
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üzelicekmiC++: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); }
#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