Browse Source

saetor creation fixed

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

Loading…
Cancel
Save