changeset 66:5ec98919c8fd

PlayerCreation 26.10.12
author Ritor1
date Fri, 26 Oct 2012 23:20:39 +0600
parents 65c940aa7bf9
children 476145dc3441
files GUIWindow.h Player.h mm7_4.cpp mm7_5.cpp
diffstat 4 files changed, 157 insertions(+), 489 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.h	Thu Oct 25 18:02:42 2012 +0600
+++ b/GUIWindow.h	Fri Oct 26 23:20:39 2012 +0600
@@ -120,7 +120,7 @@
   UIMSG_PlayerCreationClickPlus = 0x3E,
   UIMSG_PlayerCreationClickMinus = 0x3F,
   UIMSG_PlayerCreationSelectActiveSkill = 0x40,
-  UIMSG_41 = 0x41,
+  UIMSG_PlayerCreationSelectClass = 0x41,
   UIMSG_PlayerCreationClickOK = 0x42,
   UIMSG_PlayerCreationClickReset = 0x43,
   UIMSG_PlayerCreationRemoveUpSkill = 0x4A,
--- a/Player.h	Thu Oct 25 18:02:42 2012 +0600
+++ b/Player.h	Fri Oct 26 23:20:39 2012 +0600
@@ -96,9 +96,9 @@
   PLAYER_CLASS_MONK = 0x8,
   PLAYER_CLASS_PALADIN = 0xC,
   PLAYER_CLASS_SHOOTER = 0x10,
-  PLAYER_CLASS_DRUID = 0x14,
+  PLAYER_CLASS_RANGER = 0x14,
   PLAYER_CLASS_CLERIC = 0x18,
-  PLAYER_CLASS_RANGER = 0x1C,
+  PLAYER_CLASS_DRUID = 0x1C,
   PLAYER_CLASS_SORCERER = 0x20,
 };
 
--- a/mm7_4.cpp	Thu Oct 25 18:02:42 2012 +0600
+++ b/mm7_4.cpp	Fri Oct 26 23:20:39 2012 +0600
@@ -5362,7 +5362,7 @@
   int v98; // eax@71
   int v101; // eax@71
   enum PLAYER_SKILL_TYPE v102; // edi@72
-  size_t v103; // eax@72
+  size_t uNumLen; // eax@72
   signed int v104; // ecx@72
   int v105; // ecx@79
   unsigned int v107; // ST0C_4@81
@@ -5597,23 +5597,17 @@
     sprintf(pTmpBuf, "\t%03u%s", v40, pSkillName);
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0);
     v41 = pPlayer->GetSkillIdxByOrder(2);
-    v42 = pSkillNames[v41];
-    v43 = pSkillNames[v41];
-    v133 = v41;
-    v44 = pFontCreate->AlignText_Center(150u, v42);
-    sprintf(pTmpBuf, "\t%03u%s", v44, v43);
+    v44 = pFontCreate->AlignText_Center(150u, pSkillNames[v41]);
+    sprintf(pTmpBuf, "\t%03u%s", v44, pSkillNames[v41]);
     v45 = uColorGreen;
-    if ( (signed int)v133 >= 37 )
+    if ( (signed int)v41 >= 37 )
       v45 = uColorTeal;
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0);
     v46 = pPlayer->GetSkillIdxByOrder(3);
-    v47 = pSkillNames[v46];
-    v48 = pSkillNames[v46];
-    v133 = v46;
-    v49 = pFontCreate->AlignText_Center(150u, v47);
-    sprintf(pTmpBuf, "\t%03u%s", v49, v48);
+    v49 = pFontCreate->AlignText_Center(150u, pSkillNames[v46]);
+    sprintf(pTmpBuf, "\t%03u%s", v49, pSkillNames[v46]);
     v50 = uColorGreen;
-    if ( (signed int)v133 >= 37 )
+    if ( (signed int)v46 >= 37 )
       v50 = uColorTeal;
     pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0);
     pPlayer++;
@@ -5656,7 +5650,7 @@
   v65 = pFontCreate->AlignText_Center(65u, pClassNames[12]);
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, v65 + 323, v64, v61, pClassNames[12], 0, 0, 0);
   v66 = uColorTeal;
-  if ( uClassType != PLAYER_CLASS_DRUID )
+  if ( uClassType != PLAYER_CLASS_RANGER )
     v66 = uColorWhite;
   v69 = 2 * v128 + 417;
   v126 = 2 * v128 + 417;
@@ -5668,7 +5662,7 @@
   v74 = pFontCreate->AlignText_Center(65u, pClassNames[24]);
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, v74 + 388, 417, v71, pClassNames[24], 0, 0, 0);
   v75 = uColorTeal;
-  if ( uClassType != 28 )
+  if ( uClassType != PLAYER_CLASS_DRUID )
     v75 = uColorWhite;
   v78 = uColorGreen;
   v79 = pFontCreate->AlignText_Center(65u, pClassNames[28]);
@@ -5703,9 +5697,9 @@
   {
     v102 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(v134 + 4);
     strcpy(Str1, pSkillNames[v102]);
-    v103 = strlen(Str1);
+    uNumLen = strlen(Str1);
     v104 = 0;
-    if ( (signed int)v103 > 0 )
+    if ( (signed int)uNumLen > 0 )
     {
 	  if ( Str1[v104] == 32 )
 	  {
@@ -5716,7 +5710,7 @@
 		while ( Str1[v104] != 32 )
 		{
 		  ++v104;
-		  if ( v104 >= (signed int)v103 )
+		  if ( v104 >= (signed int)uNumLen )
 		   break;
 		}
 	  }
@@ -5842,255 +5836,46 @@
     ++uControlParama;
   }
   while ( (signed int)uXa < 640 );
-  pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(
-                                  10u,
-                                  32u,
-                                  11u,
-                                  13u,
-                                  1,
-                                  0,
-                                  0xABu,
-                                  0,
-                                  0,
-                                  nullstring,
-                                  pTexture_presleft,
-                                  0);
-  pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(
-                                  169u,
-                                  32u,
-                                  11u,
-                                  13u,
-                                  1,
-                                  0,
-                                  0xABu,
-                                  1u,
-                                  0,
-                                  nullstring,
-                                  pTexture_presleft,
-                                  0);
-  pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(
-                                  327u,
-                                  32u,
-                                  11u,
-                                  13u,
-                                  1,
-                                  0,
-                                  0xABu,
-                                  2u,
-                                  0,
-                                  nullstring,
-                                  pTexture_presleft,
-                                  0);
-  pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(
-                                  486u,
-                                  32u,
-                                  11u,
-                                  13u,
-                                  1,
-                                  0,
-                                  0xABu,
-                                  3u,
-                                  0,
-                                  nullstring,
-                                  pTexture_presleft,
-                                  0);
-  pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(
-                                   74u,
-                                   32u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0xACu,
-                                   0,
-                                   0,
-                                   nullstring,
-                                   pTexture_pressrigh,
-                                   0);
-  pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(
-                                   233u,
-                                   32u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0xACu,
-                                   1u,
-                                   0,
-                                   nullstring,
-                                   pTexture_pressrigh,
-                                   0);
-  pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(
-                                   391u,
-                                   32u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0xACu,
-                                   2u,
-                                   0,
-                                   nullstring,
-                                   pTexture_pressrigh,
-                                   0);
-  pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(
-                                   549u,
-                                   32u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0xACu,
-                                   3u,
-                                   0,
-                                   nullstring,
-                                   pTexture_pressrigh,
-                                   0);
-  pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(
-                                   10u,
-                                   103u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0x90u,
-                                   0,
-                                   0,
-                                   nullstring,
-                                   pTexture_presleft,
-                                   0);
-  pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(
-                                   169u,
-                                   103u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0x90u,
-                                   1u,
-                                   0,
-                                   nullstring,
-                                   pTexture_presleft,
-                                   0);
-  pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(
-                                   327u,
-                                   103u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0x90u,
-                                   2u,
-                                   0,
-                                   nullstring,
-                                   pTexture_presleft,
-                                   0);
-  pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(
-                                   486u,
-                                   103u,
-                                   11u,
-                                   13u,
-                                   1,
-                                   0,
-                                   0x90u,
-                                   3u,
-                                   0,
-                                   nullstring,
-                                   pTexture_presleft,
-                                   0);
-  pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(
-                                    74u,
-                                    103u,
-                                    11u,
-                                    13u,
-                                    1,
-                                    0,
-                                    0x91u,
-                                    0,
-                                    0,
-                                    nullstring,
-                                    pTexture_pressrigh,
-                                    0);
-  pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(
-                                    233u,
-                                    103u,
-                                    11u,
-                                    13u,
-                                    1,
-                                    0,
-                                    0x91u,
-                                    1u,
-                                    0,
-                                    nullstring,
-                                    pTexture_pressrigh,
-                                    0);
-  pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(
-                                    391u,
-                                    103u,
-                                    11u,
-                                    13u,
-                                    1,
-                                    0,
-                                    0x91u,
-                                    2u,
-                                    0,
-                                    nullstring,
-                                    pTexture_pressrigh,
-                                    0);
-  pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(
-                                    549u,
-                                    103u,
-                                    11u,
-                                    13u,
-                                    1,
-                                    0,
-                                    0x91u,
-                                    3u,
-                                    0,
-                                    nullstring,
-                                    pTexture_pressrigh,
-                                    0);
+  pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(10u, 32u, 11u, 13u, 1, 0, 0xABu, 0, 0,
+                                  nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169u, 32u, 11u, 13u, 1, 0, 0xABu, 1u, 0,
+                                  nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327u, 32u, 11u, 13u, 1, 0, 0xABu, 2u, 0,
+                                  nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486u, 32u, 11u, 13u, 1, 0, 0xABu, 3u, 0,
+                                  nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(74u, 32u, 11u, 13u, 1, 0, 0xACu, 0, 0,
+                                   nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(233u, 32u, 11u, 13u, 1, 0, 0xACu, 1u, 0,
+                                   nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(391u, 32u, 11u, 13u, 1, 0, 0xACu, 2u, 0,
+                                   nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(549u, 32u, 11u, 13u, 1, 0, 0xACu, 3u, 0,
+                                   nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(10u, 103u, 11u, 13u, 1, 0, 0x90u, 0, 0,
+                                   nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(169u, 103u, 11u, 13u, 1, 0, 0x90u, 1u, 0,
+                                   nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(327u, 103u, 11u, 13u, 1, 0, 0x90u, 2u, 0,
+                                   nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(486u, 103u, 11u, 13u, 1, 0, 0x90u, 3u, 0,
+                                   nullstring, pTexture_presleft, 0);
+  pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(74u, 103u, 11u, 13u, 1, 0, 0x91u, 0, 0,
+                                    nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233u, 103u, 11u, 13u, 1, 0,
+                                    0x91u, 1u, 0, nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391u, 103u, 11u, 13u, 1, 0,
+                                    0x91u, 2u, 0, nullstring, pTexture_pressrigh, 0);
+  pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549u, 103u, 11u, 13u, 1, 0, 0x91u, 3u, 0,
+                                    nullstring, pTexture_pressrigh, 0);
   uControlParamb = 0;
   uXb = 8;
   do
   {
     pGUIWindow_CurrentMenu->CreateButton(uXb, 308u, 150u, v0, 1, 0, 0x48u, uControlParamb, 0, nullstring, 0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXb,
-      v0 + 308,
-      150u,
-      v0,
-      1,
-      0,
-      0x49u,
-      uControlParamb,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXb,
-      2 * v0 + 308,
-      150u,
-      v0,
-      1,
-      0,
-      0x4Au,
-      uControlParamb,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXb,
-      3 * v0 + 308,
-      150u,
-      v0,
-      1,
-      0,
-      0x4Bu,
-      uControlParamb,
-      0,
-      nullstring,
-      0);
+    pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150u, v0, 1, 0, 0x49u, uControlParamb, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150u, v0, 1, 0, 0x4Au, uControlParamb, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150u, v0, 1, 0, 0x4Bu, uControlParamb, 0, nullstring,  0);
     uXb += 158;
     ++uControlParamb;
   }
@@ -6104,78 +5889,12 @@
   do
   {
     pGUIWindow_CurrentMenu->CreateButton(uXc, 169u, 120u, 20u, 1, 0, 0, uControlParamc - 2, 0, nullstring, 0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXc,
-      v0 + 169,
-      120u,
-      20u,
-      1,
-      0,
-      0,
-      uControlParamc - 1,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXc,
-      2 * v0 + 169,
-      120u,
-      20u,
-      1,
-      0,
-      0,
-      uControlParamc,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXc,
-      3 * v0 + 169,
-      120u,
-      20u,
-      1,
-      0,
-      0,
-      uControlParamc + 1,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXc,
-      4 * v0 + 169,
-      120u,
-      20u,
-      1,
-      0,
-      0,
-      uControlParamc + 2,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXc,
-      5 * v0 + 169,
-      120u,
-      20u,
-      1,
-      0,
-      0,
-      uControlParamc + 3,
-      0,
-      nullstring,
-      0);
-    pGUIWindow_CurrentMenu->CreateButton(
-      uXc,
-      6 * v0 + 169,
-      120u,
-      20u,
-      1,
-      0,
-      0,
-      uControlParamc + 4,
-      0,
-      nullstring,
-      0);
+    pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120u, 20u, 1, 0, 0, uControlParamc - 1, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120u, 20u, 1, 0, 0, uControlParamc, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120u, 20u, 1, 0, 0, uControlParamc + 1, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120u, 20u, 1, 0, 0, uControlParamc + 2, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120u, 20u, 1, 0, 0, uControlParamc + 3, 0, nullstring, 0);
+    pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120u, 20u, 1, 0, 0, uControlParamc + 4, 0, nullstring, 0);
     uControlParamc += 7;
     uXc += 158;
   }
@@ -6196,73 +5915,21 @@
     uXd = -5;
     if ( uControlParamd <= 3 )
       uXd = 0;
-    pGUIWindow_CurrentMenu->CreateButton(
-      100 * uControlParamd / 3 + uXd + 17,
-      v0 * uControlParamd % 3 + 417,
-      100u,
-      v0,
-      1,
-      0,
-      0x40u,
-      uControlParamd,
-      0,
-      nullstring,
-      0);
+    pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417,
+                                         100u, v0, 1, 0, 0x40u, uControlParamd, 0, nullstring, 0);
     ++uControlParamd;
   }
   while ( uControlParamd < 9 );
-  pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(
-                              580u,
-                              431u,
-                              51u,
-                              39u,
-                              1,
-                              0,
-                              0x42u,
-                              0,
-                              0xDu,
-                              nullstring,
+  pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580u, 431u, 51u, 39u, 1, 0, 0x42u, 0, 0xDu, nullstring,
                               (Texture *)(uTextureID_BUTTMAKE != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0),
                               0);
-  pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(
-                                 527u,
-                                 431u,
-                                 51u,
-                                 39u,
-                                 1,
-                                 0,
-                                 0x43u,
-                                 0,
-                                 0x43u,
-                                 nullstring,
+  pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527u, 431u, 51u, 39u, 1, 0, 0x43u, 0, 0x43u, nullstring,
                                  (Texture *)(uTextureID_BUTTMAKE2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0),
                                  0);
-  pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(
-                                 523u,
-                                 393u,
-                                 20u,
-                                 35u,
-                                 1,
-                                 0,
-                                 0x3Fu,
-                                 0,
-                                 0x2Du,
-                                 nullstring,
-                                 pTexture_buttminu,
-                                 0);
-  pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(
-                                613u,
-                                393u,
-                                20u,
-                                35u,
-                                1,
-                                0,
-                                0x3Eu,
-                                1u,
-                                0x2Bu,
-                                nullstring,
-                                pTexture_buttplus,
-                                0);
+  pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523u, 393u, 20u, 35u, 1, 0, 0x3Fu, 0, 0x2Du, nullstring,
+                                 pTexture_buttminu, 0);
+  pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613u, 393u, 20u, 35u, 1, 0, 0x3Eu, 1u, 0x2Bu, nullstring,
+                                pTexture_buttplus, 0);
   pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0);
 }
 // 4E28F8: using guessed type int pCurrentScreen;
@@ -6304,6 +5971,7 @@
   POINT v25; // [sp+6Ch] [bp-14h]@6
   bool v26; // [sp+74h] [bp-Ch]@1
   POINT v24; // [sp+78h] [bp-8h]@6
+  Player *pPlayer;
 
   v0 = &pTexture_PCX;
   v1 = 0;
@@ -6434,7 +6102,7 @@
     *(char *)(v11 + 6734) = v12;
 LABEL_45:
     pItemsTable->GenerateItem(2, 40, &item);
-    ((Player *)(v10 - 6014))->AddItem2(0xFFFFFFFFu, &item);
+    pPlayer->AddItem2(0xFFFFFFFFu, &item);
     v14 = 0;
     v24.y = 0;
     do
@@ -6477,31 +6145,31 @@
             v18 = 76;
             goto LABEL_69;
           case 12:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x191u);
+            pPlayer->AddItem(0xFFFFFFFFu, 401);
             *(char *)(v11 + 402) = 1;
             break;
           case 13:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x19Cu);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 412);
             *(char *)(v11 + 413) = 1;
             break;
           case 14:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1A7u);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 423);
             *(char *)(v11 + 424) = 1;
             break;
           case 15:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1B2u);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 434);
             *(char *)(v11 + 435) = 1;
             break;
           case 16:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1BDu);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 445);
             *(char *)(v11 + 446) = 1;
             break;
           case 17:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1C8u);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 456);
             *(char *)(v11 + 457) = 1;
             break;
           case 18:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1D3u);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 467);
             *(char *)(v11 + 468) = 1;
             break;
           case 21:
@@ -6510,7 +6178,7 @@
           case 26:
           case 29:
           case 36:
-            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0xDCu);
+            ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 220);
             v18 = 5 * (rand() % 3 + 40);
             goto LABEL_69;
           case 30:
--- a/mm7_5.cpp	Thu Oct 25 18:02:42 2012 +0600
+++ b/mm7_5.cpp	Fri Oct 26 23:20:39 2012 +0600
@@ -3509,7 +3509,7 @@
         continue;
       }
 
-      if ( (signed int)pUIMessageType > 75 )
+      if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )
       {
         if ( pUIMessageType > UIMSG_A3 )
         {
@@ -3609,10 +3609,10 @@
             pCurrentScreen = 0;
             viewparams->bRedrawGameUI = 1;
           }
-          GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, (enum WindowType)92, (int)ptr_5079F0, 0);
+          GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)ptr_5079F0, 0);
           if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
             continue;
-          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
+          pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CloseBook;
           goto LABEL_93;
         }
         if ( pUIMessageType == UIMSG_CloseBook )
@@ -3813,9 +3813,9 @@
             pSoundID = (SoundID)24;
             goto LABEL_40;
           }
-          if ( pUIMessageType == UIMSG_41 )
-          {
-            (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(0);
+          if ( pUIMessageType == UIMSG_PlayerCreationSelectClass )
+          {
+            (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(uNum);
             goto LABEL_36;
           }
           if ( pUIMessageType == UIMSG_PlayerCreationClickOK )
@@ -14727,8 +14727,8 @@
 //----- (004156F0) --------------------------------------------------------
 void __cdecl GUI_UpdateWindows()
 {
-  GUIWindow *v0; // esi@4
-  unsigned int v1; // eax@4
+  GUIWindow *pWindow; // esi@4
+  unsigned int pWindowType; // eax@4
   int v2; // eax@10
   int v3; // eax@11
   int v4; // eax@12
@@ -14785,10 +14785,10 @@
   for ( i = 1; i <= uNumVisibleWindows; ++i )
   {
     //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
-    v0 = &pWindowList[pVisibleWindowsIdxs[i] - 1];
-    v1 = v0->eWindowType;
-
-    switch (v0->eWindowType)
+    pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1];
+    pWindowType = pWindow->eWindowType;
+
+    switch (pWindow->eWindowType)
     {
       case WINDOW_MainMenu_Load:
         GameUI_MainMenu_DrawLoad();
@@ -14796,15 +14796,15 @@
 
       case WINDOW_5E: // window that initiates savegame loading
       {
-        if (v0->Hint != (char *)1)
+        if (pWindow->Hint != (char *)1)
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-        auto v20 = (GUIButton *)v0->ptr_1C;
-        pRenderer->DrawTextureIndexed(v0->uFrameX, v0->uFrameY, v20->pTextures[0]);
-        v21 = v0->Hint;
+        auto v20 = (GUIButton *)pWindow->ptr_1C;
+        pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, v20->pTextures[0]);
+        v21 = pWindow->Hint;
         viewparams->bRedrawGameUI = 1;
         if ( v21 && v21 != (char *)1 )
           v20->DrawLabel(v21, pFontCreate, 0, 0);
-        v0->Release();
+        pWindow->Release();
         if (pCurrentScreen == 11)
           pMessageQueue_50CBD0->SendMessage(UIMSG_SaveGame, 0, 0);
         else
@@ -14814,22 +14814,22 @@
     }
 
 
-    if ( (signed int)v1 > 70 )
-    {
-      if ( (signed int)v1 > 95 )
-      {
-        v33 = v1 - 96;
+    if ( (signed int)pWindowType > 70 )
+    {
+      if ( (signed int)pWindowType > 95 )
+      {
+        v33 = pWindowType - 96;
         if ( !v33 )
         {
-          if ( v0->Hint != (char *)1 )
+          if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v42 = (GUIButton *)v0->ptr_1C;
-          pRenderer->DrawTextureIndexed(v0->uFrameX, v0->uFrameY, v42->pTextures[0]);
-          v43 = v0->Hint;
+          v42 = (GUIButton *)pWindow->ptr_1C;
+          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, v42->pTextures[0]);
+          v43 = pWindow->Hint;
           viewparams->bRedrawGameUI = 1;
           if ( v43 && v43 != (char *)1 )
             v42->DrawLabel(v43, pFontCreate, 0, 0);
-          v0->Release();
+          pWindow->Release();
           if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
             continue;
           v41 = pMessageQueue_50CBD0->uNumMessages;
@@ -14866,13 +14866,13 @@
               }
               else
               {
-                v0->DrawMessageBox(0);
-                v0->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
-                v0->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
+                pWindow->DrawMessageBox(0);
+                pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
+                pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
                 if ( !pKeyActionMap->field_204 )
                 {
                   v51.Reset();
-                  v0->Release();
+                  pWindow->Release();
                   pEventTimer->Resume();
                   pCurrentScreen = 0;
                   viewparams->bRedrawGameUI = 1;
@@ -14886,9 +14886,9 @@
               }
               continue;
             }
-            v46 = (Texture *)*((_DWORD *)v0->ptr_1C + 15);
-            v45 = v0->uFrameY;
-            v44 = v0->uFrameX;
+            v46 = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);
+            v45 = pWindow->uFrameY;
+            v44 = pWindow->uFrameX;
 LABEL_18:
             pRenderer->DrawTextureIndexed(v44, v45, v46);
 LABEL_114:
@@ -14904,49 +14904,49 @@
           Dst.uHeight = 37;
           Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent;
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          pRenderer->DrawTextureIndexed(v0->uFrameX, v0->uFrameY, *((Texture **)v0->ptr_1C + 15));
+          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15));
           viewparams->bRedrawGameUI = 1;
           Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);
           Dst.pParent = 0;
           goto LABEL_134;
         }
-        if ( v0->Hint != (char *)1 )
+        if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-        v32 = v0->ptr_1C;
-        pRenderer->DrawTextureIndexed(v0->uFrameX, v0->uFrameY, *((Texture **)v32 + 16));
+        v32 = pWindow->ptr_1C;
+        pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16));
         goto LABEL_138;
       }
-      if ( v1 == 95 )
-      {
-        if ( v0->Hint != (char *)1 )
+      if ( pWindowType == 95 )
+      {
+        if ( pWindow->Hint != (char *)1 )
           pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-        v32 = v0->ptr_1C;
-        pRenderer->DrawTextureTransparent(v0->uFrameX, v0->uFrameY, *((Texture **)v32 + 15));
+        v32 = pWindow->ptr_1C;
+        pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 15));
 LABEL_138:
-        v40 = v0->Hint;
+        v40 = pWindow->Hint;
         viewparams->bRedrawGameUI = 1;
         if ( v40 && v40 != (char *)1 )
           ((GUIButton *)v32)->DrawLabel(v40, pFontCreate, 0, 0);
-        v0->Release();
+        pWindow->Release();
 LABEL_142:
         v41 = pMessageQueue_50CBD0->uNumMessages;
         if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           goto LABEL_151;
         continue;
       }
-      v14 = v1 - 80;
+      v14 = pWindowType - 80;
       if ( v14 )
       {
         v15 = v14 - 9;
         if ( !v15 )
         {
-          v0->DrawMessageBox(0);
-          v0->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
-          v0->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
+          pWindow->DrawMessageBox(0);
+          pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
+          pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
           if ( !pKeyActionMap->field_204 )
           {
             _this.Reset();
-            v0->Release();
+            pWindow->Release();
             pEventTimer->Resume();
             pCurrentScreen = 0;
             viewparams->bRedrawGameUI = 1;
@@ -14977,9 +14977,9 @@
         v16 = v15 - 1;
         if ( !v16 )
         {
-          if ( v0->Hint != (char *)1 )
+          if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v22 = (GUIButton *)v0->ptr_1C;
+          v22 = (GUIButton *)pWindow->ptr_1C;
           if ( (v22->uX & 0x80000000u) == 0 )
           {
             if ( (signed int)v22->uX <= 640 )
@@ -14995,7 +14995,7 @@
               }
             }
           }
-          v23 = v0->Hint;
+          v23 = pWindow->Hint;
           viewparams->bRedrawGameUI = 1;
           if ( v23 )
           {
@@ -15003,20 +15003,20 @@
             goto LABEL_82;
           }
 LABEL_134:
-          v28 = v0;
+          v28 = pWindow;
           goto LABEL_110;
         }
         v17 = v16 - 1;
         if ( !v17 )
         {
-          if ( v0->Hint != (char *)1 )
+          if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v22 = (GUIButton *)v0->ptr_1C;
+          v22 = (GUIButton *)pWindow->ptr_1C;
           v47 = v22->pTextures[1];
 LABEL_94:
-          pRenderer->DrawTextureIndexed(v0->uFrameX, v0->uFrameY, v47);
+          pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, v47);
 LABEL_80:
-          v23 = v0->Hint;
+          v23 = pWindow->Hint;
           viewparams->bRedrawGameUI = 1;
           if ( v23 )
           {
@@ -15030,18 +15030,18 @@
         v18 = v17 - 1;
         if ( !v18 )
         {
-          if ( v0->Hint != (char *)1 )
+          if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          v22 = (GUIButton *)v0->ptr_1C;
-          pRenderer->DrawTextureTransparent(v0->uFrameX, v0->uFrameY, v22->pTextures[0]);
+          v22 = (GUIButton *)pWindow->ptr_1C;
+          pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, v22->pTextures[0]);
           goto LABEL_80;
         }
         v19 = v18 - 1;
         if ( !v19 )
         {
-          if ( v0->Hint != (char *)1 )
+          if ( pWindow->Hint != (char *)1 )
             pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
-          pRenderer->DrawTextureTransparent(v0->uFrameX, v0->uFrameY, *((Texture **)v0->ptr_1C + 16));
+          pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 16));
           viewparams->bRedrawGameUI = 1;
           goto LABEL_134;
         }
@@ -15069,7 +15069,7 @@
         if ( ptr_507BD0->field_40 == 2 )
         {
           v29 = pMessageQueue_50CBD0->uNumMessages;
-          v0->field_40 = 0;
+          pWindow->field_40 = 0;
           if ( (signed int)v29 < 40 )
           {
             pMessageQueue_50CBD0->pMessages[v29].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C;
@@ -15084,7 +15084,7 @@
         }
         if ( ptr_507BD0->field_40 == 3 )
         {
-          v0->field_40 = 0;
+          pWindow->field_40 = 0;
           pEventTimer->Resume();
           v28 = ptr_507BD0;
 LABEL_110:
@@ -15095,16 +15095,16 @@
     }
     else
     {
-      if ( v1 == 70 )
+      if ( pWindowType == 70 )
       {
         sub_41420D_press_esc();
         continue;
       }
-      if ( (signed int)v1 > 18 )
-      {
-        if ( (signed int)v1 > 25 )
-        {
-          v12 = v1 - 26;
+      if ( (signed int)pWindowType > 18 )
+      {
+        if ( (signed int)pWindowType > 25 )
+        {
+          v12 = pWindowType - 26;
           if ( v12 )
           {
             v13 = v12 - 4;
@@ -15133,9 +15133,9 @@
           }
           continue;
         }
-        if ( v1 != 25 )
-        {
-          v7 = v1 - 19;
+        if ( pWindowType != 25 )
+        {
+          v7 = pWindowType - 19;
           if ( v7 )
           {
             v8 = v7 - 1;
@@ -15156,7 +15156,7 @@
             {
               if ( pCurrentScreen == 10 )
               {
-                Chest::DrawChestUI((unsigned int)v0->ptr_1C);
+                Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
               }
               else
               {
@@ -15200,15 +15200,15 @@
         }
         goto LABEL_142;
       }
-      if ( v1 == 18 )
+      if ( pWindowType == 18 )
       {
         sub_412B58();
       }
       else
       {
-        if ( (signed int)v1 > 10 )
-        {
-          v5 = v1 - 12;
+        if ( (signed int)pWindowType > 10 )
+        {
+          v5 = pWindowType - 12;
           if ( v5 )
           {
             v6 = v5 - 4;
@@ -15228,9 +15228,9 @@
           }
           continue;
         }
-        if ( v1 != 10 )
-        {
-          v2 = v1 - 3;
+        if ( pWindowType != 10 )
+        {
+          v2 = pWindowType - 3;
           if ( v2 )
           {
             v3 = v2 - 1;
@@ -15240,7 +15240,7 @@
               if ( v4 )
               {
                 if ( v4 == 3 )
-                  DrawSpellbook((unsigned int)v0->ptr_1C);
+                  DrawSpellbook((unsigned int)pWindow->ptr_1C);
               }
               else
               {