Hi, guys I'm a new imm to a fairly old smaug based mud and our coder is taking a small break. I just have a few questions that I'm sure you'll be able to answer rather quickly.
Can someone explain this save to me? A line by line explanation would be great.
bool saves_spell_staff( int level, CHAR_DATA *victim )
{
int save;
if ( IS_SET( victim->immune, RIS_MAGIC ) )
return TRUE;
if ( IS_NPC( victim ) && level > 10 )
level -= 5;
save = 50 + ( victim->level - level - victim->saving_spell_staff ) * 5;
save = URANGE( 5, save, 95 );
return victim->ChanceRoll( save );
}
I'm also having trouble understanding some spells too. Line by line explanations would be great.
ch_ret spell_magic_missile( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
static const sh_int dam_each[] =
{
0,
3, 3, 4, 4, 5, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 18, 18, 18, 18, 18
};
int dam;
level = UMIN(level, sizeof(dam_each)/sizeof(dam_each[0]) - 1);
level = UMAX(0, level);
dam = number_range( dam_each[level] / 2, dam_each[level] * 2 );
/* What's this? You can't save vs. magic missile! -Thoric
if ( saves_spell( level, victim ) )
dam /= 2;
*/
return damage( ch, victim, dam, sn, 0 );
}
We are currently in the process of trying to balance our classes and we need good information on our spells before we start.
Thanks in advance,
Blarg
Can someone explain this save to me? A line by line explanation would be great.
bool saves_spell_staff( int level, CHAR_DATA *victim )
{
int save;
if ( IS_SET( victim->immune, RIS_MAGIC ) )
return TRUE;
if ( IS_NPC( victim ) && level > 10 )
level -= 5;
save = 50 + ( victim->level - level - victim->saving_spell_staff ) * 5;
save = URANGE( 5, save, 95 );
return victim->ChanceRoll( save );
}
I'm also having trouble understanding some spells too. Line by line explanations would be great.
ch_ret spell_magic_missile( int sn, int level, CHAR_DATA *ch, void *vo )
{
CHAR_DATA *victim = (CHAR_DATA *) vo;
static const sh_int dam_each[] =
{
0,
3, 3, 4, 4, 5, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 18, 18, 18, 18, 18
};
int dam;
level = UMIN(level, sizeof(dam_each)/sizeof(dam_each[0]) - 1);
level = UMAX(0, level);
dam = number_range( dam_each[level] / 2, dam_each[level] * 2 );
/* What's this? You can't save vs. magic missile! -Thoric
if ( saves_spell( level, victim ) )
dam /= 2;
*/
return damage( ch, victim, dam, sn, 0 );
}
We are currently in the process of trying to balance our classes and we need good information on our spells before we start.
Thanks in advance,
Blarg