Page 1 of 1

IMPORTANT: Rev 1529 - RespawnInterval

PostPosted: Sat Feb 14, 2009 2:27 am
by Kakuri
RespawnInterval appears to have been designed to operate as follows:
value < 0: don't respawn at all
value = 0: calculate respawn time based on mob level
value > 0: use specified value to determine respawn time

However, the accessor for RespawnInterval was not handling the <0 case. Now it is. So if you have any mobs in your database with RespawnInterval < 0, you might want to change them to 0. With revisions prior to 1529, any mob with RespawnInterval <= 0 would use a respawn time based on the mob's level. With 1529+, if the value is <0 the mob will never respawn.

The following should do the trick:
UPDATE mob SET RespawnInterval = 0 WHERE RespawnInterval < 0;

On Storm there are about 15,000 mobs that will not respawn after being killed if the database isn't updated first.

Re: IMPORTANT: Rev 1529 - RespawnInterval

PostPosted: Sat Feb 14, 2009 3:07 am
by Tired
mob @livedol (Storm DOL)

Affected rows: 146,295 of 150,494
Time: 3.688ms
Unaffected rows: 4,199

Re: IMPORTANT: Rev 1529 - RespawnInterval

PostPosted: Sat Feb 14, 2009 3:35 am
by Kakuri
Right, I meant 150k... lost a zero. :P

Also, just in case anyone's concerned about "losing" their no-respawn mobs, it wasn't working before. So if you change all your mobs with -1 to 0, you'll see no change in behavior (regardless of whether you update to 1529 or not). But if you leave them at -1 and update to 1529, then all mobs with -1 will not respawn after being killed. They'll only come back after a server restart.

Re: IMPORTANT: Rev 1529 - RespawnInterval

PostPosted: Sat Feb 14, 2009 9:20 am
by Dinberg
Hmmm this is very nice - it means for instances now we can just set the respawn interval to -1, rather than attempting to make a new classtype that would not respawn :D

Just out of interest, what happens to non respawn mobs? Do they remain in limbo, or get collected by the GC?

Re: IMPORTANT: Rev 1529 - RespawnInterval

PostPosted: Sat Feb 14, 2009 9:42 am
by Kakuri
I was wondering the same myself... it looks to me like the same in-memory object is used for all incarnations of a mob, with the object just switching state between alive and kicking in the game world and dead & not visible in the game world. I didn't really investigate the issue in detail, but I didn't see anything that led me to believe a mob object is freed to be collected once the mob is killed and won't be respawned.

Re: IMPORTANT: Rev 1529 - RespawnInterval

PostPosted: Sat Feb 14, 2009 9:44 am
by Dinberg
Hmm, perhaps on StartRespawn, if the respawn time is less than one you could call 'Delete()' on the object? It will persist in the db but should be removed from the Server.