Skip to content

Npc class autolevel

NPC Class Autoleveling

Updated the way NPCs (randbosses) are assigned character classes (game.state:applyRandomClass).

The new method makes high level NPCs with character classes scale like player levels and tends to increase the number of talents randomly learned while limiting the maximum talent levels.

This is a nerf for high level randbosses (including those enhanced due to game difficulty) and a buff for fixed bosses that are updated, while making turning their difficulty much simpler.

This replaces the previous method of assigning an increasing number of class talents at maximum level, that could result in boss's skills scaling much faster than its actor level.

This should allow the difficulty to fixed and random bosses to be more consistent.

DETAILS:

Talents are learned randomly one level at a time and are restricted by the normal progression of talent and stat points and all normal talent restrictions.

After setup, NPCs automatically advance in their character classes when gaining levels, tending to focus their talent choices with randomly determined preferred categories.

Random bosses and bosses enhanced for game difficulty can use "partial" character classes. Game balance tuning is handled my adjusting the number of added classes.

The number of character classes assigned to bosses at higher difficulties is adjusted slightly:

NIGHTMARE -- max 1 random class (BUFF), INSANE -- max 2 random classes , MADNESS -- max 3 random classes

NPC (fixed boss) definitions can be updated to specify automatic class advancement begining at a certain level and rate.

This allows many bosses that become unchallenging on advanced difficulties or when spawning in the I.D. to be easily buffed by specifying character class advancement based on level.

This commit updates the definitions of some (fixed) bosses to use this method:

Trollmire troll bosses: 75% Berserker class advancement starting at level 11

Aluin the Fallen: 50% Sun Paladin and 50% Cursed starting at level 36

The Shade: 75% Archmage starting at level 12

The Possessed: 75% Arcane Blade starting at level 12

Kor's Fury: 50% Archmage, 50% Corruptor starting at level 39

Epoch: 100% Paradox Mage starting at level 36

The Abomination: 50% Anorithil and 50% Cursed class advancement starting at level 36

Nimisil: 100% Anorithil starting at level 44

Snaproot: 100% Summoner starting at level 51

Corrupted Sand Wyrm: 50% Corruptor, 50% Wyrmic starting at level 48

Massok the Dragonslayer: 100% Berserker, starting at level 46

Pale Drake: 50% Archmage, 50% Corruptor starting at level 41

Fallen Sun Paladin Aeryn: 100% Sun Paladin starting at level 57

Summary of function changes:

Actor:learnStats(statorder, repeats)

Updated to maintain the current stat index within the passed statorder table. This allows multiple stat progressions to be applied to the same Actor and repeated multiple times with the same function call.

Actor:levelupClass(c_data)

New function to automatically assign character class levels to an actor according to c_data. Sets up the self.auto_classes table, retrieves data as needed from class birth descriptors. Assigns stat/talent/category points randomly on a level-by-level basis.

Actor:resolveLevelTalents()

Updated to process any self.auto_classes defined

game.state:applyRandomClass(b, data, instant)

Works as before, but is updated to use Actor:levelupClass to set up class definitions. nb_classes can be a floating point number, allowing "fractional" classes to be assigned: (1.5 == one class at 100% actor level plus another class at 50% of actor level). The instant parameter forces advancement in the class(es) immediately. Fixed a bug where auto_equip_filters were being copied even when forbid_equip was set.

game.state:createRandomBoss(base, data)

By default, randombosses are nerfed slightly, getting 1.75 random classes by default.

NPC:addedToLevel(level, x, y)

Higher game difficulties assign slightly random classes based on rank, which may be partial classes: NIGHTMARE -- up to 1 random class, INSANE -- up to 2 random classes, MADNESS -- up to 3 random classes Random bosses gain extra character classes at 1/2 the rate of fixed bosses.

resolvers.sustains_at_birth()

Will check that a talent is inactive before trying to activate it.

resolvers.talented_ai_tactic(method, tactic_emphasis, weight_power)

May specify "instant" as the method to force recalculating the talent table immediately when resolved (instead of through on_added_to_level).

RandomActor debug Dialog: updated Help reference to show header for Actor:levelupClass

SummonCreature debug Dialog: updated to spawn the alchemy golem if needed

Merge request reports

Loading