changeset 55:663d5bf032d9

Слияние
author Ritor1
date Wed, 24 Oct 2012 17:55:45 +0600
parents c28452924144 (diff) 4211cceb3813 (current diff)
children 1f161a887c69
files mm7_4.cpp mm7_5.cpp
diffstat 5 files changed, 161 insertions(+), 243 deletions(-) [+]
line wrap: on
line diff
--- a/GUIWindow.cpp	Tue Oct 23 23:40:55 2012 +0200
+++ b/GUIWindow.cpp	Wed Oct 24 17:55:45 2012 +0600
@@ -1238,15 +1238,15 @@
 
   v1 = pPlayers[uActiveCharacter];
   v2 = this;
-  LoadSpellbook(v1->field_1A4E);
+  LoadSpellbook(v1->pNumSpellBookPage);
   v3 = 0;
   a2 = 0;
-  v7 = (int)(&v1->spellbook.pFireSpellbook + v1->field_1A4E);
+  v7 = (int)(&v1->spellbook.pFireSpellbook + v1->pNumSpellBookPage);
   do
   {
     if ( *(char *)(v7 + v3) )
     {
-      v4 = 2 * (12 * v1->field_1A4E + (unsigned __int8)*(&byte_4E2431[12 * v1->field_1A4E] + v3));
+      v4 = 2 * (12 * v1->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2431[12 * v1->pNumSpellBookPage] + v3));
       v2->CreateButton(
         pViewport->uViewportX + dword_4E20D0[v4],
         pViewport->uViewportY + dword_4E20D0[v4 + 1],
--- a/Party.cpp	Tue Oct 23 23:40:55 2012 +0200
+++ b/Party.cpp	Wed Oct 24 17:55:45 2012 +0600
@@ -280,11 +280,11 @@
 //----- (0049137D) --------------------------------------------------------
 void Party::CreateDefaultParty(char bGiveItems)
 {
-  Party *v2; // esi@1
+  Party *pParty; // esi@1
   signed __int16 v3; // ax@1
-  int v4; // ecx@1
-  Player *v5; // esi@3
-  signed int v6; // edx@5
+  int pResMagicBase; // ecx@1
+  Player *pCharacter; // esi@3
+  signed int uSpellBookPageCount; // edx@5
   int v7; // eax@5
   int uSkillIdx; // eax@11
   unsigned __int8 v9; // zf@37
@@ -292,110 +292,109 @@
   unsigned __int8 v11; // of@37
   char *v12; // eax@38
   signed int v13; // ecx@38
-  int v14; // eax@42
+  int uMaxSP; // eax@42
   unsigned int v15; // [sp-4h] [bp-44h]@14
   unsigned int v16; // [sp-4h] [bp-44h]@26
   int v17; // [sp+10h] [bp-30h]@1
   int v18; // [sp+14h] [bp-2Ch]@11
-  signed int v19; // [sp+18h] [bp-28h]@1
+  signed int uNumPlayers; // [sp+18h] [bp-28h]@1
   ItemGen Dst; // [sp+1Ch] [bp-24h]@10
 
-  v2 = this;
-  strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]);
-  v2->pPlayers[0].field_1928 = 17;
-  v2->pPlayers[0].uFace = 17;
-  v2->pPlayers[0].field_1924 = 17;
-  v2->pPlayers[0].uVoiceID = 17;
-  v2->pPlayers[0].uMight = 30;
-  v2->pPlayers[0].uIntelligence = 5;
-  v2->pPlayers[0].uWillpower = 5;
-  v2->pPlayers[0].uEndurance = 13;
-  v2->pPlayers[0].uAccuracy = 13;
-  v2->pPlayers[0].uSpeed = 14;
-  v2->pPlayers[0].uLuck = 7;
-  v2->pPlayers[0].pActiveSkills[9] = 1;         // leather
-  v2->pPlayers[0].pActiveSkills[33] = 1;        // armsmaster
-  v2->pPlayers[0].pActiveSkills[5] = 1;         // bow
-  v2->pPlayers[0].pActiveSkills[1] = 1;         // sword
-  v2->pPlayers[1].field_1928 = 3;
-  v2->pPlayers[1].uFace = 3;
-  v2->pPlayers[1].field_1924 = 3;
-  v2->pPlayers[1].uVoiceID = 3;
-  strcpy(v2->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]);
-  v2->pPlayers[1].uMight = 13;
-  v2->pPlayers[1].uIntelligence = 9;
-  v2->pPlayers[1].uWillpower = 9;
-  v2->pPlayers[1].uEndurance = 13;
-  v2->pPlayers[1].uAccuracy = 13;
-  v2->pPlayers[1].uSpeed = 13;
-  v2->pPlayers[1].uLuck = 13;
-  v2->pPlayers[1].pActiveSkills[9] = 1;         // leather
-  v2->pPlayers[1].pActiveSkills[34] = 1;        // stealing
-  v2->pPlayers[1].pActiveSkills[2] = 1;         // dagger
-  v2->pPlayers[1].pActiveSkills[29] = 1;        // disarm trap
-  v2->pPlayers[2].field_1928 = 14;
-  v2->pPlayers[2].uFace = 14;
-  v2->pPlayers[2].field_1924 = 14;
-  v2->pPlayers[2].uVoiceID = 14;
-  strcpy(v2->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]);
-  v2->pPlayers[2].uMight = 12;
-  v2->pPlayers[2].uIntelligence = 9;
-  v2->pPlayers[2].uWillpower = 20;
-  v2->pPlayers[2].uEndurance = 22;
-  v2->pPlayers[2].uAccuracy = 7;
-  v2->pPlayers[2].uSpeed = 13;
-  v2->pPlayers[2].uLuck = 7;
-  v2->pPlayers[2].pActiveSkills[35] = 1;        // alchemy
-  v2->pPlayers[2].pActiveSkills[9] = 1;         // leather
-  v2->pPlayers[2].pActiveSkills[18] = 1;        // body
-  v2->pPlayers[2].pActiveSkills[6] = 1;         // mace
-  strcpy(v2->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]);
+  pParty = this;
+  strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan
+  pParty->pPlayers[0].field_1928 = 17;
+  pParty->pPlayers[0].uFace = 17;
+  pParty->pPlayers[0].field_1924 = 17;
+  pParty->pPlayers[0].uVoiceID = 17;
+  pParty->pPlayers[0].uMight = 30;
+  pParty->pPlayers[0].uIntelligence = 5;
+  pParty->pPlayers[0].uWillpower = 5;
+  pParty->pPlayers[0].uEndurance = 13;
+  pParty->pPlayers[0].uAccuracy = 13;
+  pParty->pPlayers[0].uSpeed = 14;
+  pParty->pPlayers[0].uLuck = 7;
+  pParty->pPlayers[0].pActiveSkills[9] = 1;         // leather
+  pParty->pPlayers[0].pActiveSkills[33] = 1;        // armsmaster
+  pParty->pPlayers[0].pActiveSkills[5] = 1;         // bow
+  pParty->pPlayers[0].pActiveSkills[1] = 1;         // sword
+  pParty->pPlayers[1].field_1928 = 3;
+  pParty->pPlayers[1].uFace = 3;
+  pParty->pPlayers[1].field_1924 = 3;
+  pParty->pPlayers[1].uVoiceID = 3;
+  strcpy(pParty->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); //Roderic
+  pParty->pPlayers[1].uMight = 13;
+  pParty->pPlayers[1].uIntelligence = 9;
+  pParty->pPlayers[1].uWillpower = 9;
+  pParty->pPlayers[1].uEndurance = 13;
+  pParty->pPlayers[1].uAccuracy = 13;
+  pParty->pPlayers[1].uSpeed = 13;
+  pParty->pPlayers[1].uLuck = 13;
+  pParty->pPlayers[1].pActiveSkills[9] = 1;         // leather
+  pParty->pPlayers[1].pActiveSkills[34] = 1;        // stealing
+  pParty->pPlayers[1].pActiveSkills[2] = 1;         // dagger
+  pParty->pPlayers[1].pActiveSkills[29] = 1;        // disarm trap
+  pParty->pPlayers[2].field_1928 = 14;
+  pParty->pPlayers[2].uFace = 14;
+  pParty->pPlayers[2].field_1924 = 14;
+  pParty->pPlayers[2].uVoiceID = 14;
+  strcpy(pParty->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); // Serena
+  pParty->pPlayers[2].uMight = 12;
+  pParty->pPlayers[2].uIntelligence = 9;
+  pParty->pPlayers[2].uWillpower = 20;
+  pParty->pPlayers[2].uEndurance = 22;
+  pParty->pPlayers[2].uAccuracy = 7;
+  pParty->pPlayers[2].uSpeed = 13;
+  pParty->pPlayers[2].uLuck = 7;
+  pParty->pPlayers[2].pActiveSkills[35] = 1;        // alchemy
+  pParty->pPlayers[2].pActiveSkills[9] = 1;         // leather
+  pParty->pPlayers[2].pActiveSkills[18] = 1;        // body
+  pParty->pPlayers[2].pActiveSkills[6] = 1;         // mace
+  strcpy(pParty->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); // Alexis
   v3 = 10;
-  v2->pPlayers[3].field_1928 = 10;
-  v2->pPlayers[3].uFace = 10;
-  v4 = (int)&v2->pPlayers[0].sResMagicBase;
-  v2->pPlayers[3].uEndurance = 13;
-  v2->pPlayers[3].uAccuracy = 13;
-  v2->pPlayers[3].uSpeed = 13;
-  v2->pPlayers[3].field_1924 = 10;
-  v2->pPlayers[3].uVoiceID = 10;
-  v2->pPlayers[3].uMight = 5;
-  v2->pPlayers[3].uIntelligence = 30;
-  v2->pPlayers[3].uWillpower = 9;
-  v2->pPlayers[3].uLuck = 7;
-  v2->pPlayers[3].pActiveSkills[9] = 1;         // leather
-  v2->pPlayers[3].pActiveSkills[13] = 1;        // air
-  v2->pPlayers[3].pActiveSkills[12] = 1;        // fire
-  v2->pPlayers[3].pActiveSkills[0] = 1;         // staff
-  v17 = (int)&v2->pPlayers[0].sResMagicBase;
-  v19 = 4;
+  pParty->pPlayers[3].field_1928 = 10;
+  pParty->pPlayers[3].uFace = 10;
+  pResMagicBase = (int)&pParty->pPlayers[0].sResMagicBase;
+  pParty->pPlayers[3].uEndurance = 13;
+  pParty->pPlayers[3].uAccuracy = 13;
+  pParty->pPlayers[3].uSpeed = 13;
+  pParty->pPlayers[3].field_1924 = 10;
+  pParty->pPlayers[3].uVoiceID = 10;
+  pParty->pPlayers[3].uMight = 5;
+  pParty->pPlayers[3].uIntelligence = 30;
+  pParty->pPlayers[3].uWillpower = 9;
+  pParty->pPlayers[3].uLuck = 7;
+  pParty->pPlayers[3].pActiveSkills[9] = 1;         // leather
+  pParty->pPlayers[3].pActiveSkills[13] = 1;        // air
+  pParty->pPlayers[3].pActiveSkills[12] = 1;        // fire
+  pParty->pPlayers[3].pActiveSkills[0] = 1;         // staff
+  pCharacter = &pParty->pPlayers[0];
+  uNumPlayers = 4;
   while ( 1 )
   {
-    v5 = (Player *)(v4 - 6014);
-    if ( !*(char *)(v4 - 5829) )
-      *(short *)v4 = v3;
-    v6 = 0;
-    v7 = v4 - 5726;
+    if ( !pCharacter->uClass )
+      *(short *)pResMagicBase = v3;
+    uSpellBookPageCount = 0;
+    v7 = pResMagicBase - 5726;// Skills
     while ( !*(short *)v7 )
     {
-      ++v6;
+      ++uSpellBookPageCount;
       v7 += 2;
-      if ( v6 >= 9 )
+      if ( uSpellBookPageCount >= 9 )
         goto LABEL_10;
     }
-    v5->field_1A4E = v6;
+    pCharacter->pNumSpellBookPage = uSpellBookPageCount;
 LABEL_10:
-    v5->uExpressionTimePassed = 0;
+    pCharacter->uExpressionTimePassed = 0;
     Dst.Reset();
     if ( bGiveItems )
     {
       pItemsTable->GenerateItem(2, 40, &Dst);
-      v5->AddItem2(0xFFFFFFFFu, &Dst);
+      pCharacter->AddItem2(-1, &Dst);
       uSkillIdx = 0;
       v18 = 0;
       do
       {
-        if ( v5->pActiveSkills[uSkillIdx] )
+        if ( pCharacter->pActiveSkills[uSkillIdx] )
         {
           switch ( uSkillIdx )
           {
@@ -432,7 +431,7 @@
             case PLAYER_SKILL_PLATE:
               v15 = ITEM_PLATE_1;
 wear_item:
-              v5->WearItem(v15);
+              pCharacter->WearItem(v15);
               break;
             case PLAYER_SKILL_FIRE:
               v16 = ITEM_SPELLBOOK_FIRE_STRIKE;
@@ -462,7 +461,7 @@
             case PLAYER_SKILL_DIPLOMACY:
             case PLAYER_SKILL_TRAP_DISARM:
             case PLAYER_SKILL_LEARNING:
-              v5->AddItem(0xFFFFFFFFu, ITEM_POTION_BOTTLE);
+              pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
               v16 = 5 * (rand() % 3 + 40);      // simple reagent
               goto add_item;
             case PLAYER_SKILL_DODGE:
@@ -471,7 +470,7 @@
             case PLAYER_SKILL_UNARMED:
               v16 = ITEM_GAUNTLETS_1;
 add_item:
-              v5->AddItem(0xFFFFFFFFu, v16);
+              pCharacter->AddItem(-1, v16);
               break;
             default:
               break;
@@ -483,7 +482,7 @@
         v10 = v18++ - 35 < 0;
       }
       while ( (unsigned __int8)(v10 ^ v11) | v9 );
-      v12 = (char *)&v5->pInventoryItems[0].uAttributes;
+      v12 = (char *)&pCharacter->pInventoryItems[0].uAttributes;
       v13 = 138;
       do
       {
@@ -494,14 +493,13 @@
       }
       while ( v13 );
     }
-    v5->sHealth = v5->GetMaxHealth();
-    v14 = v5->GetMaxMana();
-    v17 += 6972;
-    v9 = v19-- == 1;
-    v5->sMana = v14;
+    pCharacter->sHealth = pCharacter->GetMaxHealth();
+    pCharacter->sMana = pCharacter->GetMaxMana();
+    pCharacter++;
+    v9 = uNumPlayers-- == 1;
     if ( v9 )
       break;
-    v4 = v17;
+    pResMagicBase = (int)pCharacter;
     v3 = 10;
   }
 }
--- a/Player.h	Tue Oct 23 23:40:55 2012 +0200
+++ b/Player.h	Wed Oct 24 17:55:45 2012 +0600
@@ -93,7 +93,12 @@
 {
   PLAYER_CLASS_KNIGHT = 0x0,
   PLAYER_CLASS_THEIF = 0x4,
+  PLAYER_CLASS_MONK = 0x8,
+  PLAYER_CLASS_PALADIN = 0xC,
+  PLAYER_CLASS_SHOOTER = 0x10,
+  PLAYER_CLASS_DRUID = 0x14,
   PLAYER_CLASS_CLERIC = 0x18,
+  PLAYER_CLASS_RANGER = 0x1C,
   PLAYER_CLASS_SORCERER = 0x20,
 };
 
@@ -424,7 +429,7 @@
   int field_1988[49];
   char field_1A4C;
   char field_1A4D;
-  char field_1A4E;
+  char pNumSpellBookPage;
   unsigned __int8 uQuickSpell;
   char field_1A50[64];
   char _some_attack_bonus;
--- a/mm7_4.cpp	Tue Oct 23 23:40:55 2012 +0200
+++ b/mm7_4.cpp	Wed Oct 24 17:55:45 2012 +0600
@@ -5333,63 +5333,41 @@
   int v51; // eax@49
   char *v52; // edi@52
   char v53; // al@52
-  int v54; // edi@53
+  int uClassType; // edi@53
   int v55; // ST0C_4@53
   int v56; // eax@53
   int v57; // eax@53
-  const char *v58; // ST10_4@55
-  unsigned int v59; // ST0C_4@55
   int v60; // eax@55
   int v61; // ecx@55
-  const char *v62; // ST10_4@57
-  unsigned int v63; // ST0C_4@57
   int v64; // ST08_4@57
   int v65; // eax@57
   int v66; // ecx@57
-  const char *v67; // ST10_4@59
-  unsigned int v68; // ST0C_4@59
   int v69; // ST08_4@59
   int v70; // eax@59
   int v71; // eax@59
-  const char *v72; // ST10_4@61
-  unsigned int v73; // ST0C_4@61
   int v74; // eax@61
   int v75; // eax@61
-  const char *v76; // ST10_4@63
-  unsigned int v77; // ST0C_4@63
   int v78; // ST08_4@63
   int v79; // eax@63
   int v80; // eax@63
-  const char *v81; // ST10_4@65
-  unsigned int v82; // ST0C_4@65
   int v83; // ST08_4@65
   int v84; // eax@65
   int v85; // eax@65
-  const char *v86; // ST10_4@67
-  unsigned int v87; // ST0C_4@67
   int v88; // eax@67
   int v89; // eax@67
-  const char *v90; // ST10_4@69
-  unsigned int v91; // ST0C_4@69
   int v92; // ST08_4@69
   int v93; // eax@69
   int v94; // eax@69
-  const char *v95; // ST10_4@71
-  unsigned int v96; // ST0C_4@71
   int v97; // ST08_4@71
   int v98; // eax@71
-  const char *v99; // ST10_4@71
-  int v100; // ST0C_4@71
   int v101; // eax@71
   enum PLAYER_SKILL_TYPE v102; // edi@72
   size_t v103; // eax@72
   signed int v104; // ecx@72
   int v105; // ecx@79
-  int v106; // edi@81
   unsigned int v107; // ST0C_4@81
   int pTextY; // ST08_4@81
   int v109; // eax@81
-  const char *v110; // ST10_4@82
   int v111; // ST0C_4@82
   int v112; // eax@82
   signed int v113; // edi@82
@@ -5661,86 +5639,65 @@
       v51 = v134;
     }
   }
-  v54 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass;
+  uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass;
   v55 = uColor1;
-  v133 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass;
   v56 = pFontCreate->AlignText_Center(193u, Str1);
   pGUIWindow_CurrentMenu->DrawText(pFontCreate, v56 + 324, 395, v55, Str1, 0, 0, 0);
   v57 = uColorTeal;
-  if ( v54 )
+  if ( uClassType )
     v57 = uColorWhite;
-  v58 = pClassNames[0];
-  v59 = v57;
   v60 = pFontCreate->AlignText_Center(65u, pClassNames[0]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v60 + 323, 417, v59, v58, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v60 + 323, 417, v57, pClassNames[0], 0, 0, 0);
   v61 = uColorTeal;
-  if ( v133 != 12 )
+  if ( uClassType != PLAYER_CLASS_PALADIN )
     v61 = uColorWhite;
-  v62 = pClassNames[12];
-  v63 = v61;
   v64 = v128 + 417;
   uColorGreen = v128 + 417;
   v65 = pFontCreate->AlignText_Center(65u, pClassNames[12]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v65 + 323, v64, v63, v62, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v65 + 323, v64, v61, pClassNames[12], 0, 0, 0);
   v66 = uColorTeal;
-  if ( v133 != 20 )
+  if ( uClassType != PLAYER_CLASS_DRUID )
     v66 = uColorWhite;
-  v67 = pClassNames[20];
-  v68 = v66;
   v69 = 2 * v128 + 417;
   v126 = 2 * v128 + 417;
   v70 = pFontCreate->AlignText_Center(65u, pClassNames[20]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v70 + 323, v69, v68, v67, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v70 + 323, v69, v66, pClassNames[20], 0, 0, 0);
   v71 = uColorTeal;
-  if ( v133 != PLAYER_CLASS_CLERIC )
+  if ( uClassType != PLAYER_CLASS_CLERIC )
     v71 = uColorWhite;
-  v72 = pClassNames[24];
-  v73 = v71;
   v74 = pFontCreate->AlignText_Center(65u, pClassNames[24]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v74 + 388, 417, v73, v72, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v74 + 388, 417, v71, pClassNames[24], 0, 0, 0);
   v75 = uColorTeal;
-  if ( v133 != 28 )
+  if ( uClassType != 28 )
     v75 = uColorWhite;
-  v76 = pClassNames[28];
-  v77 = v75;
   v78 = uColorGreen;
   v79 = pFontCreate->AlignText_Center(65u, pClassNames[28]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v79 + 388, v78, v77, v76, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v79 + 388, v78, v75, pClassNames[28], 0, 0, 0);
   v80 = uColorTeal;
-  if ( v133 != PLAYER_CLASS_SORCERER )
+  if ( uClassType != PLAYER_CLASS_SORCERER )
     v80 = uColorWhite;
-  v81 = pClassNames[32];
-  v82 = v80;
   v83 = v126;
   v84 = pFontCreate->AlignText_Center(65u, pClassNames[32]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v84 + 388, v83, v82, v81, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v84 + 388, v83, v80, pClassNames[32], 0, 0, 0);
   v85 = uColorTeal;
-  if ( v133 != 16 )
+  if ( uClassType != PLAYER_CLASS_SHOOTER )
     v85 = uColorWhite;
-  v86 = pClassNames[16];
-  v87 = v85;
   v88 = pFontCreate->AlignText_Center(65u, pClassNames[16]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v88 + 453, 417, v87, v86, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v88 + 453, 417, v85, pClassNames[16], 0, 0, 0);
   v89 = uColorTeal;
-  if ( v133 != 8 )
+  if ( uClassType != PLAYER_CLASS_MONK )
     v89 = uColorWhite;
-  v90 = pClassNames[8];
-  v91 = v89;
   v92 = uColorGreen;
   v93 = pFontCreate->AlignText_Center(65u, pClassNames[8]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v93 + 453, v92, v91, v90, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v93 + 453, v92, v89, pClassNames[8], 0, 0, 0);
   v94 = uColorTeal;
-  if ( v133 != 4 )
+  if ( uClassType != PLAYER_CLASS_THEIF )
     v94 = uColorWhite;
-  v95 = pClassNames[4];
-  v96 = v94;
   v97 = v126;
   v98 = pFontCreate->AlignText_Center(65u, pClassNames[4]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v98 + 453, v97, v96, v95, 0, 0, 0);
-  v99 = pGlobalTXT_LocalizationStrings[20];     // "Available Skills"
-  v100 = uColor1;
-  v101 = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v101 + 37, 395, v100, v99, 0, 0, 0);
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v98 + 453, v97, v94, pClassNames[4], 0, 0, 0);
+  v101 = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v101 + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
   v134 = 0;
   do
   {
@@ -5770,12 +5727,11 @@
     v105 = uColorTeal;
     if ( !pParty->pPlayers[0].pActiveSkills[v102 + 3486 * uPlayerCreationUI_SelectedCharacter] )
       v105 = uColorWhite;
-    v106 = v134 / 3;
-	v107 = v105;
+    v107 = v105;
 	v109 = pFontCreate->AlignText_Center(100u, Str1);
     pGUIWindow_CurrentMenu->DrawText(
       pFontCreate,
-      100 * v106 + v109 + uColorGreen + 17,
+      100 * (v134 / 3) + v109 + uColorGreen + 17,
       v128 * (v134 % 3) + 417,
       v107,
       Str1,
@@ -5785,10 +5741,9 @@
     ++v134;
   }
   while ( v134 < 9 );
-  v110 = pGlobalTXT_LocalizationStrings[30];    // "Bonus"
   v111 = uColor1;
-  v112 = pFontCreate->AlignText_Center(0x5Cu, pGlobalTXT_LocalizationStrings[30]);
-  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v112 + 533, 394, v111, v110, 0, 0, 0);
+  v112 = pFontCreate->AlignText_Center(0x5Cu, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
+  pGUIWindow_CurrentMenu->DrawText(pFontCreate, v112 + 533, 394, v111, pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
   v113 = PlayerCreation_ComputeAttributeBonus();
   sprintf(pTmpBuf, "%d", v113);
   v114 = uColorWhite;
--- a/mm7_5.cpp	Tue Oct 23 23:40:55 2012 +0200
+++ b/mm7_5.cpp	Wed Oct 24 17:55:45 2012 +0600
@@ -2670,7 +2670,7 @@
         case 0x4E:
           if ( dword_50654C && byte_506550 )
           {
-            v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->field_1A4E].pName;
+            v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage].pName;
             v157 = pGlobalTXT_LocalizationStrings[483];
 _sprintex_2args_draw_status_and_continue:
             sprintfex(pTmpBuf, v157, v173);
@@ -2726,7 +2726,7 @@
             v127 = 203;
             goto _play_sound_and_continue;
           }
-          v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->field_1A4E;
+          v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage;
           pPlayers[uActiveCharacter]->uQuickSpell = v99;
           stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter);
           if ( uActiveCharacter )
@@ -2745,7 +2745,7 @@
           {
             if ( *(short *)thisl )
             {
-              if ( v100->field_1A4E == v101 )
+              if ( v100->pNumSpellBookPage == v101 )
                 uAction = (int)v195;
               v102 = (int)v195;
               v195 = (NPCData *)((char *)v195 + 1);
@@ -2770,13 +2770,13 @@
               uAction = 0;
           }
           sub_41140B();
-          pPlayers[uActiveCharacter]->field_1A4E = LOBYTE(v217[uAction]);
+          pPlayers[uActiveCharacter]->pNumSpellBookPage = LOBYTE(v217[uAction]);
           goto LABEL_661;
         case UIMSG_SaveGame|0x4:
-          if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->field_1A4E )
+          if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage )
             goto _continue;
           sub_41140B();
-          pPlayers[uActiveCharacter]->field_1A4E = uMessageParam;
+          pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam;
 LABEL_661:
           pGUIWindow_CurrentMenu->_411621();
 LABEL_662:
@@ -3539,20 +3539,11 @@
             pPlayer->SetSexByVoice();
             pPlayer->RandomizeName();
             v25 = uNum;
-            pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem
-                                                       - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
-                                                      % 7
-                                                      + pGUIWindow_CurrentMenu->pStartingPosActiveItem
-                                                      + 7 * uNum;
+            pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
+                                                      % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
             uPlayerCreationUI_SelectedCharacter = v25;
-            GUIWindow::Create(
-              pCreationUI_BtnPressLeft[v25]->uX,
-              pCreationUI_BtnPressLeft[v25]->uY,
-              0,
-              0,
-              (enum WindowType)92,
-              (int)pCreationUI_BtnPressLeft[v25],
-              1);
+            GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0,
+              (enum WindowType)92, (int)pCreationUI_BtnPressLeft[v25], 1);
             //v0 = pAudioPlayer;
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0);
             v22 = pPlayer;
@@ -3568,20 +3559,11 @@
             pPlayer->SetSexByVoice();
             pPlayer->RandomizeName();
             v21 = uNum;
-            pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem
-                                                       - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
-                                                      % 7
-                                                      + pGUIWindow_CurrentMenu->pStartingPosActiveItem
-                                                      + 7 * uNum;
+            pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
+                                                      % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
             uPlayerCreationUI_SelectedCharacter = v21;
-            GUIWindow::Create(
-              pCreationUI_BtnPressRight[v21]->uX,
-              pCreationUI_BtnPressRight[v21]->uY,
-              0,
-              0,
-              (enum WindowType)92,
-              (int)pCreationUI_BtnPressRight[v21],
-              1);
+            GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, (enum WindowType)92,
+			  (int)pCreationUI_BtnPressRight[v21], 1);
             //v0 = pAudioPlayer;
             pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
             v22 = pPlayer;
@@ -3590,29 +3572,15 @@
             v1 = (char *)pParty->pPlayers;
             continue;
           }
-          if ( v45 == UIMSG_AD )
-          {
-            GUIWindow::Create(
-              pMainMenu_BtnNew->uX,
-              pMainMenu_BtnNew->uY,
-              0,
-              0,
-              (enum WindowType)90,
-              (int)pMainMenu_BtnNew,
-              0);
+          if ( v45 == UIMSG_AD ) //Press NEW
+          {
+            GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0);
           SetCurrentMenuID(MENU_LOAD);
           continue;
           }
-          if ( v45 != 174 )
+          if ( v45 != 174 )//Press EXIT
             continue;
-          GUIWindow::Create(
-            pMainMenu_BtnExit->uX,
-            pMainMenu_BtnExit->uY,
-            0,
-            0,
-            (enum WindowType)90,
-            (int)pMainMenu_BtnExit,
-            0);
+          GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
 LABEL_114:
           v40 = 10;
 LABEL_89:
@@ -3727,11 +3695,8 @@
           if ( v45 == 118 )
           {
             v14 = uNum;
-            pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem
-                                                       - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
-                                                      % 7
-                                                      + pGUIWindow_CurrentMenu->pStartingPosActiveItem
-                                                      + 7 * uNum;
+            pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
+                                                      % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
             uPlayerCreationUI_SelectedCharacter = v14;
 LABEL_36:
             v42 = 0;
@@ -3788,25 +3753,20 @@
             v39 = (int)ptr_69BD5C;
             v8 = pGUIWindow_CurrentMenu->uFrameY + 197;
 LABEL_105:
-            v37 = (WindowType)90;
-            v35 = 0;
-            v33 = 0;
-            v18 = v7->uFrameX + 215;
-            GUIWindow::Create(v18, v8, v33, v35, v37, v39, v43);
+            GUIWindow::Create(v7->uFrameX + 215, v8, 0, 0, (WindowType)90, v39, v43);
             continue;
           }
         }
       }
       else
       {
-        if ( v45 == 75 )
+        if ( v45 == 75 ) //sellect quality
         {
           uPlayerCreationUI_SelectedCharacter = uNum;
           v41 = 3;
           v1 = (char *)pParty->pPlayers;
           v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
-             + pGUIWindow_CurrentMenu->pStartingPosActiveItem
-             + 7 * uNum;
+             + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
           goto LABEL_44;
         }
         if ( (signed int)v45 > 60 )
@@ -12566,7 +12526,7 @@
 
   v1 = pPlayers[uActiveCharacter];
   v10 = _this;
-  v2 = &pSpellStats->pInfos[(signed int)((char *)_this + 11 * v1->field_1A4E) + 1];
+  v2 = &pSpellStats->pInfos[(signed int)((char *)_this + 11 * v1->pNumSpellBookPage) + 1];
   if ( pMouse->GetCursorPos(&a2)->y <= 250 )
     v3 = pMouse->GetCursorPos(&a2)->y + 30;
   else
@@ -12625,14 +12585,14 @@
   a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0);
   a1.uFrameWidth = 108;
   a1.uFrameZ = a1.uFrameX + 107;
-  a1.DrawText2(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->field_1A4E + 12], 3u);
+  a1.DrawText2(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->pNumSpellBookPage + 12], 3u);
   sprintfex(
     pTmpBuf,
     "%s\n%d",
     pGlobalTXT_LocalizationStrings[522],
     *(&pSpellDatas[0].field_14
-    + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->field_1A4E + 12]) >> 6)
-    + 10 * (int)((char *)v10 + 11 * v1->field_1A4E)));
+    + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->pNumSpellBookPage + 12]) >> 6)
+    + 10 * (int)((char *)v10 + 11 * v1->pNumSpellBookPage)));
   a1.DrawText2(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u);
   dword_507B00_spell_info_to_draw_in_popup = 0;
 }
@@ -13144,7 +13104,7 @@
 
   sub_412AF9();
   v0 = pPlayers[uActiveCharacter];
-  v1 = 11 * v0->field_1A4E;
+  v1 = 11 * v0->pNumSpellBookPage;
   v2 = pIcons_LOD->FindTextureByName("Pending");
   v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
   pRenderer->ClearZBuffer(0, 479);
@@ -13170,14 +13130,14 @@
           }
           if ( v6->pLevelOfDetail0 )
           {
-            v7 = 2 * (12 * v0->field_1A4E + (unsigned __int8)*(&byte_4E2430[12 * v0->field_1A4E] + v4));
+            v7 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage + v4]));
             v19 = pViewport->uViewportY + dword_4E20D0[v7 + 1];
             v17 = pViewport->uViewportX + dword_4E20D0[v7];
             if ( BYTE1(v6->pBits) & 2 )
               pRenderer->DrawTextureTransparent(v17, v19, v6);
             else
               pRenderer->DrawTextureIndexed(v17, v19, v6);
-            v8 = 2 * (12 * v0->field_1A4E + (unsigned __int8)*(&byte_4E2430[12 * v0->field_1A4E] + v4));
+            v8 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v4));
             pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], (Texture *)v23[0], v4);
           }
         }
@@ -13194,7 +13154,7 @@
     if ( v11->pLevelOfDetail0 )
     {
       v21 = dword_5063D8[v10];
-      v12 = 2 * (12 * v0->field_1A4E + (unsigned __int8)*(&byte_4E2430[12 * v0->field_1A4E] + v10));
+      v12 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v10));
       v20 = pViewport->uViewportY + dword_4E20D0[v12 + 1];
       v18 = pViewport->uViewportX + dword_4E20D0[v12];
       if ( BYTE1(v11->pBits) & 2 )
@@ -13212,7 +13172,7 @@
   {
     if ( *(short *)a2.x )
     {
-      if ( v0->field_1A4E == v13 )
+      if ( v0->pNumSpellBookPage == v13 )
       {
         v16 = *(Texture **)&pTextures_tabs[0][0].pName[8 * v13 + 4];
         switch ( v13 )