Slipknight wrote: oh so iDice does'nt effect drop rate at all. Hmm I kinda dont like that.
Let's sit down before we hurt ourselves thinking of how the HGServer works. iDice is not a drop rate controller, or anything for that matter. All it is, is a fancy way to do rand(). It's actually quite strange how it works, but it's easy to use.
iDice(1,5) can only return a number 1-5 correct?
iDice(1,10000) can only return a number 1-10000.
But, iDice(2,10000) returns a number 2-20000.
Code: Select all
int iDice(int iThrow, int iRange)
{
register int i, iRet;
if (iRange <= 0) return 0;
iRet = 0;
for (i = 1; i <= iThrow; i++) {
iRet += (rand() % iRange) + 1;
}
return iRet;
}
It does a for loop depending on iThrow. If iThrow is one (iDice(1,*)) then it only does it once. The higher the iThrow, the more times it goes through meaning it adds them up on top of each other iThrow amount of times meaning the result can be iThrow times bigger. % mean divide and return the remainder. rand() makes a random int between 0 and 32767 (RAND_MAX). If iRange is say, 10, then it takes a random number (let's say 2473), divides it by 10 (247.3), and returns the remainder (3). Adds 1, (4). And adds that to iRet. So there's your result of iDice(1,10). 4.
If you didn't care about that at all, then how you change drop rate is by either: if using hbx sources, changing it in the configs, or for any sources, changing it in the drop function. If you use 2.20 or 2.03, search for iDice(1,6500) and you'll find it unless it was changed. iDice is just a number generator.. not really a controller of parts of the game.