Metinkő +0-+4 kövek kiszedése. SRC

Indította xTryx, 2018-02-18, 18:58:52

2018-02-18, 18:58:52 Utolsó szerkesztés: 2018-02-18, 19:00:57 Szerző: xTryx
Nem vagyok egy nagy c++ zseni, hogyan kellene ezt módosítani úgy, hogy a köveket ne dobja de a mob_drop_item dropp megmaradjon.

Char.cpp
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ľż Áő°ˇ
}
}
}
}
}

constants.cpp
const SStoneDropInfo aStoneDrop[STONE_INFO_MAX_NUM] =
{
//  mob pct {+0 +1 +2 +3 +4}
{8005, 60, {30, 30, 30, 9, 1} },
{8006, 60, {28, 29, 31, 11, 1} },
{8007, 60, {24, 29, 32, 13, 2} },
{8008, 60, {22, 28, 33, 15, 2} },
{8009, 60, {21, 27, 33, 17, 2} },
{8010, 60, {18, 26, 34, 20, 2} },
{8011, 60, {14, 26, 35, 22, 3} },
{8012, 60, {10, 26, 37, 24, 3} },
{8013, 60, {2, 26, 40, 29, 3} },
{8014, 60, {0, 26, 41, 30, 3} },
};