Aller au contenu

Photo

NPC Training for PCs


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

#1
Androrc

Androrc
  • Members
  • 101 messages
I have an idea I want to implement: to make it so, in order to level up in a class, a PC needs training from a NPC of higher level in that class. By using the SCRIPTVAR requirement in the cls_pres_*.2da files, I can make the training be required. However, I'd like the PCs to only be able to train if they have an unspent level-up. How do I check for that?

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
If you wanted it as a starting condition you could do it like this.

int StartingConditional()
{
  object oPC =GetPCSpeaker();
  int nHD= GetHitDice(oPC);
  int nXP = GetXP(oPC);
 
int bCanLevel = ( (nHD+1)*nHD*500 < nXP );

  return  bCanLevel;
}



#3
_Guile

_Guile
  • Members
  • 685 messages
int bCanLevel = ( (nHD+1)*nHD*500 < nXP );

That's some pretty snappy code there Lightfoot8, bravo! :D

#4
Androrc

Androrc
  • Members
  • 101 messages
Excellent! :)