Newer
Older
-- ToME - Tales of Maj'Eyal
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
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
load("/data/general/objects/scrolls.lua")
load("/data/general/objects/gem.lua")
local Stats = require "engine.interface.ActorStats"
local Talents = require "engine.interface.ActorTalents"
-- This file describes the twelve elixirs and three artifacts obtainable through the Brotherhood of Alchemists quest
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_FOX",
type = "potion", subtype="potion",
name = "Elixir of the Fox", unique=true, unided_name="vial of pink fluid",
display = "!", color=colors.VIOLET,
desc = [[A vial of pink, airy fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your dexterity and cunning by three", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.inc_stats[who.STAT_DEX] = who.inc_stats[who.STAT_DEX] + 3
who:onStatChange(who.STAT_DEX, 3)
who.inc_stats[who.STAT_CUN] = who.inc_stats[who.STAT_CUN] + 3
who:onStatChange(who.STAT_CUN, 3)
game.logPlayer(who, "#00FF00#The elixir has given you foxlike physical and mental agility!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_AVOIDANCE",
type = "potion", subtype="potion",
name = "Elixir of Avoidance", unique=true, unided_name="vial of green fluid",
display = "!", color=colors.GREEN,
desc = [[A vial of opaque green fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your defense and ranged defense by six", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.combat_def = who.combat_def + 6
game.logPlayer(who, "#00FF00#The elixir has improved your defensive instincts!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_PRECISION",
type = "potion", subtype="potion",
name = "Elixir of Precision", unique=true, unided_name="vial of red fluid",
display = "!", color=colors.GREEN,
desc = [[A vial of chunky red fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your physical critical strike chance by 4%", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.combat_physcrit = who.combat_physcrit + 4
game.logPlayer(who, "#00FF00#The elixir has improved your eye for an enemy's weak points!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_MYSTICISM",
type = "potion", subtype="potion",
name = "Elixir of Mysticism", unique=true, unided_name="vial of cyan fluid",
display = "!", color=colors.BLUE,
desc = [[A vial of glowing cyan fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your magic and willpower by three", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.inc_stats[who.STAT_MAG] = who.inc_stats[who.STAT_MAG] + 3
who:onStatChange(who.STAT_MAG, 3)
who.inc_stats[who.STAT_WIL] = who.inc_stats[who.STAT_WIL] + 3
who:onStatChange(who.STAT_WIL, 3)
game.logPlayer(who, "#00FF00#The elixir has augmented your magical and mental capacity!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_SAVIOR",
type = "potion", subtype="potion",
name = "Elixir of the Savior", unique=true, unided_name="vial of grey fluid",
display = "!", color=colors.GREY,
desc = [[A vial of bubbling, slate-colored fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase all your saving throws by 4", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.combat_physresist = who.combat_physresist + 4
who.combat_spellresist = who.combat_spellresist + 4
who.combat_mentalresist = who.combat_mentalresist + 4
game.logPlayer(who, "#00FF00#The elixir has improved your resistance to unpleasant effects!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_MASTERY",
type = "potion", subtype="potion",
name = "Elixir of Mastery", unique=true, unided_name="vial of maroon fluid",
display = "!", color=colors.PURPLE,
desc = [[A vial of thick maroon fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="grant you four additional stat points", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
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
game.logPlayer(who, "#00FF00#The elixir has greatly expanded your capacity for improving your mind and body.")
game.logPlayer(who, "You have %d stat point(s) to spend. Press G to use them.", who.unused_stats)
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_FORCE",
type = "potion", subtype="potion",
name = "Elixir of Explosive Force", unique=true, unided_name="vial of orange fluid",
display = "!", color=colors.ORANGE,
desc = [[A vial of churning orange fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your chance to critically strike with spells by 4%", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.combat_spellcrit = who.combat_spellcrit + 4
game.logPlayer(who, "#00FF00#The elixir has improved your eye for an enemy's magical weak points!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_SERENDIPITY",
type = "potion", subtype="potion",
name = "Elixir of Serendipity", unique=true, unided_name="vial of yellow fluid",
display = "!", color=colors.YELLOW,
desc = [[A vial of lifelike yellow fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your luck by 5", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.inc_stats[who.STAT_LCK] = who.inc_stats[who.STAT_LCK] + 5
who:onStatChange(who.STAT_LCK, 5)
game.logPlayer(who, "#00FF00#The elixir seems to have subtly repositioned your entire being within the fabric of reality!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_FOCUS",
type = "potion", subtype="potion",
name = "Elixir of Focus", unique=true, unided_name="vial of clear fluid",
display = "!", color=colors.WHITE,
desc = [[A vial of clear, steaming fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="grant you two additional class talent points", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.unused_talents = who.unused_talents + 2
game.logPlayer(who, "#00FF00#The elixir has improved your capacity for exercising your core talents.")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_BRAWN",
type = "potion", subtype="potion",
name = "Elixir of Brawn", unique=true, unided_name="vial of tan fluid",
display = "!", color=colors.TAN,
desc = [[A vial of sluggish tan fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your strength and constitution by three", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.inc_stats[who.STAT_STR] = who.inc_stats[who.STAT_STR] + 3
who:onStatChange(who.STAT_STR, 3)
who.inc_stats[who.STAT_CON] = who.inc_stats[who.STAT_CON] + 3
who:onStatChange(who.STAT_CON, 3)
game.logPlayer(who, "#00FF00#The elixir has augmented your physical might and resilience!")
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_STONESKIN",
type = "potion", subtype="potion",
name = "Elixir of Stoneskin", unique=true, unided_name="vial of iron-colored fluid",
display = "!", color=colors.SLATE,
desc = [[A vial of grainy, iron-colored fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="permanently increase your armor by four", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.combat_armor = who.combat_armor + 4
game.logPlayer(who, "#00FF00#The elixir has reinforced your entire body!")
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
return true, "destroy", true
end}
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_FOUNDATIONS",
type = "potion", subtype="potion",
name = "Elixir of Foundations", unique=true, unided_name="vial of white fluid",
display = "!", color=colors.WHITE,
desc = [[A vial of murky wuite fluid.]],
no_unique_lore = true,
cost = 1000,
use_simple = { name="grant you two additional generic talent points", use = function(self, who)
game.logPlayer(who, "#00FFFF#You drink the elixir and feel forever transformed!")
who.unused_generics = who.unused_generics + 2
game.logPlayer(who, "#00FF00#The elixir has improved your capacity for exercising your core talents.")
return true, "destroy", true
end}
}
-- The four possible final rewards for the Brotherhood of Alchemists quest:
newEntity{ base = "BASE_TAINT",
name = "Taint of Telepathy",
define_as = "TAINT_TELEPATHY",
unique = true,
identified = true,
cost = 200,
material_level = 3,
inscription_kind = "utility",
inscription_data = {
cooldown = 30,
dur = 5,
},
inscription_talent = "TAINT:_TELEPATHY",
}
newEntity{ base = "BASE_INFUSION",
name = "Infusion of Wild Growth",
define_as = "INFUSION_WILD_GROWTH",
unique = true,
identified = true,
cost = 200,
material_level = 3,
inscription_kind = "utility",
inscription_data = {
cooldown = 30,
dur = 5,
},
inscription_talent = "INFUSION:_WILD_GROWTH",
}
newEntity{ base = "BASE_GEM",
define_as = "LIFEBINDING_EMERALD",
power_source = {nature=true},
unique = true,
unided_name = "cloudy, heavy emerald",
name = "Lifebinding Emerald", subtype = "green",
color = colors.GREEN, image="object/emerald.png",
desc = [[A lopsided, heavy emerald with murky green clouds shifting sluggishly under the surface.]],
cost = 200,
material_level = 5,
wielder = {
inc_stats = {[Stats.STAT_CON] = 10, },
healing_factor = 0.3,
life_regen = 2,
resists = {
[DamageType.BLIGHT] = 10,
},
},
imbue_powers = {
inc_stats = {[Stats.STAT_CON] = 10, },
healing_factor = 0.3,
life_regen = 2,
resists = {
[DamageType.BLIGHT] = 10,
},
},
}
newEntity{
power_source = {nature=true},
define_as = "ELIXIR_INVULNERABILITY",
encumber = 2,
type = "potion", subtype="potion",
name = "Elixir of Invulnerability", unique=true, unided_name="vial of black fluid",
display = "!", color=colors.SLATE,
desc = [[A vial of thick fluid, metallic and reflective. It's incredibly heavy.]],
cost = 200,
use_simple = { name="grant you complete invulnerability for five turns", use = function(self, who)
who:setEffect(who.EFF_DAMAGE_SHIELD, 5, {power=1000000})
game.logPlayer(who, "#00FF00#You feel indestructible!")
return true, "destroy", true
end}
}