Author Topic: Script for auto-levelling monsters?  (Read 424 times)

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Script for auto-levelling monsters?
« on: December 01, 2012, 09:09:27 pm »


               Is it possible to level up a spawned monster (with its chosen level-up package) so that it would be of chosen difficulty to the players group?
For example, a dragon spawning on such level so that it would be of "Very Difficult" challenge rating to the group.

It would work similarly to difficulty scaling encounters but without creating twenty versions of the monster.

Does such a script exist? I know some modules (like Good VS Evil) have difficulty scaling via level-up packages but I have no idea how this is achieved.

I imagine this being done by taking the average party level and then levelling the monster up to this level adjusted by chosen numbers of levels less or more, e.g. the script that levels the spawned monster to average level of the party minus 2.

Umm... but I'm pretty bad at scripting so I don't think I can do such thing. I believe it would be an OnSpawn script?
Any help is welcome. '<img'>
               
               

               


                     Modifié par Grani, 01 décembre 2012 - 10:51 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Script for auto-levelling monsters?
« Reply #1 on: December 02, 2012, 06:49:48 am »


               First off, while CR determines XP, it is not necessarily a good indication of difficulty.  Leveling up a creature by script does not improve upon special abilities, nor does it improve the creature's skin.  If you want to level up a creature to your liking as far as difficulty is concerned, you are often best at creating your own level up packages which you would define in packages.2da.

Secondly, this will not work on most toolkit creatures.  Creatures that have more than one HD will typically fail the LevelUpHenchman() command, as the command assumes a starting level of one.  Thus you will need to create one HD variants of the creatures you want to be leveled up.

With that said, the below script demonstrates leveling a creature to the point just above 20.0 CR. It uses a one HD creature (the skeleton). In this script the delay command is important as there are problems with leveling up when the creature is just created.


void LevelToCR(object oCreature, float fCRLimit, int nclass, int nLevelUpPackage = PACKAGE_INVALID)
{
float fCR = GetChallengeRating(oCreature);
int nHD = GetHitDice(oCreature);
while(fCR < fCRLimit)
 {
 LevelUpHenchman(oCreature, nclass, TRUE, nLevelUpPackage);
 fCR = GetChallengeRating(oCreature);
 nHD++;
 //Cut the loop if no longer leveling up
 if(nHD != GetHitDice(oCreature)) return;
 }
}


void main()
{
object oSkel = CreateObject(OBJECT_TYPE_CREATURE, "nw_skeleton", GetLocation(OBJECT_SELF));
DelayCommand(0.5, LevelToCR(oSkel, 20.0, CLASS_TYPE_FIGHTER));
}
               
               

               


                     Modifié par WhiZard, 02 décembre 2012 - 06:57 .
                     
                  


            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Script for auto-levelling monsters?
« Reply #2 on: December 02, 2012, 10:54:04 am »


               Thanks a lot!
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Script for auto-levelling monsters?
« Reply #3 on: December 02, 2012, 08:50:36 pm »


               You might want to check this out too, has all the base races that can be leveled up by the DM in any of the classes. You could look at the scripts for personal use.
HR DM TOOL