Quote:
Originally Posted by .SnoX
Wir suchen:
PHP Code:
nloop += pAttacker->GetAdjParam( DST_GIFTBOX );
fügen das darunter ein:
PHP Code:
#ifdef __DST_PENYA if( pAttacker->GetAdjParam( DST_PENYA ) > 0 ) { npenyafaktor *= pAttacker->GetAdjParam( DST_PENYA ); } #endif // __DST_PENYA
|
Surely this is done incorrectly?
Shouldn't it be something like
PHP Code:
#ifdef __DST_PENYA
if( pAttacker->GetAdjParam( DST_PENYA ) > 0 )
{
npenyafaktor += pAttacker->GetAdjParam( DST_PENYA );
}
#endif // __DST_PENYA
Obviously depending on how you wish to store to modifier (if it is 1 like lucky box or 100% like exp rate.)
Either way shouldn't it be done by adding it on to the original amount, as if you have 1 factor to begin with, then add an item that gives another 1 factor, it ends up being 1 factor still after you multiply it out (1 *= 1 == 1)?
If you want precise penya, where it is done based on percentage, then you can do the following instead
PHP Code:
#ifdef __DST_PENYA
if( pAttacker->GetAdjParam( DST_PENYA ) > 0 )
{
npenyafaktor += (float)((float)pAttacker->GetAdjParam( DST_PENYA ) / 100.0f);
}
#endif // __DST_PENYA
in this case npenyafaktor should be a float instead of an int.
So instead of the following code
PHP Code:
#ifdef __DST_PENYA
int npenyafaktor = 1;
#endif // __DST_PENYA
Use this instead
PHP Code:
#ifdef __DST_PENYA
float npenyafaktor = 1;
#endif // __DST_PENYA