summaryrefslogtreecommitdiff
path: root/lib/scpt/mimic.lua
blob: 6529f35c9fb517c9ea1806200d228fede83a292e (plain)
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
-- Define the various possible mimic shapes

-- Nature shapes
add_mimic_shape
{
	["name"] =      "Mouse",
	["obj_name"] =  "Mouse Fur",
	["desc"] = 	"Mice are small, fast and very stealthy",
	["realm"] =     "nature",
	["level"] =     1,
	["rarity"] =    10,
	["duration"] =  {20, 40},
	["calc"] =      function ()
			-- Mice run!
			player.pspeed = player.pspeed + 5 + (player.mimic_level / 7)

			-- They can crtawl under your armor to hit you ;)
			player.to_h = player.to_h + 10 + (player.mimic_level / 5)
			player.dis_to_h = player.dis_to_h + 10 + (player.mimic_level / 5)

			-- But they are not very powerfull
			player.to_d = player.to_d / 5
			player.dis_to_d = player.dis_to_d / 5

			-- But they are stealthy
			player.skill_stl = player.skill_stl + 10 + (player.mimic_level / 5)

			-- Stat mods
			player.modify_stat(A_STR, -5)
			player.modify_stat(A_DEX, 3)
			player.modify_stat(A_CON, 1)

	end,
	["power"] =     function()
			if player.mimic_level >= 30 then
				player.add_power(POWER_INVISIBILITY)
			end
	end,
}

add_mimic_shape
{
	["name"] =      "Eagle",
	["obj_name"] =  "Feathers Cloak",
	["desc"] = 	"Eagles are master of the air, good hunters with excellent vision.",
	["realm"] =     "nature",
	["level"] =     10,
	["rarity"] =    30,
	["duration"] =  {10, 50},
	["calc"] =      function ()
			player.ffall = TRUE
			player.pspeed = player.pspeed + 2 + (player.mimic_level / 6)

			player.modify_stat(A_STR, -3)
			player.modify_stat(A_DEX, 2 + (player.mimic_level / 15))
			player.modify_stat(A_CON, 4 + (player.mimic_level / 20))
			player.modify_stat(A_INT, -1)
			player.modify_stat(A_WIS, 1)
			player.modify_stat(A_CHR, -1)

			if player.mimic_level >= 20 then
                player.xtra_f4 = bor(player.xtra_f4, TR4_FLY)
                player.xtra_f3 = bor(player.xtra_f3, TR3_SEE_INVIS)
			end
			if player.mimic_level >= 25 then
                player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
			end
			if player.mimic_level >= 30 then
                player.xtra_f2 = bor(player.xtra_f2, TR2_RES_ELEC)
			end
			if player.mimic_level >= 30 then
                player.xtra_f3 = bor(player.xtra_f3, TR3_SH_ELEC)
			end
	end,
}

add_mimic_shape
{
	["name"] =      "Wolf",
	["obj_name"] =  "Wolf Pelt",
	["desc"] = 	"Wolves are masters of movement, strong and have excellent eyesight.",
	["realm"] =     "nature",
	["level"] =     20,
	["rarity"] =    40,
	["duration"] =  {10, 50},
	["calc"] =      function ()
			player.modify_stat(A_STR, 2 + (player.mimic_level / 20))
			player.modify_stat(A_DEX, 3 + (player.mimic_level / 20))
			player.modify_stat(A_INT, -3)
			player.modify_stat(A_CHR, -2)

			player.pspeed = player.pspeed + 10 + (player.mimic_level / 5)

            player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
            player.xtra_f2 = bor(player.xtra_f2, TR2_RES_FEAR)

			if player.mimic_level >= 10 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_COLD)
			end
			if player.mimic_level >= 15 then
                player.xtra_f3 = bor(player.xtra_f3, TR3_SEE_INVIS)
			end
			if player.mimic_level >= 30 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_DARK)
			end
			if player.mimic_level >= 35 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_CONF)
			end
	end,
}

add_mimic_shape
{
	["name"] =      "Spider",
	["obj_name"] =  "Spider Web",
	["desc"] = 	"Spiders are clever and become good climbers.",
	["realm"] =     "nature",
	["level"] =     25,
	["rarity"] =    50,
	["duration"] =  {10, 50},
	["calc"] =      function ()
			player.modify_stat(A_STR, -4)
			player.modify_stat(A_DEX, 1 + (player.mimic_level / 8))
			player.modify_stat(A_INT, 1 + (player.mimic_level / 5))
			player.modify_stat(A_WIS, 1 + (player.mimic_level / 5))
			player.modify_stat(A_CON, -5)
			player.modify_stat(A_CHR, -10)

			player.pspeed = player.pspeed + 5

			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_FEAR)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_DARK)

			if player.mimic_level >= 40 then
                player.xtra_f4 = bor(player.xtra_f4, TR4_CLIMB)
			end

	end,
	["power"] =     function()
			if player.mimic_level >= 25 then
				player.add_power(POWER_WEB)
			end
	end,
}

add_mimic_shape
{
	["name"] =      "Elder Ent",
	["obj_name"] =  "Entish Bark",
	["desc"] = 	"Ents are powerful tree-like beings dating from the dawn of time.",
	["realm"] =     "nature",
	["level"] =     40,
	["rarity"] =    60,
	["duration"] =  {10, 30},
	["limit"] =     TRUE,
	["calc"] =      function ()
			player.pspeed = player.pspeed - 5 - (player.mimic_level / 10)

			player.to_a = player.to_a + 10 + player.mimic_level
			player.dis_to_a = player.dis_to_a + 10 + player.mimic_level

			player.modify_stat(A_STR, player.mimic_level / 5)
			player.modify_stat(A_INT, - (player.mimic_level / 7))
			player.modify_stat(A_WIS, - (player.mimic_level / 7))
			player.modify_stat(A_DEX, -4)
			player.modify_stat(A_CON, player.mimic_level / 5)
			player.modify_stat(A_CHR, -7)

			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_COLD)
            player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
            player.xtra_f3 = bor(player.xtra_f3, TR3_REGEN)
            player.xtra_f3 = bor(player.xtra_f3, TR3_SEE_INVIS)
            player.xtra_f2 = bor(player.xtra_f2, TR2_SENS_FIRE)
	end,
	["power"] =     function ()
			player.add_power(PWR_GROW_TREE)
	end,
}

add_mimic_shape
{
	["name"] =      "Vapour",
	["obj_name"] =  "Cloak of Mist",
	["desc"] = 	"A sentient cloud, darting around",
	["realm"] =     "nature",
	["level"] =     15,
	["rarity"] =    10,
	["duration"] =  {10, 40},
	["calc"] =      function ()

			player.pspeed = player.pspeed + 5

			--Try to hit a cloud!
			player.to_a = player.to_a + 40 + player.mimic_level
			player.dis_to_a = player.dis_to_a + 40 + player.mimic_level

			--Try to hit WITH a cloud!
			player.to_h = player.to_h - 40
			player.dis_to_h = player.dis_to_h -40

			-- Stat mods
			player.modify_stat(A_STR, -4)
			player.modify_stat(A_DEX, 5)
			player.modify_stat(A_CON, -4)
			player.modify_stat(A_CHR, -10)

			-- But they are stealthy
			player.skill_stl = player.skill_stl + 10 + (player.mimic_level / 5)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_SHARDS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_COLD)
            player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
            player.xtra_f3 = bor(player.xtra_f3, TR3_REGEN)
            player.xtra_f3 = bor(player.xtra_f3, TR3_SEE_INVIS)
            player.xtra_f2 = bor(player.xtra_f2, TR2_SENS_FIRE)
            player.xtra_f3 = bor(player.xtra_f3, TR3_FEATHER)
	end,
}

add_mimic_shape
{
	["name"] =      "Serpent",
	["obj_name"] =  "Snakeskin Cloak",
	["desc"] = 	"Serpents are fast, lethal predators.",
	["realm"] =     "nature",
	["level"] =     30,
	["rarity"] =    25,
	["duration"] =  {15, 20},
	["calc"] =      function ()
			player.pspeed = player.pspeed + 10 + (player.mimic_level / 6)
			player.to_a = player.to_a + 3 + (player.mimic_level / 8)
			player.dis_to_a = player.dis_to_a + 3 + (player.mimic_level / 8)

			player.modify_stat(A_STR, player.mimic_level / 8)
			player.modify_stat(A_INT, -6)
			player.modify_stat(A_WIS, -6)
			player.modify_stat(A_DEX, -4)
			player.modify_stat(A_CON, player.mimic_level / 7)
			player.modify_stat(A_CHR, -6)

			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			if player.mimic_level >= 25 then
            	player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
			end
	end,
}

add_mimic_shape
{
	["name"] =      "Mumak",
	["obj_name"] =  "Mumak Hide",
	["desc"] = 	"A giant, elaphantine form.",
	["realm"] =     "nature",
	["level"] =     40,
	["rarity"] =    40,
	["duration"] =  {15, 20},
	["calc"] =      function ()
			player.pspeed = player.pspeed - 5 - (player.mimic_level / 10)
			player.to_a = player.to_a + 10 + (player.mimic_level / 6)
			player.dis_to_a = player.dis_to_a + 10 + (player.mimic_level / 6)
			player.to_d = player.to_d + 5 + ((player.mimic_level * 2) / 3)
			player.dis_to_d = player.dis_to_d + 5 + ((player.mimic_level * 2) / 3)

			player.modify_stat(A_STR, player.mimic_level / 4)
			player.modify_stat(A_INT, -8)
			player.modify_stat(A_WIS, -4)
			player.modify_stat(A_DEX, -5)
			player.modify_stat(A_CON, player.mimic_level / 3)
			player.modify_stat(A_CHR, -10)

			if player.mimic_level >= 10 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_FEAR)
			end
			if player.mimic_level >= 25 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_CONF)
			end
			if player.mimic_level >= 30 then
            	player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
			end
			if player.mimic_level >= 35 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_NEXUS)
			end
	end,
}

--------- Extra shapes -----------

-- For Beornings
add_mimic_shape
{
	["name"] =      "Bear",
	["desc"] = 	"A fierce, terrible bear.",
	["realm"] =     nil,
	["level"] =     1,
	["rarity"] =    101,
	["duration"] =  {50, 200},
	["limit"] =     TRUE,
	["calc"] =      function ()
			player.pspeed = player.pspeed - 5 + (player.mimic_level / 5)

			player.to_a = player.to_a + 5 + ((player.mimic_level * 2) / 3)
			player.dis_to_a = player.dis_to_a + 5 + ((player.mimic_level * 2) / 3)

			player.modify_stat(A_STR, player.mimic_level / 11)
			player.modify_stat(A_INT, player.mimic_level / 11)
			player.modify_stat(A_WIS, player.mimic_level / 11)
			player.modify_stat(A_DEX, -1)
			player.modify_stat(A_CON, player.mimic_level / 11)
			player.modify_stat(A_CHR, -10)

			if player.mimic_level >= 10 then
            	player.xtra_f2 = bor(player.xtra_f2, TR2_FREE_ACT)
			end
			if player.mimic_level >= 20 then
	            player.xtra_f3 = bor(player.xtra_f3, TR3_REGEN)
			end
			if player.mimic_level >= 30 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_CONF)
			end
			if player.mimic_level >= 35 then
				player.xtra_f2 = bor(player.xtra_f2, TR2_RES_NEXUS)
			end

			-- activate the skill
			skill(SKILL_BEAR).hidden = FALSE
	end,
}

-- For balrog corruptions
add_mimic_shape
{
	["name"] =      "Balrog",
	["desc"] = 	"A corrupted maia.",
	["realm"] =     nil,
	["level"] =     1,
	["rarity"] =    101,
	["duration"] =  {30, 70},
	["limit"] =     TRUE,
	["calc"] =      function ()
			player.modify_stat(A_STR, 5 + player.mimic_level / 5)
			player.modify_stat(A_INT, player.mimic_level / 10)
			player.modify_stat(A_WIS, - ( 5 + player.mimic_level / 10))
			player.modify_stat(A_DEX, player.mimic_level / 10)
			player.modify_stat(A_CON, 5 + player.mimic_level / 5)
			player.modify_stat(A_CHR, - ( 5 + player.mimic_level / 10))

			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_ACID)
			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_FIRE)
			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_ELEC)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_DARK)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_CHAOS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_HOLD_LIFE)
			player.xtra_f3 = bor(player.xtra_f3, TR3_FEATHER)
			player.xtra_f3 = bor(player.xtra_f3, TR3_REGEN)
			player.xtra_f3 = bor(player.xtra_f3, TR3_SH_FIRE)
			player.xtra_f3 = bor(player.xtra_f3, TR3_LITE1)
			return 1
	end,
}

-- For avatar spell
add_mimic_shape
{
	["name"] =      "Maia",
	["desc"] = 	"A near god-like being.",
	["realm"] =     nil,
	["level"] =     1,
	["rarity"] =    101,
	["duration"] =  {30, 70},
	["limit"] =     TRUE,
	["calc"] =      function ()
			player.modify_stat(A_STR, 5 + player.mimic_level / 5)
			player.modify_stat(A_INT, 5 + player.mimic_level / 5)
			player.modify_stat(A_WIS, 5 + player.mimic_level / 5)
			player.modify_stat(A_DEX, 5 + player.mimic_level / 5)
			player.modify_stat(A_CON, 5 + player.mimic_level / 5)
			player.modify_stat(A_CHR, 5 + player.mimic_level / 5)

			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_FIRE)
			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_ELEC)
			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_ACID)
			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_COLD)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_LITE)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_DARK)
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_CHAOS)
			player.xtra_f2 = bor(player.xtra_f2, TR2_HOLD_LIFE)
			player.xtra_f3 = bor(player.xtra_f3, TR3_FEATHER)
			player.xtra_f3 = bor(player.xtra_f3, TR3_REGEN)
			return 2
	end,
}

-- For Geomancy
add_mimic_shape
{
	["name"] =      "Fire Elem.",
	["desc"] = 	"A towering column of flames",
	["realm"] =     nil,
	["level"] =     1,
	["rarity"] =    101,
	["duration"] =  {10, 10},
	["limit"] =     TRUE,
	["calc"] =      function ()
			player.modify_stat(A_STR, 5 + (player.mimic_level / 5))
			player.modify_stat(A_DEX, 5 + (player.mimic_level / 5))
			player.modify_stat(A_WIS, -5 - (player.mimic_level / 5))

			player.xtra_f2 = bor(player.xtra_f2, TR2_IM_FIRE)
			-- was immune to poison in the 3.0.0 version
			player.xtra_f2 = bor(player.xtra_f2, TR2_RES_POIS)
			player.xtra_f3 = bor(player.xtra_f3, TR3_SH_FIRE)
			player.xtra_f3 = bor(player.xtra_f3, TR3_LITE1)
			return 0
	end,
}