Aller au contenu

Photo

Custom class bonus feats?


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

Is there a way to program a custom class bonus feat that is only availible at 1st level.  The class is allowed to choose one of three options at 1st level and then the other two are never availiable ever again.  Is there a way to do this?  How does the ranger class do it at 2nd level?



#2
kamal_

kamal_
  • Members
  • 5 238 messages

Look at any of the feats that are normally only available at level 1. Specifically, you want the MaxLevel column: http://nwn2.wikia.com/wiki/Feat.2da



#3
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

Look at any of the feats that are normally only available at level 1. Specifically, you want the MaxLevel column: http://nwn2.wikia.com/wiki/Feat.2da

Yes, but if they start their character as one class and then change to this class, the MaxLevel will have them locked out.  Unfortunately I have already ruled-out this option.



#4
kamal_

kamal_
  • Members
  • 5 238 messages

Ah, that's not first level, that's first level in a particular class (which could be level 10).

 

Take a look at cls_feat_rang.2da, which is the class feat 2da for the ranger class, since your custom class would have the same basic implementation as the ranger's path choice.



#5
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

The ranger's combat style choice is hardcoded, you won't see them on cls_feat_rang.2da. You will see them on the prereq column for the successor feats, but those are awarded automatically, not as bonus feats.



#6
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

Ah, that's not first level, that's first level in a particular class (which could be level 10).

 

Take a look at cls_feat_rang.2da, which is the class feat 2da for the ranger class, since your custom class would have the same basic implementation as the ranger's path choice.

I followed the cls_feat_rang.2da format but it did not fix the situation.  It is still not allowing the character to select one of these three if they were another class before this class.  The MaxLevel prevents it.  I used the prereq format Clangeddin86 mentioned but he is correct in that it is hard-coded.  There does not seem to be a way of having bonus feats availiable at one specific level only.



#7
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

I think there may be an (ugly) workaround to it.

You make a new "OnLevelUp" script that trigger a conversation for that specific level only and you award the feat depending on the choice made during the dialog.

Or you could use a persistent passive feat (those trigger after level up as well) automatically awarded (at level 1 of said class) that calls the conversation only if you have reached that specific class level and you don't have one of the feats of choice.

EDIT: for the persistent feat, the impact spellscript would be something along the lines of:

int has_bonus(object oPC) // To check if you have the bonus feats, add more or modify the IDs as needed
{
	if (GetHasFeat(1000, oPC, TRUE)==TRUE) return TRUE;
	else if (GetHasFeat(1001, oPC, TRUE)==TRUE) return TRUE;
	else if (GetHasFeat(1002, oPC, TRUE)==TRUE) return TRUE;
	else if (GetHasFeat(1003, oPC, TRUE)==TRUE) return TRUE;
	else return FALSE;
}

void main()
{
	object oPC = OBJECT_SELF;
	int nLEVEL = 1; //the specific class level, modify as needed
	int nCLASS = CLASS_TYPE_DRAGONDISCIPLE; //the specific class, modify as needed
	if (GetLevelByClass(nCLASS, oPC) < nLEVEL) return;
	if (has_bonus(oPC) == TRUE) return;
	BeginConversation("conversation_feat", oPC, TRUE); //rename "conversation_feat" to an actual conversation
}

The weak point of this approach is that it should be used for class specific feats only, if used with general feats or feats that are available to multiple class there's a risk that the conversation may never fire because you may attain one of those possible "extra bonus feats" from other sources.

Then, of course, you have to script the FeatAdd(....) in the various choices of the conversation.

 

P.S. If you intend to use the OnLevelUp module script rather than making a new persistent feat from scratch, simply replace the "object oPC = OBJECT_SELF;" with "object oPC = GetPCLevellingUp();"


  • Laugh out loud aime ceci

#8
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

Thanks Clangeddin86 I will give this a try.



#9
Laugh out loud

Laugh out loud
  • Members
  • 109 messages

I think there may be an (ugly) workaround to it.

You make a new "OnLevelUp" script that trigger a conversation for that specific level only and you award the feat depending on the choice made during the dialog.

Or you could use a persistent passive feat (those trigger after level up as well) automatically awarded (at level 1 of said class) that calls the conversation only if you have reached that specific class level and you don't have one of the feats of choice.

EDIT: for the persistent feat, the impact spellscript would be something along the lines of:

int has_bonus(object oPC) // To check if you have the bonus feats, add more or modify the IDs as needed
{
	if (GetHasFeat(1000, oPC, TRUE)==TRUE) return TRUE;
	else if (GetHasFeat(1001, oPC, TRUE)==TRUE) return TRUE;
	else if (GetHasFeat(1002, oPC, TRUE)==TRUE) return TRUE;
	else if (GetHasFeat(1003, oPC, TRUE)==TRUE) return TRUE;
	else return FALSE;
}

void main()
{
	object oPC = OBJECT_SELF;
	int nLEVEL = 1; //the specific class level, modify as needed
	int nCLASS = CLASS_TYPE_DRAGONDISCIPLE; //the specific class, modify as needed
	if (GetLevelByClass(nCLASS, oPC) < nLEVEL) return;
	if (has_bonus(oPC) == TRUE) return;
	BeginConversation("conversation_feat", oPC, TRUE); //rename "conversation_feat" to an actual conversation
}

The weak point of this approach is that it should be used for class specific feats only, if used with general feats or feats that are available to multiple class there's a risk that the conversation may never fire because you may attain one of those possible "extra bonus feats" from other sources.

Then, of course, you have to script the FeatAdd(....) in the various choices of the conversation.

 

P.S. If you intend to use the OnLevelUp module script rather than making a new persistent feat from scratch, simply replace the "object oPC = OBJECT_SELF;" with "object oPC = GetPCLevellingUp();"

In the conversation version do I need to summon the person that the conversation is with first?



#10
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

In the conversation version do I need to summon the person that the conversation is with first?

That script makes you converse with yourself, so I'm pretty sure you're already there. :P