View Single Post
Old 04-02-2013, 10:05 PM   #280
Senior Member
JCarter426's Avatar
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,668
// 341: A creature can have up to three classes.  This function determines the
// creature's class (CLASS_TYPE_*) based on nClassPosition.
// - nClassPosition: 1, 2 or 3
// - oCreature
// * Returns CLASS_TYPE_INVALID if the oCreature does not have a class in
//   nClassPosition (i.e. a single-class creature will only have a value in
//   nClassLocation=1) or if oCreature is not a valid creature.
int GetClassByPosition(int nClassPosition, object oCreature=OBJECT_SELF);
So, if you want to check if a creature has any particular class:
int StartingConditional(){

	object oCreature = [whatever];
	int iClass = [whatever];
	int iC1 = GetClassByPosition(1, oCreature);
	int iC2 = GetClassByPosition(2, oCreature);
	int iC3 = GetClassByPosition(3, oCreature);

if(	iC1 == iClass ||
	iC2 == iClass ||
	iC3 == iClass ){
	return TRUE;
return FALSE;

I'm not sure how the class positions get assigned, so depending on what you need it could be trickier than just that.

JCarter426 is offline   you may: quote & reply,