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
|
// TMW2 Scripts
// Author:
// Jesusalva
// Description:
// Tulimshar Guardhouse Taskmaster
003-10,41,63,0 script Kreist NPC_PLAYER,{
.@d=gettimeparam(GETTIME_DAYOFMONTH);
mesn l("Kreist, Taskmaster");
mesq l("Hello, and welcome to the Tulimshar guard house.");
next;
mesn l("Kreist, Taskmaster");
mesq l("My name is @@ and I am the daily task master. Interested in keeping this world free from monsters, or are you here to report back?", .name$);
next;
tutmes l("All quests expire at 00:00 server time, be sure to finish AND report back before that!");
// Borrowed from Arkim Code
mesc l("Time remaining to report completion: ")+FuzzyTime($@ARKIM_TIMER+86400), 1;
select
l("I want an EASY task!"),
l("I want a MODERATE task!"),
l("I want an EXPERT task!"),
l("It was nice seeing you.");
mes "";
switch (@menu) {
case 1:
.@q1=getq(General_MobHunting1);
.@q2=getq2(General_MobHunting1);
.@q3=getq3(General_MobHunting1);
.@q=General_MobHunting1;
.@lv=3;
goto L_QuestMaster;
case 2:
.@q1=getq(General_MobHunting2);
.@q2=getq2(General_MobHunting2);
.@q3=getq3(General_MobHunting2);
.@q=General_MobHunting2;
.@lv=5;
goto L_QuestMaster;
case 3:
.@q1=getq(General_MobHunting3);
.@q2=getq2(General_MobHunting3);
.@q3=getq3(General_MobHunting3);
.@q=General_MobHunting3;
.@lv=12;
goto L_QuestMaster;
}
closeclientdialog;
goodbye();
close;
L_QuestMaster:
// It's a new day, so we must generate a new quest!
if (.@q1 != .@d) {
.@q1=.@d;
if (.@lv == 3) {
.@q2=any(Maggot, Scorpion, Croc, FireGoblin, CaveMaggot, Duck);
} else if (.@lv == 5) {
.@q2=any(CaveSnake, DesertBandit, Sarracenus, DesertLogHead, RedScorpion);
} else if (.@lv == 12) {
.@q2=any(GiantMaggot, BlackScorpion, Snake, MountainSnake);
} else {
Exception("Bad setting for GMH.LV: "+.@lv, RB_DEFAULT|RB_SPEECH|RB_ISFATAL);
}
setq .@q, .@q1, .@q2, 0;
}
// Maybe there is no monster to kill
if (!.@q2) {
mesn l("Kreist, Taskmaster");
mesq l("You've already completed this quest today. Try again tomorrow.");
close;
}
// Maybe you finished the quest?
if (.@q3 && get_byte(.@q3, 1) >= get_byte(.@q3, 0)) {
mesn l("Kreist, Taskmaster");
mesq l("Good job, you've killed the %d %s and reported back in time!", get_byte(.@q3, 0), getmonsterlink(.@q2));
next;
inventoryplace MercBoxA, 1;
if (MERCENARY_DAILYQUEST == 100) {
inventoryplace BountyHunterHelmet, 1;
getitem BountyHunterHelmet, 1;
}
mesn l("Kreist, Taskmaster");
mesq l("It's not much of a reward, but doesn't it feel great to help others in need?! HAHAHA!");
.@overkill=get_byte(.@q3, 1)-get_byte(.@q3, 0);
Zeny+=.@lv*(72+MERCENARY_DAILYQUEST);
// Raise LV according to monster level
.@lv+=getmonsterinfo(.@q2, MOB_LV)+MERCENARY_DAILYQUEST*11/10;
getexp BaseLevel*.@lv, .@lv+.@overkill;
setq2 .@q, 0;
setq3 .@q, 0;
MERCENARY_DAILYQUEST+=1;
if (MERCENARY_DAILYQUEST % 5 == 0) {
getitem MercBoxA, 1;
}
close;
}
mesn l("Kreist, Taskmaster");
// amount to kill
set_byte(.@q3, 0, 15);
// amount already killed
// Explanation why the city needs that
if (.@q2 == Maggot ) {
mesq l("%ss have infested the store houses, spilling onto the streets. Stop them from destroying even more food.", getmonsterlink(.@q2));
set_byte(.@q3, 0, 30);
} else if (.@q2 == GiantMaggot) {
mesq l("The %ss are the cause for all the little maggots to appear, so we need you to stop the problem at the source.", getmonsterlink(.@q2));
set_byte(.@q3, 0, 10);
} else if (.@q2 == Duck) {
mesq l("This request was made by the inn: The %ss are stealing their cherry cakes, causing disruption to their business.", getmonsterlink(.@q2));
} else if (.@q2 == Croc) {
mesq l("The %ss have been reproducing rapidly and their natural habitat, our Croconut trees, are being damaged by the excessive number of them.", getmonsterlink(.@q2));
} else if (.@q2 == FireGoblin) {
mesq l("Some %ss have buried themselves in the sand near the path to the mine, causing burns to people stepping on them.", getmonsterlink(.@q2));
} else if (.@q2 == CaveMaggot) {
mesq l("The %ss have been multiplying, crawling from the cave into the magic school, causing damage.", getmonsterlink(.@q2));
set_byte(.@q3, 0, 20);
} else if (.@q2 == CaveSnake) {
mesq l("Researchers from the magic school complained about %ss disturbing whatever they are studying in the cave.", getmonsterlink(.@q2));
} else if (.@q2 == Scorpion) {
mesq l("All the %ss have become a real nuisance to the citizens and people are getting stung more often now.", getmonsterlink(.@q2));
set_byte(.@q3, 0, 20);
} else if (.@q2 == DesertBandit) {
mesq l("A group of %ss are threatening the city. Go to the Desert Canyon and teach them a lesson.", getmonsterlink(.@q2));
set_byte(.@q3, 0, 20);
} else if (.@q2 == Sarracenus) {
mesq l("%ss are lead by the %ss. Disposing of them would bring the bandits into disarray.", getmonsterlink(DesertBandit), getmonsterlink(.@q2));
set_byte(.@q3, 0, 10);
} else if (.@q2 == BlackScorpion) {
mesq l("A large number of %ss have been sighted. Both the sewer and the mines have been infested, they have even been spotted in the city wall!", getmonsterlink(.@q2));
} else if (.@q2 == RedScorpion) {
mesq l("Some %ss have left the mines and made themselves comfortable in the desert, coming closer than ever to us. When there are none left in the desert, go after their nest in the mines.", getmonsterlink(.@q2));
} else if (.@q2 == DesertLogHead) {
mesq l("The %ss are growing and disturbing the already rather infertile desert soil, preventing our crops from growing.", getmonsterlink(.@q2));
}
setq3 .@q, .@q3;
mesq l("So, please kill %d/%d %ss for us and make the city a better place!", get_byte(.@q3, 1), get_byte(.@q3, 0), getmonsterlink(.@q2));
close;
OnInit:
// Check items.xml for info about this.
.@npcId = getnpcid(.name$);
setunitdata(.@npcId, UDT_HEADTOP, WarlordHelmet);
setunitdata(.@npcId, UDT_HEADMIDDLE, LieutenantArmor);
setunitdata(.@npcId, UDT_HEADBOTTOM, RaidTrousers);
setunitdata(.@npcId, UDT_SHIELD, LousyMoccasins); // TODO FIXME: Display Boots
setunitdata(.@npcId, UDT_WEAPON, Backsword);
setunitdata(.@npcId, UDT_HAIRSTYLE, 7);
setunitdata(.@npcId, UDT_HAIRCOLOR, 15);
npcsit;
.sex = G_MALE;
.distance = 4;
end;
}
// What is with this stupidly long quest name?
function script Guardhouse_RandQuestCheck {
if (!playerattached())
return;
.@mobId=getarg(0, killedrid);
.@d=gettimeparam(GETTIME_DAYOFMONTH);
// Easy Task
if (getq(General_MobHunting1) == .@d &&
getq2(General_MobHunting1) == .@mobId) {
.@q3=getq3(General_MobHunting1);
.@killamount=get_byte(.@q3, 1);
set_byte(.@q3, 1, min(255, .@killamount+1));
setq3 General_MobHunting1, .@q3;
if (!(.@killamount % 5))
dispbottom l("%d/%d %s killed", .@killamount+1, get_byte(.@q3, 0), getmonsterlink(.@mobId));
}
// Medium Task
if (getq(General_MobHunting2) == .@d &&
getq2(General_MobHunting2) == .@mobId) {
.@q3=getq3(General_MobHunting2);
.@killamount=get_byte(.@q3, 1);
set_byte(.@q3, 1, .@killamount+1);
setq3 General_MobHunting2, .@q3;
if (!(.@killamount % 5))
dispbottom l("%d/%d %s killed", .@killamount+1, get_byte(.@q3, 0), getmonsterlink(.@mobId));
}
// Hard Task
if (getq(General_MobHunting3) == .@d &&
getq2(General_MobHunting3) == .@mobId) {
.@q3=getq3(General_MobHunting3);
.@killamount=get_byte(.@q3, 1);
set_byte(.@q3, 1, .@killamount+1);
setq3 General_MobHunting3, .@q3;
if (!(.@killamount % 5))
dispbottom l("%d/%d %s killed", .@killamount+1, get_byte(.@q3, 0), getmonsterlink(.@mobId));
}
// Frostia's Task
if (getq(General_MobHunting4) == .@d &&
getq2(General_MobHunting4) == .@mobId) {
.@q3=getq3(General_MobHunting4)+1;
setq3 General_MobHunting4, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Frostia - Medium Task
if (getq(General_MobHunting5) == .@d &&
getq2(General_MobHunting5) == .@mobId) {
.@q3=getq3(General_MobHunting5)+1;
setq3 General_MobHunting5, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Frostia - Hard Task
if (getq(General_MobHunting6) == .@d &&
getq2(General_MobHunting6) == .@mobId) {
.@q3=getq3(General_MobHunting6)+1;
setq3 General_MobHunting6, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Frostia - Nightmare Task
if (getq(General_MobHunting7) == .@d &&
getq2(General_MobHunting7) == .@mobId) {
.@q3=getq3(General_MobHunting7)+1;
setq3 General_MobHunting7, .@q3;
if (!(.@q3 % 10))
dispbottom l("@@/@@ @@ killed", .@q3, 50, getmonsterlink(.@mobId));
}
// Frostia - Boss Task
if (getq(General_MobHunting8) == .@d &&
getq2(General_MobHunting8) == .@mobId) {
if (!.@q3)
dispbottom l("%s slain!", getmonsterlink(.@mobId));
.@q3=getq3(General_MobHunting8)+1;
setq3 General_MobHunting8, .@q3;
}
return;
}
|