Page 1 of 1
Respawn time for mobs
PostPosted: Sat Feb 04, 2017 6:18 pm
by Leorekk
There are mobs respawning extrem slow, for example the "Albion Invader" on mid startregion, he has on the DB a RespawnInterval of 0, what does 0 here mean? In which measure is this value in the DB - minutes, seconds, milliseconds?
There are alot of other mobs with a 0 too, as far i saw, is there a way to globally lower the respawn time?
BR
Leorekk
Re: Respawn time for mobs
PostPosted: Sat Feb 04, 2017 6:33 pm
by PlanarChaosRvrtwo
Respawn Interval 1800 means 3 minutes.
And RespawnInterval 0 means no spawn after death.
Replacevalue just mean if it spawn or not.
to fix that generally use this Heidisql command (save db before):
UPDATE mob
SET RespawnInterval = replace(field, '0', '2400')
that will set all mobs with no respawn timer to respawn time 4 minutes.
Re: Respawn time for mobs
PostPosted: Sat Feb 04, 2017 6:43 pm
by PlanarChaosRvrtwo
Im aware of that issue i gonna do a beta version of my db with that fixed but atm to ill to do it.
Re: Respawn time for mobs
PostPosted: Sat Feb 04, 2017 7:02 pm
by Leorekk
OK, if the logic is stay dead if its 0, it shouldnt be 0 for most of the mobs then right?
But if its in seconds, thats enough to know, i will patch it locally too - thanks!
Re: Respawn time for mobs
PostPosted: Sat Feb 04, 2017 7:05 pm
by PlanarChaosRvrtwo
It shouldtnt be 0 correct but couse i needed to mix very outdated dbs and such to have again an very useful db a few errors occured like that and i tried to fix all my own but now its at that point i wasnt able to find fails my own so i released and let players appeal so the next db will have this fixed.
Re: Respawn time for mobs
PostPosted: Sat Feb 04, 2017 8:05 pm
by Leorekk
I patch my DB now like this:
/*SELECT * FROM mob WHERE ClassType='DOL.GS.GameNPC' AND (RespawnInterval = 0 OR RespawnInterval = NULL)*/
UPDATE mob SET RespawnInterval = 60 WHERE ClassType='DOL.GS.GameNPC' AND (RespawnInterval = 0 OR RespawnInterval = NULL)
The GameNPC are the only once which would need it, i think... maybe there are others, but i need to investigate the logic of the table further.
Re: Respawn time for mobs
PostPosted: Sat Feb 04, 2017 11:17 pm
by PlanarChaosRvrtwo
that works too ofc^^
Re: Respawn time for mobs
PostPosted: Sun Feb 05, 2017 10:20 am
by Leodagan
RespawnInterval with 0 value doesn't mean that mob won't respawn !
0 value is treated like a default value and the server will randomize the Respawn Timer using Server Properties ( I think default Server Properties may be around 5 or 15 minutes

)
To disable a mob Respawning (I don't remember if that's possible...) you may try to use a negative value like "-1", most database fields that are "signed" integer when only positive value make sense probably have special behavior for negative value... (but it's not consistent between negative meaning auto-config or negative meaning disable...)
Re: Respawn time for mobs
PostPosted: Sun Feb 05, 2017 11:02 am
by PlanarChaosRvrtwo
Nvm checked it was wrong i did an fail^^
Re: Respawn time for mobs
PostPosted: Sat Feb 11, 2017 10:26 pm
by PlanarChaosRvrtwo
I checked again -1 is script based respawn timer 0 means no respawn.
Re: Respawn time for mobs
PostPosted: Sun Feb 12, 2017 8:20 am
by Leodagan
I must insist that "0" is in not meaning "No Respawn"
Here is the RespawnInterval Property of a GameNPC
- Code: Select all
/// <summary>
/// The Respawn Interval of this mob in milliseconds
/// </summary>
public virtual int RespawnInterval
{
get
{
if ( m_respawnInterval > 0 || m_respawnInterval < 0 )
return m_respawnInterval;
int minutes = Util.Random(ServerProperties.Properties.NPC_MIN_RESPAWN_INTERVAL, ServerProperties.Properties.NPC_MIN_RESPAWN_INTERVAL + 5);
if (Name != Name.ToLower())
{
minutes += 5;
}
if (Level <= 65 && Realm == 0)
{
return minutes * 60000;
}
else if (Realm != 0)
{
// 5 to 10 minutes for realm npc's
return Util.Random(5 * 60000, 10 * 60000);
}
else
{
int add = (Level - 65) + ServerProperties.Properties.NPC_MIN_RESPAWN_INTERVAL;
return (minutes + add) * 60000;
}
}
set
{
m_respawnInterval = value;
}
}
There is clearly Randomization of Respawn Time when the RespawnInterval is "0"
In GameNPC.StartRespawn we can see that any negative value will disable the Respawn Timer
- Code: Select all
int respawnInt = RespawnInterval;
if (respawnInt > 0)
{
lock (m_respawnTimerLock)
{
if (m_respawnTimer == null)
{
m_respawnTimer = new RegionTimer(this);
m_respawnTimer.Callback = new RegionTimerCallback(RespawnTimerCallback);
}
else if (m_respawnTimer.IsAlive)
{
m_respawnTimer.Stop();
}
// register Mob as "respawning"
CurrentRegion.MobsRespawning.TryAdd(this, respawnInt);
m_respawnTimer.Start(respawnInt);
}
}
There is even example in code on how to use this for Adventure Wing Instances :
- Code: Select all
// Set respawn to false
foreach(GameNPC mob in GetMobsInsideInstance(true))
{
mob.RespawnInterval = -1;
}
Re: Respawn time for mobs
PostPosted: Sun Feb 12, 2017 10:50 am
by PlanarChaosRvrtwo
gah worked to long yesterday and mixed up the current code and an very old code.