summaryrefslogtreecommitdiff
path: root/npc/019-2/guards.txt
blob: 04ca4911777d277b0ebad7e4da177789f5b7764b (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
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Protect Nivalis
//    Q_NivalisLibday
//    Day, Score, Temporary Time;

019-2,44,54,0	script	Guard#019-2.1	NPC_GUARD1,{
    .@q=getq(Q_NivalisLibday);

    if ($NIVALIS_LIBDATE) {
        mesn;
        mesq l("Nivalis was liberated @@ ago.", FuzzyTime($NIVALIS_LIBDATE));
        close;
    } else if ($NLIB_DAY > 0) {
        if ($NLIB_DAY >= 7) goto L_MK;
        if (.@q == $NLIB_DAY) goto L_Delay;
        if (BaseLevel < 30) goto L_Noob;
        if (BaseLevel >= 30) goto L_Veteran;
        close;
    } else if (is_admin()) {
        mesc "Initiate Nivalis Liberation Day?", 1;
        mesc "Event will last 7 days.", 1;
        select
            "Not yet.",
            "Yes",
            "No";
        if (@menu == 2) {
            addmapmask "019-3", MASK_MATTACK;
            $NLIB_DAY=1;
            $NLIB_HIGHTIME=0;
            $NLIB_HIGHNAME$="";
            setmapflagnosave("019-3", "000-1", 22, 22);
            setmapflagnosave("020-1", "000-1", 22, 22);
            setmapflagnosave("023-2", "000-1", 22, 22);
            setmapflag("019-3",mf_bexp,25);
            setmapflag("020-1",mf_bexp,150);
            disablenpc "#019-1_70_21";
            disablenpc "#019-2_37_55";
            disablenpc "#020-1_70_128";
            disablenpc "#020-1_107_55";
            enablenpc "Lightbringer#NLib";
            kamibroadcast("Nivalis Liberation Day has started.");
        }
        close;
    } else {
        legiontalk; end;
    }
    end;
// Event Selectors
L_Noob:
    mesn;
    mesq l("Hey, you! We need help to get rid from some remaining monsters at Nivalis City.");
    mesq l("No need to kill the Fluffies, though.");
    next;
    mesn;
    mesq l("Are you up for the challenge?");
    if (askyesno() == ASK_YES) {
        // Begin quest. Logout/Death will cause loss of the current day.
        setq1 Q_NivalisLibday, $NLIB_DAY;
        @nlib_wave=0;
        @nlib_time=300; // This makes sure that wave 1 will start.
        addtimer(5000, "#NLib_Siege::OnLoop");
        warp "020-1", rand(69,82), rand(78, 91);
    }
    close;

L_Veteran:
    mesn;
    mesq l("Hey, you! We need help to find the Monster King.");
    next;
    mesn;
    mesq l("Could you head deep in the woods and track him down?");
    if (askyesno() == ASK_YES) {
        // Control if you already found the Monster King
        @QNL3=0;
        // Begin quest. Logout/Death will cause loss of the current day.
        setq1 Q_NivalisLibday, $NLIB_DAY;
        setq3 Q_NivalisLibday, gettimetick(2);
        warp "019-3", any(128, 129, 130, 131, 132), any(24, 25, 26, 27);
        doevent("Guard#019-3.1::OnBegin");
        closedialog;
    }
    close;

L_MK:
    if (gettime(3) != 18 && !$@GM_OVERRIDE) {
        mesn;
        mesq l("Today at 18:30 UTC we are going to attack the Monster King by surprise. There will be no delays, so be there.");
    } else {
        mesn;
        mesq l("Do you want to go against the Monster King now? The event will start 18:30 UTC sharply.");
        if (askyesno() == ASK_YES) {
            // Control if you already found the Monster King
            @QNL3=0;
            // Begin quest. Logout/Death will cause loss of the current day.
            setq1 Q_NivalisLibday, $NLIB_DAY;
            setq3 Q_NivalisLibday, gettimetick(2);
            warp "019-3", any(128, 129, 130, 131, 132), any(24, 25, 26, 27);
            doevent("Guard#019-3.1::OnAdvise");
            closedialog;
        }
    }
    close;

// Misc
L_Delay:
    mesn;
    mesq l("You already helped us today. Come back tomorrow.");
    next;
    mesc l("Do you want to cross to the other side? You'll need to find the sea to return here if you do."), 1;
    next;
    if (askyesno() == ASK_YES)
        warp "019-1", 70, 30;
    close;

OnInit:
    if ($NLIB_DAY)
            addmapmask "019-3", MASK_MATTACK;

    .sex = G_MALE;
    .distance = 5;
    end;

OnHour00:
    if ($NLIB_DAY)
        $NLIB_DAY+=1;
    end;

OnClock1825:
    if ($NLIB_DAY == 7)
        announce "All players, Nivalis Liberation Day starting in five minutes.", bc_all | bc_npc;
    end;

OnClock1830:
    if ($NLIB_DAY != 7)
        end;
    setmapflag("023-2",mf_bexp,200);
    setmapflag("023-2",mf_nopenalty);
    donpcevent("The Monster King#NLib::OnBegin");
    end;
}