public PlayerDataToSave(PlayerHandler player) { playerName = player.name; level = 0; if (player.currentCheckPoint != null) { checkpoint = player.currentCheckPoint.name; } else { checkpoint = player.firstCheckPointName; } maxHealth = player.maxHealth; maxMana = player.maxMana; maxStamina = player.maxStamina; currentHealth = player.currentHealth; currentMana = player.currentMana; currentStamina = player.currentStamina; currentPositionX = player.transform.position.x; currentPositionY = player.transform.position.y; currentPositionZ = player.transform.position.z; currentRotationX = player.transform.rotation.x; currentRotationW = player.transform.rotation.w; currentRotationY = player.transform.rotation.y; currentRotationZ = player.transform.rotation.z; skinIndex = player.skinIndex; hairIndex = player.hairIndex; mouthIndex = player.mouthIndex; eyesIndex = player.eyesIndex; clothesIndex = player.clothesIndex; armourIndex = player.armourIndex; characterClass = player.characterClass; characterName = player.characterName; for (int i = 0; i < player.stats.Length; i++) { stats[i] = player.stats[i].value; } }
void ChooseClass(int className) { switch (className) { case 0: playerStats[0].statValue = 35; playerStats[1].statValue = 5; playerStats[2].statValue = 5; playerStats[3].statValue = 5; playerStats[4].statValue = 5; playerStats[5].statValue = 5; characterClass = Customization.CharacterClass.Barbarian; break; case 1: playerStats[0].statValue = 5; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 5; // DEX playerStats[2].statValue = 10; // CON playerStats[3].statValue = 15; // WIS playerStats[4].statValue = 5; // INT playerStats[5].statValue = 20; // CHA characterClass = Customization.CharacterClass.Bard; break; case 2: playerStats[0].statValue = 6; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 6; // DEX playerStats[2].statValue = 8; // CON playerStats[3].statValue = 15; // WIS playerStats[4].statValue = 15; // INT playerStats[5].statValue = 10; // CHA characterClass = Customization.CharacterClass.Cleric; break; case 3: playerStats[0].statValue = 10; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 5; // DEX playerStats[2].statValue = 10; // CON playerStats[3].statValue = 15; // WIS playerStats[4].statValue = 15; // INT playerStats[5].statValue = 5; // CHA characterClass = Customization.CharacterClass.Druid; break; case 4: playerStats[0].statValue = 15; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 10; // DEX playerStats[2].statValue = 15; // CON playerStats[3].statValue = 10; // WIS playerStats[4].statValue = 5; // INT playerStats[5].statValue = 5; // CHA characterClass = Customization.CharacterClass.Fighter; break; case 5: playerStats[0].statValue = 10; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 10; // DEX playerStats[2].statValue = 10; // CON playerStats[3].statValue = 10; // WIS playerStats[4].statValue = 10; // INT playerStats[5].statValue = 10; // CHA characterClass = Customization.CharacterClass.Monk; break; case 6: playerStats[0].statValue = 10; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 5; // DEX playerStats[2].statValue = 15; // CON playerStats[3].statValue = 10; // WIS playerStats[4].statValue = 10; // INT playerStats[5].statValue = 10; // CHA characterClass = Customization.CharacterClass.Paladin; break; case 7: playerStats[0].statValue = 10; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 15; // DEX playerStats[2].statValue = 5; // CON playerStats[3].statValue = 10; // WIS playerStats[4].statValue = 10; // INT playerStats[5].statValue = 10; // CHA characterClass = Customization.CharacterClass.Ranger; break; case 8: playerStats[0].statValue = 5; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 5; // DEX playerStats[2].statValue = 5; // CON playerStats[3].statValue = 10; // WIS playerStats[4].statValue = 25; // INT playerStats[5].statValue = 10; // CHA characterClass = Customization.CharacterClass.Sorcerer; break; case 9: playerStats[0].statValue = 5; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 5; // DEX playerStats[2].statValue = 5; // CON playerStats[3].statValue = 20; // WIS playerStats[4].statValue = 20; // INT playerStats[5].statValue = 5; // CHA characterClass = Customization.CharacterClass.Warlock; break; case 10: playerStats[0].statValue = 5; // STR strength, dexterity, constitution, wisdom, intelligence, charisma; playerStats[1].statValue = 5; // DEX playerStats[2].statValue = 5; // CON playerStats[3].statValue = 10; // WIS playerStats[4].statValue = 30; // INT playerStats[5].statValue = 5; // CHA characterClass = Customization.CharacterClass.Wizard; break; } }