… | |
… | |
239 | static int |
239 | static int |
240 | god_gives_present (object *op, object *god, treasure *tr) |
240 | god_gives_present (object *op, object *god, treasure *tr) |
241 | { |
241 | { |
242 | object *tmp; |
242 | object *tmp; |
243 | |
243 | |
|
|
244 | if (!tr->item) |
|
|
245 | return 0; |
|
|
246 | |
244 | if (follower_has_similar_item (op, &tr->item->clone)) |
247 | if (follower_has_similar_item (op, &tr->item->clone)) |
245 | return 0; |
248 | return 0; |
246 | |
249 | |
247 | tmp = arch_to_object (tr->item); |
250 | tmp = arch_to_object (tr->item); |
248 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); |
251 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); |
249 | tmp = insert_ob_in_ob (tmp, op); |
252 | tmp = insert_ob_in_ob (tmp, op); |
250 | if (op->type == PLAYER) |
253 | if (op->type == PLAYER) |
251 | esrv_send_item (op, tmp); |
254 | esrv_send_item (op, tmp); |
|
|
255 | |
252 | return 1; |
256 | return 1; |
253 | } |
257 | } |
254 | |
258 | |
255 | /** |
259 | /** |
256 | * Player prays at altar. |
260 | * Player prays at altar. |
… | |
… | |
394 | remove = 1; |
398 | remove = 1; |
395 | for (tr = god->randomitems->items; tr; tr = tr->next) |
399 | for (tr = god->randomitems->items; tr; tr = tr->next) |
396 | { |
400 | { |
397 | object *item; |
401 | object *item; |
398 | |
402 | |
399 | if (tr->item == NULL) |
403 | if (!tr->item) |
400 | continue; |
404 | continue; |
401 | item = &tr->item->clone; |
405 | item = &tr->item->clone; |
402 | |
406 | |
403 | /* Basically, see if the matching spell is granted by this god. */ |
407 | /* Basically, see if the matching spell is granted by this god. */ |
404 | |
408 | |
… | |
… | |
682 | { |
686 | { |
683 | object *item; |
687 | object *item; |
684 | |
688 | |
685 | if (!tr->item) |
689 | if (!tr->item) |
686 | continue; |
690 | continue; |
|
|
691 | |
687 | item = &tr->item->clone; |
692 | item = &tr->item->clone; |
688 | |
693 | |
689 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
694 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
690 | return item->other_arch; |
695 | return item->other_arch; |
691 | } |
696 | } |
… | |
… | |
847 | create_treasure (tl, op, GT_STARTEQUIP | GT_ONLY_GOOD | GT_UPDATE_INV, skill->level, 0); |
852 | create_treasure (tl, op, GT_STARTEQUIP | GT_ONLY_GOOD | GT_UPDATE_INV, skill->level, 0); |
848 | return; |
853 | return; |
849 | } |
854 | } |
850 | |
855 | |
851 | if (!tr->item) |
856 | if (!tr->item) |
852 | { |
|
|
853 | LOG (llevError, "BUG: empty entry in %s's treasure list\n", &god->name); |
|
|
854 | continue; |
857 | continue; |
855 | } |
858 | |
856 | item = &tr->item->clone; |
859 | item = &tr->item->clone; |
857 | |
860 | |
858 | /* Grace limit */ |
861 | /* Grace limit */ |
859 | if (item->type == BOOK && item->invisible && strcmp (item->name, "grace limit") == 0) |
862 | if (item->type == BOOK && item->invisible && strcmp (item->name, "grace limit") == 0) |
860 | { |
863 | { |