summaryrefslogtreecommitdiff
path: root/npc/functions/asklanguage.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/asklanguage.txt')
-rw-r--r--npc/functions/asklanguage.txt56
1 files changed, 56 insertions, 0 deletions
diff --git a/npc/functions/asklanguage.txt b/npc/functions/asklanguage.txt
new file mode 100644
index 00000000..f0cbe0f8
--- /dev/null
+++ b/npc/functions/asklanguage.txt
@@ -0,0 +1,56 @@
+// Evol functions.
+// Author:
+// Reid
+// Description:
+// Function setting the player language
+
+function script asklanguage {
+
+ .@nb_language = 11;
+
+ switch (getarg(0, 0))
+ {
+ case LANG_ON_SEA:
+ setarray .@messages$[0], "I hear you... (English)", // English
+ "Je vous entends... (Français)", // French
+ "Te oigo... (Español)", // Spanish
+ "Ich höre euch... (Deutsch)"; // German
+ break;
+ case LANG_IN_SHIP:
+ setarray .@messages$[0], "I speak English.", // English
+ "Je parle français.", // French
+ "Hablo Español.", // Spanish
+ "Ich spreche Deutsch."; // German
+ break;
+ default:
+ return;
+ }
+
+ setarray .@flags$[0], "flags/en",
+ "flags/fr",
+ "flags/es",
+ "flags/de";
+
+ .@menustr$ = "";
+ .@separator$ = ":";
+
+ for (.@i = 0; .@i <= .@nb_language; .@i++)
+ {
+ if (.@i == .@nb_language)
+ {
+ .@separator$ = "";
+ }
+ .@menustr$ = .@menustr$ + .@flags$[.@i] + "|" + .@messages$[.@i] + .@separator$;
+ }
+
+ select(.@menustr$);
+
+ .@lang = @menu - 1;
+
+ if (.@lang >= 0 || .@lang <= .@nb_language)
+ {
+ Lang = .@lang;
+ }
+
+ return;
+}