Issue information

Issue ID
#774
Status
Working as Intended
Severity
None
Started
Hercules Elf Bot
Jan 8, 2008 21:25
Last Post
Hercules Elf Bot
Jan 8, 2008 21:25
Confirmation
N/A

Hercules Elf Bot - Jan 8, 2008 21:25

Originally posted by [b]Hypnotoad[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=774

Description:
I am not able to confirm this other then having to wait longer then the indicated maximum time for Bosses and Mobs to respawn. I killed a Ghostring at 15:55 server time, the mob is expected to respawn 30-60 minutes after the death of the mob. I started searching 16:30 and kept walking around poring island. At around 17:20, there were still no signs of it. So I decided to give up. I became very frustrated, and took a look at the source, here are my findings:

The current process for NPC Respawn:
- Upon an NPCs death, whatever mob->spawn->delay1 is, the respawn time is set to that using the function mob_setdelayspawn. If mob->spawn->delay1 is 0, the mob is respawned after 5 seconds, the minimum value in mob_setdelayspawn.
- The random variable is stored in mob->spawn->delay2.
- Using rand()%mob->spawn->delay2, you get a number from 1 to mob->spawn->delay2
- This number is added to minimum value and the timer is set for the next respawn

I was looking at different online databases and noticed they have a range. For example, RODB and RateMyServer shows Ghostring spawns within the range 30~60 minutes on Poring Island. I couldn't find where exactly the battle config files are located (i assume inside map_cache.dat) so i was unable to find the minimum and maximum spawn times for myself.

Possible Error:
Is it possible that mob->spawn->delay2 is the max value instead of the random value. For example mob->spawn->delay2 = 60 in the cace of Ghostring. So your actually have a range of (min)30-90(min 30+60 max) instead of (min)30-60(min30+range 30[max 60-30 min]). So in npc.c's npc_parse_mob:

CODE
            mob.delay1 = mob.delay1/100*battle_config.boss_spawn_delay;
            mob.delay2 = mob.delay2/100*battle_config.boss_spawn_delay;


should be:

CODE
            mob.delay1 = mob.delay1/100*battle_config.boss_spawn_delay;
            mob.delay2 = mob.delay2/100*battle_config.boss_spawn_delay - mob.delay1/100*battle_config.boss_spawn_delay;


Can anyone confirm this, the only evidence I have is the longer than maximum spawn delay, maybe I missed the respawn and someone took it but thats highly unlikely. Ghostring is usually there for the taking, and I asked everyone I ran into if they saw any or killed any recently.

This post has been edited by Hypnotoad: Jan 8 2008, 01:31 PM