summaryrefslogtreecommitdiff
path: root/npc/commands/debug.txt
blob: a2b25447a94496d3a1ebb09567293f62bc317a24 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
function	script	Debug	{
    goto L_Begin;

L_Begin:
    @debug_mask = 65535;
    @debug_shift = 0;
    @mexp = ((MAGIC_EXPERIENCE & @debug_mask) >> @debug_shift);
    mes "What do you want to do?";
    mes "Your range: "+readbattleparam(getcharid(3), UDT_ATKRANGE);
    mes "Bow range: "+getiteminfo(Bow, ITEMINFO_RANGE);
    menu
        "Reset stat points.", L_Level,
        "Change my level.", L_Level,
        "Change other stuff.", L_Stats,
        "Change my basic skills.", L_BasicSkills,
        "Change my focus skills.", L_FocusSkills,
        "Change my magic skills.", L_MagicSkills,
        "Add everything.", L_AddAll,
        "Reset everything.", L_ResetAll,
        "Close.", L_close;

L_Stats:
    mesc l("Stats: %s", col(b("@str/@agi/@vit/@int/@dex/@luk/@allstats"),3));
    mesc l("GP: %s", col(b("@zeny"),3));
    mesc l("Items: %s", col(b("/createitems"),3));
    mesc l("Hide from monsters: %s", col(b("@monsterignore or @safe"),3));
    next;
    goto L_Begin;

L_Level:
    mes "What level do you want to be (min: 1 - max: 99)?";
    input @lvl;
    if (@lvl < 1)
        goto L_LevelTooLow;
    if (@lvl > 99)
        goto L_LevelTooHigh;
    if (BaseLevel == @lvl)
        goto L_SameLevel;
    BaseLevel = @lvl;
    resetstatus;
    mes "You are now level " + BaseLevel + ".";
    goto L_Begin;

L_LevelTooLow:
    mes "Bad choice. Minimum level is 1.";
    next;
    goto L_Begin;

L_LevelTooHigh:
    mes "Bad choice. Maximum level is 99.";
    next;
    goto L_Begin;

L_SameLevel:
    mes "You already are level " + @lvl + ".";
    next;
    goto L_Begin;

L_ResetStatusPoints:
    resetstatus;
    mes "Stats successfully resetted.";
    next;
    goto L_Begin;

L_BasicSkills:
    adddefaultskills();
    goto L_Begin;

L_FocusSkills:
    @pool = getskilllv(SKILL_POOL);
    @mallard = getskilllv(SKILL_MALLARDS_EYE);
    @brawling = getskilllv(SKILL_BRAWLING);
    @speed = getskilllv(SKILL_SPEED);
    @poison = getskilllv(SKILL_RESIST_POISON);
    @astralsoul = getskilllv(SKILL_ASTRAL_SOUL);
    @raging = getskilllv(SKILL_RAGING);
    /*
    menu
        "Overview of my focus skills.", L_SeeFocusSkills,
        "Focus or unfocus.", L_Unfocus,
        "Add focus skills.", L_ChangeFocusSkills,
        "Reset focus skills.", L_ResetFocusSkills,
        "Back to the main menu.", L_Begin,
        "Close.", L_close;
    */
    mes "Your focusing skill level is " + @pool + ".";
    mes "Your mallard's eye skill level is " + @mallard + ".";
    mes "Your brawling skill level is " + @brawling + ".";
    mes "Your speed skill level is " + @speed + ".";
    mes "Your resist poison skill level is " + @poison + ".";
    mes "Your astral soul skill level is " + @astralsoul + ".";
    mes "Your raging skill level is " + @raging + ".";
    next;
    mes "";
    mes l("Focus list:");
    mesc l("%s : %s", l("Mallard's Eye"),
          (isfocused(SKILL_MALLARDS_EYE) ? l("Yes") : l("No")));
    mesc l("%s : %s", l("Brawling"),
          (isfocused(SKILL_BRAWLING) ? l("Yes") : l("No")));
    mesc l("%s : %s", l("Speed"),
          (isfocused(SKILL_SPEED) ? l("Yes") : l("No")));
    mesc l("%s : %s", l("Resist Ailment"),
          (isfocused(SKILL_RESIST_POISON) ? l("Yes") : l("No")));
    mesc l("%s : %s", l("Astral Soul"),
          (isfocused(SKILL_ASTRAL_SOUL) ? l("Yes") : l("No")));
    mesc l("%s : %s", l("Raging"),
          (isfocused(SKILL_RAGING) ? l("Yes") : l("No")));
    .@t=getactivatedpoolskilllist();
    menuint
        l("Back"), -3,
        l("Focus Skill +"), -2,
        rif(getskilllv(SKILL_POOL), l("Focus Skill -")), -1,
        l("Add all focus skills"), 0,
        l("Remove all focus skills"), -4,
        ("Toggle Focus - Mallards Eye"), SKILL_MALLARDS_EYE,
        ("Toggle Focus - Brawling"), SKILL_BRAWLING,
        ("Toggle Focus - Speed"), SKILL_SPEED,
        ("Toggle Focus - Resist Ailment"), SKILL_RESIST_POISON,
        ("Toggle Focus - Astral Soul"), SKILL_ASTRAL_SOUL,
        ("Toggle Focus - Raging"), SKILL_RAGING;
    mes "";
    switch (@menuret) {
    case -3: goto L_Begin;
    case -2:
        skill SKILL_POOL, @pool+1, 0; break;
    case -1:
        skill SKILL_POOL, max(0, @pool-1), 0; break;
    case 0:
        updateskill SKILL_MALLARDS_EYE, 9;
        updateskill SKILL_BRAWLING, 9;
        updateskill SKILL_SPEED, 9;
        updateskill SKILL_RESIST_POISON, 9;
        updateskill SKILL_ASTRAL_SOUL, 9;
        updateskill SKILL_RAGING, 9;
        break;
    case -4:
        skill SKILL_POOL, 0, 0; break;
        updateskill SKILL_MALLARDS_EYE, 0;
        updateskill SKILL_BRAWLING, 0;
        updateskill SKILL_SPEED, 0;
        updateskill SKILL_RESIST_POISON, 0;
        updateskill SKILL_ASTRAL_SOUL, 0;
        updateskill SKILL_RAGING, 0;
        break;
    default:
        if (FOCUSING & getpoolskillFID(@menuret)) {
            unpoolskill(@menuret);
            mesc "Focus removed", 1;
        } else {
            .@s = poolskill(@menuret);
            if (.@s)
                mesc "Focus added", 2;
            else
                mesc sprintf("Impossible to focus. You can only focus %d skills at a time.", .@t), 1;
        }
    }
    goto L_FocusSkills;

L_MagicSkills:
    @general = getskilllv(SKILL_MAGIC);
    @life = getskilllv(SKILL_MAGIC_LIFE);
    @war = getskilllv(SKILL_MAGIC_WAR);
    @trans = getskilllv(SKILL_MAGIC_TRANSMUTE);
    @nature = getskilllv(SKILL_MAGIC_NATURE);
    @astral = getskilllv(SKILL_MAGIC_ASTRAL);
    @dark = getskilllv(SKILL_MAGIC_DARK);
    menu
        "Overview of my magical skills.", L_MagicSkillsOverview,
        "Get magic skills.", L_ChangeMagicSkills,
        "Get magic experience.", L_MagicExperience,
        "All magic skills to their maximum level and maximum magic experience.", L_GetAllMagic,
        "Reset magic skills and experience.", L_ResetMagicSkills,
        "Back to the main menu.", L_Begin,
        "Close.", L_close;

L_MagicSkillsOverview:
    mes "Your current legacy magic experience skill is " + @mexp + ".";
    mes "Your current Evolved magic exp is "+MAGIC_EXP;
    mes "Your level in the general magic skill is " + @general + ".";
    mes "Your level in the life magic skill is " + @life + ".";
    mes "Your level in the war magic skill is " + @war + ".";
    mes "Your level in the transmutation magic skill is " + @trans + ".";
    mes "Your level in the nature magic skill is " + @nature + ".";
    mes "Your level in the astral magic skill is " + @astral + ".";
    mes "Your level in the dark magic skill is " + @dark + ".";
    next;
    goto L_MagicSkills;

L_MagicExperience:
    mes "Your current magic experience is " + @mexp + ".";
    if (@general == 0
        && @life == 0
        && @war == 0
        && @trans == 0
        && @nature == 0
        && @astral == 0
        && @dark == 0)
            goto L_NoMagicSkills;

    goto L_ChangeMagicExperience;

L_NoMagicSkills:
    mes "You can't have magic experience, since you have no magic skills yet.";
    goto L_MagicSkills;

L_ChangeMagicExperience:
    mes "Set the desired legacy magic experience (min: 0 - max: 8000).";
    input @value;
    if (@value < 0 || @value > 8000)
        goto L_WrongMagicExperience;
    @mexp = @value;
    callsub S_Update_Mask;
    mes "You now have " + @mexp + " legacy magic experience points.";
    goto L_MagicSkills;

L_WrongMagicExperience:
    mes "Wrong value informed. Aborting.";
    goto L_MagicSkills;

L_ChangeMagicSkills:
    menu
        "General Magic.", L_ChangeGeneralMagicSkill,
        "Life Magic.", L_ChangeLifeMagicSkill,
        "War Magic.", L_ChangeWarMagicSkill,
        "Transmutation Magic.", L_ChangeTransmutationMagicSkill,
        "Nature Magic.", L_ChangeNatureMagicSkill,
        "Astral Magic.", L_ChangeAstralMagicSkill,
        "Dark Magic.", L_ChangeDarkMagicSkill,
        "Back to the magic skills menu.", L_MagicSkills,
        "Close.", L_close;

L_ChangeGeneralMagicSkill:
    mes "Your level in the general magic skill is " + @general + ". What do you want to do?";
    menu
        "Get level 0.", L_Next4,
        "Get level 1.", L_ChangeGeneralMagicSkill1,
        "Get level 2.", L_ChangeGeneralMagicSkill2;

L_Next4:
    if (@menu == 1)
        updateskill SKILL_MAGIC, 0;
    mes "General Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeGeneralMagicSkill1:
    updateskill SKILL_MAGIC, 1;
    mes "General Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeGeneralMagicSkill2:
    updateskill SKILL_MAGIC, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "General Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

L_ChangeLifeMagicSkill:
    mes "Your level in the life magic skill is " + @life + ". What do you want to do?";
    menu
        "Get level 0.", L_Next5,
        "Get level 1.", L_ChangeLifeMagicSkill1,
        "Get level 2.", L_ChangeLifeMagicSkill2;

L_Next5:
    if (@menu == 1)
        updateskill SKILL_MAGIC_LIFE, 0;
    mes "Life Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeLifeMagicSkill1:
    updateskill SKILL_MAGIC_LIFE, 1;
    mes "Life Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeLifeMagicSkill2:
    updateskill SKILL_MAGIC_LIFE, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "Life Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

L_ChangeWarMagicSkill:
    mes "Your level in the war magic skill is " + @war + ". What do you want to do?";
    menu
        "Get level 0.", L_Next6,
        "Get level 1.", L_ChangeWarMagicSkill1,
        "Get level 2.", L_ChangeWarMagicSkill2;

L_Next6:
    if (@menu == 1)
        updateskill SKILL_MAGIC_WAR, 0;
    mes "War Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeWarMagicSkill1:
    updateskill SKILL_MAGIC_WAR, 1;
    mes "War Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeWarMagicSkill2:
    updateskill SKILL_MAGIC_WAR, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "War Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

L_ChangeTransmutationMagicSkill:
    mes "Your level in the transmutation magic skill is " + @trans + ". What do you want to do?";
    menu
        "Get level 0.", L_Next7,
        "Get level 1.", L_ChangeTransmutationMagicSkill1,
        "Get level 2.", L_ChangeTransmutationMagicSkill2;

L_Next7:
    if (@menu == 1)
        updateskill SKILL_MAGIC_TRANSMUTE, 0;
    mes "Transmutation Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeTransmutationMagicSkill1:
    updateskill SKILL_MAGIC_TRANSMUTE, 1;
    mes "Transmutation Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeTransmutationMagicSkill2:
    updateskill SKILL_MAGIC_TRANSMUTE, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "Transmutation Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

L_ChangeNatureMagicSkill:
    mes "Your level in the nature magic skill is " + @nature + ". What do you want to do?";
    menu
        "Get level 0.", L_Next8,
        "Get level 1.", L_ChangeNatureMagicSkill1,
        "Get level 2.", L_ChangeNatureMagicSkill2;

L_Next8:
    if (@menu == 1)
        updateskill SKILL_MAGIC_NATURE, 0;
    mes "Nature Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeNatureMagicSkill1:
    updateskill SKILL_MAGIC_NATURE, 1;
    mes "Nature Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeNatureMagicSkill2:
    updateskill SKILL_MAGIC_NATURE, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "Nature Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

L_ChangeAstralMagicSkill:
    mes "Your level in the astral magic skill is " + @astral + ". What do you want to do?";
    menu
        "Get level 0.", L_Next9,
        "Get level 1.", L_ChangeAstralMagicSkill1,
        "Get level 2.", L_ChangeAstralMagicSkill2;

L_Next9:
    if (@menu == 1)
        updateskill SKILL_MAGIC_ASTAL, 0;
    mes "Astral Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeAstralMagicSkill1:
    updateskill SKILL_MAGIC_ASTRAL, 1;
    mes "Astral Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeAstralMagicSkill2:
    updateskill SKILL_MAGIC_ASTRAL, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "Astral Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

L_ChangeDarkMagicSkill:
    mes "Your level in the dark magic skill is " + @dark + ". What do you want to do?";
    menu
        "Get level 0.", L_Next10,
        "Get level 1.", L_ChangeDarkMagicSkill1,
        "Get level 2.", L_ChangeDarkMagicSkill2;

L_Next10:
    if (@menu == 1)
        updateskill SKILL_MAGIC_DARK, 0;
    mes "Dark Magic skill changed to level 0.";
    next;
    goto L_MagicSkills;

L_ChangeDarkMagicSkill1:
    updateskill SKILL_MAGIC_DARK, 1;
    mes "Dark Magic skill changed to level 1.";
    next;
    goto L_MagicSkills;

L_ChangeDarkMagicSkill2:
    updateskill SKILL_MAGIC_DARK, 2;
    if (@mexp < 100)
        @mexp = 100;
    callsub S_Update_Mask;
    mes "Dark Magic skill changed to level 2.";
    next;
    goto L_MagicSkills;

S_Update_Mask:
    set MAGIC_EXPERIENCE,
        (MAGIC_EXPERIENCE & ~(@debug_mask))
            | (@mexp << @debug_shift);
    return;

L_GetAllMagic:
    updateskill SKILL_MAGIC, 5;
    updateskill SKILL_MAGIC_LIFE, 5;
    updateskill SKILL_MAGIC_WAR, 5;
    updateskill SKILL_MAGIC_TRANSMUTE, 5;
    updateskill SKILL_MAGIC_NATURE, 5;
    updateskill SKILL_MAGIC_ASTRAL, 5;
    updateskill SKILL_MAGIC_DARK, 5;
    @mexp = 8000;
    callsub S_Update_Mask;
    mes "Magic skills added.";
    next;
    goto L_MagicSkills;

L_ResetMagicSkills:
    updateskill SKILL_MAGIC, 0;
    updateskill SKILL_MAGIC_LIFE, 0;
    updateskill SKILL_MAGIC_WAR, 0;
    updateskill SKILL_MAGIC_TRANSMUTE, 0;
    updateskill SKILL_MAGIC_NATURE, 0;
    updateskill SKILL_MAGIC_ASTRAL, 0;
    updateskill SKILL_MAGIC_DARK, 0;
    @mexp = 0;
    callsub S_Update_Mask;
    mes "Magic skills removed.";
    next;
    goto L_MagicSkills;

L_AddAll:
    adddefaultskills();
    updateskill SKILL_POOL, 1;
    updateskill SKILL_MALLARDS_EYE, 9;
    updateskill SKILL_BRAWLING, 9;
    updateskill SKILL_SPEED, 9;
    updateskill SKILL_RESIST_POISON, 9;
    updateskill SKILL_ASTRAL_SOUL, 9;
    updateskill SKILL_RAGING, 9;
    updateskill SKILL_MAGIC, 5;
    updateskill SKILL_MAGIC_LIFE, 5;
    updateskill SKILL_MAGIC_WAR, 5;
    updateskill SKILL_MAGIC_TRANSMUTE, 5;
    updateskill SKILL_MAGIC_NATURE, 5;
    updateskill SKILL_MAGIC_ASTRAL, 5;
    updateskill SKILL_MAGIC_DARK, 5;

    // Real skills
    updateskill EVOL_AREA_PROVOKE, 9;
    updateskill EVOL_PHYSICAL_SHIELD, 9;
    updateskill SKILL_ABIZIT, 1;
    updateskill SKILL_FLAR, 9;
    @mexp = 8000;
    resetstatus;
    BaseLevel = 99;
    mes "All skills added to their maximum level.";
    mes "Maximum number of Legacy Magic Experience points.";
    mes "You are now level " + BaseLevel + ".";
    next;
    goto L_Begin;

L_ResetAll:
    cleararray @skilllist_name$[0], "", 8;
    cleararray @skilllist_id[0], 0, 8;
    cleararray @skilllist_count[0], 0, 8;
    //adddefaultskills();
    updateskill SKILL_POOL, 0;
    updateskill SKILL_MALLARDS_EYE, 0;
    updateskill SKILL_BRAWLING, 0;
    updateskill SKILL_SPEED, 0;
    updateskill SKILL_RESIST_POISON, 0;
    updateskill SKILL_ASTRAL_SOUL, 0;
    updateskill SKILL_RAGING, 0;
    updateskill SKILL_MAGIC, 0;
    updateskill SKILL_MAGIC_LIFE, 0;
    updateskill SKILL_MAGIC_WAR, 0;
    updateskill SKILL_MAGIC_TRANSMUTE, 0;
    updateskill SKILL_MAGIC_NATURE, 0;
    updateskill SKILL_MAGIC_ASTRAL, 0;
    updateskill SKILL_MAGIC_DARK, 0;
    @mexp = 0;
    callsub S_Update_Mask;
    resetstatus;
    BaseLevel = 1;
    mes "All skills removed.";
    mes "Minimum number of Legacy Magic Experience points.";
    mes "You are now level " + BaseLevel + ".";
    next;
    goto L_Begin;

L_close:
    closeclientdialog;
    return;
}

-	script	Debug Spell	NPC32767,{
    end;

OnDebug:
    if (!debug && getgmlevel() < CMD_DEBUG) end;
    callfunc "Debug";
    end;

OnSetVar:
    if (getarraysize(.@atcmd_parameters$) != 3)
        Exception("Usage: @set-var VARIABLE INDEX VALUE", RB_DISPBOTTOM|RB_ISFATAL);

    .@cmd$=array_shift(.@atcmd_parameters$);
    .@idx=atoi(array_shift(.@atcmd_parameters$));
    if (charat(.@atcmd_parameters$[0],
               getstrlen(.@atcmd_parameters$[0])-1) == "$")
        .@str=true;

    if (.@str)
        .@val$=array_shift(.@atcmd_parameters$);
    else
        .@val=array_shift(.@atcmd_parameters$);

    if (.@str)
        setd(sprintf("%s[%d]", .@cmd$, .@idx), .@val$);
    else
        setd(sprintf("%s[%d]", .@cmd$, .@idx), .@val);

    .@msg$=sprintf("%s[%d] is now: %s", .@cmd$, .@idx,
                   getd(sprintf("%s[%d]", .@cmd$, .@idx)));

    if (!is_trusted())
        charcommand("@request System Information: "+.@msg$);
    else
        dispbottom(.@msg$);
    end;

// If the char is not a staff member, it'll be sent to GM Log instead
OnGetVar:
    if (getarraysize(.@atcmd_parameters$) != 2)
        Exception("Usage: @get-var VARIABLE INDEX", RB_DISPBOTTOM|RB_ISFATAL);

    .@cmd$=array_shift(.@atcmd_parameters$);
    .@idx=atoi(array_shift(.@atcmd_parameters$));

    .@mg$=sprintf("%s[%d] == %s", .@cmd$, .@idx,
                      getd(sprintf("%s[%d]", .@cmd$, .@idx)));

    if (!is_trusted())
        charcommand("@request System Information: "+.@mg$);
    else
        dispbottom(.@mg$);
    end;

OnSClear:
    sc_end SC_ALL;
    sc_end SC_DAILYSENDMAILCNT;
    dispbottom l("Status Condition Cleared");
    end;

OnAllPerms:
    if (@allperms) end;
    charcommand("@addperm all_skill");
    charcommand("@addperm all_equipment");
    charcommand("@addperm skill_unconditional");
    charcommand("@addperm join_chat");
    charcommand("@addperm hide_session");
    charcommand("@addperm any_warp");
    charcommand("@addperm view_hpmeter");
    charcommand("@addperm view_equipment");
    charcommand("@addperm receive_requests");
    charcommand("@addperm can_trade_bound");
    charcommand("@addperm bypass_nostorage");
    @allperms=true;
    end;

OnInit:
    registercmd "@debug", "Debug Spell::OnDebug";
    bindatcmd "getvar", "Debug Spell::OnGetVar", 99, 99, 1;
    bindatcmd "get-var", "Debug Spell::OnGetVar", 99, 99, 1;
    bindatcmd "setvar", "Debug Spell::OnSetVar", 99, 99, 1;
    bindatcmd "set-var", "Debug Spell::OnSetVar", 99, 99, 1;
    bindatcmd "sclear", "Debug Spell::OnSClear", 99, 99, 1;
    bindatcmd "allperms", "Debug Spell::OnAllPerms", 99, 100, 1;
    end;
}

029-2,30,26,0	script	Debug#0	NPC154,{
    @debug_npc = 1;
    callfunc "Debug";
    end;
OnInit:
    if (!debug)
        disablenpc "Debug#0";
    end;
}

001-1,53,47,0	script	Debug#1	NPC154,{
    @debug_npc = 1;
    callfunc "Debug";
    end;
OnInit:
    if (!debug)
        disablenpc "Debug#1";
    end;
}

009-1,45,33,0	script	Debug#2	NPC154,{
    @debug_npc = 1;
    callfunc "Debug";
    end;
OnInit:
    if (!debug)
        disablenpc "Debug#2";
    end;
}

020-1,75,85,0	script	Debug#3	NPC154,{
    @debug_npc = 1;
    callfunc "Debug";
    end;
OnInit:
    if (!debug)
        disablenpc "Debug#3";
    end;
}