… | |
… | |
201 | if (tmp->nrof > 1) |
201 | if (tmp->nrof > 1) |
202 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumble to dust!", query_short_name (tmp)); |
202 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumble to dust!", query_short_name (tmp)); |
203 | else |
203 | else |
204 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumbles to dust!", query_short_name (tmp)); |
204 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s crumbles to dust!", query_short_name (tmp)); |
205 | |
205 | |
206 | remove_ob (tmp); /* remove obj from players inv. */ |
206 | tmp->remove (); /* remove obj from players inv. */ |
207 | esrv_del_item (op->contr, tmp->count); /* notify client */ |
207 | esrv_del_item (op->contr, tmp->count); /* notify client */ |
208 | free_object (tmp); /* free object */ |
208 | tmp->destroy (); /* free object */ |
209 | } |
209 | } |
|
|
210 | |
210 | if (tmp->inv) |
211 | if (tmp->inv) |
211 | follower_remove_similar_item (tmp, item); |
212 | follower_remove_similar_item (tmp, item); |
212 | } |
213 | } |
213 | } |
214 | } |
214 | } |
215 | } |
… | |
… | |
414 | /* just do the work of removing the spell ourselves - we already |
415 | /* just do the work of removing the spell ourselves - we already |
415 | * know that the player knows the spell |
416 | * know that the player knows the spell |
416 | */ |
417 | */ |
417 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &tmp->name); |
418 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &tmp->name); |
418 | player_unready_range_ob (op->contr, tmp); |
419 | player_unready_range_ob (op->contr, tmp); |
419 | remove_ob (tmp); |
420 | tmp->destroy (); |
420 | free_object (tmp); |
|
|
421 | } |
421 | } |
422 | |
422 | |
423 | } |
423 | } |
424 | } |
424 | } |
425 | |
425 | |
… | |
… | |
442 | |
442 | |
443 | /* take away any special god-characteristic items. */ |
443 | /* take away any special god-characteristic items. */ |
444 | for (item = op->inv; item != NULL; item = next) |
444 | for (item = op->inv; item != NULL; item = next) |
445 | { |
445 | { |
446 | next = item->below; |
446 | next = item->below; |
447 | /* remove all invisible startequip items which are |
447 | // remove all invisible startequip items which are not skill, exp or force |
448 | * not skill, exp or force |
|
|
449 | */ |
|
|
450 | if (QUERY_FLAG (item, FLAG_STARTEQUIP) && item->invisible && |
448 | if (QUERY_FLAG (item, FLAG_STARTEQUIP) && item->invisible && |
451 | (item->type != SKILL) && (item->type != EXPERIENCE) && (item->type != FORCE)) |
449 | (item->type != SKILL) && (item->type != FORCE)) |
452 | { |
450 | { |
453 | |
451 | |
454 | if (item->type == SPELL) |
452 | if (item->type == SPELL) |
455 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &item->name); |
453 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", &item->name); |
|
|
454 | |
456 | player_unready_range_ob (op->contr, item); |
455 | player_unready_range_ob (op->contr, item); |
457 | remove_ob (item); |
456 | item->destroy (); |
458 | free_object (item); |
|
|
459 | } |
457 | } |
460 | } |
458 | } |
461 | |
459 | |
462 | /* remove any godgiven items from the old god */ |
460 | /* remove any godgiven items from the old god */ |
463 | if (old_god) |
461 | if (old_god) |
… | |
… | |
869 | /* Follower lacks the required grace for the following |
867 | /* Follower lacks the required grace for the following |
870 | * treasure list items. */ |
868 | * treasure list items. */ |
871 | |
869 | |
872 | tmp = get_archetype (HOLY_POSSESSION); |
870 | tmp = get_archetype (HOLY_POSSESSION); |
873 | cast_change_ability (op, op, tmp, 0, 1); |
871 | cast_change_ability (op, op, tmp, 0, 1); |
874 | free_object (tmp); |
872 | tmp->destroy (); |
875 | return; |
873 | return; |
876 | } |
874 | } |
877 | continue; |
875 | continue; |
878 | } |
876 | } |
879 | |
877 | |
… | |
… | |
918 | int success; |
916 | int success; |
919 | |
917 | |
920 | tmp = get_archetype_by_object_name (item->slaying); |
918 | tmp = get_archetype_by_object_name (item->slaying); |
921 | |
919 | |
922 | success = cast_heal (op, op, tmp, 0); |
920 | success = cast_heal (op, op, tmp, 0); |
923 | free_object (tmp); |
921 | tmp->destroy (); |
924 | if (success) |
922 | if (success) |
925 | return; |
923 | return; |
926 | else |
924 | else |
927 | continue; |
925 | continue; |
928 | } |
926 | } |
… | |
… | |
956 | { |
954 | { |
957 | LOG (llevError, "Could not find archetype depletion.\n"); |
955 | LOG (llevError, "Could not find archetype depletion.\n"); |
958 | continue; |
956 | continue; |
959 | } |
957 | } |
960 | depl = present_arch_in_ob (at, op); |
958 | depl = present_arch_in_ob (at, op); |
|
|
959 | |
961 | if (depl == NULL) |
960 | if (depl == NULL) |
962 | continue; |
961 | continue; |
|
|
962 | |
963 | new_draw_info (NDI_UNIQUE, 0, op, "Shimmering light surrounds and restores you!"); |
963 | new_draw_info (NDI_UNIQUE, 0, op, "Shimmering light surrounds and restores you!"); |
|
|
964 | |
964 | for (i = 0; i < NUM_STATS; i++) |
965 | for (i = 0; i < NUM_STATS; i++) |
965 | if (get_attr_value (&depl->stats, i)) |
966 | if (get_attr_value (&depl->stats, i)) |
966 | new_draw_info (NDI_UNIQUE, 0, op, restore_msg[i]); |
967 | new_draw_info (NDI_UNIQUE, 0, op, restore_msg[i]); |
967 | remove_ob (depl); |
968 | |
968 | free_object (depl); |
969 | depl->destroy (); |
969 | fix_player (op); |
970 | fix_player (op); |
970 | return; |
971 | return; |
971 | } |
972 | } |
972 | |
973 | |
973 | /* Voices */ |
974 | /* Voices */ |
… | |
… | |
1161 | |
1162 | |
1162 | /* if caster is a rune or the like, it doesn't worship anything. However, |
1163 | /* if caster is a rune or the like, it doesn't worship anything. However, |
1163 | * if this object is owned by someone, then the god that they worship |
1164 | * if this object is owned by someone, then the god that they worship |
1164 | * is relevant, so use that. |
1165 | * is relevant, so use that. |
1165 | */ |
1166 | */ |
1166 | if (!god && get_owner (caster)) |
1167 | if (!god && caster->owner) |
1167 | god = find_god (determine_god (get_owner (caster))); |
1168 | god = find_god (determine_god (caster->owner)); |
1168 | |
1169 | |
1169 | if (!god || (spellop->attacktype & AT_HOLYWORD && !god->race)) |
1170 | if (!god || (spellop->attacktype & AT_HOLYWORD && !god->race)) |
1170 | { |
1171 | { |
1171 | if (!caster_is_spell) |
1172 | if (!caster_is_spell) |
1172 | new_draw_info (NDI_UNIQUE, 0, caster, "This prayer is useless unless you worship an appropriate god"); |
1173 | new_draw_info (NDI_UNIQUE, 0, caster, "This prayer is useless unless you worship an appropriate god"); |
1173 | else |
1174 | else |
1174 | LOG (llevError, "BUG: tailor_god_spell(): no god\n"); |
1175 | LOG (llevError, "BUG: tailor_god_spell(): no god\n"); |
1175 | free_object (spellop); |
1176 | |
|
|
1177 | spellop->destroy (); |
1176 | return 0; |
1178 | return 0; |
1177 | } |
1179 | } |
1178 | |
1180 | |
1179 | /* either holy word or godpower attacks will set the slaying field */ |
1181 | /* either holy word or godpower attacks will set the slaying field */ |
1180 | if (spellop->attacktype & AT_HOLYWORD || spellop->attacktype & AT_GODPOWER) |
1182 | if (spellop->attacktype & AT_HOLYWORD || spellop->attacktype & AT_GODPOWER) |