View Single Post
03/18/14, 04:46 PM   #2
inDef
Join Date: Mar 2014
Posts: 16
Originally Posted by Uesp View Post
I tried using the following to log information on NPCs inside a EVENT_RETICLE_TARGET_CHANGED function:
Code:
local level = GetUnitLevel(unitTag)
local gender = GetUnitGender(unitTag)
local difficulty = GetUnitDifficulty(unitTag)
local class = GetUnitClass(unitTag)           --Doesn't work
local race = GetUnitRace(unitTag)            --Doesn't work
The first 3 functions work fine but the Class/Race functions return an empty string. I assume they work fine on PCs but was wondering why not working on NPCs? I would expect NPCs to have a set race. As far as I can tell there are no other "get race" type functions in the API.

Any ideas or pointing out something I've missed would be great.
This is 100% speculation but I'd bet that:

1. NPC's don't have a race, they are just skinned a certain way. As a super generic example, imagine that any particular instance of class "NPC" does not have any sort of "race" definition...it just has a skin assigned to it. I'd imagine NPC's don't have passives...and it doesn't appear there are any racial damage buffs in the game (i.e. do x% increased damage to Breton) for which would make a racial definition important.

Note: Daedra and undead are not a class, they are an attribute. I mention this because there are "do x% increased damage to Daedra/Undead" mods.

2. NPC's don't have a class, they just have a pool of abilities they can use.

Again, complete speculation but if true would explain your results.
  Reply With Quote