Determining NPC Stats

From Tales of Maj'Eyal
Jump to: navigation, search

Placeholder page.

How to figure out NPC stats, talents, etc. from .lua file info.

Life

All NPCs should have the 'fixed_rating' flag set to false (fixed_rating = false), meaning they have variable hitpoints when created. There may be some odd NPCs that don't have this setting.

We also need to know the variables for the NPC: 'rank', 'life_rating', 'max_life', and 'level_range'. Finally we also want to know the 'level_range' from the Zone. NPC.lua file 'level_range' is {x, y}. Zone.lua "level_range" is from {a, b}. NPC level range is almost always 'nil' for the max ('y' value).

Then we can figure out the NPC's possible life range (not counting talents):

  1. NPC's possible level range is {x, b}.
  2. Starting life is defined by 'max_life' (yes, backwards, I know).
  3. Life per level is defined by: Life_rating * (1+level/40)+(rank_lookup)

Rank_lookup is confusing but here's a table for you:

Rank Lookup Value
1 -0.2
2 -0.1
3 0.1
3.2 0.15
3.5 1.0
4 2
5 3
10 (or more) 6

Putting It Together

Using Subject Z as our example:

  • NPC level_range: {10, nil}
  • Zone level_range: {10, 25}
  • Subject Z's level is therefore {10, 25}
  • Subject Z's rank is 4, rank_lookup is 2
  • Subject Z's max_life is 100
  • Subject Z's life_rating is 12

Per level-up HP gain is: 12 * (1+current_level/40)+2 or 3+(current_level/40)

Starting life is 100.

To get a fully accurate count we'd have to compute for level 1, level 2, level ... level 10 and add all the values. We can average and multiply for a faster but less accurate result. Instead of summing, we use 12 * number_of_levels * (1.2+average_value/40).

Lowest possible level: 10. Number of levels-ups: 9. Average value: sum(1->10)/10 = ((10*11)/2)/10 = 5.5.

FINALLY (you've stuck with this math? good on you):

  • Total HP (for Level 10): 100 + (12 * 9 * (3+(5.5/40))) = 438.
  • Total HP (for Level 25): 100 + (12 * 24 * (3+(32.5/40))) = 1198