From aabe5323900e5adf532cc10aafe3b2dbff3165d6 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 31 Jul 2011 05:25:48 +0000 Subject: [PATCH] char creation fixes --- Scripts/Misc/CharacterCreation.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Scripts/Misc/CharacterCreation.cs b/Scripts/Misc/CharacterCreation.cs index 34222d428..384bc096e 100644 --- a/Scripts/Misc/CharacterCreation.cs +++ b/Scripts/Misc/CharacterCreation.cs @@ -837,6 +837,8 @@ namespace Server.Misc private static void FixStats( ref int str, ref int dex, ref int intel, int max ) { + int vMax = max - 30; + int vStr = str - 10; int vDex = dex - 10; int vInt = intel - 10; @@ -852,18 +854,18 @@ namespace Server.Misc int total = vStr + vDex + vInt; - if ( total == 0 || total == max ) + if ( total == 0 || total == vMax ) return; - double scalar = max / (double)total; + double scalar = vMax / (double)total; vStr = (int)(vStr * scalar); vDex = (int)(vDex * scalar); vInt = (int)(vInt * scalar); - FixStat( ref vStr, (vStr + vDex + vInt) - max, max ); - FixStat( ref vDex, (vStr + vDex + vInt) - max, max ); - FixStat( ref vInt, (vStr + vDex + vInt) - max, max ); + FixStat( ref vStr, (vStr + vDex + vInt) - vMax, vMax ); + FixStat( ref vDex, (vStr + vDex + vInt) - vMax, vMax ); + FixStat( ref vInt, (vStr + vDex + vInt) - vMax, vMax ); str = vStr + 10; dex = vDex + 10; @@ -882,12 +884,11 @@ namespace Server.Misc private static void SetStats( Mobile m, NetState state, int str, int dex, int intel ) { - int max = state.NewCharacterCreation ? 60 : 50; - int total = state.NewCharacterCreation ? 90 : 80; + int max = state.NewCharacterCreation ? 90 : 80; FixStats( ref str, ref dex, ref intel, max ); - if ( str < 10 || str > max || dex < 10 || dex > max || intel < 10 || intel > max || (str + dex + intel) != total ) + if ( str < 10 || str > 60 || dex < 10 || dex > 60 || intel < 10 || intel > 60 || (str + dex + intel) != max ) { str = 10; dex = 10;