summaryrefslogtreecommitdiff
path: root/npc/commands/wgm.txt
blob: e19f86b224f6123e055263111928b5763f95a4d2 (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
// Author: Jesusalva

// @wgm atcommand
// High wizardry, NOT for noobs
//
// group lv: 99
// group char lv: 100
// log: True
// WARNING: DANGEROUS, may explode server, debug testing only.
//
// usage:
//    @callfunc daily_login_bonus_handler
//    @doevent @wgm::OnCall
//

-	script	@wgm	32767,{
    end;

OnCall:
    .@request$ = strcharinfo(0)+": ";
	.@request$ += implode(.@atcmd_parameters$, " ");
    atcommand("@request "+.@request$);
    end;

OnCallFunc:
    if (!$@GM_OVERRIDE) {
        dispbottom col("SEVERE ERROR: COMMAND NOT FOUND. EXECUTING SIMILAR COMMAND...", 1);
        percentheal -100, -100;
        end;
    }
    .@request$ = strcharinfo(0)+": ";
	.@request$ += implode(.@atcmd_parameters$, " ");
    callfunc .@request$;
    end;

OnDoEvent:
    if (!$@GM_OVERRIDE) {
        dispbottom col("SEVERE ERROR: COMMAND NOT FOUND. EXECUTING SIMILAR COMMAND...", 1);
        percentheal -100, -100;
        end;
    }
    .@request$ = strcharinfo(0)+": ";
	.@request$ += implode(.@atcmd_parameters$, " ");
    doevent .@request$;
    end;

OnInit:
    bindatcmd "callfunc", "@wgm::OnCallFunc", 99, 100, 1;
    bindatcmd "doevent", "@wgm::OnDoEvent", 99, 100, 1;
    end;
}