void Captain::LoadDefaults(void) { if(Race::ALL & home.GetRace()) { u8 book, spell; Skill::Primary::LoadDefaults(home.GetRace(), *this, book, spell); SpellBookActivate(); if(home.GetLevelMageGuild()) home.GetMageGuild().EducateHero(*this); } }
void HeroBase::LoadDefaults(int type, int race) { if(Race::ALL & race) { // fixed default primary skills Skill::Primary::LoadDefaults(type, race); // fixed default spell switch(type) { case HeroBase::CAPTAIN: { // force add spell book SpellBookActivate(); Spell spell = Skill::Primary::GetInitialSpell(race); if(spell.isValid()) AppendSpellToBook(spell, true); } break; case HeroBase::HEROES: { Spell spell = Skill::Primary::GetInitialSpell(race); if(spell.isValid()) { SpellBookActivate(); AppendSpellToBook(spell, true); } } break; default: break; } } }