Issue Information
-
#001927
-
2 - Fair
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by Inkfish
http://www.eathena.w...er&showbug=1927
I found that a rand() command cannot rand a number higer than 10000 when scripting.
But it never occurred to me that this also affected the code part.
look at this:
As the introduction of the Convex Mirror, I found that the mvp's respawn delay would never go higher than the delay1.
This is because this random value of delay2 is too small to affect the whole.
And this can fix it.
Hope there is better calculation...
This post has been edited by theultramage: Aug 1 2008, 07:42 AM
http://www.eathena.w...er&showbug=1927
I found that a rand() command cannot rand a number higer than 10000 when scripting.
But it never occurred to me that this also affected the code part.
look at this:
CODE
spawntime = md->spawn->delay1; //Base respawn time
if (md->spawn->delay2) //random variance
spawntime+= rand()%(md->spawn->delay2;
if (md->spawn->delay2) //random variance
spawntime+= rand()%(md->spawn->delay2;
As the introduction of the Convex Mirror, I found that the mvp's respawn delay would never go higher than the delay1.
This is because this random value of delay2 is too small to affect the whole.
And this can fix it.
CODE
spawntime = md->spawn->delay1; //Base respawn time
if (md->spawn->delay2) //random variance
spawntime+= (rand()%(md->spawn->delay2/10000))*10000+rand()%10000;
if (md->spawn->delay2) //random variance
spawntime+= (rand()%(md->spawn->delay2/10000))*10000+rand()%10000;
Hope there is better calculation...
This post has been edited by theultramage: Aug 1 2008, 07:42 AM