Browse Source

saetor creation fixed

lakebane-strongholds
FatBoy-DOTC 3 months ago
parent
commit
fafa777e98
  1. 21
      src/engine/objects/PlayerCharacter.java

21
src/engine/objects/PlayerCharacter.java

@ -784,6 +784,9 @@ public class PlayerCharacter extends AbstractCharacter {
// Verify Race // Verify Race
int raceID = msg.getRace(); int raceID = msg.getRace();
if(raceID == 0)
raceID = 1999;
Race race = Race.getRace(raceID); Race race = Race.getRace(raceID);
if (race == null) { if (race == null) {
@ -823,6 +826,7 @@ public class PlayerCharacter extends AbstractCharacter {
int hairColorID = msg.getHairColor(); int hairColorID = msg.getHairColor();
int beardColorID = msg.getBeardColor(); int beardColorID = msg.getBeardColor();
if(raceID != 1999) {
if (!race.isValidHairStyle(hairStyleID)) { if (!race.isValidHairStyle(hairStyleID)) {
Logger.info("Invalid HairStyleID: " + hairStyleID + " for race: " + race.getName()); Logger.info("Invalid HairStyleID: " + hairStyleID + " for race: " + race.getName());
return null; return null;
@ -842,7 +846,7 @@ public class PlayerCharacter extends AbstractCharacter {
Logger.info("Invalid beardColorID: " + beardColorID + " for race: " + race.getName()); Logger.info("Invalid beardColorID: " + beardColorID + " for race: " + race.getName());
return null; return null;
} }
}
// Get stat modifiers // Get stat modifiers
int strMod = msg.getStrengthMod(); int strMod = msg.getStrengthMod();
int dexMod = msg.getDexterityMod(); int dexMod = msg.getDexterityMod();
@ -1123,9 +1127,15 @@ public class PlayerCharacter extends AbstractCharacter {
int kitID = msg.getKit(); int kitID = msg.getKit();
// get the correctKit // get the correctKit
int raceClassID = Kit.GetKitIDByRaceClass(raceID, baseClassID); int raceClassID;
if(raceID != 1999){
raceClassID = Kit.GetKitIDByRaceClass(raceID, baseClassID);
}else{
raceClassID = Kit.GetKitIDByRaceClass(2011, baseClassID);
}
ArrayList<Kit> allKits = Kit.RaceClassIDMap.get(raceClassID); ArrayList<Kit> allKits = Kit.RaceClassIDMap.get(raceClassID);
Kit kit = null; Kit kit = null;
for (Kit k : allKits) { for (Kit k : allKits) {
@ -1155,6 +1165,13 @@ public class PlayerCharacter extends AbstractCharacter {
clientConnection); clientConnection);
return null; return null;
} }
if(raceID == 1999){
hairStyleID = 0;
beardStyleID = 0;
skinColorID = 0;
hairColorID = 0;
beardColorID = 0;
}
// Make PC // Make PC
PlayerCharacter pcWithoutID = new PlayerCharacter(firstName, lastName, (short) strMod, (short) dexMod, (short) conMod, PlayerCharacter pcWithoutID = new PlayerCharacter(firstName, lastName, (short) strMod, (short) dexMod, (short) conMod,

Loading…
Cancel
Save