Skip to content
Gotest edited this page May 9, 2021 · 4 revisions

Adding Levels To Enemy NPCs

You must know the class name or have access to the class for the NPC you wish to add data for.

expRate: The EXP rate to set. 100 = 100%.

hideLevel: Hides the level of this NPC unless the player is 10 levels higher than the set level.

bossExp: Sets if this NPC will have boss EXP scaling for level differences between the player and NPC.

NpcLevelData.AddNpcLevel(ModContent.NPCType<NPC CLASS>(), Level, EXP Rate);
OR
NpcLevelData.AddNpcLevel(ModInstance.NPCType("NPC CLASS NAME"), Level, EXP Rate));

Mod Call is also supported.

LeveledModInstance.Call("AddNpcLevelData", (int)NPC ID, (int)Level, (int)EXP Rate, (bool)Hide Level, (bool)Boss EXP);

Add any of this in PostSetupContent() in the main class of the mod.

Clone this wiki locally