Player Resource Consortium

Neverwinter Nights => Builders => Topic started by: Silvercloud on January 26, 2012, 05:27:30 AM

Title: Adding a race
Post by: Silvercloud on January 26, 2012, 05:27:30 AM
Good morning, in my beta-test i ran into an issue with my created race, so I would like some insight in what is going wrong..

I'm trying to add a race that has some of the monk abilities prebuilt... specifically the monk AC bonus where wisdom is added to their AC... i have created a char and as far as I can see it should work. Character has monk ac bonus and the 9 natural armor as in the file... however it looks as if the wisdom bonus is not applied (e.g. he has AC 23 (from 9 natural armor and 18 dex... but his 20 wisdom does nothing). Any ideas what might be causing this and what i can do to fix it (do you have to be a monk for example for it to work)?

Attached my modded files... in racialtypes it is in line 100...
Title: Re: Adding a race
Post by: xwarren on January 26, 2012, 09:32:48 AM
I wouldn't be surprised if monk's AC was hard-coded only to monk class. I know that AC bonuses from Dragon Disciple and Pale Master are (I tested it once).
Title: Re: Adding a race
Post by: Silvercloud on January 26, 2012, 10:30:19 AM
well theres the ninja class thats in the PRC... it also adds the same bonus.... and adding that feat also doesnt work... and i know why... it is because the script that adds the composite bonus only adds it if you are that class....  its run from prc_inc_function... so i guess if i add a case referring to the racial constant i could also trigger a script that adds the composite bonus... hmmmm
Title: Re: Adding a race
Post by: DM Heatstroke on January 26, 2012, 10:59:16 AM
I wouldn't be surprised if monk's AC was hard-coded only to monk class.

Correct.  It's hard coded to the Monk class (http://nwn.wikia.com/wiki/Monk_AC_bonus).
Title: Re: Adding a race
Post by: Silvercloud on January 26, 2012, 11:05:41 AM
Yep, but you can apparently script it... as has been done for the ninja class... my only issue is I don't really understand in what file I should run my script, but my code would be something like this:

Quote

if((GetRacialType(oPC)==100 ) &&
    (GetLevelByClass(CLASS_TYPE_MONK, oPC)< 1) &&
     (GetLevelByClass(CLASS_TYPE_NINJA, oPC)< 1))
{
SetCompositeBonus(oSkin, "MonkACBonus", GetAbilityModifier(ABILITY_WISDOM, oPC), ITEM_PROPERTY_AC_BONUS);
}


Do you guys know where I should execute this code so it will work properly (e.g. in which PRC file)
Title: Re: Adding a race
Post by: xwarren on January 26, 2012, 11:24:59 AM
Nymph race has similar ability. It's hooked in race_skin.nss script:
Code: [Select]
    if(GetHasFeat(FEAT_UNEARTHLY_GRACE))
    {
        int nGrace = GetAbilityModifier(ABILITY_CHARISMA, oPC);
        SetCompositeBonus(oSkin, "UnearthlyGraceAC", nGrace, ITEM_PROPERTY_AC_BONUS);
        SetCompositeBonus(oSkin, "UnearthlyGraceSave", nGrace, ITEM_PROPERTY_SAVING_THROW_BONUS, SAVING_THROW_ALL);
    }
Title: Re: Adding a race
Post by: Silvercloud on January 26, 2012, 04:32:44 PM
Yep thats got it done, thanks xwarren...