Jump to content

Recommended Posts

Posted

Heya,

I would like to suggest adding @reloadnpc as an official atcommand to reload scripts. Currently we have to use @unloadnpcfile followed by @loadnpc which is a bit awkward when you want to create a new script. With @reloadnpc, you'd be able to load and reload NPCs with the same command.

ACMD_FUNC(reloadnpc) {
	if (!message || !*message) {
		clif_displaymessage(fd, "Usage: @reloadnpc <file name>");
		return -1;
	}

	if (npc_unloadfile(message))
		clif_displaymessage(fd, msg_txt(sd,1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed.

	if (!npc_addsrcfile(message) || !npc_parsesrcfile(message,true)) {
		clif_displaymessage(fd, msg_txt(sd,261));
		return -1;
	}

	npc_read_event_script();

	clif_displaymessage(fd, msg_txt(sd,262));
	return 0;
}

 

  • Upvote 6
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...