Last active
August 29, 2015 14:13
-
-
Save jd28/2f4000ae4ad8ea0c0824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define your races and your FE feats, make these for each custom race replacing MYRACE | |
// with a more descriptive name. | |
#define RACIAL_TYPE_MYRACE <index into the race 2da> | |
#define FEAT_FAVORED_ENEMEY_MYRACE <index into the feat 2da> | |
int Hook_GetFavoredEnemyBonus(CNWSCreatureStats *attacker, CNWSCreature *defender) { | |
uint16_t race = defender->cs_stats->cs_race; | |
int feat = -1; | |
switch(race) { | |
// copy between here | |
case RACIAL_TYPE_DWARF: | |
feat = FEAT_FAVORED_ENEMY_DWARF; | |
break; | |
// and here and paste and replace them with all the races and FE feats, including yours you made above in between here: | |
// and here. | |
} | |
if (feat == -1 || !nwn_GetKnowsFeat(attacker, feat)) { return 0; } | |
// There should be some harper scout here too, but I forget. | |
int ranger = nwn_GetLevelByClass(attacker, CLASS_TYPE_RANGER); | |
// Might need to deal with bane of enemies here too. | |
int bonus = 1 + (ranger / 5); | |
return bonus; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment