racial.txt
snippets · 1.1 KB · 2010-03-30
Racial skills: lets players practice and improve in racial abilities (Dennis Reichel).
Download « Back to the snippets list
From: Dennis Reichel <dennis@starlifter.reichel.net>
Hi, here's a quick hack to allow players to practice and
improve in racial skills. (made for Rom 2.4)
When used appropriately in do_practice and check_improve
it will allow players to actually utilize those racial skills,
even though their class may disallow them. I didn't bother
adding it to skills all, but that's planned sometime this century.
Watch for divide by zero - and be aware the use of a table
containing each racial skill and a divisor for difficulty
of learning per class is a better way to go, but fast and
dirty, (there is no *convenient* way to do this) it's better
than nothing :-)
For those who need to be told, this should be declared in
merc.h and probably placed in skills.c
bool is_racial_skill( CHAR_DATA * ch, int sn )
{
int i;
bool skill_found = FALSE;
for (i = 0; i < 5; i++)
{
if (pc_race_table[ch->race].skills[i] == NULL)
break;
if ( sn == skill_lookup( pc_race_table[ch->race].skills[i] ) )
{
skill_found = TRUE;
}
}
return skill_found;
}