Author Topic: OnPlayerLevelUp Event Question  (Read 435 times)

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
OnPlayerLevelUp Event Question
« on: August 17, 2012, 01:01:07 am »


               According to the Lexicon regarding the OnPlayerLevelUp event:  "Occurs when a PC has gained a new level. Fires right after the player has clicked okay to confirm the choices he has made for the gained level. There’s no way to prevent the level from occurring, but you can script it so that the PC is knocked back a level right after he has gained it."

My level-up script has multiple checks to ensure that PCs meet level-up requirements (special cross-classing or prestige class restrictions, for example).  If PCs don't meet the requirements, then the script exits and XP is set to allow them to level again.

As we know there are certain classes that when de-leveled, do not fully remove their feats/bonuses (such as rdd).

If I abort my PC's level via my level-up script, are there cases where this could lead to cases of PCs getting bonuses without properly levelling (because my restrictions would prevent them from getting the level and resetting the xp)?

Thanks!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
OnPlayerLevelUp Event Question
« Reply #1 on: August 19, 2012, 02:34:08 am »


               You can stop the PC from taking any of the prestige class, during any of the levels up. All you have to do is set a Local var on them to 1. The local Var to set will be listed in the cls_pres_*.2da.

For example in cls_pres_harper.2da line 6 is:

6 ScriptVar VAR X1_AllowHarper 0

It basicly states that in order for the PC to be allowed to take the class they will have to have the X1_AllowHarper local variable on them at 0. If it is set to anything else they will not be able to take the class.

If you are using haks you can also make the Base classes work the same way. The PreReqTable column in classes.2da points a list of class restrictions, You would just have to add it for you base races.


EDIT:  I do believe that shadow has stated that he has already done this in the 1.70 patch.  
               
               

               


                     Modifié par Lightfoot8, 19 août 2012 - 01:35 .