summaryrefslogtreecommitdiff
path: root/npc/commands/debug-skill.txt
blob: 2e5393a494760d8d3f4e61708d45852b324856fe (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
74
75
76
77
78
79
80
81
function	script	GlobalSkillDebug	{

    function modifySkill {

        function setSkill {
            clear;
            mes l("Enter desired skill level:");
            input .@y;
            skill getarg(0,1), max(0, min(10, .@y)), 0;
            return;
        }

        setnpcdialogtitle l("Skill Debug - Modify Skill");
        .@k = getarg(0,1);
        .@v = getskilllv(.@k);
        select
            menuimage("actions/abort", l("Abort")),
            rif(.@v > 0, menuimage("actions/remove", l("Remove this skill"))),
            rif(.@v < 10, menuimage("actions/raise", l("Raise this skill"))),
            rif(.@v > 0, menuimage("actions/lower", l("Lower this skill"))),
            menuimage("actions/edit", l("Set the level manually")),
            menuimage("actions/back", l("Return to skill debug menu"));

        switch (@menu)
        {
            case 2: skill .@k, 0, 0; break;
            case 3: skill .@k, min(10, .@v + 1), 0; break;
            case 4: skill .@k, max(0, .@v - 1), 0; break;
            case 5: setSkill .@k; break;
        }

        return;
    }

    do
    {
        clear;
        setnpcdialogtitle l("Skill Debug");
        mes l("This menu allows you to change your skills.");
        mes "";

        mes "---";
        // FIXME: maybe get skills from an array or `getskilllist;` <= would need a `getskillinfo()` buildin though
        mes "NV_BASIC: " + getskilllv(NV_BASIC);
        mes "---";

        mes "";
        mes l("Which skill do you wish to change?");
        next;

        menuint
            "NV_BASIC", NV_BASIC,
            rif(getarg(0,0), menuimage("actions/back", l("Return to Debug menu"))), -1;

        switch (@menuret)
        {
            case -1: return;
        }

        modifySkill @menuret;

    } while (1);
}



-	script	@sdebug	32767,{
    end;

OnCall:
    if (!debug && !is_admin())
    {
        end;
    }
    GlobalSkillDebug;
    closedialog;
    end;

OnInit:
    bindatcmd "sdebug", "@sdebug::OnCall", 0, 99, 0;
}