i used cheat engine to change the starting stats you receive when you are making your character but when i finish creating the character it disappears. is there a way to get this to work?
#region CheckCharacter
/// <summary>
/// Provides methods to handle char creation checks
/// </summary>
protected class CheckCharacter
{
protected const int STR = 0;
protected const int CON = 1;
protected const int DEX = 2;
protected const int QUI = 3;
protected const int INT = 4;
protected const int PIE = 5;
protected const int EMP = 6;
protected const int CHA = 7;
/// <summary>
/// Verify whether created character is valid
/// </summary>
/// <param name="ch">The character to check</param>
/// <returns>True if valid</returns>
public static bool IsCharacterValid(Character ch)
{
bool valid = true;
try
{
if (ch.Realm > 3)
{
if (log.IsWarnEnabled)
log.Warn("Wrong realm: " + ch.Realm);
valid = false;
}
if (ch.Level != 1)
{
if (log.IsWarnEnabled)
log.Warn("Wrong level: " + ch.Level);
valid = false;
}
if (Array.IndexOf(STARTING_CLASSES[ch.Realm], ch.Class) == -1)
{
if (log.IsWarnEnabled)
log.Warn("Wrong class: " + ch.Class + ", realm:" + ch.Realm);
valid = false;
}
if (Array.IndexOf(RACES_CLASSES[ch.Race], ch.Class) == -1)
{
if (log.IsWarnEnabled)
log.Warn("Wrong race: " + ch.Race + ", class:" + ch.Class);
valid = false;
}
int pointsUsed = 0;
pointsUsed += PointsUsed(ch.Race, STR, ch.Strength);
pointsUsed += PointsUsed(ch.Race, CON, ch.Constitution);
pointsUsed += PointsUsed(ch.Race, DEX, ch.Dexterity);
pointsUsed += PointsUsed(ch.Race, QUI, ch.Quickness);
pointsUsed += PointsUsed(ch.Race, INT, ch.Intelligence);
pointsUsed += PointsUsed(ch.Race, PIE, ch.Piety);
pointsUsed += PointsUsed(ch.Race, EMP, ch.Empathy);
pointsUsed += PointsUsed(ch.Race, CHA, ch.Charisma);
if (pointsUsed != 30)
{
if (log.IsWarnEnabled)
log.Warn("Points used: " + pointsUsed);
valid = false;
}
}
catch (Exception e)
{
if (log.IsErrorEnabled)
log.Error("CharacterCreation", e);
return false;
}
return valid;
}
/// <summary>
/// Calculates amount of starting points spent on one stat
/// </summary>
/// <param name="race">race index in starting stats array</param>
/// <param name="statIndex">index of that stat in starting stats array</param>
/// <param name="statValue">base+spent points in stat</param>
/// <returns></returns>
protected static int PointsUsed(int race, int statIndex, int statValue)
{
statValue -= STARTING_STATS[race][statIndex];
int result = statValue; //one point used
result += Math.Max(0, statValue - 10); //two points used
result += Math.Max(0, statValue - 15); //three points used
return result;
}
/// <summary>
/// All possible player races
/// </summary>
protected static readonly int[][] STARTING_STATS = new int[][]
{
null, // "Unknown",
// STR CON DEX QUI INT PIE EMP CHA
new int[8] { 60, 60, 60, 60, 60, 60, 60, 60 }, // Briton
new int[8] { 45, 45, 60, 70, 80, 60, 60, 60 }, // Avalonian
new int[8] { 70, 70, 50, 50, 60, 60, 60, 60 }, // Highlander
new int[8] { 50, 50, 80, 60, 60, 60, 60, 60 }, // Saracen
new int[8] { 70, 70, 50, 50, 60, 60, 60, 60 }, // Norseman
new int[8] { 100, 70, 35, 35, 60, 60, 60, 60 }, // Troll
new int[8] { 60, 80, 50, 50, 60, 60, 60, 60 }, // Dwarf
new int[8] { 50, 50, 70, 70, 60, 60, 60, 60 }, // Kobold
new int[8] { 60, 60, 60, 60, 60, 60, 60, 60 }, // Celt
new int[8] { 90, 60, 40, 40, 60, 60, 70, 60 }, // Firbolg
new int[8] { 40, 40, 75, 75, 70, 60, 60, 60 }, // Elf
new int[8] { 40, 40, 80, 80, 60, 60, 60, 60 }, // Lurikeen
new int[8] { 50, 60, 70, 50, 70, 60, 60, 60 }, // Inconnu
new int[8] { 55, 45, 65, 75, 60, 60, 60, 60 }, // Valkyn
new int[8] { 70, 60, 55, 45, 70, 60, 60, 60 }, // Sylvan
new int[8] { 90, 70, 40, 40, 60, 60, 60, 60 }, // Half Ogre
new int[8] { 55, 55, 55, 60, 60, 75, 60, 60 }, // Frostalf
new int[8] { 60, 80, 50, 50, 60, 60, 60, 60 }, // Shar
new int[8] { 80, 70, 50, 40, 60, 60, 60, 60 }, // AlbionMenotaur
new int[8] { 80, 70, 50, 40, 60, 60, 60, 60 }, // MidgardMenotaur
new int[8] { 80, 70, 50, 40, 60, 60, 60, 60 }, // HiberniaMenotaur
};
/// <summary>
/// All possible player starting classes
/// </summary>
protected static readonly int[][] STARTING_CLASSES = new int[][]
{
null, // "Unknown",
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Acolyte,
(int)eCharacterClass.Mage,
(int)eCharacterClass.Elementalist,
(int)eCharacterClass.AlbionRogue,
(int)eCharacterClass.Disciple }, // Albion
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.Seer,
(int)eCharacterClass.MidgardRogue }, // Midgard
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Stalker,
(int)eCharacterClass.Naturalist,
(int)eCharacterClass.Magician,
(int)eCharacterClass.Forester }, // Hibernia
};
protected static readonly int[][] RACES_CLASSES = new int[][]
{
null, // "Unknown",
//
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Acolyte,
(int)eCharacterClass.Mage,
(int)eCharacterClass.Elementalist,
(int)eCharacterClass.AlbionRogue,
(int)eCharacterClass.Disciple }, // Briton
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Acolyte,
(int)eCharacterClass.Mage,
(int)eCharacterClass.Elementalist }, // Avalonian
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Acolyte,
(int)eCharacterClass.AlbionRogue }, // Highlander
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Mage,
(int)eCharacterClass.AlbionRogue,
(int)eCharacterClass.Disciple }, // Saracen
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.Seer,
(int)eCharacterClass.MidgardRogue }, // Norseman
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.Seer }, // Troll
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.Seer,
(int)eCharacterClass.MidgardRogue }, // Dwarf
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.Seer,
(int)eCharacterClass.MidgardRogue }, // Kobold
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Stalker,
(int)eCharacterClass.Naturalist,
(int)eCharacterClass.Magician,
(int)eCharacterClass.Forester }, // Celt
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Naturalist,
(int)eCharacterClass.Forester }, // Firbolg
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Stalker,
(int)eCharacterClass.Magician }, // Elf
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Stalker,
(int)eCharacterClass.Magician }, // Lurikeen
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Acolyte,
(int)eCharacterClass.Mage,
(int)eCharacterClass.AlbionRogue,
(int)eCharacterClass.Disciple }, // Inconnu
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.MidgardRogue }, // Valkyn
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Naturalist,
(int)eCharacterClass.Forester }, // Sylvan
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Mage,
(int)eCharacterClass.Elementalist }, // Half Ogre
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Mystic,
(int)eCharacterClass.Seer,
(int)eCharacterClass.MidgardRogue }, // Frostalf
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Stalker,
(int)eCharacterClass.Magician }, // Shar
new int[] { (int)eCharacterClass.Fighter,
(int)eCharacterClass.Acolyte },//AlbionMenotaur
new int[] { (int)eCharacterClass.Viking,
(int)eCharacterClass.Seer }, //MidgardMenotaur
new int[] { (int)eCharacterClass.Guardian,
(int)eCharacterClass.Naturalist }, //HiberniaMenotaur
};
}
#endregion