summaryrefslogtreecommitdiff
path: root/npc/fermi/chairman.txt
blob: aae05c3a2a0f5476f0aabeb805559f432af88372 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// The Mana World scripts.
// Author:
//    Jesusalva
// Description:
//    Meetings Chairman

fermi	mapflag	nosave	009-1,42,44

fermi,27,18,0	script	#Chairman	NPC_NO_SPRITE,{
    if (!is_admin()) end;
    mesn l("Chairman");
    mes "Configuration for Team Meetings.";
    select
        "Exit",
        rif($@TMWT_MEETING, "Count and Announce votes"),
        rif(!$@TMWT_MEETING, "Open Meeting"),
        rif($@TMWT_MEETING, "Close Meeting"),
        "Announce Meeting (here)",
        "Announce Meeting (global)";
    mes "";
    closeclientdialog;
    switch (@menu) {
    case 1:
        close;
        break;
    case 2:
        .@y$ = "";
        .@yay = getunits(BL_PC, .@py, false, "fermi", 30, 20, 39, 29);
        for (.@i = 0; .@i < .@yay; .@i++) {
            if (.@y$ != "")
                .@y$ += ", ";
            .@y$ += strcharinfo(0, "???", .@py[.@i]);
        }
        .@n$ = "";
        .@nae = getunits(BL_PC, .@pn, false, "fermi", 30, 30, 39, 39);
        for (.@i = 0; .@i < .@nae; .@i++) {
            .@n$ += strcharinfo(0, "???", .@pn[.@i]);
        }
        .@a$ = "";
        .@abs = getunits(BL_PC, .@pa, false, "fermi", 24, 20, 29, 39);
        for (.@i = 0; .@i < .@abs; .@i++) {
            .@n$ += strcharinfo(0, "???", .@pa[.@i]);
        }
        // If yay == nae, motion fails
        .@s$ = (.@yay > .@nae ? "##3passed##0" : "##1failed##0");
        mapannounce "fermi", sprintf("Chairman : %d Yay from: %s", .@yay, .@y$), 0;
        mapannounce "fermi", sprintf("Chairman : %d Nae from: %s", .@nae, .@n$), 0;
        mapannounce "fermi", sprintf("Chairman : %d Abs from: %s", .@abs, .@a$), 0;
        sleep2(200);
        mapannounce "fermi", sprintf("Chairman : Motion %s: YAY %d - %d NAE", .@s$, .@yay, .@nae), 0;
        break;
    case 3:
        $@TMWT_MEETING = true;
        announce sprintf("Chairman : The Mana World Team Meeting is %s.", $@TMWT_MEETING ? "in session, and can be accessed in Jack's House, Hurnscald" : "adjourned, thanks everyone for attending"), 0;
        break;
    case 4:
        $@TMWT_MEETING = false;
        announce sprintf("Chairman : The Mana World Team Meeting is %s.", $@TMWT_MEETING ? "in session, and can be accessed in Jack's House, Hurnscald" : "adjourned, thanks everyone for attending"), 0;
        break;
    case 5:
        mapannounce "fermi", sprintf("Chairman : The meeting is now %s.", $@TMWT_MEETING ? "in session" : "adjourned"), 0;
        break;
    case 6:
        announce sprintf("Chairman : The Mana World Team Meeting is %s.", $@TMWT_MEETING ? "in session, and can be accessed in Jack's House, Hurnscald" : "adjourned, thanks everyone for attending"), 0;
        break;
    }
    close;

OnInit:
    .distance=5;
    end;
}