Issue information

Issue ID
#1927
Status
Fixed
Severity
Fair
Started
Hercules Elf Bot
Jul 27, 2008 7:38
Last Post
Hercules Elf Bot
Apr 19, 2012 15:41
Confirmation
N/A

Hercules Elf Bot - Jul 27, 2008 7:38

Originally posted by [b]Inkfish[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&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

Hercules Elf Bot - Jan 17, 2012 18:09

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