I need to know if have an method on server configuration, in RME we need to change each monsterCheck your mapname-spawns.xml or open your map with rme.
spawnBlock_t& sb = it.second;
if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
spawnBlock_t& sb = it.second;
uint32_t newInterval = (sb.interval / static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWNTIME)));
if (OTSYS_TIME() >= sb.lastSpawn + newInterval) {
if (findPlayer(sb.pos)) {
sb.lastSpawn = OTSYS_TIME();
continue;
}
(<monster name="MONSTER NAME"[^>]*)(spawntime="CURRENT SPAWN TIME")([^>]*/>)
\1spawntime="UPDATED SPAWN TIME"\3
<spawn centerx="32104" centery="31133" centerz="0" radius="2">
<monster name="Ice Golem" x="2" y="1" z="0" spawntime="120" />
</spawn>
<spawn centerx="32135" centery="31135" centerz="0" radius="2">
<monster name="Ice Golem" x="1" y="-2" z="0" spawntime="120" />
</spawn>
<spawn centerx="32106" centery="31140" centerz="0" radius="2">
<monster name="Ice Golem" x="2" y="0" z="0" spawntime="120" />
</spawn>
<spawn centerx="32129" centery="31141" centerz="0" radius="2">
<monster name="Ice Golem" x="-1" y="0" z="0" spawntime="120" />
</spawn>
(<monster name="Ice Golem"[^>]*)(spawntime="120")([^>]*/>)
\1spawntime="160"\3
<spawn centerx="32104" centery="31133" centerz="0" radius="2">
<monster name="Ice Golem" x="2" y="1" z="0" spawntime="160" />
</spawn>
<spawn centerx="32135" centery="31135" centerz="0" radius="2">
<monster name="Ice Golem" x="1" y="-2" z="0" spawntime="160" />
</spawn>
<spawn centerx="32106" centery="31140" centerz="0" radius="2">
<monster name="Ice Golem" x="2" y="0" z="0" spawntime="160" />
</spawn>
<spawn centerx="32129" centery="31141" centerz="0" radius="2">
<monster name="Ice Golem" x="-1" y="0" z="0" spawntime="160" />
</spawn>
I made these changes, build the .exe, replaced my server's .exe with the newly built one and I am seeing no difference in the spawn time.You have rateSpawn in your config.lua.. From looking at the spawn.cpp I found out that rateSpawn seems to be increasing the amount of monsters spawned..
Therefore you can't change it in config.lua (at this moment).
You have two options:
- Change the source and add spawn time modifier for your config
- Change the monster spawn times in RME or by opening world-spawn.xml in texteditor and using replace to quickly edit the spawn times
If you want a quick solution for the source:
This what you will find at step 5:
- Go to configmanager.cpp and find integer[RATE_SPAWN] = getGlobalNumber(L, "rateSpawn", 1);
- Under that add new line with integer[RATE_SPAWNTIME] = getGlobalNumber(L, "rateSpawnTime", 1);
- Go to configmanager.h and find enum integer_config_t { under that find RATE_SPAWN,
- Under that add new line with RATE_SPAWNTIME,
- Now go to spawn.cpp and find line if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) {
Change it to:C++:spawnBlock_t& sb = it.second; if (OTSYS_TIME() >= sb.lastSpawn + sb.interval) { if (findPlayer(sb.pos)) { sb.lastSpawn = OTSYS_TIME(); continue; }
C++:spawnBlock_t& sb = it.second; uint32_t newInterval = (sb.interval / static_cast<uint32_t>(g_config.getNumber(ConfigManager::RATE_SPAWNTIME))); if (OTSYS_TIME() >= sb.lastSpawn + newInterval) { if (findPlayer(sb.pos)) { sb.lastSpawn = OTSYS_TIME(); continue; }
- Now compile
- Add rateSpawnTime = 2 to your config.lua (for example this will divide your spawntime by 2)
- Enjoy