void CHARACTER::DetermineDropMetinStone()
{
const int METIN_STONE_NUM = 14;
static DWORD c_adwMetin[METIN_STONE_NUM] =
{
28030,
28031,
28032,
28033,
28034,
28035,
28036,
28037,
28038,
28039,
28040,
28041,
28042,
28043,
};
DWORD stone_num = GetRaceNum();
int idx = std::lower_bound(aStoneDrop, aStoneDrop+STONE_INFO_MAX_NUM, stone_num) - aStoneDrop;
if (idx >= STONE_INFO_MAX_NUM || aStoneDrop[idx].dwMobVnum != stone_num)
{
m_dwDropMetinStone = 0;
}
else
{
const SStoneDropInfo & info = aStoneDrop[idx];
m_bDropMetinStonePct = info.iDropPct;
{
m_dwDropMetinStone = c_adwMetin[number(0, METIN_STONE_NUM - 1)];
int iGradePct = number(1, 100);
for (int iStoneLevel = 0; iStoneLevel < STONE_LEVEL_MAX_NUM; iStoneLevel ++)
{
int iLevelGradePortion = info.iLevelPct[iStoneLevel];
if (iGradePct <= iLevelGradePortion)
{
break;
}
else
{
iGradePct -= iLevelGradePortion;
m_dwDropMetinStone += 100; // µ¹ +a -> +(a+1)ÀÌ µÉ¶§¸¶´Ù 100¾¿ Áõ°¡
}
}
}
}
}