Thread Tools Display Modes
03/15/14, 01:06 PM   #1
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
GetUnitClassId(string unitTag)

GetUnitClassId(string unitTag)
Returns: integer classId

Any one have constants for classId? none on the wiki and I didn't see any in zgoo...

by my testing I know:
sorcerer == 2


But I assume there should be constants????
  Reply With Quote
03/15/14, 01:23 PM   #2
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
It might be part of the localisation stuff we don't have on the wiki yet.

Theoretically you can figure it out by using a combination of

GetUnitClass("target")
and
GetUnitClassId("target")

and see what comes up for the different people out there .. or create one of each class and use "player"
  Reply With Quote
05/13/14, 04:34 PM   #3
stjobe
 
stjobe's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
Originally Posted by Lodur View Post
GetUnitClassId(string unitTag)
Returns: integer classId

Any one have constants for classId? none on the wiki and I didn't see any in zgoo...

by my testing I know:
sorcerer == 2


But I assume there should be constants????
I don't have the constants, but by using d(GetUnitClassId("player")) I've found these values:

Sorcerer: 2
Nightblade: 3
Templar: 6

(don't have a Dragonknight to test on, sorry)
  Reply With Quote
05/13/14, 04:43 PM   #4
Kith
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 49
Code:
local classID = {
	[1] = 'Dragonknight',
	[2] = 'Sorcerer',
	[3] = 'Nightblade',
	[6] = 'Templar',
}
This is the current list, not sure why Templar is all out on its own at 6.
  Reply With Quote
05/13/14, 05:58 PM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Full list is:
  1. Dragonknight
  2. Sorcerer
  3. Nightblade
  4. Warden
  5. Battlemage
  6. Templar

But to get just valid classes you can use:
Lua Code:
  1. local gender = GENDER_MALE  --or GENDER_FEMALE
  2.  
  3. for i = 1, GetNumClasses() do
  4.    local classId = GetClassInfo(i)
  5.    d(GetClassName(gender, classId))
  6. end

Last edited by Garkin : 05/13/14 at 06:06 PM.
  Reply With Quote
05/14/14, 06:12 AM   #6
LoPony
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 10
Sometimes I get 0 as result from GetUnitClassId()
Someone else experienced that too?

I'm using it in a context with the Group unitTags (e.g. group1, group2, ...)
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » GetUnitClassId(string unitTag)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off