Jump to content

REGEN.TXT COMMAND


Go to solution Solved by TMP4,

Recommended Posts

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 comment
Share on other sites

  • Contributor
  • 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 comment
Share on other sites

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 comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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