Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×

Server loads regen only once after start


Recommended Posts

Hey yoo!

This little thing allows you to make new regen files called: regen_once.txt (you can rename it to anything).
Modification is using an already existing function called: regen_load_in_file, which has been used by quests.
You can use it, to generate some monsters / npcs at the server startup which don't have any respawn time, so if you kill them, they won't appear until a new server restart, or manually reloading your regens if you have those functions.

In common/service.h - Add:

#define ENABLE_REGEN_ONCE


In game/src/sectree_manager.cpp - Search:

			snprintf(szFilename, sizeof(szFilename), "%s/%s/regen.txt", c_pszMapBasePath, szMapName);
			regen_load(szFilename, setting.iIndex, setting.iBaseX, setting.iBaseY);


Add under:

#ifdef ENABLE_REGEN_ONCE
			snprintf(szFilename, sizeof(szFilename), "%s/%s/regen_once.txt", c_pszMapBasePath, szMapName);
			regen_load_in_file(szFilename, setting.iIndex, setting.iBaseX, setting.iBaseY);
#endif


In game/src/regen.cpp - Search:

	snprintf(szFilename, sizeof(szFilename), "%sregen.txt", mbMapDataContainer[lMapIndex]->szBaseName);
	regen_load(szFilename, lMapIndex, mbMapDataContainer[lMapIndex]->base_x, mbMapDataContainer[lMapIndex]->base_y);


Add under:

#ifdef ENABLE_REGEN_ONCE
    snprintf(szFilename, sizeof(szFilename), "%sregen_once.txt", mbMapDataContainer[lMapIndex]->szBaseName);
    regen_load_in_file(szFilename, lMapIndex, mbMapDataContainer[lMapIndex]->base_x, mbMapDataContainer[lMapIndex]->base_y);
#endif


If you done it, you can create regen_once.txt with some mobs, and place it to your map folder next to regen.txt. If you don't place it in every map folder, you will get some syserr that says it can't find regen_once.txt. It won't cause any problem. It just inform you, that you didn't create that file for certain maps. 

Edited by Heathcliff™
Link to comment
Share on other sites

!-->


  • Similar Content

  • Activity

    1. 1

      Costume shining/costume effect system

    2. 992

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    3. 3

      Biologist Manager (C++ & LUA)

    4. 3

      Visual studio 2022 compiling issue

    5. 63

      Metin2 | Mount System Renewal

    6. 58

      Metin2 2004 Beta Client

    7. 0

      🔥Paradise2 PVP SERVER GLOBAL!! EN-ES-PT 🕐📢Apertura 11 de diciembre 21 horas de España!

  • Recently Browsing

    • No registered users viewing this page.
!-->
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.