summaryrefslogtreecommitdiff
path: root/src/store.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-01 05:37:37 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-01 06:48:55 +0200
commit53bf1478ad25f03d6df584371b0653f83ead1b6d (patch)
treed87a2dbec80bf2f52b0efa3c80cac2f732df4aad /src/store.c
parent3f78069df10241f1111e171ab9d1db40b33b5774 (diff)
Lua: Move "Temple" and "Magic shop" hook code to C
Diffstat (limited to 'src/store.c')
-rw-r--r--src/store.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/store.c b/src/store.c
index 78120846..d290785a 100644
--- a/src/store.c
+++ b/src/store.c
@@ -1164,6 +1164,38 @@ static void store_create(void)
q_ptr = process_hooks_return[0].o_ptr;
}
+ /* Magic Shop */
+ else if (streq(st_info[st_ptr->st_idx].name + st_name, "Magic shop") &&
+ magik(20))
+ {
+ s16b spell;
+
+ object_prep(&forge, lookup_kind(TV_BOOK, BOOK_RANDOM));
+ spell = get_random_spell(SKILL_MAGIC, 20);
+ assert (spell > -1);
+ forge.pval = spell;
+
+ /* Use the forged object */
+ q_ptr = &forge;
+ obj_all_done = TRUE;
+ }
+
+ /* Temple */
+ else if (streq(st_info[st_ptr->st_idx].name + st_name, "Temple") &&
+ magik(20))
+ {
+ s16b spell;
+
+ object_prep(&forge, lookup_kind(TV_BOOK, BOOK_RANDOM));
+ spell = get_random_spell(SKILL_SPIRITUALITY, 20);
+ assert(spell > -1);
+ forge.pval = spell;
+
+ /* Use the forged object */
+ q_ptr = &forge;
+ obj_all_done = TRUE;
+ }
+
/* Black Market */
else if (st_info[st_ptr->st_idx].flags1 & SF1_ALL_ITEM)
{