///////// MANA CALCULATIONS.. Rom24B6 and probably all Merc 2.1 and up derivs..
// I had problems when I first started working on spell casters. I use Merc 2.2 but
// updated bits of code from Rom24B6.. However, The way Rom calculates mana cost is
// whacked out and makes no sense why it was never just calculated to be exact.
// In Rom24B6.. you will see this bit of code above do_cast;
/* for finding mana costs -- temporary version */
int mana_cost (CHAR_DATA *ch, int min_mana, int level)
{
if (ch->level + 2 == level)
return 1000;
return UMAX(min_mana,(100/(2 + ch->level - level)));
}
// And in do_cast itself, you will see this code..
if (ch->level + 2 == skill_table[sn].skill_level[ch->class])
mana = 50;
else
mana = UMAX( skill_table[sn].min_mana, 100 / ( 2 + ch->level - skill_table[sn].skill_level[ch->class] ) );
// And the purpose for those were....
// Remove int mana_cost all together and in do_cast replace the block of code just above with;
mana = UMAX (skill_table[sn].min_mana, skill_table[sn].skill_level[ch->class]);