summaryrefslogtreecommitdiff
path: root/npc/008-1/prsm.txt
blob: 929deaccc916102a041fb2746294663c9ed6cd36 (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
// Evol scripts.
// Author:
//    Jesusalva
// Description:
//    No sitting or standing on Prsm

008-1,0,0,0	script	#PrsmGuard	NPC_HIDDEN,0,0,{
OnInit:
    .accid=0;
    .active=false;
    end;

OnPCLogin:
    if (strcharinfo(0) == "Prsm")
    {
        initnpctimer;
        .accid=getcharid(3);
    }
    end;

OnTimer5000:
    if (!attachrid(.accid))
    {
        stopnpctimer;
        .accid=0;
        .active=false;
        end;
    }
    // Prsm is attached
    getmapxy(.@m$, .@x, .@y ,0);
    if (.@m$ != "008-1" && .active)
    {
        movenpc .name$, .@x, .@y;
        .active=false;
    }
    else if (.@m$ == "008-1")
    {
        .active=true;
        movenpc .name$, .@x, .@y;
    }
    end;

OnTouch:
    // GMs can stand/sit on Prsm because they might be Prsm >.>
    if (getgroupid())
        end;
    // Start timer (in case player just passed by, and is not trying to annoy Prsm)
    addtimer 2000, "#PrsmGuard::OnWarning";
    end;

OnUnTouch:
    deltimer("#PrsmGuard::OnWarning");
    end;

OnWarning:
    switch (@prsm_warning)
    {
        case 0:
        case 3:
            dispbottom l("Sitting or standing in Prsm is prohibted. Please move peacefully.");
            break;
        case 1:
        case 4:
        case 7:
            dispbottom l("Sitting or standing in Prsm is prohibted. YOU HAVE BEEN WARNED!");
            break;
        case 2:
        case 5:
        case 8:
            dispbottom l("Moving player preventively.");
            getmapxy(.@m$, .@x, .@y, 0);
            slide .@x+any(1,-1), .@y+any(1,-1);
            break;
        case 6:
        case 9:
            dispbottom l("Moving and killing player preventively.");
            getmapxy(.@m$, .@x, .@y, 0);
            slide .@x+any(1,-1), .@y+any(1,-1);
            percentheal -100, -100;
            break;
        case 10:
        default:
            dispbottom l("Preventively banning annoying player so Prsm can rest in peace.");
            getmapxy(.@m$, .@x, .@y, 0);
            slide .@x+any(1,-1), .@y+any(1,-1);
            atcommand "@ban 10mn "+strcharinfo(0); // This is half sane, half insane
            break;
    }
    @prsm_warning+=1;
    addtimer rand(3800, 4800), "#PrsmGuard::OnWarning";
    end;

}