Jump to content

Adding reloadnpc as an atcommand


Tokei

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  657
  • Reputation:   662
  • Joined:  11/12/12
  • Last Seen:  

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


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

It would be nice to see this implemented. We've talk about it too ( Issue: 203 )

Link to comment
Share on other sites


  • Group:  Development Manager
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  732
  • Reputation:   525
  • Joined:  12/13/11
  • Last Seen:  

Implemented in Git Hash: 9c2026d!

  • Upvote 2
Link to comment
Share on other sites

×
×
  • Create New...