summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-05-07 14:08:51 -0400
committermekolat <mekolat@users.noreply.github.com>2015-05-07 14:08:51 -0400
commitd40e9ab167749ff8f388c90f67457b36c6216aa9 (patch)
tree2999454384a13def286adf84f6e06e751749fb5b
parent481ed1e0eea0423dd2597c72ca67b5872f8e8862 (diff)
downloadserverdata-d40e9ab167749ff8f388c90f67457b36c6216aa9.tar.gz
serverdata-d40e9ab167749ff8f388c90f67457b36c6216aa9.tar.bz2
serverdata-d40e9ab167749ff8f388c90f67457b36c6216aa9.tar.xz
serverdata-d40e9ab167749ff8f388c90f67457b36c6216aa9.zip
death to the motd!
-rw-r--r--world/map/.gitignore2
-rw-r--r--world/map/conf/.gitignore1
-rw-r--r--world/map/conf/map_athena.conf3
-rw-r--r--world/map/conf/motd.txt.example2
-rw-r--r--world/map/npc/functions/announcements.txt14
-rw-r--r--world/map/npc/functions/clear_vars.txt2
-rw-r--r--world/map/npc/functions/global_event_handler.txt2
-rw-r--r--world/map/npc/functions/motd.txt.example11
-rw-r--r--world/map/npc/scripts.conf2
9 files changed, 32 insertions, 7 deletions
diff --git a/world/map/.gitignore b/world/map/.gitignore
index fcd1d9f0..2c681650 100644
--- a/world/map/.gitignore
+++ b/world/map/.gitignore
@@ -3,3 +3,5 @@
/news.phpbb.txt
/db/const-debugflag.txt
+
+/npc/functions/motd.txt
diff --git a/world/map/conf/.gitignore b/world/map/conf/.gitignore
index 88c1dc21..c2b48eb6 100644
--- a/world/map/conf/.gitignore
+++ b/world/map/conf/.gitignore
@@ -1,5 +1,4 @@
/*_local.conf
/magic-secrets.conf
/magic-secrets.sex
-/motd.txt
/secrets-build
diff --git a/world/map/conf/map_athena.conf b/world/map/conf/map_athena.conf
index f0f59fd7..86f7f072 100644
--- a/world/map/conf/map_athena.conf
+++ b/world/map/conf/map_athena.conf
@@ -3,9 +3,6 @@
// Database autosave time, in seconds.
autosave_time: 60
-// Message of the day file, when a character logs on, this message is displayed.
-motd_txt: conf/motd.txt
-
mapreg_txt: save/mapreg.txt
import: npc/scripts.conf
diff --git a/world/map/conf/motd.txt.example b/world/map/conf/motd.txt.example
deleted file mode 100644
index 9c949dda..00000000
--- a/world/map/conf/motd.txt.example
+++ /dev/null
@@ -1,2 +0,0 @@
-Welcome to The Mana World! (running on tmwAthena)
-You can report abuse by typing in chat: @wgm Player XYZ is abusing me
diff --git a/world/map/npc/functions/announcements.txt b/world/map/npc/functions/announcements.txt
new file mode 100644
index 00000000..cd4e3b80
--- /dev/null
+++ b/world/map/npc/functions/announcements.txt
@@ -0,0 +1,14 @@
+function|script|DisplayMOTD
+{
+ if($@MOTD_Disabled || $@MOTD$[0] == "") goto L_Return;
+ goto L_MOTD;
+
+L_MOTD:
+ message strcharinfo(0), "##7Server : " + $@MOTD$[@motd_index];
+ set @motd_index, @motd_index + 1;
+ if($@MOTD$[@motd_index] == "") goto L_Return;
+ goto L_MOTD;
+
+L_Return:
+ return;
+}
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index f26164df..76365f07 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -437,5 +437,5 @@ L_EventClear:
// Variable was used in Voltain's script, was renamed and turned into a temporary variable
set $state, 0;
- end;
+ return;
}
diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt
index 92194086..04f89159 100644
--- a/world/map/npc/functions/global_event_handler.txt
+++ b/world/map/npc/functions/global_event_handler.txt
@@ -11,6 +11,7 @@ OnPCLoginEvent:
set @login_event, 1;
callfunc "getHeadStyles"; // converts class, color and hair
callfunc "ClearVariables"; // removes / converts old variables
+ callfunc "DisplayMOTD"; // send the motd to the client, if enabled
// add more here
set @login_event, 2;
end;
@@ -30,5 +31,6 @@ OnPCDieEvent:
OnInit: //fixme: change to OnInterIfInit
callfunc "ClearGlobalVars";
+ callfunc "MOTD"; // set the MOTD array
end;
}
diff --git a/world/map/npc/functions/motd.txt.example b/world/map/npc/functions/motd.txt.example
new file mode 100644
index 00000000..082d31d6
--- /dev/null
+++ b/world/map/npc/functions/motd.txt.example
@@ -0,0 +1,11 @@
+function|script|MOTD
+{
+ setarray $@MOTD$,
+
+ "Welcome to The Mana World! (running on tmwAthena)",
+ "[@@http://ow.ly/MCesp|Website & Wiki@@] [@@http://ow.ly/MCeBR|Vote For GMs@@] [@@http://ow.ly/MCehc|Bug Reports@@] [@@http://ow.ly/MCe5W|Live Support@@]",
+ "Like us on [@@http://ow.ly/MCdZW|Facebook@@] [@@http://ow.ly/MCdTt|G+@@] [@@http://ow.ly/MCdJR|Youtube@@] [@@http://ow.ly/MCePp|Twitter@@]",
+ "You can report abuse by typing in chat: @wgm Player XYZ is abusing me";
+
+ return;
+}
diff --git a/world/map/npc/scripts.conf b/world/map/npc/scripts.conf
index 1414f681..39ad7d92 100644
--- a/world/map/npc/scripts.conf
+++ b/world/map/npc/scripts.conf
@@ -28,6 +28,8 @@ npc: npc/functions/stat_reset.txt
npc: npc/functions/quiz.txt
npc: npc/functions/dynamic_menu.txt
npc: npc/functions/DyeConfig.txt
+npc: npc/functions/announcements.txt
+npc: npc/functions/motd.txt
// Item Functions
npc: npc/items/magic_gm_top_hat.txt