# HG changeset patch # User Nomad # Date 1351212158 -7200 # Node ID 30ec77bbd0182cb5b1a3e465735c7488ca871800 # Parent 5159d2e6f559dd2544d8c7c607d73b20fe38d754# Parent 6b3a5283b1070430ed857bea7b706b65637dee81 Merge diff -r 5159d2e6f559 -r 30ec77bbd018 GUIWindow.cpp --- a/GUIWindow.cpp Fri Oct 26 02:38:26 2012 +0200 +++ b/GUIWindow.cpp Fri Oct 26 02:42:38 2012 +0200 @@ -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], diff -r 5159d2e6f559 -r 30ec77bbd018 GUIWindow.h --- a/GUIWindow.h Fri Oct 26 02:38:26 2012 +0200 +++ b/GUIWindow.h Fri Oct 26 02:42:38 2012 +0200 @@ -116,6 +116,16 @@ UIMSG_MainMenu_ShowLoadWindow = 0x37, UIMSG_ShowCredits = 0x38, UIMSG_ExitToWindows = 0x39, + UIMSG_3C = 0x3C, + UIMSG_PlayerCreationClickPlus = 0x3E, + UIMSG_PlayerCreationClickMinus = 0x3F, + UIMSG_PlayerCreationSelectActiveSkill = 0x40, + UIMSG_41 = 0x41, + UIMSG_PlayerCreationClickOK = 0x42, + UIMSG_PlayerCreationClickReset = 0x43, + UIMSG_PlayerCreationRemoveUpSkill = 0x4A, + UIMSG_PlayerCreationRemoveDownSkill = 0x4B, + UIMSG_4B = 0x4B, UIMSG_LoadGame = 0x52, UIMSG_SaveGame = 0x53, UIMSG_ShowStatus_DateTime = 0x5C, @@ -123,16 +133,20 @@ UIMSG_ShowStatus_Player = 0x5E, UIMSG_ShowStatus_Food = 0x64, UIMSG_ShowStatus_Funds = 0x65, + UIMSG_6B = 0x6B, UIMSG_SelectCharacter = 0x6E, UIMSG_ChangeSoundVolume = 0x6F, UIMSG_ChangeMusicVolume = 0x70, UIMSG_CloseBook = 0x71, + UIMSG_PlayerCreationSelectQuality = 0x76, UIMSG_SkillUp = 0x79, UIMSG_StartNewGame = 0x7C, UIMSG_Game_OpenLoadGameDialog = 0x7D, UIMSG_Game_OpenOptionsDialog = 0x7F, UIMSG_SetGraphicsMode = 0x83, UIMSG_Quit = 0x84, + UIMSG_PlayerCreationVoiceBack = 0x90, + UIMSG_PlayerCreationVoiceForward = 0x91, UIMSG_StartNPCDialogue = 0xA1, UIMSG_A2 = 0xA2, UIMSG_A3 = 0xA3, @@ -143,8 +157,8 @@ UIMSG_A8 = 0xA8, UIMSG_A9 = 0xA9, UIMSG_AA = 0xAA, - UIMSG_AB = 0xAB, - UIMSG_AC = 0xAC, + UIMSG_SelectFacePlayerBack = 0xAB, + UIMSG_SelectFacePlayerForward = 0xAC, UIMSG_AD = 0xAD, UIMSG_AE = 0xAE, UIMSG_AF = 0xAF, diff -r 5159d2e6f559 -r 30ec77bbd018 Party.cpp --- a/Party.cpp Fri Oct 26 02:38:26 2012 +0200 +++ b/Party.cpp Fri Oct 26 02:42:38 2012 +0200 @@ -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; } } diff -r 5159d2e6f559 -r 30ec77bbd018 Player.h --- a/Player.h Fri Oct 26 02:38:26 2012 +0200 +++ b/Player.h Fri Oct 26 02:42:38 2012 +0200 @@ -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; diff -r 5159d2e6f559 -r 30ec77bbd018 mm7_4.cpp --- a/mm7_4.cpp Fri Oct 26 02:38:26 2012 +0200 +++ b/mm7_4.cpp Fri Oct 26 02:42:38 2012 +0200 @@ -5336,63 +5336,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 @@ -5664,86 +5642,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 { @@ -5773,12 +5730,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, @@ -5788,10 +5744,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; diff -r 5159d2e6f559 -r 30ec77bbd018 mm7_5.cpp --- a/mm7_5.cpp Fri Oct 26 02:38:26 2012 +0200 +++ b/mm7_5.cpp Fri Oct 26 02:42:38 2012 +0200 @@ -2671,7 +2671,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: sprintf(pTmpBuf, v157, v173); @@ -2727,7 +2727,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 ) @@ -2746,7 +2746,7 @@ { if ( *(short *)thisl ) { - if ( v100->field_1A4E == v101 ) + if ( v100->pNumSpellBookPage == v101 ) uAction = (int)v195; v102 = (int)v195; v195 = (NPCData *)((char *)v195 + 1); @@ -2771,13 +2771,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: @@ -3417,7 +3417,7 @@ int v42; // [sp-10h] [bp-20h]@36 int v43; // [sp-10h] [bp-20h]@56 int uNum; // [sp+4h] [bp-Ch]@3 - UIMessageType v45; // [sp+8h] [bp-8h]@3 + UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 int v46; // [sp+Ch] [bp-4h]@3 Player *pPlayer; @@ -3428,8 +3428,8 @@ pPlayer = pParty->pPlayers; do { - pMessageQueue_50CBD0->PopMessage(&v45, &uNum, &v46); - switch (v45) + pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &v46); + switch (pUIMessageType) { case UIMSG_MainMenu_ShowPartyCreationWnd: { @@ -3470,15 +3470,14 @@ } - switch (v45) + switch (pUIMessageType) { case UIMSG_A5: // WINDOW_5A { //main menu save/load wnd clicking on savegame lines if (pGUIWindow_CurrentMenu->field_40 == 1) pKeyActionMap->_459ED1(0); - if ( pCurrentScreen != 11 - || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) + if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) { //load clicked line v26 = uNum + dword_6A0C9C; @@ -3505,18 +3504,17 @@ case UIMSG_A4: { - GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, - pGUIWindow_CurrentMenu->uFrameY + 302, + GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)ptr_69BD64, 0); } continue; } - if ( (signed int)v45 > 75 ) - { - if ( v45 > UIMSG_A3 ) - { - if ( v45 == UIMSG_A6 ) + if ( (signed int)pUIMessageType > 75 ) + { + if ( pUIMessageType > UIMSG_A3 ) + { + if ( pUIMessageType == UIMSG_A6 ) { v43 = 0; v39 = (int)ptr_69BD60; @@ -3528,7 +3526,7 @@ GUIWindow::Create(v18, v8, v33, v35, v37, v39, v43); continue; } - if ( v45 == UIMSG_AB ) // sellect face -1 + if ( pUIMessageType == UIMSG_SelectFacePlayerBack ) { pPlayer = &pParty->pPlayers[uNum]; v12 = (char)((int)pPlayer->uFace - 1) < 0; @@ -3540,26 +3538,19 @@ 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; - goto LABEL_117; - } - if ( v45 == UIMSG_AC ) //sellect face +1 + v22->PlaySound(102, 0); + v1 = (char *)pParty->pPlayers; + continue; + } + if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) { pPlayer = &pParty->pPlayers[uNum]; v20 = (char)((int)pPlayer->uFace + 1) % 20; @@ -3569,60 +3560,35 @@ 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; -LABEL_117: v22->PlaySound(102, 0); 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 ( pUIMessageType == UIMSG_AD ) + { + 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 ( pUIMessageType != UIMSG_AE ) 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: v2 = v40; -LABEL_90: SetCurrentMenuID((MENU_STATE)v2); continue; } - if ( v45 == UIMSG_A3 ) + if ( pUIMessageType == UIMSG_A3 ) { ++dword_6A0C9C; if ( dword_6A0C9C >= uNum ) @@ -3635,7 +3601,7 @@ v8 = pGUIWindow_CurrentMenu->uFrameY + 323; goto LABEL_105; } - if ( v45 == 107 ) + if ( pUIMessageType == UIMSG_6B ) { if ( pCurrentScreen ) { @@ -3650,7 +3616,7 @@ pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; goto LABEL_93; } - if ( v45 == UIMSG_CloseBook ) + if ( pUIMessageType == UIMSG_CloseBook ) { if ( ptr_507BDC ) { @@ -3692,8 +3658,7 @@ } v16 = GetCurrentMenuID() == 8; v17 = pCurrentScreen; - if ( v16 - && !pCurrentScreen ) + if ( v16 && !pCurrentScreen ) goto LABEL_83; if ( pCurrentScreen == 12 ) { @@ -3725,15 +3690,11 @@ } else { - if ( v45 == 118 ) - { - v14 = uNum; - pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - - pGUIWindow_CurrentMenu->pStartingPosActiveItem) - % 7 - + pGUIWindow_CurrentMenu->pStartingPosActiveItem - + 7 * uNum; - uPlayerCreationUI_SelectedCharacter = v14; + if ( pUIMessageType == UIMSG_PlayerCreationSelectQuality ) + { + pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) + % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; + uPlayerCreationUI_SelectedCharacter = uNum; LABEL_36: v42 = 0; v38 = 0; @@ -3747,7 +3708,7 @@ pAudioPlayer->PlaySound(pSoundID, v30, v31, v32, v34, v36, v38, v42); continue; } - if ( v45 == 144 ) + if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack ) { v9 = &pPlayer[uNum]; v46 = v9->GetSexByVoice(); @@ -3762,7 +3723,7 @@ v11 = pCreationUI_BtnPressLeft2[uNum]; goto LABEL_60; } - if ( v45 == 145 ) + if ( pUIMessageType == UIMSG_PlayerCreationVoiceForward ) { v9 = &pPlayer[uNum]; v46 = v9->GetSexByVoice(); @@ -3779,7 +3740,7 @@ v9->PlaySound(102, 0); continue; } - if ( v45 == UIMSG_A2 ) + if ( pUIMessageType == UIMSG_A2 ) { --dword_6A0C9C; if ( dword_6A0C9C < 0 ) @@ -3789,30 +3750,25 @@ 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 ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) { 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 ) - { - if ( v45 == 62 ) //click + + if ( (signed int)pUIMessageType > UIMSG_3C ) + { + if ( pUIMessageType == UIMSG_PlayerCreationClickPlus ) { GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute( @@ -3827,7 +3783,7 @@ pSoundID = (SoundID)20; goto LABEL_40; } - if ( v45 == 63 ) // click - + if ( pUIMessageType == UIMSG_PlayerCreationClickMinus ) { GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); (&pPlayer[uPlayerCreationUI_SelectedCharacter])->DecreaseAttribute( @@ -3842,7 +3798,7 @@ pSoundID = (SoundID)23; goto LABEL_40; } - if ( v45 == 64 ) // sellect active skill + if ( pUIMessageType == UIMSG_PlayerCreationSelectActiveSkill ) { auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; v6 = _t->GetSkillIdxByOrder(uNum + 4); @@ -3858,34 +3814,34 @@ pSoundID = (SoundID)24; goto LABEL_40; } - if ( v45 == 65 ) + if ( pUIMessageType == UIMSG_41 ) { (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(0); goto LABEL_36; } - if ( v45 == 66 ) // click ok - { - GUIWindow::Create(0x244u, 0x1AFu, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); + if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) + { + GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); if ( PlayerCreation_ComputeAttributeBonus() || !sub_4908DE() ) GameUI_StatusBar_TimedStringTimeLeft = GetTickCount() + 4000; else uGameState = 6; continue; } - if ( v45 == 67 ) // click reset - { - GUIWindow::Create(0x20Fu, 0x1AFu, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); + if ( pUIMessageType == UIMSG_PlayerCreationClickReset ) + { + GUIWindow::Create(527, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); pParty->Reset(); } else { - if ( v45 == 74 ) + if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill ) { uPlayerCreationUI_SelectedCharacter = uNum; v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; v46 = pGUIWindow_CurrentMenu->pStartingPosActiveItem; v41 = 2; - v5 = (v4 % 7) + v46 + 7 * uNum; + v5 = v4 % 7 + v46 + 7 * uNum; LABEL_44: pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) @@ -3896,7 +3852,7 @@ } else { - switch ( v45 ) + switch ( pUIMessageType ) { case 60: pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); @@ -3912,7 +3868,7 @@ pMouse->SetCursorBitmap("MICON2"); break; default: - if ( v45 == 58 ) + if ( pUIMessageType == 58 ) goto LABEL_114; break; } @@ -12563,7 +12519,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 @@ -12622,14 +12578,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; } @@ -13141,7 +13097,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); @@ -13167,14 +13123,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); } } @@ -13191,7 +13147,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 ) @@ -13209,7 +13165,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 )