summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 3fe6c8581..76448b237 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4499,6 +4499,7 @@ ACMD(loadnpc)
// add to list of script sources and run it
npc->addsrcfile(message);
npc->parsesrcfile(message,true);
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
clif->message(fd, msg_fd(fd,262));
@@ -4533,6 +4534,7 @@ ACMD(unloadnpc)
npc->unload_duplicates(nd, (flag != 0));
npc->unload(nd, true, (flag != 0));
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
clif->message(fd, msg_fd(fd, 112)); /// Npc Disabled.
return true;
@@ -4588,6 +4590,7 @@ ACMD(reloadnpc)
clif->message(fd, msg_fd(fd, 1386)); /// File unloaded. Be aware that...
npc->addsrcfile(file_path);
npc->parsesrcfile(file_path, true);
+ npc->motd = npc->name2id("HerculesMOTD");
npc->read_event_script();
clif->message(fd, msg_fd(fd, 262)); /// Script loaded.
return true;
@@ -8916,13 +8919,17 @@ ACMD(accinfo)
/* [Ind] */
ACMD(set)
{
- char reg[SCRIPT_VARNAME_LENGTH+1], val[254];
+ char reg[SCRIPT_VARNAME_LENGTH + 1];
+ char val[SCRIPT_STRING_VAR_LENGTH + 1];
struct script_data* data;
int toset = 0;
bool is_str = false;
size_t len;
- if (!*message || (toset = sscanf(message, "%32s %253[^\n]", reg, val)) < 1) {
+ char format[20];
+ safesnprintf(format, sizeof(format), "%%%ds %%%d[^\\n]", SCRIPT_VARNAME_LENGTH, SCRIPT_STRING_VAR_LENGTH);
+
+ if (*message == '\0' || (toset = sscanf(message, format, reg, val)) < 1) {
clif->message(fd, msg_fd(fd,1367)); // Usage: @set <variable name> <value>
clif->message(fd, msg_fd(fd,1368)); // Usage: ex. "@set PoringCharVar 50"
clif->message(fd, msg_fd(fd,1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String"