hey everyone,
off topic:
I know i haven't posted in a few months and i sort of abandoned my old project, but that was because i realized that it didn't have very much potential as it was created in visual basic. Anyways, now i'm back and i've started a new project, this time in c++, and i already have the client connecting using boost::asio.
On topic:
So i was looking through the drop rate file in data.res (propmoverex.inc) and i found this table.
Code:
/3000000000 percent 100/ decimal
9375 0.0003125% 320000 0.000003125
18750 0.000625% 160000 0.00000625
37500 0.00125% 80000 0.0000125
75000 0.0025% 40000 0.000025
150000 0.005% 20000 0.00005
300000 0.01% 10000 0.0001
1000000 0.0333% 3000 0.000333
1875000 0.0625% 1600 0.000625
3000000 0.1% 1000 0.001
3750000 0.125% 800 0.00125
5000000 0.166% 600 0.00166
7500000 0.25% 400 0.0025
15000000 0.5% 200 0.005
30000000 1% 100 0.01
300000000 10% 10 0.1
3000000000 100% 1 1
(i added the decimal column.)
i don't know if any of the devs know about this, or even need this, but i'm going to explain this to help anyone that might need it and for future reference.
So the number in the left column / 3000000000 equals the corresponding percent in the second column.
100 / the number in the right column equals the corresponding percent in the second column.
And, obviously, the second column is the percentage of the item dropping.
In propmoverex.inc, each monster has something similar to this.
(giant aibatt):
Code:
mi_aibatt4
{
maxitem = 5;
dropgold(78, 113);
dropkind(ik3_swd, 1, 6);
dropkind(ik3_helmet, 1, 6);
dropkind(ik3_suit, 1, 6);
dropkind(ik3_gauntlet, 1, 6);
dropkind(ik3_boots, 1, 6);
dropkind(ik3_shield, 1, 6);
dropitem(ii_gen_mat_ele_flame, 3750000, 0, 1); //¼ó¼º 䫵å3 0.125%
dropitem(ii_gen_mat_ele_touch, 7500000, 0, 1); //¼ó¼º 䫵å2 0.25%
dropitem(ii_gen_mat_orichalcum01, 3006250, 0, 1);
dropitem(ii_gen_mat_moonstone, 1560000, 0, 1);
dropitem(ii_gen_gem_gem_twinklestone, 1000000000, 0, 1);
dropitem(ii_gen_gem_gem_twinklestone, 1000000000, 0, 1);
dropitem(ii_gen_foo_ins_lollipop, 1000000001, 0, 1);
dropitem(ii_gen_foo_ins_lollipop, 1000000001, 0, 1);
dropitem(ii_gen_foo_ins_lollipop, 1000000001, 0, 1);
dropitem(ii_gen_foo_ice_orangejuiice, 600000001, 0, 1);
dropitem(ii_gen_foo_ice_orangejuiice, 600000001, 0, 1);
m_dwattackmovedelay = 0;
m_dwrunawaydelay = 1000;
setrunaway( 10, mi_aibatt2, 5 );
m_nattackfirstrange = 8;
ai
{
#scan
{
scan
}
#battle
{
attack cunning low
recovery 10 50 100 m
evade 20
}
#move
{
loot d 5
}
}
}
here is a possible dropitem() function.
(lmao i don't know what the last two parameters are for the dropitem() function...)
note: In this example, rate refers to the number in the first column of the table above.
Note 2: This is not a working example as i am still working on it :p
note 3: I divide rate / 100000 because unsigned long is too big for the rand() function.
Code:
void dropitem(int itemid, unsigned long rate, ??, ??)
{
rate = rate / 100000;
int randnum = 0;
srand(time(null));
randnum = rand();
if(randnum > 30000)
randnum = 30000;
if((float)randnum / 30000 <= (float)rate / 30000)
{
...
}
}
well i tested out the above code and it seems to be pretty accurate. (if you want my testing code just ask or pm me)
so that's it i hope it helped someone :d:
P.s. If i feel like working on this guide more i might extend on it.