summaryrefslogtreecommitdiff
path: root/npc/commands/super-menu.txt
blob: 5ed7ced35344e995992cc164399accee4c8d8720 (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
function	script	SuperMenu	{
    do
    {
        if (debug && !is_dev())
        {
            GlobalDebugMenu;
            return;
        }

        clear;
        setnpcdialogtitle l("Super Menu");
        mes l("This menu contains all options available to you, based on your access privileges.");
        mes "";
        mes l("What do you want to access?");
        next;
        select
            l("Scheduled broadcasts"),
            l("MOTD"),
            rif(is_evtc(), l("Event management")),
            l("Debug");

        switch (@menu)
        {
            case 1: StoneBoard 1; break;
            case 2: MOTDConfig 1; break;
            case 3: GlobalEventMenu 1; break;
            case 4: GlobalDebugMenu 1; break;
        }
    } while (1);
}



-	script	@super	32767,{
    end;

OnCall:

    if (!debug && !is_dev())
    {
        dispbottom l("You do not have the required access privileges to use the Super Menu.");
        end;
    }

    SuperMenu;
    closeclientdialog;
    end;

OnInit:
    bindatcmd "super", "@super::OnCall", 0, 99, 0;
    bindatcmd "numa", "@super::OnCall", 0, 99, 0; // alias for those used to TMW's @numa
}

function	script	GrantSuperSkill	{
    .@debug_skill = getskilllv(EVOL_SUPER_MENU);

    if (.@debug_skill > 0 && !debug)
    {
        skill EVOL_SUPER_MENU, 0, 0; // remove debug skill. Not needed (skill tree)
    }

    else if (.@debug_skill < 1 && debug)
    {
        skill EVOL_SUPER_MENU, 1, 0; // give debug skill
    }
    return;
}