Proper fix for ClassMaster low level Kamael NPE.

This commit is contained in:
MobiusDev
2017-10-20 20:28:47 +00:00
parent 9196b4c5d6
commit e3ac480982
4 changed files with 12 additions and 24 deletions

View File

@@ -336,12 +336,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
return null; return null;
} }
int classId = Integer.parseInt(st.nextToken()); final int classId = Integer.parseInt(st.nextToken());
if (classId == ClassId.FEMALE_SOUL_HOUND.getId())
{
classId = ClassId.FEOH_SOUL_HOUND.getId(); // Fix for Female Soulhounds
}
boolean canChange = false; boolean canChange = false;
if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation
{ {
@@ -734,11 +729,13 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
htmltext = "test_server_helper020a.html"; htmltext = "test_server_helper020a.html";
break; break;
} }
case MALE_SOLDIER:
case TROOPER: case TROOPER:
{ {
htmltext = "test_server_helper020c.html"; htmltext = "test_server_helper020c.html";
break; break;
} }
case FEMALE_SOLDIER:
case WARDER: case WARDER:
{ {
htmltext = "test_server_helper020d.html"; htmltext = "test_server_helper020d.html";

View File

@@ -336,12 +336,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
return null; return null;
} }
int classId = Integer.parseInt(st.nextToken()); final int classId = Integer.parseInt(st.nextToken());
if (classId == ClassId.FEMALE_SOUL_HOUND.getId())
{
classId = ClassId.FEOH_SOUL_HOUND.getId(); // Fix for Female Soulhounds
}
boolean canChange = false; boolean canChange = false;
if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation
{ {
@@ -734,11 +729,13 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
htmltext = "test_server_helper020a.html"; htmltext = "test_server_helper020a.html";
break; break;
} }
case MALE_SOLDIER:
case TROOPER: case TROOPER:
{ {
htmltext = "test_server_helper020c.html"; htmltext = "test_server_helper020c.html";
break; break;
} }
case FEMALE_SOLDIER:
case WARDER: case WARDER:
{ {
htmltext = "test_server_helper020d.html"; htmltext = "test_server_helper020d.html";

View File

@@ -336,12 +336,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
return null; return null;
} }
int classId = Integer.parseInt(st.nextToken()); final int classId = Integer.parseInt(st.nextToken());
if (classId == ClassId.FEMALE_SOUL_HOUND.getId())
{
classId = ClassId.FEOH_SOUL_HOUND.getId(); // Fix for Female Soulhounds
}
boolean canChange = false; boolean canChange = false;
if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation
{ {
@@ -734,11 +729,13 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
htmltext = "test_server_helper020a.html"; htmltext = "test_server_helper020a.html";
break; break;
} }
case MALE_SOLDIER:
case TROOPER: case TROOPER:
{ {
htmltext = "test_server_helper020c.html"; htmltext = "test_server_helper020c.html";
break; break;
} }
case FEMALE_SOLDIER:
case WARDER: case WARDER:
{ {
htmltext = "test_server_helper020d.html"; htmltext = "test_server_helper020d.html";

View File

@@ -304,12 +304,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
return null; return null;
} }
int classId = Integer.parseInt(st.nextToken()); final int classId = Integer.parseInt(st.nextToken());
if (classId == ClassId.FEMALE_SOUL_HOUND.getId())
{
classId = ClassId.FEOH_SOUL_HOUND.getId(); // Fix for Female Soulhounds
}
boolean canChange = false; boolean canChange = false;
if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation if ((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) // In retail you can skip first occupation
{ {
@@ -702,11 +697,13 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader
htmltext = "test_server_helper020a.html"; htmltext = "test_server_helper020a.html";
break; break;
} }
case MALE_SOLDIER:
case TROOPER: case TROOPER:
{ {
htmltext = "test_server_helper020c.html"; htmltext = "test_server_helper020c.html";
break; break;
} }
case FEMALE_SOLDIER:
case WARDER: case WARDER:
{ {
htmltext = "test_server_helper020d.html"; htmltext = "test_server_helper020d.html";