{
availSubs = EnumSet.copyOf(KAMAEL_SUBCLASS_SET);
}
else
{
ClassId classId = player.getClassId();
if ((classId.isOfLevel(ClassLevel.Third)) || (classId.isOfLevel(ClassLevel.Fourth)) || (classId.isOfLevel(ClassLevel.Awaking)))
{
availSubs = EnumSet.copyOf(MAIN_SUBCLASS_SET);
availSubs1 = EnumSet.copyOf(MAIN_SUBCLASS_SET1);
availSubs.removeAll(BANNED_SUBCLASSES);
availSubs.remove(classId);
availSubs1.removeAll(BANNED_SUBCLASSES);
availSubs1.remove(classId);
switch (race.ordinal())
{
case 1:
availSubs.removeAll(getSet(Race.darkelf, ClassLevel.Third));
break;
case 2:
availSubs.removeAll(getSet(Race.elf, ClassLevel.Third));
break;
}
switch (race.ordinal())
{
case 1:
availSubs1.removeAll(getSet(Race.darkelf, ClassLevel.Awaking));
break;
case 2:
availSubs1.removeAll(getSet(Race.elf, ClassLevel.Awaking));
break;
}
Set<?> unavailableClasses = SUBCLASS_SET_MAP.get(classId);
if (unavailableClasses != null)
{
availSubs.removeAll(unavailableClasses);
availSubs1.removeAll(unavailableClasses);
}
}
}
int charClassId = player.getBaseClassId();
ClassId currClass = ClassId.VALUES[charClassId];
if (availSubs == null)
{
return Collections.emptySet();
}
availSubs.remove(currClass);
for (ClassId availSub : availSubs)
{
for (SubClass subClass : player.getSubClassList().values())
{
if (availSub.getId() == subClass.getClassId())
{
availSubs.remove(availSub);
continue;
}
ClassId parent = ClassId.VALUES[availSub.ordinal()].getParent(player.getSex());
if ((parent != null) && (parent.getId() == subClass.getClassId()))
{
availSubs.remove(availSub);
continue;
}
ClassId subParent = ClassId.VALUES[subClass.getClassId()].getParent(player.getSex());
if ((subParent != null) && (subParent.getId() == availSub.getId()))
{
availSubs.remove(availSub);
}
if(availSub.getType2() == ClassId.VALUES[subClass.getClassId()].getType2() && subClass.isBase())
{