summaryrefslogtreecommitdiff
path: root/world/map/npc/mobs/miner_mania.txt
blob: 445c82e0d3cd9c000e0c56d682c2e30782a69f42 (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
///////////////////////////////////////////////////////////////////////////////
// Miner Mania
-|script|Miner_Mania|32767
{
    close;

OnInit:
/*
- 1 tick = 1 sec

- If $@bif/slime_mine_maps_x0/y0/x1/y1 = -1 the matching min/max corner value is taken x0 = 0, y0 = 0, x1 = max x, y1 = max y

- $@bifs_big and $@bifs_small must always have the same size as $@bifs

- if "error_log: on" is in world/map/conf/battle_local.conf it displays messages like "npc_event: event not found [Miner_Mania::OnBifMined10]" which clutter the server console
  but otherwise do no harm, its also possible to make "error_log: off" so they don't get displayed anymore but to be sure include a label with the mapnumber in it like:
  OnBifMined99:
      end;

- $@bifs/slimes_multi set after how many ticks this map/spot spawns.
  For example multi 6 would spawn on 6th tick which is 6 sec on 1 sec tick duration.
  For example if you have multiple sqares on a map and to not spawn <num of squares> * 1 tick faster than other maps, use multi = num of squares:
    setarray $@bif_mine_maps$,   "009-1", "009-1", "009-1", "009-2", "008-1", "018-1";
    setarray $@bifs_count,             4,      20,      20,      44,      44,      44;
    setarray $@bifs_multi,             3,       3,       3,       1,       1,       1;
    setarray $@bif_mine_maps_x0,      30,      25,      41,      -1,      -1,      -1;
    setarray $@bif_mine_maps_y0,      34,      39,      39,      -1,      -1,      -1;
    setarray $@bif_mine_maps_x1,      33,      34,      48,      -1,      -1,      -1;
    setarray $@bif_mine_maps_y1,      37,      51,      51,      -1,      -1,      -1;

Note:
    The values used in _mobs.txt are not x0, y0, x1, y1 they are x, y, width, height so they are not compatible with areaspawn since the spawn area extents from x and y in - and + directions
*/

//  .map_nr                            0,       1,       2,       3,       4,       5,       6,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16
    setarray $@bif_mine_maps$,   "002-4", "002-5", "005-3", "006-3", "009-3", "011-4", "011-6", "012-3", "012-4", "013-3", "018-3", "014-3", "017-3", "032-3", "043-3", "043-4", "055-3";
    setarray $@bifs_count,            10,      10,      15,      15,      20,      20,      25,      20,      35,      20,      30,      10,      10,      15,      15,      20,      15;
    setarray $@bifs_multi,             2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2;
    setarray $@bif_mine_maps_x0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      30,      -1;
    setarray $@bif_mine_maps_y0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      23,      -1;
    setarray $@bif_mine_maps_x1,      -1,      -1,     100,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     173,      -1;
    setarray $@bif_mine_maps_y1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     170,      -1;
    setarray $@bifs,       Bif,           AmethystBif,      DiamondBif,      EmeraldBif,      RubyBif,     SapphireBif,       TopazBif;
    setarray $@bifs_small, SmallBif, SmallAmethystBif, SmallDiamondBif, SmallEmeraldBif, SmallRubyBif, SmallSapphireBif, SmallTopazBif;
    setarray $@bifs_big,   BigBif,     BigAmethystBif,   BigDiamondBif,   BigEmeraldBif,   BigRubyBif,   BigSapphireBif,   BigTopazBif;

//  .map_nr                              0,       1,       2,       3,       4,       5,       6,       7,       8,       9,      10,      11,      12,      13,      14,      15,      16
    setarray $@slime_mine_maps$,   "002-4", "002-5", "005-3", "006-3", "009-3", "011-4", "011-6", "012-3", "012-4", "013-3", "018-3", "014-3", "017-3", "032-3", "043-3", "043-4", "055-3";
    setarray $@slimes_count,            10,      10,      15,      15,      20,      20,      25,      20,      35,      20,      30,      10,      10,      15,      15,      20,      15;
    setarray $@slimes_multi,             2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2,       2;
    setarray $@slime_mine_maps_x0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      30,      -1;
    setarray $@slime_mine_maps_y0,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      23,      -1;
    setarray $@slime_mine_maps_x1,      -1,      -1,     100,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     173,      -1;
    setarray $@slime_mine_maps_y1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,      -1,     170,      -1;
    setarray $@slimes, CopperSlime, SilverSlime, BromenalSlime, GoldSlime, IronSlime, CoalSlime;

// Bifs -----------------------------

    set .map_count, getarraysize($@bif_mine_maps$[0]);
    set .map_nr, 0;

    freeloop 1; // do not check for infinity loop

    goto L_BifMapInitLoop;

L_BifMapInitLoop:

    if ($@bif_mine_maps_x0[.map_nr] > -1) goto L_BifMapInitLoop_x0Set;

    set $@bif_mine_maps_x0[.map_nr], 0;
    goto L_BifMapInitLoop_x0Set;

L_BifMapInitLoop_x0Set:

    if ($@bif_mine_maps_y0[.map_nr] > -1) goto L_BifMapInitLoop_y0Set;

    set $@bif_mine_maps_y0[.map_nr], 0;
    goto L_BifMapInitLoop_y0Set;

L_BifMapInitLoop_y0Set:

    if ($@bif_mine_maps_x1[.map_nr] > -1) goto L_BifMapInitLoop_x1Set;

    set $@bif_mine_maps_x1[.map_nr], getmapmaxx($@bif_mine_maps$[.map_nr]);
    goto L_BifMapInitLoop_x1Set;

L_BifMapInitLoop_x1Set:

    if ($@bif_mine_maps_y1[.map_nr] > -1) goto L_BifMapInitLoop_y1Set;

    set $@bif_mine_maps_y1[.map_nr], getmapmaxy($@bif_mine_maps$[.map_nr]);
    goto L_BifMapInitLoop_y1Set;

L_BifMapInitLoop_y1Set:

    if ($@bifs_multi[.map_nr] < 1) set $@bifs_multi[.map_nr], 1;
    set $@bifs_multi_count[.map_nr], $@bifs_multi[.map_nr];

    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_BifMapInitLoop;

// Slimes -----------------------------

    set .map_count, getarraysize($@slime_mine_maps$[0]);
    set .map_nr, 0;

    goto L_SlimeMapInitLoop;

L_SlimeMapInitLoop:

    if ($@slime_mine_maps_x0[.map_nr] > -1) goto L_SlimeMapInitLoop_x0Set;

    set $@slime_mine_maps_x0[.map_nr], 0;
    goto L_SlimeMapInitLoop_x0Set;

L_SlimeMapInitLoop_x0Set:

    if ($@slime_mine_maps_y0[.map_nr] > -1) goto L_SlimeMapInitLoop_y0Set;

    set $@slime_mine_maps_y0[.map_nr], 0;
    goto L_SlimeMapInitLoop_y0Set;

L_SlimeMapInitLoop_y0Set:

    if ($@slime_mine_maps_x1[.map_nr] > -1) goto L_SlimeMapInitLoop_x1Set;

    set $@slime_mine_maps_x1[.map_nr], getmapmaxx($@slime_mine_maps$[.map_nr]);
    goto L_SlimeMapInitLoop_x1Set;

L_SlimeMapInitLoop_x1Set:

    if ($@slime_mine_maps_y1[.map_nr] > -1) goto L_SlimeMapInitLoop_y1Set;

    set $@slime_mine_maps_y1[.map_nr], getmapmaxy($@slime_mine_maps$[.map_nr]);
    goto L_SlimeMapInitLoop_y1Set;

L_SlimeMapInitLoop_y1Set:

    if ($@slimes_multi[.map_nr] < 1) set $@slimes_multi[.map_nr], 1;
    set $@slimes_multi_count[.map_nr], $@slimes_multi[.map_nr];

    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_SlimeMapInitLoop;

    freeloop 0; // re-enable infinity loop check

    initnpctimer;

    end;

OnTimer1000:

// Bifs -----------------------------

    set .map_count, getarraysize($@bif_mine_maps$[0]);
    set .map_nr, 0;

    freeloop 1; // do not check for infinity loop

    goto L_BifMapLoop;

L_BifMapLoop:
    set $@bifs_multi_count[.map_nr], $@bifs_multi_count[.map_nr] - 1;
    if ($@bifs_multi_count[.map_nr] >= 1) goto L_BifContinue;

    set $@bifs_multi_count[.map_nr], $@bifs_multi[.map_nr];

    set .bifs_alive, mobcount($@bif_mine_maps$[.map_nr], "Miner_Mania::OnBifMined" + .map_nr)+1;
    set .bifs_respawn_count, $@bifs_count[.map_nr] - .bifs_alive;

    if (.bifs_respawn_count < 1) goto L_BifContinue;

    if (rand(GEM_BIF_CHANCE)<1) set .bif, rand(getarraysize($@bifs[0])-1)+1;
    else set .bif, 0;

    if (rand(BIG_BIF_CHANCE)<1)
        areamonster $@bif_mine_maps$[.map_nr], $@bif_mine_maps_x0[.map_nr], $@bif_mine_maps_y0[.map_nr], $@bif_mine_maps_x1[.map_nr], $@bif_mine_maps_y1[.map_nr], "",   $@bifs_big[.bif], 1, "Miner_Mania::OnBifMined" + .map_nr;
    elif (rand(NORMAL_BIF_CHANCE)<1)
        areamonster $@bif_mine_maps$[.map_nr], $@bif_mine_maps_x0[.map_nr], $@bif_mine_maps_y0[.map_nr], $@bif_mine_maps_x1[.map_nr], $@bif_mine_maps_y1[.map_nr], "",       $@bifs[.bif], 1, "Miner_Mania::OnBifMined" + .map_nr;
    else
        areamonster $@bif_mine_maps$[.map_nr], $@bif_mine_maps_x0[.map_nr], $@bif_mine_maps_y0[.map_nr], $@bif_mine_maps_x1[.map_nr], $@bif_mine_maps_y1[.map_nr], "", $@bifs_small[.bif], 1, "Miner_Mania::OnBifMined" + .map_nr;

    goto L_BifContinue;

L_BifContinue:
    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_BifMapLoop;

// Slimes -----------------------------

    set .map_count, getarraysize($@slime_mine_maps$[0]);
    set .map_nr, 0;

    goto L_SlimeMapLoop;

L_SlimeMapLoop:
    set $@slimes_multi_count[.map_nr], $@slimes_multi_count[.map_nr] - 1;
    if ($@slimes_multi_count[.map_nr] >= 1) goto L_SlimeContinue;

    set $@slimes_multi_count[.map_nr], $@slimes_multi[.map_nr];

    set .slimes_alive, mobcount($@slime_mine_maps$[.map_nr], "Miner_Mania::OnSlimeSlain" + .map_nr)+1;
    set .slimes_respawn_count, $@slimes_count[.map_nr] - .slimes_alive;

    if (.slimes_respawn_count < 1) goto L_SlimeContinue;

    set .slime, rand(getarraysize($@slimes[0]));

    areamonster $@slime_mine_maps$[.map_nr], $@slime_mine_maps_x0[.map_nr], $@slime_mine_maps_y0[.map_nr], $@slime_mine_maps_x1[.map_nr], $@slime_mine_maps_y1[.map_nr], "", $@slimes[.slime], 1, "Miner_Mania::OnSlimeSlain" + .map_nr;

    goto L_SlimeContinue;

L_SlimeContinue:
    set .map_nr, .map_nr + 1;
    if (.map_nr < .map_count) goto L_SlimeMapLoop;

    freeloop 0; // re-enable infinity loop check

    stopnpctimer;
    setnpctimer 0;
    startnpctimer;

    end;

OnBifMined0:
    end;
OnBifMined1:
    end;
OnBifMined2:
    end;
OnBifMined3:
    end;
OnBifMined4:
    end;
OnBifMined5:
    end;
OnBifMined6:
    end;
OnBifMined7:
    end;
OnBifMined8:
    end;
OnBifMined9:
    end;
OnBifMined10:
    end;
OnBifMined11:
    end;
OnBifMined12:
    end;
OnBifMined13:
    end;
OnBifMined14:
    end;
OnBifMined15:
    end;
OnBifMined16:
    end;

OnSlimeSlain0:
    end;
OnSlimeSlain1:
    end;
OnSlimeSlain2:
    end;
OnSlimeSlain3:
    end;
OnSlimeSlain4:
    end;
OnSlimeSlain5:
    end;
OnSlimeSlain6:
    end;
OnSlimeSlain7:
    end;
OnSlimeSlain8:
    end;
OnSlimeSlain9:
    end;
OnSlimeSlain10:
    end;
OnSlimeSlain11:
    end;
OnSlimeSlain12:
    end;
OnSlimeSlain13:
    end;
OnSlimeSlain14:
    end;
OnSlimeSlain15:
    end;
OnSlimeSlain16:
    end;
}