Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (0)No (0)
Photo

Rand() And Mvp Respawn Delay

Posted by Hercules Bot on 27 July 2008 - 07:38 AM

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:
CODE
    spawntime = md->spawn->delay1; //Base respawn time
    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;


Hope there is better calculation...

This post has been edited by theultramage: Aug 1 2008, 07:42 AM

Originally posted by Gepard
Fixed in [rev=15483].