summaryrefslogtreecommitdiff
path: root/npc/functions/asklanguage.txt
blob: f0cbe0f8d8d506dda82290b935cd208b19e26b81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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;
}