Jump to content
  • Register Now

    Sign up and take advantage of the features of our community! Some forums are only accessible to our members!

  • 0

REGEN.TXT COMMAND


ByLost
Go to solution Solved by TMP4,

Question

Version of Files 40k

Hi Devs :D

I'm using this command line 
regen_in_map(68, "data/events/fimdeano/teste.txt")

 

When the player kills the mob, it does not come back but.
That way the respaw is not done.
 

Do you have any way to do the respaw using this command line?

Another curiosity, would have how to remove the npc of the event and the mob of the event ?



Thanks :D

Link to post

3 answers to this question

Recommended Posts

  • 0
  • Solution
    int _set_regen_in_map( lua_State * L )
    {
        int iMapIndex = static_cast<int>(lua_tonumber(L, 1));
        std::string szFilename(lua_tostring(L, 2));

        LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(iMapIndex);

        if (pkMap != NULL)
        {
            regen_load( szFilename.c_str(), iMapIndex, pkMap->m_setting.iBaseX ,pkMap->m_setting.iBaseY );
        }

        return 0;
    }
	{	"set_regen_in_map",					_set_regen_in_map					},

I made it back in the time so i pasted for you. Endymion right, regen_load function is what needed. Add it to questlua_global.cpp

Keep in mind you can't cancel it lol. If you make a clear regen function, it will clear the map's basic regen too.

If you want to cancel it would be better to use that map as a dungeon.

Link to post
  • 0
  • VIP
2 hours ago, TMP4 said:

Keep in mind you can't cancel it lol. If you make a clear regen function, it will clear the map's basic regen too.

If you want to cancel it would be better to use that map as a dungeon.

 

didn't test but in theory it can works

void regen_free_in_map(int32_t lMapIndex) {
	for (auto& pRegen = regen_list; pRegen != nullptr; pRegen = pRegen->next) {
		if (pRegen->lMapIndex == lMapIndex) {
			if (pRegen->prev)
				pRegen->prev->next = pRegen->next;
			if (pRegen->next)
				pRegen->next->prev = pRegen->prev;

			event_cancel(&pRegen->event);
			M2_DELETE(pRegen);
		}
	}
}

 

  • Love 2
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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.