Issue information

Issue ID
#4971
Status
Fixed
Severity
Medium
Started
Hercules Elf Bot
Jun 21, 2011 18:12
Last Post
Hercules Elf Bot
Mar 15, 2012 13:07
Confirmation
Yes (1)
No (0)

Hercules Elf Bot - Jun 21, 2011 18:12

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

Each mobdb entry has 'spawn' array (with a capacity for 10 entries) holding pairs <map id, quantity>. It was added for the @whereis command in r11110 to locate maps with the largest amounts of naturally spawning mobs of a certain type.

The array is currently populated at startup, by hooking onto the npc_parse_mob() function and using the spawn info as it goes by during the npc loading procedure. And such it has an unfortunate consequence - it's hard to re-run. When you issue a @reloadmobdb (which you can't avoid if you want floating exp rates), the spawn cache gets wiped. But to fill it again, you'd have to do a @reloadscript, which is a nutty thing to do in production.

A break came in r11485 when the spawn cache was (ab)used to fix a glitch in the Taekwon Mission skill, where the randomizer would choose mobs that don't spawn anywhere naturally. If the cache is wiped, the search fails and falls back to the 'Scorpion' mobdb entry, all the time everytime - which can be exploited for easy taekwon points.

PS: thanks to 'Theni' for reporting the issue to me on #athena.