Player Resource Consortium

 

Author Topic: Adding a race  (Read 5092 times)

0 Members and 1 Guest are viewing this topic.

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...


January 26, 2012, 09:32:48 AM
Reply #1
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

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).


January 26, 2012, 10:30:19 AM
Reply #2

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
« Last Edit: January 26, 2012, 10:43:57 AM by Silvercloud »


January 26, 2012, 10:59:16 AM
Reply #3

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.
HEATSTROKE


January 26, 2012, 11:05:41 AM
Reply #4

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)
« Last Edit: January 26, 2012, 11:12:30 AM by Silvercloud »


January 26, 2012, 11:24:59 AM
Reply #5
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

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);
    }


January 26, 2012, 04:32:44 PM
Reply #6

Yep thats got it done, thanks xwarren...