… | |
… | |
709 | */ |
709 | */ |
710 | if (tmp->type != EARTHWALL) //TODO |
710 | if (tmp->type != EARTHWALL) //TODO |
711 | tmp->set_owner (op); |
711 | tmp->set_owner (op); |
712 | |
712 | |
713 | set_spell_skill (op, caster, spell_ob, tmp); |
713 | set_spell_skill (op, caster, spell_ob, tmp); |
714 | tmp->level = caster_level (caster, spell_ob) / 2; |
714 | tmp->level = casting_level (caster, spell_ob) / 2; |
715 | |
715 | |
716 | name = tmp->name; |
716 | name = tmp->name; |
717 | if (!(tmp = m->insert (tmp, x, y, op))) |
717 | if (!(tmp = m->insert (tmp, x, y, op))) |
718 | { |
718 | { |
719 | new_draw_info_format (NDI_UNIQUE, 0, op, "Something destroys your %s", name); |
719 | new_draw_info_format (NDI_UNIQUE, 0, op, "Something destroys your %s", name); |
… | |
… | |
1428 | ((QUERY_FLAG (tmp, FLAG_CURSED) && QUERY_FLAG (spell, FLAG_CURSED)) || |
1428 | ((QUERY_FLAG (tmp, FLAG_CURSED) && QUERY_FLAG (spell, FLAG_CURSED)) || |
1429 | (QUERY_FLAG (tmp, FLAG_DAMNED) && QUERY_FLAG (spell, FLAG_DAMNED)))) |
1429 | (QUERY_FLAG (tmp, FLAG_DAMNED) && QUERY_FLAG (spell, FLAG_DAMNED)))) |
1430 | { |
1430 | { |
1431 | was_one++; |
1431 | was_one++; |
1432 | |
1432 | |
1433 | if (tmp->level <= caster_level (caster, spell)) |
1433 | if (tmp->level <= casting_level (caster, spell)) |
1434 | { |
1434 | { |
1435 | success++; |
1435 | success++; |
1436 | if (QUERY_FLAG (spell, FLAG_DAMNED)) |
1436 | if (QUERY_FLAG (spell, FLAG_DAMNED)) |
1437 | CLEAR_FLAG (tmp, FLAG_DAMNED); |
1437 | CLEAR_FLAG (tmp, FLAG_DAMNED); |
1438 | |
1438 | |
… | |
… | |
1543 | |
1543 | |
1544 | /* We precompute some values here so that we don't have to keep |
1544 | /* We precompute some values here so that we don't have to keep |
1545 | * doing it over and over again. |
1545 | * doing it over and over again. |
1546 | */ |
1546 | */ |
1547 | god = find_god (determine_god (op)); |
1547 | god = find_god (determine_god (op)); |
1548 | level = caster_level (caster, spell); |
1548 | level = casting_level (caster, spell); |
1549 | range = spell->range + SP_level_range_adjust (caster, spell); |
1549 | range = spell->range + SP_level_range_adjust (caster, spell); |
1550 | |
1550 | |
1551 | if (!skill) |
1551 | if (!skill) |
1552 | skill = caster; |
1552 | skill = caster; |
1553 | |
1553 | |
… | |
… | |
1796 | } |
1796 | } |
1797 | /* give sp */ |
1797 | /* give sp */ |
1798 | if (spell->stats.dam > 0) |
1798 | if (spell->stats.dam > 0) |
1799 | { |
1799 | { |
1800 | plyr->stats.sp += spell->stats.dam + SP_level_dam_adjust (caster, spell); |
1800 | plyr->stats.sp += spell->stats.dam + SP_level_dam_adjust (caster, spell); |
1801 | charge_mana_effect (plyr, caster_level (caster, spell)); |
1801 | charge_mana_effect (plyr, casting_level (caster, spell)); |
1802 | return 1; |
1802 | return 1; |
1803 | } |
1803 | } |
1804 | /* suck sp away. Can't suck sp from yourself */ |
1804 | /* suck sp away. Can't suck sp from yourself */ |
1805 | else if (op != plyr) |
1805 | else if (op != plyr) |
1806 | { |
1806 | { |
… | |
… | |
1818 | /* Player doesn't get full credit */ |
1818 | /* Player doesn't get full credit */ |
1819 | sucked = (sucked * rate) / 100; |
1819 | sucked = (sucked * rate) / 100; |
1820 | op->stats.sp += sucked; |
1820 | op->stats.sp += sucked; |
1821 | if (sucked > 0) |
1821 | if (sucked > 0) |
1822 | { |
1822 | { |
1823 | charge_mana_effect (op, caster_level (caster, spell)); |
1823 | charge_mana_effect (op, casting_level (caster, spell)); |
1824 | } |
1824 | } |
1825 | } |
1825 | } |
1826 | return 1; |
1826 | return 1; |
1827 | } |
1827 | } |
1828 | return 0; |
1828 | return 0; |
… | |
… | |
1925 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
1925 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
1926 | break; |
1926 | break; |
1927 | if (tmp->type == HOLY_ALTAR) |
1927 | if (tmp->type == HOLY_ALTAR) |
1928 | { |
1928 | { |
1929 | |
1929 | |
1930 | if (tmp->level > caster_level (caster, spell)) |
1930 | if (tmp->level > casting_level (caster, spell)) |
1931 | { |
1931 | { |
1932 | new_draw_info_format (NDI_UNIQUE, 0, op, "You are not powerful enough to reconsecrate the %s", &tmp->name); |
1932 | new_draw_info_format (NDI_UNIQUE, 0, op, "You are not powerful enough to reconsecrate the %s", &tmp->name); |
1933 | return 0; |
1933 | return 0; |
1934 | } |
1934 | } |
1935 | else |
1935 | else |
1936 | { |
1936 | { |
1937 | /* If we got here, we are consecrating an altar */ |
1937 | /* If we got here, we are consecrating an altar */ |
1938 | sprintf (buf, "Altar of %s", &god->name); |
1938 | sprintf (buf, "Altar of %s", &god->name); |
1939 | tmp->name = buf; |
1939 | tmp->name = buf; |
1940 | tmp->level = caster_level (caster, spell); |
1940 | tmp->level = casting_level (caster, spell); |
1941 | tmp->other_arch = god->arch; |
1941 | tmp->other_arch = god->arch; |
1942 | |
1942 | |
1943 | if (op->type == PLAYER) |
1943 | if (op->type == PLAYER) |
1944 | esrv_update_item (UPD_NAME, op, tmp); |
1944 | esrv_update_item (UPD_NAME, op, tmp); |
1945 | |
1945 | |
… | |
… | |
2132 | tmp->state = weapon->state; |
2132 | tmp->state = weapon->state; |
2133 | tmp->flag [FLAG_ANIMATE] = weapon->flag [FLAG_ANIMATE]; |
2133 | tmp->flag [FLAG_ANIMATE] = weapon->flag [FLAG_ANIMATE]; |
2134 | } |
2134 | } |
2135 | |
2135 | |
2136 | /* make experience increase in proportion to the strength of the summoned creature. */ |
2136 | /* make experience increase in proportion to the strength of the summoned creature. */ |
2137 | tmp->stats.exp *= 1 + (MAX (spell->stats.maxgrace, spell->stats.sp) / caster_level (caster, spell)); |
2137 | tmp->stats.exp *= 1 + (MAX (spell->stats.maxgrace, spell->stats.sp) / casting_level (caster, spell)); |
2138 | |
2138 | |
2139 | tmp->speed_left = -1; |
2139 | tmp->speed_left = -1; |
2140 | tmp->direction = dir; |
2140 | tmp->direction = dir; |
2141 | |
2141 | |
2142 | m->insert (tmp, x, y, op); |
2142 | m->insert (tmp, x, y, op); |
… | |
… | |
2190 | new_aura->stats.dam = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
2190 | new_aura->stats.dam = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
2191 | |
2191 | |
2192 | set_spell_skill (op, caster, spell, new_aura); |
2192 | set_spell_skill (op, caster, spell, new_aura); |
2193 | new_aura->attacktype = spell->attacktype; |
2193 | new_aura->attacktype = spell->attacktype; |
2194 | |
2194 | |
2195 | new_aura->level = caster_level (caster, spell); |
2195 | new_aura->level = casting_level (caster, spell); |
2196 | |
2196 | |
2197 | if (refresh) |
2197 | if (refresh) |
2198 | new_draw_info (NDI_UNIQUE, 0, op, "You recast the spell while in effect."); |
2198 | new_draw_info (NDI_UNIQUE, 0, op, "You recast the spell while in effect."); |
2199 | else |
2199 | else |
2200 | new_draw_info (NDI_UNIQUE, 0, op, "You create an aura of magical force."); |
2200 | new_draw_info (NDI_UNIQUE, 0, op, "You create an aura of magical force."); |