This will reload one npc at a time and will not affect other npc or monster spawn.
Try this:
- script oninitreload -1,{OnAtcommand: dispbottom .@atcmd_parameters$[1]; if ( .@atcmd_parameters$[0] == "" || .@atcmd_parameters$[0] == " " ) { dispbottom "Please enter an npc's unique name."; end; } donpcevent implode(.@atcmd_parameters$," ")+ "::OnInit"; dispbottom "OnInit for "+ implode(.@atcmd_parameters$," ")+ " has been reloaded."; end;OnInit: bindatcmd("reload", strnpcinfo(3)+"::OnAtcommand", 99, 99, 1); // Only gm 99 and above can use this command, 1 to log command else 0. end;}
Usage: @loadnpc <
path >
then
@reload <
npc's unique name >
eg:
- script monstertry#4444 -1,{ // monstertry#4444 is the npc's unique name.OnLabel: announce "???",0; end;OnInit: monster "prontera", 150, 150, "Poring", 1002, 1, strnpcinfo(3)+"::OnLabel"; end;}
will print:
[Debug]: NPCEvent 'monstertry::OnInit' not found! (source: oninitreload)
if npc is not found.
@edit
may test server crashes whenever I use atcommand "@reloadscript". so I made this.