Aller au contenu

Photo

Henchmen questions


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

#1
Bubba McThudd

Bubba McThudd
  • Members
  • 147 messages
 Greetings all,

Two queries:
1) Which scripts need to be altered to allow more than one henchmen?

2) Is it possible to tinker with a henchman's script so that the henchman remains X levels lower than the PC?

Cheers!

#2
Mudeye

Mudeye
  • Members
  • 126 messages
void SetMaxHenchmen(

int nNumHenchmen

);

#3
Mudeye

Mudeye
  • Members
  • 126 messages
To make a henchman that levels up with the PC.

You first make a level 1 henchman.  It must be level 1. You can give it any feats or anything you want.

In the conversation where you take the henchman on, you add a little code to the ActionsTake script where you get the henchman.  This will level up the henchman to your level (or below if you like).  the variable levelsBelowPC is the number of levels below the PC that you want the henchman to be.  The PC level needs to be at least (1+levelsBelowPC).


  object pc = GetPCSpeaker();
  int pcLev = GetHidDice(pc);
  int i;
  int levelsBelowPC = 1;
  int lev = GetHitDice(OBJECT_SELF);
  lev = lev + levelsBelowPC;
  for( i=lev; i<pcLev; i++ )
  {
    LevelUpHenchman( OBJECT_SELF );
  }
 
 
That will level the henchman up to the level of the PC-1  when you first get them.

Now to keep them leveled up you put some code in the Modules event script for the event OnPlayerLevelUp

    object pc = GetPCLevelingUp();
    int maxHenchmen = GetMaxHenchmen();
    int i;
    for( i=1; i<=maxHenchmen; i++ )
    {
        object hench = GetHenchman(pc, i );
        if( GetIsObjectValid(hench) )
        {
            LevelUpHenchman( hench );
        }
    }
   
Every time the PC levels up any henchmen will also level up.  If you drop a henchman and regain them later the first script will level them up to the right level and then when you level up again the second script will keep them at the right level.

   

#4
420

420
  • Members
  • 190 messages

Bubba McThudd wrote...

1) Which scripts need to be altered to allow more than one henchmen?


Mudeye wrote...

void SetMaxHenchmen(
int nNumHenchmen
);

This goes in the module's OnModuleLoad event.

-420

#5
Bubba McThudd

Bubba McThudd
  • Members
  • 147 messages
Thanks!