The following two functions always return [Empty String] or 0 when called on any NPC, with either "interact" or "reticleover" as the arguments.
GetUnitRace("interact") returns [Empty String]
GetUnitRaceId("interact") returns 0
The fix would be to have them return the NPC Race and RaceId, respectively.
All other GetUnit functions (applicable to NPC's) return appropriate information with either "interact" or "reticleover" as the argument:
GetUnitAlliance("interact")
GetUnitChampionPoints("interact")
GetUnitDifficulty("interact")
GetUnitEffectiveChampionPoints("interact")
GetUnitEffectiveLevel("interact")
GetUnitGender("interact")
GetUnitLevel("interact")
GetUnitName("interact")
GetUnitReaction("interact")
GetUnitReactionColor("interact")
GetUnitType("interact")
GetUnitZone("interact")
GetUnitZoneIndex("interact")
GetRawUnitName("interact")
Note: NPC's must have some form of racial identifier, and even if its unnamed or different from player races, it would be extremely useful to have this information. Take for example Argonians; they tend to slowly drone on, so I'd set the timer on my addon to be much longer before expecting the dialog to be over when a lizard is the speaker.
NPC's may not have well defined classes similar enough to players, so these two may or may not be working as intended:
GetUnitClass("interact") returns [Empty String]
GetUnitClassId("interact") returns 0
Testing Methodology:
Warning: Spoiler
I'm including the information from tests on an interactable NPC ("interact" and "reticleover"), a non-interactable NPC ("reticleover"), another player ("reticleover"), and myself ("player") with the stated arguments.
The following function calls are done inside a function registered for handling EVENT_CHATTER_BEGIN and EVENT_CONVERSATION_UPDATED where "interact" and "player" are used as arguments, and in a function hooked to a keybind for "reticleover" calls.
The test NPC here is "Valaste", in the Mages Guild of Ghratwood. Using "interact" and "reticleover" yield the same results:
Next, testing with "reticleover" on an "Elden Root Guard" NPC:
Next, testing with "reticleover" on another player:
And lastly, testing with the argument "player" (which calls the above functions on me):