summaryrefslogtreecommitdiff
path: root/world/map/conf/magic-level1.sex
blob: da29ad22c902204abfa1e903cbcb5e0e543ea68e (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
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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
"--------------------------------------------------------------------------------"
" Level 1 spells                                                                 "
"--------------------------------------------------------------------------------"
(SPELL () ask-magic-exp "#abizit" ()
    (LET level 1)
    (LET school MAGIC)
    (=>
        (GUARD
            (MANA 1)
            (CASTTIME 1000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level)))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (SET level
                (skill caster MAGIC))
            (SET experience
                (&
                    (>>
                        (script_int caster SCRIPT_XP)
                        SCRIPT_XP_SHIFT)
                    SCRIPT_XP_MASK))
            (IF (&&
                    (== experience SCRIPT_XP_MASK)
                    (> level 4))
                (message caster "You are as proficient at magic as you can possibly be.")
                (BLOCK "This duplicates the table in mana-seed.txt"
                    (IF (> level 4)
                        (SET max_experience SCRIPT_XP_MASK)
                        (IF (== level 4)
                            (SET max_experience 40000)
                            (IF (== level 3)
                                (SET max_experience 8000)
                                (IF (== level 2)
                                    (SET max_experience 1200)
                                    (SET max_experience 100)))))
                    (SET ratio
                        (/
                            (-
                                (* 10 experience)
                                (random
                                    (/ max_experience 30)))
                            max_experience)) "Randomness:  jitter a bit at the transitions to give more precise information if used frequently"
                    (IF (>= ratio 45)
                        (message caster
                            (+ "Magic flows naturally from you, readily and with ease. Your understanding of what you can currently control at present is flawless, far beyond your requirements to cast magic at this level."
                                (if_then_else
                                    (>= level MAX_MAGIC_LEVEL)
                                    ""
                                    " Surely the Mana Seed will more than readily offer more magic for such a proficient user.")))
                        (IF (>= ratio 20)
                            (message caster "You have perfect control of what you understand now, but there is now a distinct sensation of something more, something indescribable. If only the Mana Seed would give more magic to you...")
                            (IF (>= ratio 10)
                                (message caster
                                    (+ "You feel in perfect control of your magic"
                                        (if_then_else
                                            (>= level MAX_MAGIC_LEVEL)
                                            "."
                                            ", and seem on the verge of something more... perhaps you should see the Mana Seed to ask for more magic?")))
                                (IF (>= ratio 9)
                                    (message caster "You feel in almost perfect control of your magic.")
                                    (IF (>= ratio 8)
                                        (message caster "You feel that you have very good control of your magic.")
                                        (IF (>= ratio 7)
                                            (message caster "You feel quite in control of your magic.")
                                            (IF (>= ratio 6)
                                                (message caster "You feel mostly in control of your magic.")
                                                (IF (>= ratio 5)
                                                    (message caster "You feel somewhat in control of your magic.")
                                                    (IF (>= ratio 4)
                                                        (message caster "You feel you still have a few difficulties in controlling your magic.")
                                                        (IF (>= ratio 3)
                                                            (message caster "Trying to control your magic is still rather troublesome.")
                                                            (IF (>= ratio 2)
                                                                (message caster "You feel that you have only the bare minimum of control over your magic.")
                                                                (IF (>= ratio 1)
                                                                    (message caster "You feel quite overwhelmed by your magic, but are beginning to see patterns.")
                                                                    (message caster "You feel completely overwhelmed by your magic."))))))))))))))))))

(SPELL () transmute-wood-to-figurine "#parum" (STRING name)
    (LET level 1)
    (LET school TRANSMUTE)
    (=>
        (GUARD
            (MANA 5)
            (CASTTIME 4000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "RawLog"))
        (|
            (=>
                (REQUIRE
                    (== name "boo"))
                (EFFECT
                    (CALL adjust_spellpower school)
                    (CALL default_effect)
                    (CALL create_item "MoubooFigurine" 1 "WarpedLog" 40)
                    (CALL gain_xp 1 0)))
            (=>
                (REQUIRE
                    (== name "lurk"))
                (EFFECT
                    (CALL adjust_spellpower school)
                    (CALL default_effect)
                    (CALL create_item "WarpedLog" 1 "WarpedLog" 40)
                    (message caster "You have no idea what a Skytlurk looks like."))))))

(SPELL () make-sulphur "#gole" ()
    (LET level 1)
    (LET school TRANSMUTE)
    (=>
        (GUARD
            (MANA 4)
            (CASTTIME 4000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "PileOfAsh"))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (CALL create_item "SulphurPowder"
                (+
                    (+ 1
                        (/ spellpower 100))
                    (/
                        (random
                            (max 1
                                (- 800 spellpower)))
                        180))
                "PileOfAsh"
                50)
            (CALL gain_xp 1 1))))

(SPELL () lesser-heal "#lum" (STRING target)
    (LET level 1)
    (LET school LIFE)
    (=>
        (GUARD
            (MANA 6)
            (CASTTIME 500)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (REQUIRE
                (if_then_else
                    (failed
                        (pc target))
                    1
                    (<
                        (rdistance
                            (location caster)
                            (location
                                (pc target)))
                        (+ 2
                            (/ spellpower 100)))))
            (GUARD
                (COMPONENTS "Lifestone")))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (IF (failed
                    (pc target))
                (BLOCK
                    (IF (&&
                            (||
                                (== target "mouboo")
                                (== target "Mouboo"))
                            (<
                                (rdistance
                                    (location caster)
                                    (location
                                        (npc "Mouboo")))
                                (+ 2
                                    (/ spellpower 100))))
                        (SCRIPT "{
                            mes \"Your spell seems to have no effect on the mouboo.\";
                            close;
                        }")
                        (SET target caster)))
                (BLOCK
                    (SET target
                        (pc target))
                    (IF (is_dead target)
                        (ABORT))))
            (CALL gain_heal_xp
                (min 200
                    (-
                        (max_hp target)
                        (hp target)))
                1
                2
                2) "report half values for non-instaheal"
            (CALL heal target 200)
            (IF (>
                    (skill caster DARK)
                    1)
                (status_change caster SC_HALT_REGENERATE 0 0 0 0 2000))
            (CALL gain_xp 1 2))))

(SPELL () flare-dart "#flar" ()
    (LET level 1)
    (LET school WAR)
    (=>
        (GUARD
            (MANA 10)
            (CASTTIME 500)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (GUARD
                (OR
                    (REQUIRE
                        (>
                            (skill caster school)
                            2))
                    (COMPONENTS "SulphurPowder"))))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (SET damage
                (* 5
                    (sqrt spellpower)))
            (SET damage_bonus
                (+ 5
                    (/
                        (level caster)
                        3)))
            (CALL install_attack_spell
                (+ 3
                    (/ spellpower 50))
                1200
                4
                31)
            (CALL gain_xp 1 3)
            (ATTRIGGER
                (CALL attack_check target)
                (CALL elt_damage target damage damage_bonus ELT_WATER ELT_FIRE 15)))))

(SPELL () magic-blade "#chiza" ()
    (LET level 1)
    (LET school WAR)
    (=>
        (GUARD
            (MANA 9)
            (CASTTIME 500)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level)))
        (|
            (=>
                (COMPONENTS "SharpKnife")
                (EFFECT
                    (CALL adjust_spellpower WAR)
                    (CALL default_effect)
                    (CALL install_melee_spell
                        (+ 10
                            (/ spellpower 15))
                        1200
                        30)
                    (CALL gain_xp 1 4)
                    (ATTRIGGER
                        (CALL melee_damage target 60
                            (+ 5
                                (str caster))))))
            (=>
                (COMPONENTS "Knife")
                (EFFECT
                    (CALL adjust_spellpower WAR)
                    (CALL default_effect)
                    (CALL install_melee_spell
                        (+ 10
                            (/ spellpower 15))
                        1200
                        30)
                    (CALL gain_xp 1 5)
                    (ATTRIGGER
                        (CALL melee_damage target 40
                            (+ 5
                                (str caster)))))))))

(SPELL () aggravate "#itenplz" ()
    (LET level 1)
    (LET school NATURE)
    (=>
        (GUARD
            (MANA 3)
            (CASTTIME 1000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level)))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (FOREACH MOB target
                (rbox
                    (location caster)
                    (+ 2
                        (/ spellpower 50)))
                (IF (line_of_sight
                        (location caster)
                        (location target))
                    (BLOCK
                        (CALL sfx_generic target)
                        (aggravate target 0 caster)))))))

(SPELL () grow-mauve "#modrilax" ()
    (LET level 1)
    (LET school NATURE)
    (=>
        (GUARD
            (MANA 4)
            (CASTTIME 2000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "MauveHerb" "Root"))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (CALL gain_xp 1 6)
            (CALL summon_spell 1029
                (+
                    (/
                        (skill caster school)
                        2)
                    1)
                (- 4000
                    (* spellpower 9))
                (+ 10000
                    (* spellpower 50))
                999999
                school))))

(SPELL () grow-alizarin "#modriphoo" ()
    (LET level 1)
    (LET school NATURE)
    (=>
        (GUARD
            (MANA 4)
            (CASTTIME 2000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "AlizarinHerb" "Root"))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (CALL gain_xp 1 7)
            (CALL summon_spell 1032
                (+
                    (/
                        (skill caster school)
                        2)
                    1)
                (- 4000
                    (* spellpower 9))
                (+ 10000
                    (* spellpower 50))
                999999
                school))))

(SPELL () grow-gamboge "#modriyikam" ()
    (LET level 1)
    (LET school NATURE)
    (=>
        (GUARD
            (MANA 4)
            (CASTTIME 2000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "GambogeHerb" "Root"))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (CALL gain_xp 1 8)
            (CALL summon_spell 1031
                (+
                    (/
                        (skill caster school)
                        2)
                    1)
                (- 4000
                    (* spellpower 9))
                (+ 10000
                    (* spellpower 50))
                999999
                school))))

(SPELL () grow-cobalt "#modrisump" ()
    (LET level 1)
    (LET school NATURE)
    (=>
        (GUARD
            (MANA 4)
            (CASTTIME 2000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "CobaltHerb" "Root"))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (CALL gain_xp 1 9)
            (CALL summon_spell 1030
                (+
                    (/
                        (skill caster school)
                        2)
                    1)
                (- 4000
                    (* spellpower 9))
                (+ 10000
                    (* spellpower 50))
                999999
                school))))

(SPELL (LOCAL) summon-maggots "#kalmurk" ()
    (LET level 1)
    (LET school ASTRAL)
    (=>
        (GUARD
            (MANA 21)
            (CASTTIME 20000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level))
            (COMPONENTS "MaggotSlime" "Root"))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL gain_xp 1 10)
            (CALL summon_spell 1002
                (+ 1
                    (/
                        (+
                            (sqrt spellpower)
                            (/ spellpower 15))
                        5))
                (- 5000
                    (* spellpower 5))
                (+ 10000
                    (* spellpower 50))
                1
                school))))

(SPELL () detect-magic "#miteyo" ()
    (LET level 1)
    (LET school MAGIC)
    (=>
        (GUARD
            (MANA 3)
            (CASTTIME 6000)
            (REQUIRE
                (>=
                    (skill caster MAGIC)
                    level)))
        (EFFECT
            (CALL adjust_spellpower school)
            (CALL default_effect)
            (SET range
                (+ 1
                    (/ spellpower 50)))
            (FOREACH NPC n
                (rbox
                    (location caster)
                    range)
                (IF (||
                        (contains_string
                            (name_of n)
                            "#MAGIC")
                        (contains_string
                            (name_of n)
                            "#_M"))
                    (sfx n SFX_DEFAULT 0)))
            (FOREACH SPELL s (rbox
                    (location caster)
                    range) (IF (!= s self_invocation)
                    (sfx s SFX_DEFAULT 0))))))