Mercurial > mm7
changeset 510:7c86030324a5
Слияние
author | Ritor1 |
---|---|
date | Fri, 01 Mar 2013 18:38:12 +0600 |
parents | dddedef7a98e (current diff) dd5124185551 (diff) |
children | a13d7b95424e |
files | Player.cpp mm7_1.cpp mm7_3.cpp mm7_4.cpp |
diffstat | 27 files changed, 2785 insertions(+), 2978 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/Actor.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -561,7 +561,7 @@ v10 = v105; LABEL_29: spellnuma = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; - a1.uItemType = stru_4E3ACC[15].uItemType; + a1.uItemType = stru_4E3ACC[15].field_0; v118 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v10 - 1); v11 = 0; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -572,7 +572,7 @@ else { v12 = &pObjectList->pObjects->uObjectID; - while ( stru_4E3ACC[15].uItemType != *v12 ) + while ( stru_4E3ACC[15].field_0 != *v12 ) { ++v11; v12 += 28; @@ -642,7 +642,7 @@ return; } LABEL_159: - a1.uItemType = stru_4E3ACC[spellnum].uItemType; + a1.uItemType = stru_4E3ACC[spellnum].field_0; v119 = 0.0; if ( (signed int)pObjectList->uNumObjects <= 0 ) { @@ -790,7 +790,7 @@ pitch = stru_5C6E00->Atan2(v31, (signed __int64)spellnumc); } a1.stru_24.Reset(); - a1.uItemType = stru_4E3ACC[9].uItemType; + a1.uItemType = stru_4E3ACC[9].field_0; spellnumd = 0; if ( (signed int)pObjectList->uNumObjects <= 0 ) { @@ -1334,7 +1334,7 @@ v70 = v108; LABEL_179: spellnume = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; - a1.uItemType = stru_4E3ACC[93].uItemType; + a1.uItemType = stru_4E3ACC[SPELL_DARK_SHARPMETAL].field_0; v116 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v70 - 1); v71 = 0; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -1345,7 +1345,7 @@ else { v72 = &pObjectList->pObjects->uObjectID; - while ( stru_4E3ACC[93].uItemType != *v72 ) + while ( stru_4E3ACC[SPELL_DARK_SHARPMETAL].field_0 != *v72 ) { ++v71; v72 += 28;
--- a/Events.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/Events.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -204,7 +204,7 @@ int v60; // eax@126 int v61; // edx@133 int v62; // eax@139 - void *v63; // ebp@145 + int v63; // ebp@145 signed int v64; // edi@146 unsigned int v65; // edx@148 Player *v66; // ecx@148 @@ -221,8 +221,8 @@ signed int v77; // ebp@186 int v78; // edx@186 Player *v79; // esi@187 - signed int v80; // ebp@200 - int v81; // edx@200 + //signed int v80; // ebp@200 + //int v81; // edx@200 Player *v82; // esi@201 int v83; // eax@212 int v84; // ebp@220 @@ -266,7 +266,7 @@ int curr_seq_num; // [sp+10h] [bp-498h]@4 //char *v123; // [sp+14h] [bp-494h]@0 signed int v124; // [sp+18h] [bp-490h]@7 - signed int v125; // [sp+1Ch] [bp-48Ch]@155 + //signed int v125; // [sp+1Ch] [bp-48Ch]@155 int v126; // [sp+1Ch] [bp-48Ch]@262 int player_choose; // [sp+20h] [bp-488h]@4 int v128; // [sp+24h] [bp-484h]@21 @@ -821,7 +821,7 @@ //v6 = v123; //v7 = ""; break; - case EVENT_Compare://_evt->_e_type == 14 cmp in Global.evt event 6 + case EVENT_Compare: pValue = EVT_DWORD(_evt->v7); if ( player_choose <= 3 ) { @@ -882,12 +882,12 @@ v4 = v124; break; case EVENT_Substract: - v63 = (void *)(_evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8)); - if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands ) + pValue = EVT_DWORD(_evt->v7); + if ( EVT_WORD(_evt->v5) == VAR_PlayerItemInHands ) + { + v64 = 0; + if ( pParty->pPickedItem.uItemID == pValue ) { - v64 = 0; - if ( (void *)pParty->pPickedItem.uItemID == v63 ) - { pMouse->RemoveHoldingItem(); ++curr_seq_num; v4 = v124; @@ -895,14 +895,14 @@ //v6 = v123; //v7 = ""; break; - } + } v65 = 0; v66 = pPlayers[uActiveCharacter]; v67 = (int)v66->pInventoryIndices; do + { + if ( (int)&v66->pInventoryItems[v67] == pValue ) { - if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 ) - { v66->RemoveItemAtInventoryIndex(v65); ++curr_seq_num; v4 = v124; @@ -910,17 +910,17 @@ //v6 = v123; //v7 = ""; break; - } + } ++v65; v67 += 4; - } - while ( (signed int)v65 < 126 ); + } + while ( (signed int)v65 < 126 ); v68 = 0; v69 = (int)&v66->pEquipment; do + { + if ( *(int *)v69 && (int)&v66->pInventoryItems[v69] == pValue ) { - if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 ) - { *(&v66->pEquipment.uOffHand + v68) = 0; ++curr_seq_num; v4 = v124; @@ -928,105 +928,143 @@ //v6 = v123; //v7 = ""; break; - } + } ++v68; v69 += 4; - } - while ( v68 < 16 ); - v125 = (signed int)&pPlayers[1]; + } + while ( v68 < 16 ); + pPlayer = pPlayers[1]; while ( 1 ) + { + v70 = pPlayer; + if ( !v64 ) { - v70 = *(Player **)v125; - if ( !v64 ) - { v71 = 0; v72 = (int)v70->pInventoryIndices; do + { + if ( (int)&v70->pInventoryItems[v72] == pValue ) { - if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 ) - { v70->RemoveItemAtInventoryIndex(v71); goto LABEL_169; - } + } ++v71; v72 += 4; - } - while ( (signed int)v71 < 126 ); + } + while ( (signed int)v71 < 126 ); v73 = 0; v74 = (int)&v70->pEquipment; - while ( !*(int *)v74 - || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 ) - { + while ( !*(int *)v74 || (int)&v70->pInventoryItems[v74] != pValue ) + { ++v73; v74 += 4; if ( v73 >= 16 ) goto LABEL_170; - } + } *(&v70->pEquipment.uOffHand + v73) = 0; LABEL_169: v64 = 1; - } + } LABEL_170: - v125 += 4; - if ( v125 > (signed int)&pPlayers[4] ) - { + pPlayer += 4; + if ( pPlayer > pPlayers[4] ) + { ++curr_seq_num; v4 = v124; //v6 = v123; //v7 = ""; break; - } } + } } v75 = player_choose; - if ( player_choose != 5 ) + if ( player_choose <= 3 ) + { + pPlayer = &pParty->pPlayers[v75]; + pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); + ++curr_seq_num; + //v4 = v124; + break; + } + else if ( player_choose == 4 ) //active + { + if ( uActiveCharacter ) { + pPlayer = pPlayers[uActiveCharacter]; + pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); + ++curr_seq_num; + v4 = v124; + break; + } + } + else if ( player_choose == 5 )//all + { + v130=0; + for(int i=0; i<4; ++i) + { + if ( pPlayers[i]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) ) + { + ++curr_seq_num; + break; + } + } + ++v130; + break; + } + else if ( player_choose == 6 ) //random + { + v75 = rand() % 4; + pPlayer = &pParty->pPlayers[v75]; + pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); + ++curr_seq_num; + v4 = v124; + break; + } +/* if ( player_choose != 5 ) + { if ( player_choose < 0 ) goto LABEL_183; - if ( player_choose > 3 ) + //if ( player_choose > 3 ) + //{ + if ( player_choose != 4 ) { - if ( player_choose != 4 ) - { if ( player_choose == 6 ) goto LABEL_180; LABEL_183: - ((Player *)v6)->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); + ((Player *)v6)->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); ++curr_seq_num; v4 = v124; //v6 = v123; //v7 = ""; break; - } + } if ( uActiveCharacter ) - { + { v6 = pPlayers[uActiveCharacter]; goto LABEL_182; - } + } LABEL_180: v75 = rand() % 4; - } + //} v6 = &pParty->pPlayers[v75]; LABEL_182: //v123 = v6; goto LABEL_183; - } - v76 = pParty->pPlayers; - v130 = 4; - do + } + v130=0; + for(int i=0; i<4; ++i) + { + if ( pPlayers[i]->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue) ) { - v76->SubtractVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v63); - ++v76; + ++curr_seq_num; + break; } - while ( (signed int)v76 < (signed int)pParty->pHirelings ); - ++curr_seq_num; - v4 = v124; - - //v6 = v123; - //v7 = ""; - break; + } + ++v130; + break;*/ case EVENT_Set: v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); v78 = player_choose; @@ -1078,8 +1116,8 @@ //v7 = ""; break; case EVENT_Add: - v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); - v81 = player_choose; + pValue = EVT_DWORD(_evt->v7); + //v81 = player_choose; if ( player_choose != 5 ) { if ( player_choose < 0 ) @@ -1091,7 +1129,7 @@ if ( player_choose == 6 ) goto LABEL_208; LABEL_211: - ((Player *)v6)->AddVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v80); + ((Player *)v6)->AddVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), pValue); goto LABEL_212; } if ( uActiveCharacter ) @@ -1100,31 +1138,23 @@ goto LABEL_210; } LABEL_208: - v81 = rand() % 4; + player_choose = rand() % 4; } - v6 = &pParty->pPlayers[v81]; + v6 = &pParty->pPlayers[player_choose]; LABEL_210: //v123 = v6; goto LABEL_211; } - v82 = pParty->pPlayers; - v130 = 4; - do - { - v82->AddVariable((enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)), v80); - ++v82; - } - while ( (signed int)v82 < (signed int)pParty->pHirelings ); + v130 = 0; + for(int i=1; i<5; ++i) + pPlayers[i]->AddVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); LABEL_212: - v83 = _evt->v5 + ((uint)_evt->v6 << 8); + v83 = EVT_WORD(_evt->v5); if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 ) viewparams->bRedrawGameUI = 1; ++curr_seq_num; v4 = v124; - - //v6 = v123; - //v7 = ""; break; case EVENT_InputString: if ( !start_event_seq_number ) @@ -1532,7 +1562,7 @@ //v7 = ""; break; case EVENT_SpeakInHouse: - if ( EnterHouse((enum HOUSE_ID)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) ) + if ( EnterHouse((enum HOUSE_ID)EVT_DWORD(_evt->v5))) { if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode ) pRenderer->_49FD3A(); @@ -1542,10 +1572,10 @@ if ( uCurrentHouse_Animation != 167 ) v104 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8); window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0); - window_SpeakInHouse->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - window_SpeakInHouse->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - window_SpeakInHouse->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - window_SpeakInHouse->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + window_SpeakInHouse->CreateButton( 61, 424, 31, 0, 2, 94, 0x6Eu, 1, 49, "", 0); + window_SpeakInHouse->CreateButton(177, 424, 31, 0, 2, 94, 0x6Eu, 2, 50, "", 0); + window_SpeakInHouse->CreateButton(292, 424, 31, 0, 2, 94, 0x6Eu, 3, 51, "", 0); + window_SpeakInHouse->CreateButton(407, 424, 31, 0, 2, 94, 0x6Eu, 4, 52, "", 0); window_SpeakInHouse->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); } ++curr_seq_num;
--- a/Events2D.h Fri Mar 01 18:37:54 2013 +0600 +++ b/Events2D.h Fri Mar 01 18:38:12 2013 +0600 @@ -1,12 +1,45 @@ #pragma once - +/* 296 */ +enum BildingType : unsigned short + { + BildingType_WeaponShop = 0x1, + BildingType_ArmorShop = 0x2, + BildingType_MagicShop = 0x3, + BildingType_AlchemistShop = 0x4, + BildingType_FireGuild = 0x5, + BildingType_AirGuild = 0x6, + BildingType_WaterGuild = 0x7, + BildingType_EarthGuild = 0x8, + BildingType_SpiritGuild = 0x9, + BildingType_MindGuild = 0xA, + BildingType_BodyGuild = 0xB, + BildingType_LightGuild = 0xC, + BildingType_DarkGuild = 0xD, + BildingType_14 = 0xE, + BildingType_15 = 0xF, + BildingType_16 = 0x10, + BildingType_TownHall = 0x11, + BildingType_18 = 0x12, + BildingType_19 = 0x13, + BildingType_Throne_Room = 0x14, + BildingType_Tavern = 0x15, + BildingType_Bank = 0x16, + BildingType_Temple = 0x17, + BildingType_Unic = 0x19, + BildingType_1A = 0x1A, + BildingType_Stables = 0x1B, + BildingType_Boats = 0x1C, + BildingType_House = 0x1D, + BildingType_Training = 0x1E, + BildingType_Jail = 0x1F, + }; /* 168 */ #pragma pack(push, 1) struct _2devent { - unsigned __int16 uType; + BildingType uType; unsigned __int16 uAnimationID; char *pName; const char *pProprieterName;
--- a/GUIWindow.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/GUIWindow.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -403,7 +403,7 @@ v1->pControlsTail = 0; v1->uNumControls = 0; v1->eWindowType = WINDOW_null; - v10 = v1->field_3C; + v10 = v1->numVisibleWindows; v11 = uNumVisibleWindows; while ( v10 < v11 ) { @@ -1146,9 +1146,7 @@ else { sprintfex( pTmpBuf, pGlobalTXT_LocalizationStrings[429], - //p2DEvents_minus1_::08[13 * (unsigned int)ptr_507BC0->ptr_1C], p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, - //p2DEvents_minus1__10[13 * (unsigned int)ptr_507BC0->ptr_1C]); p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); v18.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, v19, pTmpBuf, 3u); switch ( in_current_building_type ) @@ -1173,10 +1171,7 @@ case BildingType_MindGuild: case BildingType_BodyGuild: case BildingType_LightGuild: - case BildingType_Dark: - //case BildingType_14: - //case BildingType_15: - //case BildingType_16: + case BildingType_DarkGuild: GuildDialog(); break; case BildingType_18: @@ -1193,7 +1188,7 @@ BankDialog(); break; case BildingType_Temple: - TampleDialog(); + TempleDialog(); break; case BildingType_Stables: TravelByTransport(); @@ -1205,6 +1200,7 @@ JailDialog(); break; default: + __debugbreak;//New BildingType break; } } @@ -1783,9 +1779,9 @@ pWindow->uFrameHeight = uHeight; pWindow->eWindowType = eWindowType; pWindow->field_44 = 0; - uNumVisibleWindows = v10; - pWindow->field_3C = v10; - pVisibleWindowsIdxs[v10] = uNextFreeWindowID + 1; + ++uNumVisibleWindows; + pWindow->numVisibleWindows = uNumVisibleWindows; + pVisibleWindowsIdxs[uNumVisibleWindows] = uNextFreeWindowID + 1; if ( (signed int)eWindowType <= 20 ) { if (eWindowType != WINDOW_Chest) @@ -1800,7 +1796,7 @@ pCurrentScreen = SCREEN_NPC_DIALOGUE; pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); - if ( pWindow->ptr_1C != (void *)1 ) + if ( pWindow->par1C != 1 ) { num_menu_buttons = 0; v11 = LOBYTE(pFontArrus->uFontHeight) - 3;
--- a/GUIWindow.h Fri Mar 01 18:37:54 2013 +0600 +++ b/GUIWindow.h Fri Mar 01 18:38:12 2013 +0600 @@ -134,7 +134,10 @@ unsigned int uFrameZ; unsigned int uFrameW; WindowType eWindowType; + union{ void *ptr_1C; + unsigned int par1C; + }; unsigned int uNumControls; int field_24; int pNumPresenceButton; @@ -142,7 +145,7 @@ int field_30; int field_34; int pStartingPosActiveItem; - int field_3C; + int numVisibleWindows; int field_40; int field_44; char *Hint; @@ -156,39 +159,7 @@ -/* 296 */ -enum BildingType -{ - BildingType_WeaponShop = 0x1, - BildingType_ArmorShop = 0x2, - BildingType_MagicShop = 0x3, - BildingType_AlchemistShop = 0x4, - BildingType_FireGuild = 0x5, - BildingType_AirGuild = 0x6, - BildingType_WaterGuild = 0x7, - BildingType_EarthGuild = 0x8, - BildingType_SpiritGuild = 0x9, - BildingType_MindGuild = 0xA, - BildingType_BodyGuild = 0xB, - BildingType_LightGuild = 0xC, - BildingType_Dark = 0xD, - BildingType_14 = 0xE, - BildingType_15 = 0xF, - BildingType_16 = 0x10, - BildingType_TownHall = 0x11, - BildingType_18 = 0x12, - BildingType_19 = 0x13, - BildingType_20 = 0x14, - BildingType_Tavern = 0x15, - BildingType_Bank = 0x16, - BildingType_Temple = 0x17, - BildingType_1A = 0x1A, - BildingType_Stables = 0x1B, - BildingType_Boats = 0x1C, - BildingType_House = 0x1D, - BildingType_Training = 0x1E, - BildingType_Jail = 0x1F, -}; + enum UIMessageType { UIMSG_00 = 0x0,
--- a/Indoor.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/Indoor.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -316,9 +316,9 @@ pRenderer->DrawBillboardList_BLV(); if ( !pRenderer->pRenderD3D ) { - if ( pBLVRenderParams->uFlags & 2 ) - stru170_sub_4B0967(); - if ( pBLVRenderParams->uFlags & 1 ) + if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_D3D_OUTLINES) + pBspRenderer->DrawFaceOutlines(); + if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_SW_OUTLINES) { v1 = pBLVRenderParams->pRenderTarget; v6 = 0; @@ -1455,7 +1455,7 @@ sub_440639(v31 - 1); } } - if ( pBLVRenderParams->uFlags & 1 ) + if (pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_SW_OUTLINES) pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); } } @@ -1614,7 +1614,7 @@ } //----- (004B0967) -------------------------------------------------------- -void __cdecl stru170_sub_4B0967() +void BspRenderer::DrawFaceOutlines() { signed int i; // edi@1 int v1; // esi@2
--- a/Indoor_stuff.h Fri Mar 01 18:37:54 2013 +0600 +++ b/Indoor_stuff.h Fri Mar 01 18:38:12 2013 +0600 @@ -66,7 +66,7 @@ /* 163 */ #pragma pack(push, 1) -struct BspRenderer +struct BspRenderer // stru170 { //----- (0043F282) -------------------------------------------------------- inline BspRenderer() @@ -82,6 +82,7 @@ void PrepareFaceRenderList_sw(int a2, unsigned int uFaceID); void PrepareFaceRenderList_d3d(signed int a2, unsigned int uFaceID); void MakeVisibleSectorList(); + void DrawFaceOutlines(); unsigned int uNumFaceIDs; __int16 pFaceIDs[150];
--- a/Items.h Fri Mar 01 18:37:54 2013 +0600 +++ b/Items.h Fri Mar 01 18:38:12 2013 +0600 @@ -42,8 +42,8 @@ ITEM_BUCKLER_1 = 0x54, ITEM_GAUNTLETS_1 = 0x6E, ITEM_BOOTS_1 = 0x73, - ITEM_WAND_FIRE = 0x87, - ITEM_WAND_STUN = 0x8A, + ITEM_WAND_FIRE = 135, + ITEM_WAND_STUN = 138, ITEM_WAND_INCENERATION = 0x9F, ITEM_TROLL_BLOOD = 0xCA, ITEM_DRAGON_EYE = 0xCC,
--- a/Party.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/Party.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -770,6 +770,7 @@ _449B7E_toggle_bit(_quest_bits, 5, 1); _449B7E_toggle_bit(_quest_bits, 6, 1); + memset(field_3C._shop_ban_times,0,53*sizeof(__int64)); memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu); memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
--- a/Party.h Fri Mar 01 18:37:54 2013 +0600 +++ b/Party.h Fri Mar 01 18:38:12 2013 +0600 @@ -28,26 +28,26 @@ /* 347 */ enum PARTY_BUFF_INDEX { - PARTY_BUFF_RESIST_AIR = 0x0, - PARTY_BUFF_RESIST_BODY = 0x1, - PARTY_BUFF_DAY_OF_GODS = 0x2, - PARTY_BUFF_DETECT_LIFE = 0x3, - PARTY_BUFF_RESIST_EARTH = 0x4, - PARTY_BUFF_FEATHER_FALL = 0x5, - PARTY_BUFF_RESIST_FIRE = 0x6, - PARTY_BUFF_FLY = 0x7, - PARTY_BUFF_HASTE = 0x8, - PARTY_BUFF_HEROISM = 0x9, - PARTY_BUFF_IMMOLATION = 0xA, + PARTY_BUFF_RESIST_AIR = 0, + PARTY_BUFF_RESIST_BODY = 1, + PARTY_BUFF_DAY_OF_GODS = 2, + PARTY_BUFF_DETECT_LIFE = 3, + PARTY_BUFF_RESIST_EARTH = 4, + PARTY_BUFF_FEATHER_FALL = 5, + PARTY_BUFF_RESIST_FIRE = 6, + PARTY_BUFF_FLY = 7, + PARTY_BUFF_HASTE = 8, + PARTY_BUFF_HEROISM = 9, + PARTY_BUFF_IMMOLATION = 10, PARTY_BUFF_INVISIBILITY = 11, - PARTY_BUFF_RESIST_MIND = 0xC, - PARTY_BUFF_PROTECTION_FROM_MAGIC = 0xD, - PARTY_BUFF_SHIELD = 0xE, - PARTY_BUFF_STONE_SKIN = 0xF, - PARTY_BUFF_TORCHLIGHT = 0x10, - PARTY_BUFF_RESIST_WATER = 0x11, - PARTY_BUFF_WATER_WALK = 0x12, - PARTY_BUFF_WIZARD_EYE = 0x13, + PARTY_BUFF_RESIST_MIND = 12, + PARTY_BUFF_PROTECTION_FROM_MAGIC = 13, + PARTY_BUFF_SHIELD = 14, + PARTY_BUFF_STONE_SKIN = 15, + PARTY_BUFF_TORCHLIGHT = 16, + PARTY_BUFF_RESIST_WATER = 17, + PARTY_BUFF_WATER_WALK = 18, + PARTY_BUFF_WIZARD_EYE = 19, }; @@ -258,8 +258,8 @@ char uNumArenaSquireWins; char uNumArenaKnightWins; char uNumArenaLordWins; - char pIsArtifactFound[68]; //7ba - //char pArtifactsFound[56]; + char pIsArtifactFound[29]; //7ba + char field_7d7[39]; unsigned char _autonote_bits[12]; char field_80A[74]; char field_854[32]; @@ -276,10 +276,11 @@ unsigned int uFlags; ItemGen StandartItemsInShops[53][12]; ItemGen SpecialItemsInShops[53][12]; //D0EC - int field_12A5C[2117]; - char field_14B70[5000]; - char field_15EF8[250]; - char field_15FF2[130]; + ItemGen SpellBooksInGuilds[32][12]; + //int field_12A5C[2117]; + // char field_14B70[5000]; + //char field_15EF8[250]; + //char field_15FF2[130]; char pHireling1Name[100]; char pHireling2Name[100]; int armageddon_timer;
--- a/Player.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/Player.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -189,21 +189,14 @@ //----- (00427730) -------------------------------------------------------- bool Player::CanCastSpell(unsigned int uRequiredMana) { - int v2; // eax@1 - bool result; // eax@2 - - v2 = this->sMana; - if ( v2 >= (signed int)uRequiredMana ) - { - this->sMana = v2 - uRequiredMana; - result = 1; - } - else - { - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - result = 0; - } - return result; + if (sMana >= uRequiredMana) + { + sMana -= uRequiredMana; + return true; + } + + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); + return false; } @@ -1751,7 +1744,6 @@ unsigned int uSlota; // [sp+14h] [bp+4h]@1 pIndices = &this->pInventoryIndices[uSlot]; - v3 = &this->pInventoryItems[*pIndices-1]; v4 = v3->uItemID; v3->Reset(); @@ -4150,7 +4142,7 @@ v9 = *(int *)v8; v3 = (char *)&pItemsTable->pItems[v9].pIconName; if ( v3[28] == 12 ) - v10 = *(&pSpellDatas[0].field_A + 10 * *((int *)&pSpellDatas[66].field_8 + v9)); + v10 = *(&pSpellDatas[0].uExpertLevelRecovery + 10 * *((int *)&pSpellDatas[66].uNormalLevelRecovery + v9)); else v10 = (unsigned __int16)word_4EDED8[(unsigned __int8)v3[29]]; v47 = v10; @@ -6498,7 +6490,11 @@ switch (i) { - case PLAYER_SKILL_FIRE: spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; break; + case PLAYER_SKILL_FIRE: spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[1] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[2] = true; + spellbook.pFireSpellbook.bIsSpellAvailable[3] = true; + break; case PLAYER_SKILL_AIR: spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_WATER: spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; break; case PLAYER_SKILL_EARTH: spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; break; @@ -8201,9 +8197,9 @@ //----- (0044A5CB) -------------------------------------------------------- -void Player::SetVariable(enum VariableType var, signed int a3) -{ - signed int v3; // ebx@1 +void Player::SetVariable(enum VariableType var_type, signed int var_value) +{ + signed int currPlayerId; // ebx@1 Player *v4; // esi@1 unsigned int v5; // edi@1 unsigned int v6; // esi@13 @@ -8233,125 +8229,114 @@ char v30; // [sp+32h] [bp-2h]@1 char v31; // [sp+33h] [bp-1h]@1 - v3 = 0; + currPlayerId = 0; v30 = 0; v31 = 0; v4 = this; v5 = 0; if ( this == pPlayers[2] ) - { - v3 = 1; - goto LABEL_8; - } - if ( this == pPlayers[3] ) - { - v27 = 2; - } - else - { - if ( this != pPlayers[4] ) - goto LABEL_8; - v27 = 3; - } - v3 = v27; -LABEL_8: - if ( var > VAR_AutoNotes ) - { - if ( var <= VAR_GoldInBank ) - { - if ( var == VAR_GoldInBank ) - { - pParty->uNumGoldInBank = a3; + currPlayerId = 1; + else if ( this == pPlayers[3] ) + currPlayerId = 2; + else if ( this == pPlayers[4] ); + currPlayerId = 3; + if ( var_type > VAR_AutoNotes ) + { + if ( var_type <= VAR_GoldInBank ) + { + if ( var_type == VAR_GoldInBank ) + { + pParty->uNumGoldInBank = var_value; return; } - if ( var <= VAR_Counter8 ) - { - if ( (signed int)var >= 0xF5 ) + if ( var_type <= VAR_Counter8 ) + { + if ( (signed int)var_type >= 0xF5 ) { - *(int *)&stru_AA1058[3].pSounds[8 * var + 44300] = LODWORD(pParty->uTimePlayed); - *(int *)&stru_AA1058[3].pSounds[8 * var + 44304] = HIDWORD(pParty->uTimePlayed); + *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); + *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); } else { - switch ( var ) + switch ( var_type ) { case VAR_MonthEquals|VAR_CurrentSP: - _449B7E_toggle_bit((unsigned char *)field_1A50, a3, 1u); + _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u); break; case VAR_NPCs2: pParty->field_709 = 0; - LOBYTE(pNPCStats->pNewNPCData[a3].uFlags) |= 0x80u; + LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; sub_44A56A(); viewparams->bRedrawGameUI = 1; break; case VAR_NumSkillPoints: - this->uSkillPoints = a3; + this->uSkillPoints = var_value; break; } } return; } - if ( var < VAR_Counter9 ) + if ( var_type < VAR_Counter9 ) return; - if ( (signed int)var <= 0x112 ) - { - *(int *)&stru_AA1058[3].pSounds[8 * var + 44532] = LODWORD(pParty->uTimePlayed); - *(int *)&stru_AA1058[3].pSounds[8 * var + 44536] = HIDWORD(pParty->uTimePlayed); + if ( (signed int)var_type <= 0x112 ) + { + *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); + *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); } else { - if ( var == VAR_ReputationInCurrentLocation ) + if ( var_type == VAR_ReputationInCurrentLocation ) { v24 = &pOutdoor->ddm; if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) v24 = &pIndoor->dlv; - v24->uReputation = a3; - if ( a3 > 10000 ) + v24->uReputation = var_value; + if ( var_value > 10000 ) v24->uReputation = 10000; return; } - if ( var <= VAR_ReputationInCurrentLocation - || var > VAR_History_28 - || (v22 = var - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22]) - || (pParty->field_3C.field_4F0[2 * (var - 276)] = LODWORD(pParty->uTimePlayed), + if ( var_type <= VAR_ReputationInCurrentLocation + || var_type > VAR_History_28 + || (v22 = var_type - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22]) + || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), v23 = pStorylineText->StoreLine[v22].pText==0,//*(&pStorylineText->field_0 + 3 * v22) == 0, - pParty->field_3C.field_4F0[2 * (var - 276) + 1] = HIDWORD(pParty->uTimePlayed), + pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), v23) ) return; bFlashHistoryBook = 1; } LABEL_172: - v25 = 8 * v3 + 400; - LOBYTE(v25) = (8 * v3 - 112) | 4; + v25 = 8 * currPlayerId + 400; + LOBYTE(v25) = (8 * currPlayerId - 112) | 4; pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5); return; } - if ( var != 307 ) - { - switch ( var ) + if ( var_type != 307 ) + { + switch ( var_type ) { case 308: - pParty->uNumBountiesCollected = a3; + pParty->uNumBountiesCollected = var_value; break; case 309: - pParty->uNumPrisonTerms = a3; + pParty->uNumPrisonTerms = var_value; break; case 310: - pParty->uNumArenaPageWins = a3; + pParty->uNumArenaPageWins = var_value; break; case 311: - pParty->uNumArenaSquireWins = a3; + pParty->uNumArenaSquireWins = var_value; break; case 312: - pParty->uNumArenaKnightWins = a3; + pParty->uNumArenaKnightWins = var_value; break; case 313: - pParty->uNumArenaLordWins = a3; + pParty->uNumArenaLordWins = var_value; break; } return; } - pParty->uNumDeaths = a3; + pParty->uNumDeaths = var_value; LABEL_168: if ( v30 != 1 ) { @@ -8362,101 +8347,101 @@ goto LABEL_172; } LABEL_169: - pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, v3); + pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); goto LABEL_170; } - if ( var == VAR_AutoNotes ) - { - if ( !((unsigned __int8)(0x80u >> ((signed __int16)a3 - 1) % 8) & pParty->_autonote_bits[((signed __int16)a3 - 1) >> 3]) + if ( var_type == VAR_AutoNotes ) + { + if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_autonote_bits[((signed __int16)var_value - 1) >> 3]) //&& (&dword_723718_autonote_related)[8 * a3] ) - && pAutonoteTxt[a3-1].pText ) - { - v20 = pPlayers[v3 + 1]; + && pAutonoteTxt[var_value-1].pText ) + { + v20 = pPlayers[currPlayerId + 1]; v30 = 1; v20->PlaySound(SPEECH_96, 0); - v21 = pAutonoteTxt[a3-1].eType;// dword_72371C[2 * a3]; + v21 = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3]; bFlashAutonotesBook = 1; dword_506568 = v21; } - _449B7E_toggle_bit(pParty->_autonote_bits, a3, 1u); + _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u); v31 = 1; goto LABEL_168; } - if ( var <= VAR_ActualMight ) - { - if ( var != VAR_ActualMight ) - { - switch ( var ) + if ( var_type <= VAR_ActualMight ) + { + if ( var_type != VAR_ActualMight ) + { + switch ( var_type ) { case VAR_RandomGold: - v6 = rand() % a3 + 1; + v6 = rand() % var_value + 1; Party::SetGold(v6); sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold ShowStatusBarString(pTmpBuf, 2u); GameUI_DrawFoodAndGold(); return; case VAR_RandomFood: - v7 = rand() % a3 + 1; + v7 = rand() % var_value + 1; Party::SetFood(v7); sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food ShowStatusBarString(pTmpBuf, 2u); GameUI_DrawFoodAndGold(); goto LABEL_124; case VAR_Sex: - this->uSex = (PLAYER_SEX)a3; + this->uSex = (PLAYER_SEX)var_value; goto LABEL_124; case VAR_Class: - this->classType = (PLAYER_CLASS_TYPE)a3; - if ( (char)a3 != 35 ) + this->classType = (PLAYER_CLASS_TYPE)var_value; + if ( (char)var_value != 35 ) goto LABEL_124; v8 = 0; v9 = this->pInventoryItems; break; case VAR_CurrentHP: - this->sHealth = a3; + this->sHealth = var_value; goto LABEL_124; case VAR_MaxHP: this->sHealth = GetMaxHealth(); return; case VAR_CurrentSP: - this->sMana = a3; + this->sMana = var_value; goto LABEL_124; case VAR_MaxSP: this->sMana = GetMaxMana(); return; case VAR_ACModifier: - this->sACModifier = (unsigned __int8)a3; + this->sACModifier = (unsigned __int8)var_value; goto LABEL_124; case VAR_BaseLevel: - this->uLevel = (unsigned __int8)a3; + this->uLevel = (unsigned __int8)var_value; goto LABEL_124; case VAR_LevelModifier: - this->sLevelModifier = (unsigned __int8)a3; + this->sLevelModifier = (unsigned __int8)var_value; goto LABEL_124; case VAR_Age: - this->sAgeModifier = a3; + this->sAgeModifier = var_value; return; case VAR_Award: - if ( !((unsigned __int8)(0x80u >> ((signed __int16)a3 - 1) % 8) & pPlayers[v3 + 1]->_guilds_member_bits[((signed __int16)a3 - 1) >> 3]) + if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & + pPlayers[currPlayerId + 1]->_guilds_member_bits[((signed __int16)var_value - 1)/ 8]) //&& dword_723E80_award_related[2 * a3] ) - && pAwards[a3-1].pText ) + && pAwards[var_value].pText ) { - v12 = pPlayers[v3 + 1]; v30 = 1; v31 = 1; - v12->PlaySound(SPEECH_96, 0); + pPlayers[currPlayerId + 1]->PlaySound(SPEECH_96, 0); } - v13 = v4->_guilds_member_bits; - goto LABEL_51; + _449B7E_toggle_bit((unsigned char *)v4->_guilds_member_bits, var_value, 1u); + goto LABEL_168; case VAR_Experience: - this->uExperience = a3; + this->uExperience = var_value; goto LABEL_124; case VAR_QBits_QuestsDone: - if ( !((unsigned __int8)(0x80u >> ((signed __int16)a3 - 1) % 8) & pParty->_quest_bits[((signed __int16)a3 - 1) >> 3]) + if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) // && (&dword_722F10)[4 * a3] ) - && pQuestTable[a3-1] ) + && pQuestTable[var_value-1] ) { - v14 = pPlayers[v3 + 1]; + v14 = pPlayers[currPlayerId + 1]; bFlashQuestBook = 1; v30 = 1; v31 = 1; @@ -8464,43 +8449,52 @@ } v13 = (char *)pParty->_quest_bits; LABEL_51: - _449B7E_toggle_bit((unsigned char *)v13, a3, 1u); - goto LABEL_168; + _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u); + if (( v30 != 1 )&&( v31 != 1 )) + return; + else + pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); + if ( v31 != 1 ) + return; + v25 = 8 * currPlayerId + 400; + LOBYTE(v25) = (8 * currPlayerId - 112) | 4; + pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); + return; case VAR_PlayerItemInHands: item.Reset(); item.Reset(); - item.uItemID = a3; + item.uItemID = var_value; item.uAttributes = 1; pParty->SetHoldingItem(&item); - if ( a3 >= ITEM_ARTIFACT_PUCK && a3 <= ITEM_RELIC_MEKORIGS_HAMMER ) - pParty->pIsArtifactFound[a3-500] = 1; + if ( var_value >= ITEM_ARTIFACT_PUCK && var_value <= ITEM_RELIC_MEKORIGS_HAMMER ) + pParty->pIsArtifactFound[var_value-500] = 1; return; case VAR_FixedGold: - Party::SetGold(a3); + Party::SetGold(var_value); return; case VAR_BaseMight: - this->uMight = (unsigned __int8)a3; + this->uMight = (unsigned __int8)var_value; goto LABEL_84; case VAR_BaseIntellect: - this->uIntelligence = (unsigned __int8)a3; + this->uIntelligence = (unsigned __int8)var_value; goto LABEL_84; case VAR_BasePersonality: - this->uWillpower = (unsigned __int8)a3; + this->uWillpower = (unsigned __int8)var_value; goto LABEL_84; case VAR_BaseEndurance: - this->uEndurance = (unsigned __int8)a3; + this->uEndurance = (unsigned __int8)var_value; goto LABEL_84; case VAR_BaseSpeed: - this->uSpeed = (unsigned __int8)a3; + this->uSpeed = (unsigned __int8)var_value; goto LABEL_84; case VAR_BaseAccuracy: - this->uAccuracy = (unsigned __int8)a3; + this->uAccuracy = (unsigned __int8)var_value; goto LABEL_84; case VAR_BaseLuck: - this->uLuck = (unsigned __int8)a3; + this->uLuck = (unsigned __int8)var_value; goto LABEL_84; case VAR_FixedFood: - Party::SetFood(a3); + Party::SetFood(var_value); goto LABEL_124; case VAR_MightBonus: goto LABEL_64; @@ -8528,7 +8522,7 @@ } v10 = (int)((char *)v4 + 36 * v8); *(int *)(v10 + 532) = 601; - *(char *)(v10 + 558) = v3 + 1; + *(char *)(v10 + 558) = currPlayerId + 1; LABEL_22: if ( v4->sResFireBase < 20 ) v4->sResFireBase = 20; @@ -8553,82 +8547,82 @@ v4->uFace = 20; v4->uVoiceID = 20; } - ReloadPlayerPortraits(v3, v4->uFace); + ReloadPlayerPortraits(currPlayerId, v4->uFace); goto LABEL_124; } LABEL_64: - this->uMightBonus = (unsigned __int8)a3; + this->uMightBonus = (unsigned __int8)var_value; LABEL_111: v28 = 0; v26 = SPEECH_91; LABEL_112: - v19 = pPlayers[v3 + 1]; + v19 = pPlayers[currPlayerId + 1]; v31 = 1; v19->PlaySound((PlayerSpeech)v26, v28); goto LABEL_169; } - if ( var <= VAR_FireResistanceBonus ) - { - if ( var == VAR_FireResistanceBonus ) - { - this->sResFireBonus = (unsigned __int8)a3; + if ( var_type <= VAR_FireResistanceBonus ) + { + if ( var_type == VAR_FireResistanceBonus ) + { + this->sResFireBonus = (unsigned __int8)var_value; goto LABEL_111; } - switch ( var ) + switch ( var_type ) { case VAR_ActualIntellect: LABEL_68: - this->uIntelligenceBonus = (unsigned __int8)a3; + this->uIntelligenceBonus = (unsigned __int8)var_value; goto LABEL_111; case VAR_ActualPersonality: LABEL_69: - this->uWillpowerBonus = (unsigned __int8)a3; + this->uWillpowerBonus = (unsigned __int8)var_value; goto LABEL_111; case VAR_ActualEndurance: LABEL_70: - this->uEnduranceBonus = (unsigned __int8)a3; + this->uEnduranceBonus = (unsigned __int8)var_value; goto LABEL_111; case VAR_ActualSpeed: LABEL_71: - this->uSpeedBonus = (unsigned __int8)a3; + this->uSpeedBonus = (unsigned __int8)var_value; goto LABEL_111; case VAR_ActualAccuracy: LABEL_72: - this->uAccuracyBonus = (unsigned __int8)a3; + this->uAccuracyBonus = (unsigned __int8)var_value; goto LABEL_111; case VAR_ActualLuck: LABEL_73: - this->uLuckBonus = (unsigned __int8)a3; + this->uLuckBonus = (unsigned __int8)var_value; goto LABEL_111; case VAR_FireResistance: - this->sResFireBase = (unsigned __int8)a3; + this->sResFireBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_AirResistance: - this->sResAirBase = (unsigned __int8)a3; + this->sResAirBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_WaterResistance: - this->sResWaterBase = (unsigned __int8)a3; + this->sResWaterBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_EarthResistance: - this->sResEarthBase = (unsigned __int8)a3; + this->sResEarthBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_SpiritResistance: - this->sResSpiritBase = (unsigned __int8)a3; + this->sResSpiritBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_MindResistance: - this->sResMindBase = (unsigned __int8)a3; + this->sResMindBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_BodyResistance: - this->sResBodyBase = (unsigned __int8)a3; + this->sResBodyBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_LightResistance: - this->sResLightBase = (unsigned __int8)a3; + this->sResLightBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_DarkResistance: - this->sResDarkBase = (unsigned __int8)a3; + this->sResDarkBase = (unsigned __int8)var_value; goto LABEL_84; case VAR_MagicResistance: - this->sResMagicBase = (unsigned __int8)a3; + this->sResMagicBase = (unsigned __int8)var_value; LABEL_84: v28 = 0; v26 = 92; @@ -8639,22 +8633,22 @@ return; } HIWORD(v15) = 0; - if ( var > VAR_DisarmTrapSkill ) - { - if ( var != VAR_LearningSkill ) - { - if ( var <= VAR_LearningSkill ) + if ( var_type > VAR_DisarmTrapSkill ) + { + if ( var_type != VAR_LearningSkill ) + { + if ( var_type <= VAR_LearningSkill ) return; - if ( var <= VAR_Eradicated ) - { - v4->SetCondition(var - 105, 1); + if ( var_type <= VAR_Eradicated ) + { + v4->SetCondition(var_type - 105, 1); } else { - if ( var != VAR_MajorCondition ) + if ( var_type != VAR_MajorCondition ) { - if ( var > VAR_MajorCondition && var <= VAR_ActiveSpells ) - byte_5E4C15[var] = a3; + if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) + byte_5E4C15[var_type] = var_value; return; } memset(v4, 0, 0xA0u); @@ -8664,66 +8658,85 @@ goto LABEL_169; } LABEL_106: - v16 = (int)((char *)&v4->pConditions[16] + 2 * var); + v16 = (int)((char *)&v4->pConditions[16] + 2 * var_type); v17 = *(char *)v16; - if ( a3 <= VAR_BodyResistanceBonus ) - { - LOWORD(v15) = (unsigned __int8)a3; + if ( var_value <= VAR_BodyResistanceBonus ) + { + LOWORD(v15) = (unsigned __int8)var_value; v18 = v15 | v17 & VAR_BodyResistanceBonus; } else { - LOWORD(v18) = (unsigned __int8)(a3 | v17 & 0xC0); + LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0); } *(short *)v16 = v18; goto LABEL_124; } - if ( var == VAR_DisarmTrapSkill ) - goto LABEL_106; - if ( var <= VAR_BodyResistanceBonus ) - { - switch ( var ) + if ( var_type == VAR_DisarmTrapSkill ) + if ( v30 != 1 ) + { + if ( v31 != 1 ) + return; + v5 = 0; + goto LABEL_172; + } + pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); + goto LABEL_170; + if ( var_type <= VAR_BodyResistanceBonus ) + { + switch ( var_type ) { case VAR_BodyResistanceBonus: - v4->sResBodyBonus = (unsigned __int8)a3; + v4->sResBodyBonus = (unsigned __int8)var_value; break; case VAR_AirResistanceBonus: - v4->sResAirBonus = (unsigned __int8)a3; + v4->sResAirBonus = (unsigned __int8)var_value; break; case VAR_WaterResistanceBonus: - v4->sResWaterBonus = (unsigned __int8)a3; + v4->sResWaterBonus = (unsigned __int8)var_value; break; case VAR_EarthResistanceBonus: - v4->sResEarthBonus = (unsigned __int8)a3; + v4->sResEarthBonus = (unsigned __int8)var_value; break; case VAR_SpiritResistanceBonus: - v4->sResSpiritBonus = (unsigned __int8)a3; + v4->sResSpiritBonus = (unsigned __int8)var_value; break; default: - if ( var != 62 ) + if ( var_type != 62 ) return; - v4->sResMindBonus = (unsigned __int8)a3; + v4->sResMindBonus = (unsigned __int8)var_value; break; } goto LABEL_111; } - if ( var == VAR_LightResistanceBonus ) - { - v4->sResLightBonus = (unsigned __int8)a3; + if ( var_type == VAR_LightResistanceBonus ) + { + v4->sResLightBonus = (unsigned __int8)var_value; goto LABEL_111; } - if ( var == VAR_DarkResistanceBonus ) - { - v4->sResDarkBonus = (unsigned __int8)a3; + if ( var_type == VAR_DarkResistanceBonus ) + { + v4->sResDarkBonus = (unsigned __int8)var_value; + goto LABEL_111; + } + if ( var_type == VAR_MagicResistanceBonus ) + { + v4->sResMagicBonus = (unsigned __int8)var_value; goto LABEL_111; } - if ( var == VAR_MagicResistanceBonus ) - { - v4->sResMagicBonus = (unsigned __int8)a3; - goto LABEL_111; - } - if ( var > VAR_MagicResistanceBonus && var <= VAR_DiplomacySkill ) - goto LABEL_106; + if ( var_type > VAR_MagicResistanceBonus && var_type <= VAR_DiplomacySkill ) + if ( v30 != 1 ) + { + if ( v31 != 1 ) + return; + v5 = 0; + v25 = 8 * currPlayerId + 400; + LOBYTE(v25) = (8 * currPlayerId - 112) | 4; + pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); + return; + } + pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); + goto LABEL_170; } @@ -8858,7 +8871,7 @@ v33 = 0x80u >> ((signed __int16)val - 1) % 8; if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & v13->_guilds_member_bits[((signed __int16)val - 1) >> 3]) //&& dword_723E80_award_related[2 * val] ) - && pAwards[val-1].pText ) + && pAwards[val].pText ) { v14 = pPlayers[uPlayerIdx + 1]; v34 = 1; @@ -8879,11 +8892,11 @@ //&& (&dword_722F10)[4 * val] ) && pQuestTable[val-1] ) { - v17 = pPlayers[uPlayerIdx + 1]; + //v17 = pPlayers[uPlayerIdx + 1]; bFlashQuestBook = 1; v34 = 1; v3 = 1; - v17->PlaySound(SPEECH_93, 0); + pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_93, 0); } v15 = (char *)pParty->_quest_bits; LABEL_44: @@ -9265,11 +9278,11 @@ //----- (0044B9C4) -------------------------------------------------------- -void Player::SubtractVariable(enum VariableType var, void *a3) +bool Player::SubtractVariable(enum VariableType VarNum, signed int pValue) { unsigned int v3; // ebx@1 signed int v4; // esi@1 - enum VariableType v5; // eax@8 + bool result; // eax@8 int v6; // esi@11 int v7; // edi@14 signed int v8; // eax@17 @@ -9279,10 +9292,10 @@ char *v12; // ecx@27 __int64 v13; // qax@27 unsigned __int8 v14; // cf@27 - char *v15; // edx@29 + int *v15; // edx@29 char *v16; // eax@90 char *v17; // ecx@94 - void *v18; // esi@97 + int v18; // esi@97 signed int v19; // edx@97 char *v20; // ecx@98 int v21; // eax@100 @@ -9310,52 +9323,53 @@ } v4 = v24; LABEL_8: - v5 = var; - if ( (signed int)var > 222 ) - { - if ( (signed int)var <= 307 ) - { - if ( var == 307 ) - { - pParty->uNumDeaths -= (unsigned int)a3; - return; - } - if ( var == 223 ) + result = false; + if ( (signed int)VarNum > 222 ) + { + if ( (signed int)VarNum <= 307 ) + { + if ( VarNum == 307 ) + { + pParty->uNumDeaths -= (unsigned int)pValue; + return pValue; + } + if ( VarNum == 223 ) { v11 = (char *)pParty->_autonote_bits; - v22 = (short)a3 - 1; + v22 = (short)pValue - 1; } else { - if ( var != 231 ) + if ( VarNum != 231 ) { - switch ( var ) + switch ( VarNum ) { case 232: - var = (VariableType)0; - GetNewNPCData(uDialogue_SpeakingActorNPC_ID, (int)&var); - dword_5B65CC = 0; - if ( (void *)var == a3 ) + VarNum = (VariableType)0; + GetNewNPCData(uDialogue_SpeakingActorNPC_ID, (int)&VarNum); + result = (bool) pValue; + dword_5B65CC = 0; + if ( (int)VarNum == pValue ) { - dword_5B65CC = (int)a3; + dword_5B65CC = (int)pValue; } else { pParty->field_709 = 0; - LOBYTE(pNPCStats->pNewNPCData[(int)a3].uFlags) &= 0x7Fu; + LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; sub_44A56A(); viewparams->bRedrawGameUI = 1; } break; case 241: - v18 = a3; + v18 = pValue; v19 = 0; if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) { v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags; do { - if ( *((void **)v20 + 4) == v18 ) + if ( *((void **)v20 + 4) == (void *)v18 ) { v21 = *(int *)v20; if ( (char)*(int *)v20 < 0 ) @@ -9369,17 +9383,21 @@ } while ( v19 < (signed int)pNPCStats->uNumNewNPCs ); } - if ( (void *)pParty->pHirelings[0].uProfession == v18 ) + if ( pParty->pHirelings[0].uProfession == v18 ) memset(pParty->pHirelings, 0, 0x4Cu); - if ( (void *)pParty->pHirelings[1].uProfession == v18 ) + if ( pParty->pHirelings[1].uProfession == v18 ) memset(&pParty->pHirelings[1], 0, 0x4Cu); pParty->field_709 = 0; sub_44A56A(); break; case 243: v17 = (char *)&this->uSkillPoints; - if ( (unsigned int)a3 <= *(int *)v17 ) - *(int *)v17 -= (int)a3; + result = *v17; + if ( (unsigned int)pValue <= *(int *)v17 ) + { + *(int *)v17 -= (int)pValue; + result = v17; + } else *(int *)v17 = 0; break; @@ -9387,70 +9405,80 @@ v16 = (char *)&pOutdoor->ddm; if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) v16 = (char *)&pIndoor->dlv; - *((int *)v16 + 2) -= (int)a3; + *((int *)v16 + 2) -= (int)pValue; if ( *((int *)v16 + 2) < -10000 ) *((int *)v16 + 2) = -10000; break; case 306: - if ( (unsigned int)a3 <= pParty->uNumGoldInBank ) - pParty->uNumGoldInBank -= (unsigned int)a3; + result = VarNum - 306; + if ( (unsigned int)pValue <= pParty->uNumGoldInBank ) + { + result = (bool)pValue; + pParty->uNumGoldInBank -= (unsigned int)pValue; + } else LABEL_88: dword_5B65C4 = 1; break; } - return; + return result; } v11 = this->field_1A50; LABEL_112: - v22 = (signed __int16)a3; + v22 = (signed __int16)pValue; } _449B7E_toggle_bit((unsigned char *)v11, v22, 0); - return; - } - switch ( var ) + return result; + } + switch ( VarNum ) { case 308: - pParty->uNumBountiesCollected -= (unsigned int)a3; + result = (bool)pValue; + pParty->uNumBountiesCollected -= (unsigned int)pValue; break; case 309: - pParty->uNumPrisonTerms -= (int)a3; + result = (bool)pValue; + pParty->uNumPrisonTerms -= (int)pValue; break; case 310: - pParty->uNumArenaPageWins -= (char)a3; + result = (bool)pValue; + pParty->uNumArenaPageWins -= (char)pValue; break; case 311: - pParty->uNumArenaSquireWins -= (char)a3; + result = (bool)pValue; + pParty->uNumArenaSquireWins -= (char)pValue; break; case 312: - pParty->uNumArenaKnightWins -= (char)a3; + result = (bool)pValue; + pParty->uNumArenaKnightWins -= (char)pValue; break; case 313: - pParty->uNumArenaLordWins -= (char)a3; + result = (bool)pValue; + pParty->uNumArenaLordWins -= (char)pValue; break; } } else { - if ( (signed int)var >= 123 ) - { - byte_5E4C15[var] -= (char)a3; + if ( (signed int)VarNum >= 123 ) + { + byte_5E4C15[VarNum] -= (char)pValue; } else { - switch ( var ) + switch ( VarNum ) { case VAR_RandomGold: - v6 = rand() % (signed int)a3 + 1; + v6 = rand() % (signed int)pValue + 1; if ( v6 > pParty->uNumGold ) v6 = pParty->uNumGold; Party::TakeGold(v6); sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[503], v6); ShowStatusBarString(pTmpBuf, 2u); GameUI_DrawFoodAndGold(); - return; + return result; case VAR_RandomFood: - v7 = rand() % (signed int)a3 + 1; + v7 = rand() % (signed int)pValue + 1; if ( v7 > pParty->uNumFoodRations ) v7 = pParty->uNumFoodRations; Party::TakeFood(v7); @@ -9459,162 +9487,162 @@ GameUI_DrawFoodAndGold(); goto LABEL_17; default: - return; + return result; case VAR_CurrentHP: - ReceiveDamage((signed int)a3, 4); + ReceiveDamage((signed int)pValue, 4); goto LABEL_17; case VAR_CurrentSP: v9 = (char *)&this->sMana; - v10 = this->sMana - (signed int)a3 < 0; - *(int *)v9 -= (int)a3; + v10 = this->sMana - (signed int)pValue < 0; + *(int *)v9 -= (int)pValue; if ( v10 ) *(int *)v9 = 0; goto LABEL_17; case VAR_ACModifier: - this->sACModifier -= (unsigned __int8)a3; + this->sACModifier -= (unsigned __int8)pValue; goto LABEL_17; case VAR_BaseLevel: - this->uLevel -= (unsigned __int8)a3; + this->uLevel -= (unsigned __int8)pValue; goto LABEL_17; case VAR_LevelModifier: - this->sLevelModifier -= (unsigned __int8)a3; + this->sLevelModifier -= (unsigned __int8)pValue; goto LABEL_17; case VAR_Age: - this->sAgeModifier -= (signed __int16)a3; - return; + this->sAgeModifier -= (signed __int16)pValue; + return result; case VAR_Award: v11 = this->_guilds_member_bits; goto LABEL_112; case VAR_Experience: v12 = (char *)&this->uExperience; - v13 = (signed int)a3; - v14 = *(int *)v12 < (unsigned int)a3; - *(int *)v12 -= (int)a3; + v13 = (signed int)pValue; + v14 = *(int *)v12 < (unsigned int)pValue; + *(int *)v12 -= (int)pValue; *((int *)v12 + 1) -= v14 + HIDWORD(v13); goto LABEL_17; case VAR_QBits_QuestsDone: - _449B7E_toggle_bit(pParty->_quest_bits, (__int16)a3, 0); + _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0); - return; + return true; case VAR_PlayerItemInHands: - v15 = (char *)this->pInventoryIndices; + v15 = this->pInventoryIndices; break; case VAR_FixedGold: - if ( (unsigned int)a3 > pParty->uNumGold ) + if ( (unsigned int)pValue > pParty->uNumGold ) goto LABEL_88; - Party::TakeGold((unsigned int)a3); - return; + Party::TakeGold((unsigned int)pValue); + return result; case VAR_MightBonus: case VAR_ActualMight: - this->uMightBonus -= (unsigned __int16)a3; + this->uMightBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_IntellectBonus: case VAR_ActualIntellect: - this->uIntelligenceBonus -= (unsigned __int16)a3; + this->uIntelligenceBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_PersonalityBonus: case VAR_ActualPersonality: - this->uWillpowerBonus -= (unsigned __int16)a3; + this->uWillpowerBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_EnduranceBonus: case VAR_ActualEndurance: - this->uEnduranceBonus -= (unsigned __int16)a3; + this->uEnduranceBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_SpeedBonus: case VAR_ActualSpeed: - this->uSpeedBonus -= (unsigned __int16)a3; + this->uSpeedBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_AccuracyBonus: case VAR_ActualAccuracy: - this->uAccuracyBonus -= (unsigned __int16)a3; + this->uAccuracyBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_LuckBonus: case VAR_ActualLuck: - this->uLuckBonus -= (unsigned __int16)a3; + this->uLuckBonus -= (unsigned __int16)pValue; goto LABEL_72; case VAR_BaseMight: - this->uMight -= (unsigned __int16)a3; + this->uMight -= (unsigned __int16)pValue; goto LABEL_45; case VAR_BaseIntellect: - this->uIntelligence -= (unsigned __int16)a3; + this->uIntelligence -= (unsigned __int16)pValue; goto LABEL_45; case VAR_BasePersonality: - this->uWillpower -= (unsigned __int16)a3; + this->uWillpower -= (unsigned __int16)pValue; goto LABEL_45; case VAR_BaseEndurance: - this->uEndurance -= (unsigned __int16)a3; + this->uEndurance -= (unsigned __int16)pValue; goto LABEL_45; case VAR_BaseSpeed: - this->uSpeed -= (unsigned __int16)a3; + this->uSpeed -= (unsigned __int16)pValue; goto LABEL_45; case VAR_BaseAccuracy: - this->uAccuracy -= (unsigned __int16)a3; + this->uAccuracy -= (unsigned __int16)pValue; goto LABEL_45; case VAR_BaseLuck: - this->uLuck -= (unsigned __int16)a3; + this->uLuck -= (unsigned __int16)pValue; goto LABEL_45; case VAR_FireResistance: - this->sResFireBase -= (signed __int16)a3; + this->sResFireBase -= (signed __int16)pValue; goto LABEL_45; case VAR_AirResistance: - this->sResAirBase -= (signed __int16)a3; + this->sResAirBase -= (signed __int16)pValue; goto LABEL_45; case VAR_WaterResistance: - this->sResWaterBase -= (signed __int16)a3; + this->sResWaterBase -= (signed __int16)pValue; goto LABEL_45; case VAR_EarthResistance: - this->sResEarthBase -= (signed __int16)a3; + this->sResEarthBase -= (signed __int16)pValue; goto LABEL_45; case VAR_SpiritResistance: - this->sResSpiritBase -= (signed __int16)a3; + this->sResSpiritBase -= (signed __int16)pValue; goto LABEL_45; case VAR_MindResistance: - this->sResMindBase -= (signed __int16)a3; + this->sResMindBase -= (signed __int16)pValue; goto LABEL_45; case VAR_BodyResistance: - this->sResBodyBase -= (signed __int16)a3; + this->sResBodyBase -= (signed __int16)pValue; goto LABEL_45; case VAR_LightResistance: - this->sResLightBase -= (signed __int16)a3; + this->sResLightBase -= (signed __int16)pValue; goto LABEL_45; case VAR_DarkResistance: - this->sResDarkBase -= (signed __int16)a3; + this->sResDarkBase -= (signed __int16)pValue; goto LABEL_45; case VAR_MagicResistance: - this->sResMagicBase -= (signed __int16)a3; + this->sResMagicBase -= (signed __int16)pValue; goto LABEL_45; case VAR_FireResistanceBonus: - this->sResFireBonus -= (signed __int16)a3; + this->sResFireBonus -= (signed __int16)pValue; goto LABEL_45; case VAR_AirResistanceBonus: - this->sResAirBonus -= (signed __int16)a3; + this->sResAirBonus -= (signed __int16)pValue; LABEL_45: v25 = 0; v23 = 92; goto LABEL_73; case VAR_WaterResistanceBonus: - this->sResWaterBonus -= (signed __int16)a3; + this->sResWaterBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_EarthResistanceBonus: - this->sResEarthBonus -= (signed __int16)a3; + this->sResEarthBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_SpiritResistanceBonus: - this->sResSpiritBonus -= (signed __int16)a3; + this->sResSpiritBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_MindResistanceBonus: - this->sResMindBonus -= (signed __int16)a3; + this->sResMindBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_BodyResistanceBonus: - this->sResBodyBonus -= (signed __int16)a3; + this->sResBodyBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_LightResistanceBonus: - this->sResLightBonus -= (signed __int16)a3; + this->sResLightBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_DarkResistanceBonus: - this->sResDarkBonus -= (signed __int16)a3; + this->sResDarkBonus -= (signed __int16)pValue; goto LABEL_72; case VAR_MagicResistanceBonus: - this->sResMagicBonus -= (signed __int16)a3; + this->sResMagicBonus -= (signed __int16)pValue; LABEL_72: v25 = 0; v23 = SPEECH_91; @@ -9622,7 +9650,7 @@ pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25); goto LABEL_17; case VAR_FixedFood: - Party::TakeFood((unsigned int)a3); + Party::TakeFood((unsigned int)pValue); goto LABEL_17; case VAR_StaffSkill: case VAR_SwordSkill: @@ -9654,7 +9682,7 @@ case VAR_DiplomacySkill: case VAR_DisarmTrapSkill: case VAR_LearningSkill: - *((short *)&this->pConditions[16] + var) -= (unsigned __int8)a3; + *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue; goto LABEL_17; case VAR_Cursed: case VAR_Weak: @@ -9673,28 +9701,33 @@ case VAR_Dead: case VAR_Stoned: case VAR_Eradicated: - *((int *)this + 2 * var - 210) = 0; - *((int *)this + 2 * v5 - 209) = 0; + *((int *)this + 2 * VarNum - 210) = 0; + *((int *)this + 2 * result - 209) = 0; LABEL_17: pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); v8 = 8 * v4 + 400; LOBYTE(v8) = (8 * v4 - 112) | 4; pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); - return; - } - do - { - if ( *(void **)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v15 + 5] == a3 ) + return result; + } + //do + for (v3 = 1; v3 < 126; v3++) + { + if ( *(&this->pInventoryItems[pInventoryIndices[v3] - 1].uItemID) == pValue )//pValue = ItemID, pInventoryItems[3] = 222 { - RemoveItemAtInventoryIndex(v3); - return; + RemoveItemAtInventoryIndex(v3);// &this->pInventoryIndices[puSlot], pInventoryIndices[1] = 4 + return true; } - ++v3; - v15 += 4; - } - while ( (signed int)v3 < 126 ); - if ( (void *)pParty->pPickedItem.uItemID == a3 ) - pMouse->RemoveHoldingItem(); + //++v3; + //v15 ++; + } + //while ( (signed int)v3 < 126 ); + if ( pParty->pPickedItem.uItemID == pValue ) + { + pMouse->RemoveHoldingItem(); + return true; + } + return false; } } }
--- a/Player.h Fri Mar 01 18:37:54 2013 +0600 +++ b/Player.h Fri Mar 01 18:38:12 2013 +0600 @@ -5,7 +5,12 @@ - +#define PLAYER_BUFF_BLESS 1 +#define PLAYER_BUFF_FATE 4 +#define PLAYER_BUFF_HAMMERHANDS 6 +#define PLAYER_BUFF_PAIN_REFLECTION 10 +#define PLAYER_BUFF_PRESERVATION 11 +#define PLAYER_BUFF_REGENERATION 12 /* 301 */ @@ -443,7 +448,7 @@ void SetVariable(enum VariableType var, signed int a3); void AddVariable(enum VariableType var, signed int val); - void SubtractVariable(enum VariableType var, void *a3); + bool SubtractVariable(enum VariableType VarNum, signed int pValue); bool CompareVariable(enum VariableType VarNum, signed int pValue); void UseItem_DrinkPotion_etc(signed int a2, int a3); bool AddItem(struct ItemGen *pItem); @@ -565,6 +570,7 @@ inline bool Dead() {return pConditions[Condition::Condition_Dead] != 0;} inline bool Eradicated() {return pConditions[Condition::Condition_Eradicated] != 0;} inline bool Zombie() {return pConditions[Condition::Condition_Zombie] != 0;} + inline bool Cursed() {return pConditions[Condition::Condition_Cursed] != 0;}
--- a/SaveLoad.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/SaveLoad.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -183,7 +183,7 @@ if (pItemsTable->pItems[uItemID].uEquipType == 12) { __debugbreak(); - v31 = *((int *)&pSpellDatas[66].field_8 + uItemID); + v31 = *((int *)&pSpellDatas[66].uNormalLevelRecovery + uItemID); stru_A750F8[i]._494836(v31, i + 9); } }
--- a/Spells.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/Spells.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -16,7 +16,22 @@ struct SpellStats *pSpellStats; -stru324_spell stru_4E3ACC[102]; +stru324_spell stru_4E3ACC[100] = +{ + {10, 0}, + {1000, 0}, {1010, 0}, {1020, 0}, {1030, 0}, {1040, 0}, {1050, 0}, {1060, 0}, {1070, 0}, {1080, 0}, {1090, 0}, {1100, 0}, + {2000, 0}, {2010, 0}, {2020, 0}, {2030, 0}, {2040, 0}, {2050, 0}, {2060, 0}, {2070, 0}, {2080, 0}, {2090, 0}, {2100, 0}, + {3000, 0}, {3010, 0}, {3020, 0}, {3030, 0}, {3040, 0}, {3050, 0}, {3060, 0}, {3070, 0}, {3080, 0}, {3090, 0}, {3100, 0}, + {4000, 0}, {4010, 0}, {4020, 0}, {4030, 0}, {4040, 0}, {4050, 0}, {4060, 0}, {4070, 0}, {4080, 0}, {4090, 0}, {4100, 0}, + {5000, 0}, {5010, 0}, {5020, 0}, {5030, 0}, {5040, 0}, {5050, 0}, {5060, 0}, {5070, 0}, {5080, 0}, {5090, 0}, {5100, 0}, + {6000, 0}, {6010, 0}, {6020, 0}, {6030, 0}, {6040, 0}, {6050, 0}, {6060, 0}, {6070, 0}, {6080, 0}, {6090, 0}, {6100, 0}, + {7000, 0}, {7010, 0}, {7020, 0}, {7030, 0}, {7040, 0}, {7050, 0}, {7060, 0}, {7070, 0}, {7080, 0}, {7090, 0}, {7100, 0}, + {8000, 0}, {8010, 0}, {8020, 0}, {8030, 0}, {8040, 0}, {8050, 0}, {8060, 0}, {8070, 0}, {8080, 0}, {8090, 0}, {8100, 0}, + {9000, 0}, {9010, 0}, {9020, 0}, {9030, 0}, {9040, 0}, {9050, 0}, {9060, 0}, {9070, 0}, {9080, 0}, {9090, 0}, {9100, 0} + //{545, 0}, + //{545, 0}, + //{555, 0} +}; //9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1! SpellData pSpellDatas[100]={ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, @@ -130,6 +145,22 @@ {60, 60, 60, 60, 300, 300, 300, 300, 2073, 0} }; + +unsigned int wand_spell_ids[25] = +{ +// 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm + SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM, +// 140 Fairy Wand of Light 141 Fairy Wand of Ice 142 Fairy Wand of Lashing 143 Fairy Wand of Mind 144 Fairy Wand of Swarms + SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM, +// 145 Alacorn Wand of Fireballs 146 Alacorn Wand of Acid 147 Alacorn Wand of Lightning 148 Alacorn Wand of Blades 149 Alacorn Wand of Charms + SPELL_FIRE_FIREBALL, SPELL_WATER_ACID_BURST, SPELL_AIR_LIGHNING_BOLT, SPELL_EARTH_BLADES, SPELL_MIND_CHARM, +// 150 Arcane Wand of Blasting 151 Arcane Wand of The Fist 152 Arcane Wand of Rocks 153 Arcane Wand of Paralyzing 154 Arcane Wand of Clouds + SPELL_WATER_ICE_BLAST, SPELL_BODY_FLYING_FIST, SPELL_EARTH_ROCK_BLAST, SPELL_LIGHT_PARALYZE, SPELL_DARK_TOXIC_CLOUD, +// 155 Mystic Wand of Implosion 156 Mystic Wand of Distortion 157 Mystic Wand of Sharpmetal 158 Mystic Wand of Shrinking 159 Mystic Wand of Incineration + SPELL_AIR_IMPLOSION, SPELL_EARTH_MASS_DISTORTION, SPELL_DARK_SHARPMETAL, SPELL_DARK_SHRINKING_RAY, SPELL_FIRE_INCINERATE +}; + + unsigned char pSpellbookSpellIndices[9][12] = // 4E2430 { //0 1 2 3 4 5 6 7 8 9 10 11 {0, 3, 1, 8, 11, 7, 4, 10, 6, 2, 5, 9},
--- a/Spells.h Fri Mar 01 18:37:54 2013 +0600 +++ b/Spells.h Fri Mar 01 18:38:12 2013 +0600 @@ -5,31 +5,122 @@ /* 360 */ enum SPELL_TYPE { - SPELL_FIRE_PROTECTION_FROM_FIRE = 0x3, - SPELL_FIRE_HASTE = 0x5, - SPELL_FIRE_FIRE_RING = 0x8, - SPELL_AIR_FEATHER_FALL = 0xD, - SPELL_AIR_PROTECTION_FROM_AIR = 0xE, - SPELL_AIR_SHIELD = 0x11, - SPELL_WATER_PROTECTION_FROM_WATER = 0x19, - SPELL_WATER_WATER_WALK = 0x1B, - SPELL_EARTH_PROTECTION_FROM_EARTH = 0x24, - SPELL_EARTH_STONESKIN = 0x26, - SPELL_SPIRIT_DETECT_LIFE = 0x2D, - SPELL_SPIRIT_BLESS = 0x2E, - SPELL_SPIRIT_DOOM = 0x2F, - SPELL_SPIRIT_PRESERVE = 0x32, - SPELL_SPIRIT_HEROISM = 0x33, - SPELL_MIND_REMOVE_FEAR = 0x38, - SPELL_MIND_PROTECTION_FROM_MIND = 0x3A, - SPELL_MIND_CURE_PARALYSIS = 0x3D, - SPELL_BODY_CURE_WEAKNESS = 0x43, - SPELL_BODY_FIRST_AID = 0x44, - SPELL_BODY_CURE_POISON = 0x48, - SPELL_BODY_HAMMERHANDS = 0x49, - SPELL_BODY_CURE_DISEASE = 0x4A, - SPELL_BODY_PROTECTION_FROM_MAGIC = 0x4B, - SPELL_DARK_PAIN_REFLECTION = 0x5F, + SPELL_FIRE_TORCH_LIGHT = 1, + SPELL_FIRE_FIRE_BOLT = 2, + SPELL_FIRE_PROTECTION_FROM_FIRE = 3, + SPELL_FIRE_FIRE_AURA = 4, + SPELL_FIRE_HASTE = 5, + SPELL_FIRE_FIREBALL = 6, + SPELL_FIRE_FIRE_SPIKE = 7, + SPELL_FIRE_IMMOLATION = 8, + SPELL_FIRE_METEOR_SHOWER = 9, + SPELL_FIRE_INFERNO = 10, + SPELL_FIRE_INCINERATE = 11, + + SPELL_AIR_WIZARD_EYE = 12, + SPELL_AIR_FEATHER_FALL = 13, + SPELL_AIR_PROTECTION_FROM_AIR = 14, + SPELL_AIR_SPARKS = 15, + SPELL_AIR_JUMP = 16, + SPELL_AIR_SHIELD = 17, + SPELL_AIR_LIGHNING_BOLT = 18, + SPELL_AIR_INVISIBILITY = 19, + SPELL_AIR_IMPLOSION = 20, + SPELL_AIR_FLY = 21, + SPELL_AIR_STARBURST = 22, + + SPELL_WATER_AWAKEN = 23, + SPELL_WATER_POISON_SPRAY = 24, + SPELL_WATER_PROTECTION_FROM_WATER = 25, + SPELL_WATER_ICE_BOLT = 26, + SPELL_WATER_WATER_WALK = 27, + SPELL_WATER_RECHARGE_ITEM = 28, + SPELL_WATER_ACID_BURST = 29, + SPELL_WATER_ENCHANT_ITEM = 30, + SPELL_WATER_TOWN_PORTAL = 31, + SPELL_WATER_ICE_BLAST = 32, + SPELL_WATER_LLOYDS_BEACON = 33, + + SPELL_EARTH_STUN = 34, + SPELL_EARTH_SLOW = 35, + SPELL_EARTH_PROTECTION_FROM_EARTH = 36, + SPELL_EARTH_DEADLY_SWARM = 37, + SPELL_EARTH_STONESKIN = 38, + SPELL_EARTH_BLADES = 39, + SPELL_EARTH_STONE_TO_FLESH = 40, + SPELL_EARTH_ROCK_BLAST = 41, + SPELL_EARTH_TELEKINESIS = 42, + SPELL_EARTH_DEATH_BLOSSOM = 43, + SPELL_EARTH_MASS_DISTORTION = 44, + + SPELL_SPIRIT_DETECT_LIFE = 45, + SPELL_SPIRIT_BLESS = 46, + SPELL_SPIRIT_FATE = 47, + SPELL_SPIRIT_TURN_UNDEAD = 48, + SPELL_SPIRIT_REMOVE_CURSE = 49, + SPELL_SPIRIT_PRESERVATION = 50, + SPELL_SPIRIT_HEROISM = 51, + SPELL_SPIRIT_SPIRIT_LASH = 52, + SPELL_SPIRIT_RAISE_DEAD = 53, + SPELL_SPIRIT_SHARED_LIFE = 54, + SPELL_SPIRIT_RESSURECTION = 55, + + SPELL_MIND_REMOVE_FEAR = 56, + SPELL_MIND_MIND_BLAST = 57, + SPELL_MIND_PROTECTION_FROM_MIND = 58, + SPELL_MIND_TELEPATHY = 59, + SPELL_MIND_CHARM = 60, + SPELL_MIND_CURE_PARALYSIS = 61, + SPELL_MIND_BERSERK = 62, + SPELL_MIND_MASS_FEAR = 63, + SPELL_MIND_CURE_INSANITY = 64, + SPELL_MIND_PSYCHIC_SHOCK = 65, + SPELL_MIND_ENSLAVE = 66, + + SPELL_BODY_CURE_WEAKNESS = 67, + SPELL_BODY_FIRST_AID = 68, + SPELL_BODY_PROTECTION_FROM_BODY = 69, + SPELL_BODY_HARM = 70, + SPELL_BODY_REGENERATION = 71, + SPELL_BODY_CURE_POISON = 72, + SPELL_BODY_HAMMERHANDS = 73, + SPELL_BODY_CURE_DISEASE = 74, + SPELL_BODY_PROTECTION_FROM_MAGIC = 75, + SPELL_BODY_FLYING_FIST = 76, + SPELL_BODY_POWER_CURE = 77, + + SPELL_LIGHT_LIGHT_BOLT = 78, + SPELL_LIGHT_DESTROY_UNDEAD = 79, + SPELL_LIGHT_DISPEL_MAGIC = 80, + SPELL_LIGHT_PARALYZE = 81, + SPELL_LIGHT_SUMMON_ELEMENTAL = 82, + SPELL_LIGHT_DAY_OF_THE_GODS = 83, + SPELL_LIGHT_PRISMATIC_LIGHT = 84, + SPELL_LIGHT_DAY_OF_PROTECTION = 85, + SPELL_LIGHT_HOUR_OF_POWER = 86, + SPELL_LIGHT_SUNRAY = 87, + SPELL_LIGHT_DIVINE_INTERVENTION = 88, + + SPELL_DARK_REANIMATE = 89, + SPELL_DARK_TOXIC_CLOUD = 90, + SPELL_DARK_VAMPIRIC_WEAPON = 91, + SPELL_DARK_SHRINKING_RAY = 92, + SPELL_DARK_SHARPMETAL = 93, + SPELL_DARK_CONTROL_UNDEAD = 94, + SPELL_DARK_PAIN_REFLECTION = 95, + SPELL_DARK_SACRIFICE = 96, + SPELL_DARK_DRAGON_BREATH = 97, + SPELL_DARK_ARMAGEDDON = 98, + SPELL_DARK_SOULDRINKER = 99, + + SPELL_BOW_ARROW = 100, + SPELL_101 = 101, + SPELL_LASER_PROJECTILE = 102, + + BECOME_MAGIC_GUILD_MEMBER = 150, + SPELL_151 = 151, + SPELL_152 = 152, + SPELL_153 = 153 }; @@ -117,7 +208,7 @@ #pragma pack(push, 1) struct stru324_spell { - __int16 uItemType; + __int16 field_0; __int16 field_2; }; #pragma pack(pop) @@ -126,21 +217,28 @@ #pragma pack(push, 1) struct SpellData { -union - { - unsigned __int16 mana_per_skill[4]; - struct - { - unsigned __int16 uNormalLevelMana; - unsigned __int16 uExpertLevelMana; - unsigned __int16 uMasterLevelMana; - unsigned __int16 uMagisterLevelMana; - }; - }; - unsigned __int16 field_8; - __int16 field_A; - __int16 field_C; - __int16 field_E; + union + { + unsigned __int16 mana_per_skill[4]; + struct + { + unsigned __int16 uNormalLevelMana; + unsigned __int16 uExpertLevelMana; + unsigned __int16 uMasterLevelMana; + unsigned __int16 uMagisterLevelMana; + }; + }; + union + { + unsigned __int16 recovery_per_skill[4]; + struct + { + unsigned __int16 uNormalLevelRecovery; + unsigned __int16 uExpertLevelRecovery; + unsigned __int16 uMasterLevelRecovery; + unsigned __int16 uMagisterLevelRecovery; + }; + }; __int16 field_10; __int16 field_12; // char field_12; @@ -164,4 +262,5 @@ extern struct SpellBookIconPos pIconPos[9][12]; extern stru324_spell stru_4E3ACC[]; -extern SpellData pSpellDatas[100]; \ No newline at end of file +extern SpellData pSpellDatas[100]; +extern unsigned int wand_spell_ids[]; \ No newline at end of file
--- a/mm7_1.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_1.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -694,7 +694,7 @@ { v5 = pStru179.field_0[v21]; v20 = 8 * pStru179.field_0[v21]; - v6 = (char *)pAwards[v20/8-1].pText;//(char *)dword_723E80_award_related[v20 / 4]; + v6 = (char *)pAwards[(v20-1)/8].pText;//(char *)dword_723E80_award_related[v20 / 4]; if ( v5 != 1 ) break; v17 = pParty->uFine; @@ -2926,17 +2926,9 @@ v116 = v106.uViewportZ; if ( v119 > (signed int)v106.uViewportW ) v119 = v106.uViewportW; - pRenderer->FillRectFast( - v106.uViewportX, - v106.uViewportY, - v106.uViewportZ - v106.uViewportX, - v106.uViewportW - v106.uViewportY, + pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); - pRenderer->FillRectFast( - v106.uViewportX, - v106.uViewportY, - v106.uViewportZ - v106.uViewportX, - v106.uViewportW - v106.uViewportY, + pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, pRenderer->uTargetBMask | pRenderer->uTargetGMask); v84.left = v106.uViewportX; v84.top = v106.uViewportY; @@ -3020,9 +3012,7 @@ { v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; - v34 = v33 & 0x1F | 2 - * (unsigned __int16)(v108[(int)((char *)v110 - + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); + v34 = v33 & 0x1F | 2 * (unsigned __int16)(v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); v35 = v124; *(short *)v30 = v34; v30 += 2; @@ -3092,7 +3082,7 @@ LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); v120 = v40; if ( !v40 ) - v45 = 1; + v45 = 1; else { v41 = (unsigned __int8)v40 & 0x3F; @@ -3105,7 +3095,7 @@ v119 = 1; } else - v45 = 1; + v45 = 1; } else { @@ -3369,22 +3359,11 @@ a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; v57 = v121->pMonsterInfo.uAttack1DamageBonus; if ( v57 ) - sprintf( - pTmpBuf, - "%s\f%05u\t080%dd%d+%d\n", - pGlobalTXT_LocalizationStrings[53], - 0, - v121->pMonsterInfo.uAttack1DamageDiceRolls, - v121->pMonsterInfo.uAttack1DamageDiceSides, - v57); + sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], + 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); else - sprintf( - pTmpBuf, - "%s\f%05u\t080%dd%d\n", - pGlobalTXT_LocalizationStrings[53], - 0, - v121->pMonsterInfo.uAttack1DamageDiceRolls, - v121->pMonsterInfo.uAttack1DamageDiceSides); + sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], + 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); } else { @@ -3505,13 +3484,7 @@ { sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); pFontSmallnum->GetLineWidth(pTmpBuf); - result = a1->DrawTitleText( - pFontSmallnum, - 0, - a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, - 0, - pTmpBuf, - 3u); + result = a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3); } return result; } @@ -5102,88 +5075,90 @@ int a4; // [sp+44h] [bp-4h]@2 v0 = pPlayers[uActiveCharacter]; - if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] != 103 - || (pMouse->GetClickPos(&pX, &pY), - v1 = pY - 17, - v2 = pX - 14, - pY = v1, - pX = v2, - v3 = 14 * (v1 >> 5), - v2 >>= 5, - v4 = v2 + v3 < 0, - v5 = v2 + v3, - a4 = v5, - v4) - || v5 > 126 - || pMouse->GetCursorPos(&a2)->x >= 462 - || pMouse->GetCursorPos(&a2)->x < 14 ) - return; - if ( unk_50C9A0 ) + if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) { - v6 = v0->GetItemIDAtInventoryIndex(&a4); - if ( v6 ) + pMouse->GetClickPos(&pX, &pY); + pY = pY - 17; + v2 =pX - 14; + pX = v2; + v3 = 14 * (pY >> 5); + v2 >>= 5; + v4 = v2 + v3 < 0; + v5 = v2 + v3; + a4 = v5; + if ( !v4 ) { - *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; - *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; - *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; - *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; - ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1]; - unk_50C9A0 = 0; - if ( pMessageQueue_50CBD0->uNumMessages ) - pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - pMouse->SetCursorBitmap("MICON1"); - dword_50C9D0 = 113; - dword_50C9D4 = 0; - dword_50C9D8 = 256; - } - return; - } - if ( ptr_50C9A4 ) - return; - v7 = pParty->pPickedItem.uItemID; - v8 = v0->GetItemIDAtInventoryIndex(&a4); - if ( !v7 ) - { - if ( !v8 ) - return; - memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); - v0->RemoveItemAtInventoryIndex(a4); - v9 = pParty->pPickedItem.uItemID; - goto LABEL_24; - } - v13 = v8; - if ( v8 ) - { - a2.y = (LONG)&v0->pInventoryItems[v8-1]; - memcpy(&this_, (const void *)a2.y, sizeof(this_)); - v0->RemoveItemAtInventoryIndex(a4); - pX = v0->AddItem2(a4, &pParty->pPickedItem); - if ( !pX ) - { - pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); - if ( !pX ) + if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462 + && pMouse->GetCursorPos(&a2)->x >= 14 ) { - v0->_49298B(&this_, v13 - 1, a4); - memcpy((void *)a2.y, &this_, sizeof(ItemGen)); - return; + if ( unk_50C9A0 ) + { + v6 = v0->GetItemIDAtInventoryIndex(&a4); + if ( v6 ) + { + *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; + *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; + *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; + *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; + ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1]; + unk_50C9A0 = 0; + if ( pMessageQueue_50CBD0->uNumMessages ) + pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; + pMouse->SetCursorBitmap("MICON1"); + dword_50C9D0 = 113; + dword_50C9D4 = 0; + dword_50C9D8 = 256; + } + return; + } + if ( ptr_50C9A4 ) + return; + v7 = pParty->pPickedItem.uItemID; + v8 = v0->GetItemIDAtInventoryIndex(&a4); + if ( !v7 ) + { + if ( !v8 ) + return; + memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); + v0->RemoveItemAtInventoryIndex(a4); + v9 = pParty->pPickedItem.uItemID; + goto LABEL_24; + } + v13 = v8; + if ( v8 ) + { + a2.y = (LONG)&v0->pInventoryItems[v8-1]; + memcpy(&this_, (const void *)a2.y, sizeof(this_)); + v0->RemoveItemAtInventoryIndex(a4); + pX = v0->AddItem2(a4, &pParty->pPickedItem); + if ( !pX ) + { + pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); + if ( !pX ) + { + v0->_49298B(&this_, v13 - 1, a4); + memcpy((void *)a2.y, &this_, sizeof(ItemGen)); + return; + } + } + v9 = this_.uItemID; + memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); +LABEL_24: + pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); + return; + } + v10 = v0->AddItem(a4, v7); + pX = v10; + if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) + { + memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u); + pMouse->RemoveHoldingItem(); + } } } - v9 = this_.uItemID; - memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); -LABEL_24: - pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); - return; - } - v10 = v0->AddItem(a4, v7); - pX = v10; - if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) - { - memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u); - pMouse->RemoveHoldingItem(); } } - //----- (0042213C) -------------------------------------------------------- void __cdecl OnGameViewportClick() { @@ -5940,10 +5915,7 @@ LODWORD(v14) = v13 << 16; HIDWORD(v14) = v13 >> 16; v15 = &_50B744_view_transformed_ys[i - 1]; - dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) - * v14 - / v12) >> 16) - + _50B834_view_transformed_zs[i - 1]; + dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) * v14 / v12) >> 16) + _50B834_view_transformed_zs[i - 1]; thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; } else @@ -6028,8 +6000,7 @@ } } dword_50BA08[v22] = v32; - dword_50BAF4_xs[v22 + 1] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) - * (signed __int64)dword_50BAF4_xs[v22 + 1]) >> 16; + dword_50BAF4_xs[v22 + 1] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF4_xs[v22 + 1]) >> 16; v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08[v22]) >> 16; dword_50BAF4_xs[v22 + 1] = pBLVRenderParams->uViewportCenterX - dword_50BAF4_xs[v22 + 1]; ++ia; @@ -6053,16 +6024,12 @@ { if ( v41 >= (signed int)v37 ) { - v67 = (signed int)(v37 - dword_50BAF4_xs[v40]) - * (signed __int64)(dword_50BA08[v40] - dword_50B9F8[v40 + 3]) - / (v41 - dword_50BAF4_xs[v40]); + v67 = (signed int)(v37 - dword_50BAF4_xs[v40]) * (signed __int64)(dword_50BA08[v40] - dword_50B9F8[v40 + 3]) / (v41 - dword_50BAF4_xs[v40]); v42 = dword_50B9F8[v40 + 3]; } else { - v67 = (signed int)(v37 - v41) - * (signed __int64)(dword_50B9F8[v40 + 3] - dword_50BA08[v40]) - / (dword_50BAF4_xs[v40] - v41); + v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50B9F8[v40 + 3] - dword_50BA08[v40]) / (dword_50BAF4_xs[v40] - v41); v42 = dword_50BA08[v40]; } ++v36; @@ -6080,16 +6047,16 @@ } while ( ib <= v79 ); - if ( !v36 - || (v43 = 0, - dword_50BAE8_xs[v36 + 1] = dword_50BAE8_xs[1], - dword_50B9F8[v36 + 1] = dword_50B9F8[1], - v44 = pBLVRenderParams->uViewportZ, - thisd = dword_50BAE8_xs[1] <= (signed int)pBLVRenderParams->uViewportZ, - ic = 1, - v36 < 1) ) + if (v36 < 1) return 0; + v43 = 0; + dword_50BAE8_xs[v36 + 1] = dword_50BAE8_xs[1]; + dword_50B9F8[v36 + 1] = dword_50B9F8[1]; + v44 = pBLVRenderParams->uViewportZ; + thisd = dword_50BAE8_xs[1] <= (signed int)pBLVRenderParams->uViewportZ; + ic = 1; + do { v45 = ic; @@ -6099,16 +6066,12 @@ { if ( v46 <= (signed int)v44 ) { - v68 = (signed int)(v44 - dword_50BAE8_xs[v45]) - * (signed __int64)(dword_50B9F8[v45 + 1] - dword_50B9F8[v45]) - / (v46 - dword_50BAE8_xs[v45]); + v68 = (signed int)(v44 - dword_50BAE8_xs[v45]) * (signed __int64)(dword_50B9F8[v45 + 1] - dword_50B9F8[v45]) / (v46 - dword_50BAE8_xs[v45]); v47 = dword_50B9F8[v45]; } else { - v68 = (signed int)(v44 - v46) - * (signed __int64)(dword_50B9F8[v45] - dword_50B9F8[v45 + 1]) - / (dword_50BAE8_xs[v45] - v46); + v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9F8[v45] - dword_50B9F8[v45 + 1]) / (dword_50BAE8_xs[v45] - v46); v47 = dword_50B9F8[v45 + 1]; } ++v43; @@ -6125,17 +6088,18 @@ thisd = v83; } while ( ic <= v36 ); - if ( !v43 - || (v48 = 0, - dword_50BAE0[v43] = dword_50BAE0[0], - dword_50B9F0[v43] = dword_50B9F0[0], - v49 = pBLVRenderParams->uViewportY, - v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY, - LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY, - v51 = 1, - id = 1, - v43 < 1) ) + + if (v43 < 1) return 0; + + v48 = 0; + dword_50BAE0[v43] = dword_50BAE0[0]; + dword_50B9F0[v43] = dword_50B9F0[0]; + v49 = pBLVRenderParams->uViewportY; + v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY; + LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY; + v51 = 1; + id = 1; do { v52 = v51; @@ -6145,16 +6109,12 @@ { if ( v53 >= (signed int)v49 ) { - v69 = (signed int)(v49 - dword_50B9EC[v52]) - * (signed __int64)(dword_50BAE0[v52] - dword_50BADC_xs[v52]) - / (v53 - dword_50B9EC[v52]); + v69 = (signed int)(v49 - dword_50B9EC[v52]) * (signed __int64)(dword_50BAE0[v52] - dword_50BADC_xs[v52]) / (v53 - dword_50B9EC[v52]); v54 = dword_50BADC_xs[v52]; } else { - v69 = (signed int)(v49 - v53) - * (signed __int64)(dword_50BADC_xs[v52] - dword_50BAE0[v52]) - / (dword_50B9EC[v52] - v53); + v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BADC_xs[v52] - dword_50BAE0[v52]) / (dword_50B9EC[v52] - v53); v54 = dword_50BAE0[v52]; } ++v48; @@ -6171,15 +6131,16 @@ v51 = id++ + 1; } while ( id <= v43 ); - if ( !v48 - || (v55 = 0, - dword_50BAD4[v48] = dword_50BAD4[0], - dword_50B9E0_ys[v48 + 1] = dword_50B9E0_ys[1], - v56 = pBLVRenderParams->uViewportW, - thise = dword_50B9E0_ys[1] <= (signed int)pBLVRenderParams->uViewportW, - ie = 1, - v48 < 1) ) + + if (v48 < 1) return 0; + + v55 = 0; + dword_50BAD4[v48] = dword_50BAD4[0]; + dword_50B9E0_ys[v48 + 1] = dword_50B9E0_ys[1]; + v56 = pBLVRenderParams->uViewportW; + thise = dword_50B9E0_ys[1] <= (signed int)pBLVRenderParams->uViewportW; + ie = 1; do { v57 = ie; @@ -6189,16 +6150,12 @@ { if ( v58 <= (signed int)v56 ) { - v70 = (signed int)(v56 - dword_50B9E0_ys[v57]) - * (signed __int64)(dword_50BAD4[v57] - dword_50BAD0[v57]) - / (v58 - dword_50B9E0_ys[v57]); + v70 = (signed int)(v56 - dword_50B9E0_ys[v57]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD0[v57]) / (v58 - dword_50B9E0_ys[v57]); v59 = dword_50BAD0[v57]; } else { - v70 = (signed int)(v56 - v58) - * (signed __int64)(dword_50BAD0[v57] - dword_50BAD4[v57]) - / (dword_50B9E0_ys[v57] - v58); + v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD0[v57] - dword_50BAD4[v57]) / (dword_50B9E0_ys[v57] - v58); v59 = dword_50BAD4[v57]; } ++v55; @@ -6215,6 +6172,7 @@ thise = v85; } while ( ie <= v48 ); + if ( !v55 ) return 0; v61 = pRenderer->pRenderD3D == 0;
--- a/mm7_2.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_2.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -1404,7 +1404,7 @@ return result; } } - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); v3 = 0; if ( dword_F8B19C == 2 ) { @@ -1944,7 +1944,7 @@ return (POINT *)v104.DrawTitleText(pFontArrus, v3, (174 - v40) / 2 + 138, v88, v90, v92); } } - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); v3 = 0; v114 = 0; if ( dword_F8B19C == 2 ) @@ -2378,7 +2378,7 @@ break; case 2: //buy standart { - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); v55 = 0; v153 = 0; for(int i=0; i<8; ++i) @@ -2580,7 +2580,7 @@ break; case 6: { - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0); if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) return; @@ -2709,7 +2709,7 @@ case 95: //buy spesial { - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); v11 = 0; v61 = 0; @@ -3608,10 +3608,10 @@ //----- (004BC8D5) -------------------------------------------------------- -Texture *__cdecl sub_4BC8D5() -{ +void SpellBookGenerator() + { int v0; // esi@1 - char *v1; // ebx@1 + int v1; // ebx@1 signed int v2; // edi@1 signed int v3; // eax@2 int v4; // esi@7 @@ -3619,13 +3619,13 @@ Texture *result; // eax@15 int v7; // [sp+10h] [bp-4h]@0 - v0 = v7; - v1 = (char *)window_SpeakInHouse->ptr_1C - 139; + // v0 = v7; + v1 = window_SpeakInHouse->par1C - 139; v2 = 0; - do + for(int i=0; i<12; ++i) { //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]; - v3 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType; + v3 = p2DEvents[window_SpeakInHouse->par1C - 1].uType; if ( v3 < 5 ) goto LABEL_12; if ( v3 <= 13 ) @@ -3664,15 +3664,15 @@ } v5 = window_SpeakInHouse; - auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C; + ItemGen * _u = &pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i]; _u->Reset(); - *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0; - *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1; - result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)]; - *(&dword_F8B164 + v2) = result; - } - while ( v2 < 12 ); - return result; + pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].uItemID= v0; + pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][i].Identified(); + + ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)]; + } + + return; } @@ -3805,7 +3805,7 @@ { v9 = pIcons_LOD->LoadTexture(off_4F03B8[in_current_building_type], TEXTURE_16BIT_PALETTE); //v3 = dword_F8B198; - dword_F8B164 = &pIcons_LOD->pTextures[v9]; + ShopTexture = &pIcons_LOD->pTextures[v9]; LABEL_13: v8 = window_SpeakInHouse; } @@ -3837,7 +3837,8 @@ v32 = 0; do { - v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C)); + //v33 = *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v32 + 12 * (unsigned int)v8->ptr_1C)); + v33 = pParty->SpellBooksInGuilds[v8->par1C-139][v32].uItemID; if ( v33 ) { v34 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v33].pIconName, TEXTURE_16BIT_PALETTE); @@ -3850,7 +3851,7 @@ } else { - sub_4BC8D5(); + SpellBookGenerator(); v30 = window_SpeakInHouse->ptr_1C; v31 = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 @@ -4313,11 +4314,11 @@ && dword_F8B19C != 97 && dword_F8B19C != 5 && dword_F8B19C != 4 - && dword_F8B164 ) - { - dword_F8B164->Release(); + && ShopTexture ) + { + ShopTexture->Release(); v0 = dword_F8B19C; - dword_F8B164 = 0; + ShopTexture = 0; } if ( v0 && v0 != 1 ) { @@ -11421,7 +11422,10 @@ pIcons_LOD->_4114F2(); } - +int __stdcall pWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam) + { + return DefWindowProcA(hWnd, Msg, wParam, lParam); + } //----- (004637EB) -------------------------------------------------------- @@ -12692,7 +12696,7 @@ wcxw.hInstance, nullptr); SetWindowTextW(hWnd, L"Might and Magic VII"); - + SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); pRenderer = Render::Create(); @@ -12715,7 +12719,7 @@ return false; } } - + pAllocator = Allocator::Create(); if (!pAllocator->Initialize(26 * 1024)) { @@ -12724,7 +12728,7 @@ L"More RAM Memory Required", MB_ICONEXCLAMATION); return false; } - + game_starting_year = 1168; pParty = new Party; @@ -12931,7 +12935,7 @@ pSoundList->ToFile(); } - + if (dword_6BE364_game_settings_1 & 2 || !(dword_6BE368_debug_settings_2 & 1))// // color depth != 16 // or @@ -13267,8 +13271,8 @@ } else __debugbreak(); - /*{ - if (GetCurrentMenuID() != MENU_10) + { + /* if (GetCurrentMenuID() != MENU_10) goto LABEL_49; pMouse->Activate(0); if (pAsyncMouse) @@ -13294,8 +13298,8 @@ if (pAsyncMouse) pAsyncMouse->Resume(); if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) - pAsyncKeyboard->Resume(); - }*/ + pAsyncKeyboard->Resume();*/ + } //LABEL_48: pGame->Loop(); LABEL_49: @@ -13335,6 +13339,7 @@ else Log::Warning(L"MM init: failed"); pGame->Deinitialize(); +return 1; } @@ -14576,7 +14581,7 @@ LABEL_74: if ( v50 ) stru_A750F8[uActiveCharacter - 1]._494836( - *((int *)&pSpellDatas[66].field_8 + v50), + *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); break; case 1u:
--- a/mm7_3.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_3.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -13956,126 +13956,126 @@ { if ( !_strnicmp(test_string, "wea", 3) ) { - p2DEvents[i].uType = 1; + p2DEvents[i].uType = BildingType_WeaponShop; break; } if ( !_strnicmp(test_string, "arm", 3) ) { - p2DEvents[i].uType = 2; + p2DEvents[i].uType = BildingType_ArmorShop; break; } if ( !_strnicmp(test_string, "mag", 3) ) { - p2DEvents[i].uType = 3; + p2DEvents[i].uType = BildingType_MagicShop; break; } if ( !_strnicmp(test_string, "alc", 3) ) { - p2DEvents[i].uType = 4; + p2DEvents[i].uType = BildingType_AlchemistShop; break; } if ( !_strnicmp(test_string, "sta", 3) ) { - p2DEvents[i].uType = 27; + p2DEvents[i].uType = BildingType_Stables; break; } if ( !_strnicmp(test_string, "boa", 3) ) { - p2DEvents[i].uType = 28; + p2DEvents[i].uType = BildingType_Boats; break; } if ( !_strnicmp(test_string, "tem", 3) ) { - p2DEvents[i].uType = 23; + p2DEvents[i].uType = BildingType_Temple; break; } if ( !_strnicmp(test_string, "tra", 3) ) { - p2DEvents[i].uType = 30; + p2DEvents[i].uType = BildingType_Training; break; } if ( !_strnicmp(test_string, "tow", 3) ) { - p2DEvents[i].uType = 17; + p2DEvents[i].uType = BildingType_TownHall; break; } if ( !_strnicmp(test_string, "tav", 3) ) { - p2DEvents[i].uType = 21; + p2DEvents[i].uType = BildingType_Tavern; break; } if ( !_strnicmp(test_string, "ban", 3) ) { - p2DEvents[i].uType = 22; + p2DEvents[i].uType = BildingType_Bank; break; } if ( !_strnicmp(test_string, "fir", 3) ) { - p2DEvents[i].uType = 5; + p2DEvents[i].uType = BildingType_FireGuild; break; } if ( !_strnicmp(test_string, "air", 3) ) { - p2DEvents[i].uType = 6; + p2DEvents[i].uType = BildingType_AirGuild; break; } if ( !_strnicmp(test_string, "wat", 3) ) { - p2DEvents[i].uType = 7; + p2DEvents[i].uType = BildingType_WaterGuild; break; } if ( !_strnicmp(test_string, "ear", 3) ) { - p2DEvents[i].uType = 8; + p2DEvents[i].uType = BildingType_EarthGuild; break; } if ( !_strnicmp(test_string, "spi", 3) ) { - p2DEvents[i].uType = 9; + p2DEvents[i].uType = BildingType_SpiritGuild; break; } if ( !_strnicmp(test_string, "min", 3) ) { - p2DEvents[i].uType = 10; + p2DEvents[i].uType = BildingType_MindGuild; break; } if ( !_strnicmp(test_string, "bod", 3) ) { - p2DEvents[i].uType = 11; + p2DEvents[i].uType = BildingType_BodyGuild; break; } if ( !_strnicmp(test_string, "lig", 3) ) { - p2DEvents[i].uType = 12; + p2DEvents[i].uType = BildingType_LightGuild; break; } if ( !_strnicmp(test_string, "dar", 3) ) { - p2DEvents[i].uType = 13; + p2DEvents[i].uType = BildingType_DarkGuild; break; } if ( !_strnicmp(test_string, "ele", 3) ) { - p2DEvents[i].uType = 14; + p2DEvents[i].uType = BildingType_14; break; } if ( !_strnicmp(test_string, "sel", 3) ) { - p2DEvents[i].uType = 15; + p2DEvents[i].uType = BildingType_15; break; } if ( !_strnicmp(test_string, "mir", 3) ) { - p2DEvents[i].uType = 16; + p2DEvents[i].uType = BildingType_16; break; } if ( !_strnicmp(test_string, "mer", 3) ) { - p2DEvents[i].uType = 17; + p2DEvents[i].uType = BildingType_TownHall; break; } - p2DEvents[i].uType = 18; + p2DEvents[i].uType = BildingType_18; } break; @@ -16404,7 +16404,7 @@ LayingItem a1; // [sp+38h] [bp-7Ch]@12 //LayingItem::LayingItem(&a1); - a1.uItemType = stru_4E3ACC[spellnum_].uItemType; + a1.uItemType = stru_4E3ACC[spellnum_].field_0; if ( spellnum_ > 58 ) { if ( spellnum_ == 69 ) @@ -17086,20 +17086,17 @@ } //----- (00449B7E) -------------------------------------------------------- -unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle) +void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle) { signed int v3; // esi@1 - unsigned char *result; // eax@1 - unsigned int v5; // edx@1 + unsigned char set_bit; // edx@1 v3 = a2 - 1; - result = &pArray[v3 / 8]; - v5 = 0x80 >> v3 % 8; + set_bit = 0x80 >> v3 % 8; if ( bToggle ) - *result |= v5; - else - *result &= ~(unsigned char)v5; - return result; + pArray[v3 / 8] |= set_bit; + else + pArray[v3 / 8] &= ~set_bit; }
--- a/mm7_4.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_4.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -3481,7 +3481,7 @@ else { v11 = &pObjectList->pObjects->uObjectID; - while ( stru_4E3ACC[8].uItemType != *v11 ) + while ( stru_4E3ACC[8].field_0 != *v11 ) { ++v10; v11 += 28; @@ -5011,7 +5011,7 @@ v24 = v23; dword_A74CDC = v23; } - v11 = (char *)pAwards[v55[v24]-1].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; + v11 = (char *)pAwards[v55[v24]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; } else { @@ -8918,9 +8918,9 @@ if ( v5 > 4000000 ) pParty->uFine = 4000000; } - v6 = pParty->uTimePlayed + 368640; - pParty->field_3C._shop_ban_times[2 * a1] = LODWORD(pParty->uTimePlayed) + 368640; - pParty->field_3C._shop_ban_times[2 * a1 + 1] = HIDWORD(v6); + + pParty->field_3C._shop_ban_times[a1] = pParty->uTimePlayed + 368640; + LABEL_13: pParty->InTheShopFlags[a1] = 1; if ( v3 ) @@ -8941,7 +8941,8 @@ v10 = result->_guilds_member_bits; result = (Player *)_449B57_test_bit((unsigned __int8 *)result->_guilds_member_bits, 1); if ( !(short)result ) - result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u); + __debugbreak; + //result = (Player *)_449B7E_toggle_bit((unsigned char *)v10, 1, 1u); } ++v8; } @@ -9262,17 +9263,11 @@ void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2) { //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) ) - if ( BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uBuildingType) ) + if ( pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId ) pAudioPlayer->PlaySound( //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)), - (SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uBuildingType) + 300)), - 806, - 0, - -1, - 0, - 0, - 0, - 0); + (SoundID)(a2 + 100 * (pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].uRoomSoundId) + 300), + 806, 0, -1, 0, 0, 0, 0); } //----- (004B1ECE) -------------------------------------------------------- @@ -9504,20 +9499,20 @@ Party::TakeGold(gold_transaction_amount); if ( uActiveCharacter ) { - v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; + v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; *(short *)v12 &= 0x3Fu; switch ( dword_F8B1B0 ) { case 2: - v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; + v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; *v15 |= 0x40u; break; case 3: - v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; + v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; *v14 |= 0x80u; break; case 4: - v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards]; + v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; v13[1] |= 1u; break; } @@ -9535,13 +9530,13 @@ } else { - if ( uMessageParam == 82 && contract_approved ) + if ( uMessageParam == 82 && contract_approved ) //join guild { Party::TakeGold(gold_transaction_amount); v4 = pParty->pPlayers; do { - v4->SetVariable(VAR_Award, dword_F8B1AC_something_todo_with_awards); + v4->SetVariable(VAR_Award, dword_F8B1AC_award_bit_number); ++v4; } while ( (signed int)v4 < (signed int)pParty->pHirelings ); @@ -9700,7 +9695,7 @@ v3 = (_this - 200) / 3; v4 = v2; v35 = (char *)pNPCTopics[127].pText; - dword_F8B1AC_something_todo_with_awards = v3; + dword_F8B1AC_award_bit_number = v3; if ( v2 ) { if ( v2 == 1 ) @@ -9796,8 +9791,8 @@ { if ( (signed int)v16 >= 2 && v7 >= 7 ) { - v17 = dword_F8B1AC_something_todo_with_awards; - switch ( dword_F8B1AC_something_todo_with_awards ) + v17 = dword_F8B1AC_award_bit_number; + switch ( dword_F8B1AC_award_bit_number ) { default: goto LABEL_41; @@ -9859,13 +9854,13 @@ if ( v34 != 4 ) { LABEL_40: - v17 = dword_F8B1AC_something_todo_with_awards; + v17 = dword_F8B1AC_award_bit_number; goto LABEL_41; } if ( (signed int)v16 >= 3 && v7 >= 10 ) { - v17 = dword_F8B1AC_something_todo_with_awards; - switch ( dword_F8B1AC_something_todo_with_awards ) + v17 = dword_F8B1AC_award_bit_number; + switch ( dword_F8B1AC_award_bit_number ) { case 19: if ( v1->_49327B(0x22u, 1) == 1 ) @@ -9922,12 +9917,12 @@ } if ( v7 < 4 ) return v35; - v17 = dword_F8B1AC_something_todo_with_awards; - if ( dword_F8B1AC_something_todo_with_awards > 27 ) - { - if ( dword_F8B1AC_something_todo_with_awards != 29 - && dword_F8B1AC_something_todo_with_awards != 32 - && (dword_F8B1AC_something_todo_with_awards <= 33 || dword_F8B1AC_something_todo_with_awards > 35) ) + v17 = dword_F8B1AC_award_bit_number; + if ( dword_F8B1AC_award_bit_number > 27 ) + { + if ( dword_F8B1AC_award_bit_number != 29 + && dword_F8B1AC_award_bit_number != 32 + && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) ) { LABEL_41: if ( !gold_transaction_amount ) @@ -9938,18 +9933,18 @@ gold_transaction_amount = 500; goto LABEL_41; } - if ( dword_F8B1AC_something_todo_with_awards >= 23 ) + if ( dword_F8B1AC_award_bit_number >= 23 ) goto LABEL_87; - if ( dword_F8B1AC_something_todo_with_awards == 7 ) + if ( dword_F8B1AC_award_bit_number == 7 ) { gold_transaction_amount = 0; goto LABEL_79; } - if ( dword_F8B1AC_something_todo_with_awards <= 7 ) + if ( dword_F8B1AC_award_bit_number <= 7 ) goto LABEL_41; - if ( dword_F8B1AC_something_todo_with_awards > 18 ) - { - if ( dword_F8B1AC_something_todo_with_awards != 21 ) + if ( dword_F8B1AC_award_bit_number > 18 ) + { + if ( dword_F8B1AC_award_bit_number != 21 ) goto LABEL_41; goto LABEL_87; } @@ -9987,33 +9982,34 @@ //----- (004B29F2) -------------------------------------------------------- -const char *__fastcall ContractSelectText(int pEventNumber) -{ +const char * ContractSelectText( int pEventCode ) + { +static const int dialogue_base=110; contract_approved = 0; - dword_F8B1AC_something_todo_with_awards = pEventNumber + 50; - gold_transaction_amount = price_for_membership[pEventNumber]; + dword_F8B1AC_award_bit_number = pEventCode + 50; + gold_transaction_amount = price_for_membership[pEventCode]; if ( pPlayers[uActiveCharacter]->CanAct() ) { - if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits, dword_F8B1AC_something_todo_with_awards) ) - { - return pNPCTopics[123].pText; + if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_guilds_member_bits, dword_F8B1AC_award_bit_number) ) + { + return pNPCTopics[dialogue_base+13].pText; } else { if ( gold_transaction_amount <= pParty->uNumGold ) { contract_approved = 1; - return pNPCTopics[pEventNumber + 110].pText; + return pNPCTopics[pEventCode + dialogue_base].pText; } else { - return pNPCTopics[124].pText; + return pNPCTopics[dialogue_base+14].pText; } } } else { - return pNPCTopics[122].pText; + return pNPCTopics[dialogue_base+12].pText; } } @@ -10623,13 +10619,13 @@ } //----- (004B3EF0) -------------------------------------------------------- -void __fastcall DrawJoinGuildWindow(int pEventNumber) -{ +void DrawJoinGuildWindow( int pEventCode ) + { uDialogueType = 81;//enum JoinGuildDialog - ptr_F8B1E8 = (char *)pNPCTopics[pEventNumber + 99].pText; - ContractSelectText(pEventNumber); + ptr_F8B1E8 = (char *)pNPCTopics[pEventCode + 99].pText; + ContractSelectText(pEventCode); pDialogueWindow->Release(); - pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventNumber, 0); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); @@ -10652,16 +10648,7 @@ pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); v2 = ""; - pBtn_ExitCancel = pDialogueWindow->CreateButton( - 0x1D7u, - 0x1BDu, - 0xA9u, - 0x23u, - 1, - 0, - 0x71u, - 0, - 0, + pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[34], (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); @@ -11734,7 +11721,7 @@ return (int)v112.DrawTitleText(pFontArrus, v3, v6, v92, v95, v97); } } - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); v3 = 0; v49 = 0; v122 = 0; @@ -12282,11 +12269,11 @@ //----- (004B5D7C) -------------------------------------------------------- -int __cdecl GuildDialog() +void GuildDialog() { GUIWindow *v0; // ebx@1 - Player *v1; // edi@1 - signed int v2; // ebx@1 + Player *currPlayer; // edi@1 + signed int base_teach_price; // ebx@1 int v3; // edi@6 int result; // eax@11 unsigned int v5; // ebx@13 @@ -12295,7 +12282,7 @@ int v8; // esi@22 signed int v9; // ecx@22 char *v10; // eax@22 - const char *v11; // ecx@26 + const char *statusbar_string; // ecx@26 POINT *v12; // esi@30 int v13; // ecx@30 void *v14; // ST1C_4@31 @@ -12336,12 +12323,12 @@ char v49[100]; // [sp+19Ch] [bp-150h]@3 POINT v50; // [sp+264h] [bp-88h]@30 POINT v51; // [sp+26Ch] [bp-80h]@30 - GUIWindow v52; // [sp+274h] [bp-78h]@1 + GUIWindow working_window; // [sp+274h] [bp-78h]@1 signed int v53; // [sp+27Ch] [bp-70h]@1 signed int v54; // [sp+284h] [bp-68h]@1 int v55; // [sp+2C8h] [bp-24h]@47 - int v56; // [sp+2CCh] [bp-20h]@1 - int v57; // [sp+2D0h] [bp-1Ch]@1 + int main_text_color; // [sp+2CCh] [bp-20h]@1 + int hi_text_color; // [sp+2D0h] [bp-1Ch]@1 Player *v58; // [sp+2D4h] [bp-18h]@1 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31 char *Str; // [sp+2DCh] [bp-10h]@35 @@ -12350,19 +12337,19 @@ int v63; // [sp+2E8h] [bp-4h]@1 v0 = window_SpeakInHouse; - memcpy(&v52, window_SpeakInHouse, sizeof(v52)); + memcpy(&working_window, window_SpeakInHouse, sizeof(GUIWindow)); v58 = pPlayers[uActiveCharacter]; - v1 = v58; - v52.uFrameX = 483; - v53 = 148; - v54 = 334; - v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + currPlayer = v58; + working_window.uFrameX = 483; + working_window.uFrameWidth = 148; + working_window.uFrameZ = 334; + main_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + hi_text_color = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); //v2 = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C] * 500.0); - v2 = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0); - v63 = v2 * (100 - v1->GetMerchant()) / 100; - if ( v63 < v2 / 3 ) - v63 = v2 / 3; + base_teach_price = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0); + v63 = base_teach_price * (100 - currPlayer->GetMerchant()) / 100; + if ( v63 < base_teach_price / 3 ) + v63 = base_teach_price / 3; strcpy(Dest, ""); strcpy(v46, ""); strcpy(v47, ""); @@ -12370,14 +12357,14 @@ strcpy(v49, ""); if ( dword_F8B19C != 1 ) { - if ( dword_F8B19C != 18 ) + if ( dword_F8B19C != 18 ) //buy skill { if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { - v3 = (int)(&v1->uIntelligence + dword_F8B19C); - if ( *(short *)v3 ) - { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dword_F8B19C + 20]); + //v3 = (int)(&currPlayer->uIntelligence + dword_F8B19C); //test skill + if ( v58->pActiveSkills[dword_F8B19C-36] ) + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dword_F8B19C - 16]); //"You already know the %s skill" ShowStatusBarString(pTmpBuf, 2u); pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); } @@ -12385,89 +12372,86 @@ { if ( pParty->uNumGold < v63 ) { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); + ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); //"You don't have enough gold" HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); } else { Party::TakeGold(v63); - *(short *)v3 = 1; - } - } - } - /*result = pMessageQueue_50CBD0->uNumMessages; - if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; - result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; - *(&pMessageQueue_50CBD0->uNumMessages + result) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ + v58->pActiveSkills[dword_F8B19C-36] = 1; + } + } + } pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); - return 1; // void function actually - } - pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164); + return; + } + pRenderer->DrawTextureIndexed(8u, 8u, ShopTexture); v5 = 0; v6 = 0; v62 = 0; v63 = 32; do { - if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) ) + if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v6].uItemID) + // if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) ) + { pRenderer->DrawTextureTransparent(v63, 0x5Au, ItemsInShopTexture[v6]); ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), ItemsInShopTexture[v6], v6 + 1); - v1 = v58; + currPlayer = v58; } v63 += 70; v62 += 280; ++v6; } while ( v63 < 452 ); + v62 = 1680; v7 = 6; v63 = 32; do { - if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) ) + if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v7].uItemID) + // if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)) ) { pRenderer->DrawTextureTransparent(v63, 0xFAu, ItemsInShopTexture[v7]); ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), ItemsInShopTexture[v7], v7 + 1); - v1 = v58; + currPlayer = v58; } v63 += 70; v62 += 280; ++v7; } while ( v63 < 452 ); - result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) + + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { v8 = 0; v9 = 12; - v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)window_SpeakInHouse->ptr_1C); + // v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)window_SpeakInHouse->ptr_1C); + // v10 = do { - if ( *(int *)v10 ) + if (pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID ) ++v8; - v10 += 36; + // v10 += 36; --v9; } while ( v9 ); + GetAsyncKeyState(17); - v11 = pGlobalTXT_LocalizationStrings[195]; + statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy" if ( dword_F8B19C != 2 ) - v11 = pGlobalTXT_LocalizationStrings[196]; - DrawTextAtStatusBar(v11, 0); + statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy" + DrawTextAtStatusBar(statusbar_string, 0); if ( !v8 ) { - v52.DrawCurrentTime( + working_window.DrawCurrentTime( __PAIR__( *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44472], *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)window_SpeakInHouse->ptr_1C + 44468]) - pParty->uTimePlayed); - return 0; + return; } v12 = pMouse->GetCursorPos(&v51); result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y]; @@ -12478,40 +12462,27 @@ v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14)); v16 = (int)window_SpeakInHouse->ptr_1C; uPlayerID = uActiveCharacter - 1; - v17 = v1->_490EEE( - (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, - 3, - v16, - 2); - v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0); - v44 = 3; - v43 = v18; - v42 = v56; - v41 = 0; - v40 = 0; - v39 = &v52; -LABEL_32: - v19 = pFontArrus->CalcTextHeight(v18, v39, v40, v41); - return (int)v52.DrawTitleText(pFontArrus, v5, (174 - v19) / 2 + 138, v42, v43, v44); - } - } - return result; + v17 = currPlayer->_490EEE( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14, 3, v16, 2); + v18 = BuilDialogueString((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0); + v19 = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0); + working_window.DrawTitleText(pFontArrus, 0, (174 - v19) / 2 + 138, main_text_color, v18, 3); + return; + } + } + return; } if ( !(unsigned __int16)_449B57_test_bit( - (unsigned __int8 *)v1->_guilds_member_bits, - word_4F0704[(unsigned int)window_SpeakInHouse->ptr_1C-139]) ) - { - v36 = pNPCTopics[121].pText; - v37 = v57; - v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0); - v52.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u); - result = (int)pDialogueWindow; + (unsigned __int8 *)currPlayer->_guilds_member_bits, + guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) ) + { //you must me member + v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0); + working_window.DrawTitleText(pFontArrus, 0, (212 - v38) / 2 + 101, hi_text_color, pNPCTopics[121].pText, 3u); pDialogueWindow->pNumPresenceButton = 0; - return result; - } - result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( !result ) - return result; + return; + } + + if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + return; v20 = pDialogueWindow; v5 = 0; v62 = 0; @@ -12519,29 +12490,32 @@ v21 = pDialogueWindow->pStartingPosActiveItem; v22 = v21 + pDialogueWindow->pNumPresenceButton; v61 = 0; - if ( v21 >= v22 ) - goto LABEL_64; + if ( pDialogueWindow->pStartingPosActiveItem >= pDialogueWindow->pStartingPosActiveItem+pDialogueWindow->pNumPresenceButton ) + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], pPlayers[uActiveCharacter]->pName, pClassNames[pPlayers[uActiveCharacter]->classType]); // "Seek knowledge elsewhere %s the %s" + strcat(pTmpBuf, "\n \n"); + strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further." + v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0); + working_window.DrawTitleText(pFontArrus, v5, (174 - v19) / 2 + 138, hi_text_color, pTmpBuf, 3); + return; + } do { v23 = v20->GetControl(v21)->uControlParam; if ( v23 == 18 ) { - v25 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &v52, 0, 0); + v25 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &working_window, 0, 0); //"Buy Spells" v62 += v25; ++v61; } else { - __debugbreak(); - //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] - // or - //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] + + if((byte_4ED970_skill_learn_ability_by_class_table[v58->classType][v23-36])&&(v58->pActiveSkills[v23-36])) // or //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] - - //if ( *(&byte_4ED94C[37 * v58->uClass] + v23) && !*(&v58->uIntelligence + v23) ) - { - v24 = pFontArrus->CalcTextHeight(pClassNames[v23 + 20], &v52, 0, 0); + { + v24 = pFontArrus->CalcTextHeight(pClassNames[v23 - 16], &working_window, 0, 0); v62 += v24; ++v61; ++Str; @@ -12553,31 +12527,25 @@ if ( !v61 ) { LABEL_64: - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->classType]); + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->classType]); // "Seek knowledge elsewhere %s the %s" strcat(pTmpBuf, "\n \n"); - strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); - v18 = pTmpBuf; - v44 = 3; - v43 = pTmpBuf; - v42 = v57; - v41 = 0; - v40 = 0; - v39 = &v52; - goto LABEL_32; + strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further." + v19 = pFontArrus->CalcTextHeight(pTmpBuf, &working_window, 0, 0); + working_window.DrawTitleText(pFontArrus, v5, (174 - v19) / 2 + 138, hi_text_color, pTmpBuf, 3); + return; } if ( Str ) { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v63); - v52.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v63); //"Skill Cost: %lu" + working_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); } v63 = (signed int)(149 - v62) / v61; if ( v63 > 32 ) v63 = 32; - result = v20->pStartingPosActiveItem; v26 = (signed int)(149 - v61 * v63 - v62) / 2 - v63 / 2 + 162; - v62 = result; + v62 = v20->pStartingPosActiveItem; v55 = v26; - if ( result < result + v20->pNumPresenceButton ) + if (v20->pStartingPosActiveItem < v20->pStartingPosActiveItem + v20->pNumPresenceButton ) { v61 = 2; while ( 1 ) @@ -12588,30 +12556,33 @@ if ( v29 == 18 ) break; - __debugbreak(); + // __debugbreak(); //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] // or - //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] + if ((byte_4ED970_skill_learn_ability_by_class_table[v58->classType][v29 - 36])&&(v58->pActiveSkills[v29-36])) // or //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] - //if ( *(&byte_4ED94C[37 * v58->uClass] + v29) && !*(&v58->uIntelligence + v29) ) - { - v30 = pClassNames[v29 + 20]; + { + v30 = pClassNames[v29 -16]; LABEL_55: Str = v30; v28->uY = v63 + v55; - v31 = pFontArrus->CalcTextHeight(v30, &v52, 0, 0); + v31 = pFontArrus->CalcTextHeight(v30, &working_window, 0, 0); v32 = v28->uY; v28->uHeight = v31; v33 = v32 + v31 - 1; v28->uW = v33; v55 = v33; - v34 = v57; + v34 = hi_text_color; if ( pDialogueWindow->pCurrentPosActiveItem != v61 ) - v34 = v56; - v52.DrawTitleText(pFontArrus, 0, v32, v34, Str, 3u); - goto LABEL_58; + v34 = main_text_color; + working_window.DrawTitleText(pFontArrus, 0, v32, v34, Str, 3u); + v35 = v20->pStartingPosActiveItem; + ++v62; + ++v61; + if ( (signed int)v62 >=v20->pNumPresenceButton +v20->pStartingPosActiveItem ) + return; } v28->uW = 0; v28->uHeight = 0; @@ -12619,22 +12590,21 @@ LABEL_58: v35 = v20->pStartingPosActiveItem; ++v62; - result = v20->pNumPresenceButton + v35; ++v61; - if ( (signed int)v62 >= result ) - return result; - } - v30 = pGlobalTXT_LocalizationStrings[400]; + if ( (signed int)v62 >=v20->pNumPresenceButton +v20->pStartingPosActiveItem ) + return; + } + v30 = pGlobalTXT_LocalizationStrings[400]; //"Buy Spells" goto LABEL_55; } - return result; + return; } //----- (004B705E) -------------------------------------------------------- -int __cdecl TampleDialog() -{ +void TempleDialog() + { GUIWindow *v0; // ebx@1 Player *v1; // esi@1 int v2; // edi@1 @@ -12664,7 +12634,7 @@ DDM_DLV_Header *v26; // edi@29 int v27; // eax@31 int v28; // eax@32 - unsigned int v29; // ecx@34 + //unsigned int v29; // ecx@34 unsigned int v30; // edx@36 unsigned int v31; // edx@38 unsigned int v32; // edx@40 @@ -12718,11 +12688,10 @@ { if ( dword_F8B19C != 11 ) { - result = dword_F8B19C - 96; + if ( dword_F8B19C == 96 ) { - result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); - if ( result ) + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { v4 = pDialogueWindow; v61 = pDialogueWindow; @@ -12816,8 +12785,10 @@ } } } - return result; - } + return; + } + + // DONATION //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; v24 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; v25 = 0; @@ -12836,58 +12807,51 @@ if ( v28 < -5 ) v26->uReputation = -5; } - v29 = uActiveCharacter; if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 ) { if ( v26->uReputation <= -5 ) { v30 = pParty->uDaysPlayed % 7 + 1; LOBYTE(v30) = v30 | 0x80; - _42777D_CastSpell_UseWand_ShootArrow(12, uActiveCharacter - 1, v30, 48, 0); - v29 = uActiveCharacter; + _42777D_CastSpell_UseWand_ShootArrow(SPELL_AIR_WIZARD_EYE, uActiveCharacter - 1, v30, 48, 0); } if ( v26->uReputation <= -10 ) { v31 = pParty->uDaysPlayed % 7 + 1; LOBYTE(v31) = v31 | 0x80; - _42777D_CastSpell_UseWand_ShootArrow(50, v29 - 1, v31, 48, 0); - v29 = uActiveCharacter; + _42777D_CastSpell_UseWand_ShootArrow(SPELL_SPIRIT_PRESERVATION, uActiveCharacter - 1, v31, 48, 0); v26 = v66; } if ( v26->uReputation <= -15 ) { v32 = pParty->uDaysPlayed % 7 + 1; LOBYTE(v32) = v32 | 0x80; - _42777D_CastSpell_UseWand_ShootArrow(75, v29 - 1, v32, 48, 0); - v29 = uActiveCharacter; + _42777D_CastSpell_UseWand_ShootArrow(SPELL_BODY_PROTECTION_FROM_MAGIC, uActiveCharacter - 1, v32, 48, 0); v26 = v66; } if ( v26->uReputation <= -20 ) { v33 = pParty->uDaysPlayed % 7 + 1; LOBYTE(v33) = v33 | 0x80; - _42777D_CastSpell_UseWand_ShootArrow(86, v29 - 1, v33, 48, 0); - v29 = uActiveCharacter; + _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_HOUR_OF_POWER, uActiveCharacter - 1, v33, 48, 0); v26 = v66; } if ( v26->uReputation <= -25 ) { v34 = pParty->uDaysPlayed % 7 + 1; LOBYTE(v34) = v34 | 0x80; - _42777D_CastSpell_UseWand_ShootArrow(85, v29 - 1, v34, 48, 0); - v29 = uActiveCharacter; - } - } - ++byte_F8B1EF[v29]; + _42777D_CastSpell_UseWand_ShootArrow(SPELL_LIGHT_DAY_OF_PROTECTION, uActiveCharacter - 1, v34, 48, 0); + } + } + ++byte_F8B1EF[uActiveCharacter]; v1->PlaySound(SPEECH_83, 0); - ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); + ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u); // "Thank You!" goto LABEL_46; } goto LABEL_55; } - result = v1->_4B6FF9(); - if ( !result ) - return result; + if ( !v1->_4B6FF9() ) + return; v25 = 0; if ( pParty->uNumGold < v2 ) { @@ -12943,17 +12907,8 @@ v1->PlaySound(SPEECH_82, 0); pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536); LABEL_46: - /*result = pMessageQueue_50CBD0->uNumMessages; - if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; - result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; - *(&pMessageQueue_50CBD0->uNumMessages + result) = v25; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v25); - return result; // void func + return ; // void func } v63 = 1; v41 = pDialogueWindow->GetControl(pDialogueWindow->pStartingPosActiveItem); @@ -12988,10 +12943,9 @@ v64 = (174 - (signed int)v66) / v46; if ( v64 > 32 ) v64 = 32; - result = v43->pStartingPosActiveItem; v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138; - v65 = v42 + result; - if ( v42 + result < result + v43->pNumPresenceButton ) + v65 = v42 + v43->pStartingPosActiveItem; + if ( v42 + v43->pStartingPosActiveItem < v43->pStartingPosActiveItem + v43->pNumPresenceButton ) { v61 = (GUIWindow *)(v42 + 2); v66 = (DDM_DLV_Header *)&a1[100 * v42]; @@ -13014,11 +12968,10 @@ v66 = (DDM_DLV_Header *)((char *)v66 + 100); v61 = (GUIWindow *)((char *)v61 + 1); ++v65; - result = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; - } - while ( (signed int)v65 < result ); - } - return result; + } + while ( (signed int)v65 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); + } + return; } @@ -14198,7 +14151,7 @@ LABEL_20: pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)26, 0, (int)sHouseName); //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) ) - if ( BYTE1(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].uBuildingType) ) + if ( pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].uRoomSoundId ) HousePlaySomeSound(v9, 1); if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 ) pPlayers[uActiveCharacter]->PlaySound(SPEECH_47, 0); @@ -14248,7 +14201,8 @@ if ( uExitMapID > 0 ) { //v17 = (unsigned int *)(uExitMapID - 1); - if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) ) + if(_449B57_test_bit(pParty->_quest_bits,uExitMapID)) + // if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) ) { //uExitPic = 0; uHouse_ExitPic = 0; @@ -14333,163 +14287,158 @@ //----- (0044622E) -------------------------------------------------------- bool EnterHouse(enum HOUSE_ID uHouseID) -{ - //enum HOUSE_ID v1; // edi@1 - //int v2; // edi@5 - signed int uOpenTime; // eax@5 - signed int uCloseTime; // esi@5 - unsigned int v5; // esi@5 - int v6; // edx@5 - signed int am_pm_flag_open; // ecx@10 - signed int am_pm_flag_close; // eax@10 - int v9; // esi@10 - //unsigned int v10; // esi@16 - int v11; // ecx@17 - unsigned int v12; // kr00_4@25 - //Player *v13; // esi@25 - int v14; // eax@25 - //Player *v15; // esi@27 - //signed int v16; // eax@32 - unsigned int v17; // eax@37 - signed int v18; // edi@37 - signed int v19; // edi@41 - //unsigned int v20; // ecx@41 - //const char *v22; // [sp-4h] [bp-40h]@33 - char pContainer[40]; // [sp+Ch] [bp-30h]@32 - unsigned int v24; // [sp+34h] [bp-8h]@5 - //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1 - - //v1 = uHouseID; - //v25 = uHouseID; - GameUI_StatusBar_TimedString[0] = 0; - pStatusBarString[0] = 0; - ShowStatusBarString("", 2u); - if ( pMessageQueue_50CBD0->uNumMessages ) - pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - viewparams->bRedrawGameUI = 1; - uDialogueType = 0; - pKeyActionMap->_459ED1(3); - pKeyActionMap->ResetKeys(); - if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601) - { - GameOverMenu(0); - return 0; - } - uOpenTime = p2DEvents[uHouseID - 1].uOpenTime; - uCloseTime = p2DEvents[uHouseID - 1].uCloseTime; - ptr_F8B1E8 = 0; - dword_F8B1E4 = 0; - dword_F8B1F4 = 0; - memset(byte_F8B1F0, 0, 4); - memset(byte_F8B148, 0, 16); - pRenderer->ClearZBuffer(0, 479); - if ( uCloseTime - 1 <= uOpenTime ) - { - if ( pParty->uCurrentHour >= uOpenTime ) - { - //v10 = uHouseID; - if ( (signed int)uHouseID < 53 ) - { - if ( !(pParty->field_3C._shop_ban_times[uHouseID]) - || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) ) - { - pParty->field_3C._shop_ban_times[uHouseID] = 0; - - } - else - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!" - return 0; - } - } - if ( !start_event_seq_number ) - pAudioPlayer->StopChannels(-1, -1); - - uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID; - in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType; - if ( in_current_building_type == BildingType_20 && pParty->uFine ) // going 2 jail - { - uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID; - uHouseID = HOUSE_JAIL; - pParty->uTimePlayed = pParty->uTimePlayed+ 0x7620000; - in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE].uAnimationID].uBuildingType; - ++pParty->uNumPrisonTerms; - pParty->uFine = 0; - for (uint i = 0; i < 4; ++i) - { - pParty->pPlayers[i].uTimeToRecovery = 0; - pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0; - pParty->pPlayers[i].SetVariable(VAR_Award, 87); - } - } - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - - switch (pParty->alignment) - { - case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break; - case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break; - case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; - default: assert(false); - } - - v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - pDialogueNPCCount = 0; - pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; - uTextureID_507B04 = uTextureID_right_panel; - PrepareHouse(uHouseID); - v18 = 1; - uTextureID_507B04 = uTextureID_right_panel; - if ( uNumDialogueNPCPortraits == 1 ) - pDialogueNPCCount = 1; - pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u); - dword_5C35D4 = 1; - if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) - { - if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) - { - return 1; - } - } - else - { //guilds - v19 = word_4F0704[uHouseID-139] - 1; //some gild flag check - //v20 = uHouseID; - if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) ) - { - HousePlaySomeSound(uHouseID, 3); - return 1; - } - } - HousePlaySomeSound(uHouseID, 1); - dword_5C35D4 = 1; - return 1; - } - } - else - { - if (( pParty->uCurrentHour < uOpenTime)||( pParty->uCurrentHour > uCloseTime - 1 )) - { - am_pm_flag_open = 0; - am_pm_flag_close = 0; - if (uOpenTime > 12 ) - { - uOpenTime -= 12; - am_pm_flag_open = 1; - } - if ( uCloseTime > 12 ) - { - uCloseTime -= 12; - am_pm_flag_close = 1; - } - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open], - uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s" - ShowStatusBarString(pTmpBuf, 2u); - if ( uActiveCharacter ) - pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0); - return 0; - } - } - -} + { + //enum HOUSE_ID v1; // edi@1 + //int v2; // edi@5 + signed int uOpenTime; // eax@5 + signed int uCloseTime; // esi@5 + unsigned int v5; // esi@5 + int v6; // edx@5 + signed int am_pm_flag_open; // ecx@10 + signed int am_pm_flag_close; // eax@10 + int v9; // esi@10 + //unsigned int v10; // esi@16 + int v11; // ecx@17 + unsigned int v12; // kr00_4@25 + //Player *v13; // esi@25 + int v14; // eax@25 + //Player *v15; // esi@27 + //signed int v16; // eax@32 + unsigned int v17; // eax@37 + signed int v18; // edi@37 + signed int v19; // edi@41 + //unsigned int v20; // ecx@41 + //const char *v22; // [sp-4h] [bp-40h]@33 + char pContainer[40]; // [sp+Ch] [bp-30h]@32 + unsigned int v24; // [sp+34h] [bp-8h]@5 + //enum HOUSE_ID v25; // [sp+38h] [bp-4h]@1 + + //v1 = uHouseID; + //v25 = uHouseID; + GameUI_StatusBar_TimedString[0] = 0; + pStatusBarString[0] = 0; + ShowStatusBarString("", 2u); + if ( pMessageQueue_50CBD0->uNumMessages ) + pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; + viewparams->bRedrawGameUI = 1; + uDialogueType = 0; + pKeyActionMap->_459ED1(3); + pKeyActionMap->ResetKeys(); + if (uHouseID == HOUSE_600 || uHouseID == HOUSE_601) + { + GameOverMenu(0); + return 0; + } + uOpenTime = p2DEvents[uHouseID - 1].uOpenTime; + uCloseTime = p2DEvents[uHouseID - 1].uCloseTime; + ptr_F8B1E8 = 0; + dword_F8B1E4 = 0; + dword_F8B1F4 = 0; + memset(byte_F8B1F0, 0, 4); + memset(byte_F8B148, 0, 16); + pRenderer->ClearZBuffer(0, 479); + + if (((uCloseTime - 1 <= uOpenTime)&&((pParty->uCurrentHour <uOpenTime)&&(pParty->uCurrentHour >(uCloseTime - 1))))|| + ((uCloseTime - 1 > uOpenTime)&&((pParty->uCurrentHour < uOpenTime)||(pParty->uCurrentHour > (uCloseTime - 1))))) + + { + am_pm_flag_open = 0; + am_pm_flag_close = 0; + if (uOpenTime > 12 ) + { + uOpenTime -= 12; + am_pm_flag_open = 1; + } + if ( uCloseTime > 12 ) + { + uCloseTime -= 12; + am_pm_flag_close = 1; + } + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[414], uOpenTime, aAMPMNames[am_pm_flag_open], + uCloseTime, aAMPMNames[am_pm_flag_close]); //"This place is open from %d%s to %d%s" + ShowStatusBarString(pTmpBuf, 2u); + if ( uActiveCharacter ) + pPlayers[uActiveCharacter]->PlaySound(SPEECH_3, 0); + return 0; + } + else + { + //v10 = uHouseID; + if ( (signed int)uHouseID < 53 ) //entering shops and guilds + { + if ( !(pParty->field_3C._shop_ban_times[uHouseID]) + || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) ) + { + pParty->field_3C._shop_ban_times[uHouseID] = 0; + } + else + { + ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!" + return 0; + } + } + if ( !start_event_seq_number ) + pAudioPlayer->StopChannels(-1, -1); + + uCurrentHouse_Animation = p2DEvents[uHouseID - 1].uAnimationID; + in_current_building_type = pAnimatedRooms[uCurrentHouse_Animation].uBuildingType; + if ( in_current_building_type == BildingType_Throne_Room && pParty->uFine ) // going 2 jail + { + uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID; + uHouseID = HOUSE_JAIL; + pParty->uTimePlayed = pParty->uTimePlayed+ 0x7620000; + in_current_building_type = pAnimatedRooms[p2DEvents[HOUSE_LORD_AND_JUDGE].uAnimationID].uBuildingType; + ++pParty->uNumPrisonTerms; + pParty->uFine = 0; + for (uint i = 0; i < 4; ++i) + { + pParty->pPlayers[i].uTimeToRecovery = 0; + pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0; + pParty->pPlayers[i].SetVariable(VAR_Award, 87); + } + } + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + switch (pParty->alignment) + { + case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break; + case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break; + case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; + default: assert(false); + } + + v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + pDialogueNPCCount = 0; + pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17]; + uTextureID_507B04 = uTextureID_right_panel; + PrepareHouse(uHouseID); + v18 = 1; + uTextureID_507B04 = uTextureID_right_panel; + if ( uNumDialogueNPCPortraits == 1 ) + pDialogueNPCCount = 1; + pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u); + dword_5C35D4 = 1; + if ( (signed int)uHouseID < 139 || (signed int)uHouseID > 172 ) + { + if ( (signed int)uHouseID >= 54 && (signed int)uHouseID <= 73 && !sub_4B68EA(uHouseID - 54) ) + { + return 1; + } + } + else + { //guilds + v19 = guild_mambership_flags[uHouseID-139]; //guilds flags + //v20 = uHouseID; + //if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->_guilds_member_bits[v19 /8]) ) + if(_449B57_test_bit((unsigned char*)pPlayers[uActiveCharacter]->_guilds_member_bits,v19)) + { + HousePlaySomeSound(uHouseID, 3); + return 1; + } + } + HousePlaySomeSound(uHouseID, 1); + dword_5C35D4 = 1; + return 1; + } + }
--- a/mm7_5.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_5.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -9269,7 +9269,7 @@ v6 = 0; if (!uNumVisibleNotEmptySectors) { -LABEL_7: +//LABEL_7: pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[uNumVisibleNotEmptySectors++] = field_FA8[i].uSectorID; } else @@ -17701,7 +17701,7 @@ v2 = (unsigned __int8 *)pPlayer->_guilds_member_bits; do { - v13 = (char *)pAwards[v1-1].pText;//dword_723E80_award_related[2 * v1]; + v13 = (char *)pAwards[v1].pText;//dword_723E80_award_related[2 * v1]; if ( (unsigned __int16)_449B57_test_bit(v2, v1) && v13 ) { v3 = dword_506520++;
--- a/mm7_6.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_6.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -2174,17 +2174,17 @@ void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) { //bool result; // eax@2 - __int16 v6; // bx@4 + //__int16 v6; // bx@4 //Player *v7; // eax@4 - char v8; // zf@12 + //char v8; // zf@12 unsigned __int16 v9; // cx@16 unsigned int v10; // eax@18 unsigned __int8 v11; // sf@18 unsigned __int8 v12; // of@18 unsigned __int16 v13; // cx@21 unsigned int v14; // eax@23 - stru277 *v15; // esi@27 - stru277 *v16; // eax@28 + //stru277 *v15; // esi@27 + //stru277 *v16; // eax@28 GUIWindow *v17; // eax@43 GUIWindow *v18; // [sp-30h] [bp-48h]@44 unsigned int v19; // [sp-2Ch] [bp-44h]@44 @@ -2198,11 +2198,11 @@ unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 char *v28; // [sp-8h] [bp-20h]@43 Texture *v29; // [sp-4h] [bp-1Ch]@43 - __int16 a3a; // [sp+10h] [bp-8h]@1 - __int16 a2a; // [sp+14h] [bp-4h]@1 - - a3a = uPlayerID; - a2a = a1; + //__int16 a3a; // [sp+10h] [bp-8h]@1 + //__int16 a2a; // [sp+14h] [bp-4h]@1 + + //a3a = uPlayerID; + //a2a = a1; //if ( pParty->bTurnBasedModeOn != 1 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) @@ -2213,7 +2213,7 @@ } - v6 = a5; + //v6 = a5; //v7 = &pParty->pPlayers[uPlayerID]; assert(uPlayerID < 4); auto player = &pParty->pPlayers[uPlayerID]; @@ -2221,72 +2221,79 @@ { switch ( a1 ) { - case 47: - case 68: - case 89: - HIBYTE(v6) = HIBYTE(a5) | 1; + case SPELL_SPIRIT_FATE: + case SPELL_BODY_FIRST_AID: + case SPELL_DARK_REANIMATE: + //HIBYTE(v6) = HIBYTE(a5) | 1; + a5 |= 0x0100; break; - case 4: - case 28: - case 30: - case 91: - LOBYTE(v6) = a5 | 0x80; + + case SPELL_FIRE_FIRE_AURA: + case SPELL_WATER_RECHARGE_ITEM: + case SPELL_WATER_ENCHANT_ITEM: + case SPELL_DARK_VAMPIRIC_WEAPON: + //LOBYTE(v6) = a5 | 0x80; + a5 |= 0x0080; break; - case 2: - case 6: - case 11: - case 18: - case 20: - case 24: - case 26: - case 29: - case 32: - case 34: - case 35: - case 37: - case 39: - case 44: - case 52: - case 57: - case 60: - case 65: - case 70: - case 76: - case 78: - case 79: - case 87: - case 90: - case 92: - case 93: - case 97: + + case SPELL_FIRE_FIRE_BOLT: + case SPELL_FIRE_FIREBALL: + case SPELL_FIRE_INCINERATE: + case SPELL_AIR_LIGHNING_BOLT: + case SPELL_AIR_IMPLOSION: + case SPELL_WATER_POISON_SPRAY: + case SPELL_WATER_ICE_BOLT: + case SPELL_WATER_ACID_BURST: + case SPELL_WATER_ICE_BLAST: + case SPELL_EARTH_STUN: + case SPELL_EARTH_SLOW: + case SPELL_EARTH_DEADLY_SWARM: + case SPELL_EARTH_BLADES: + case SPELL_EARTH_MASS_DISTORTION: + case SPELL_SPIRIT_SPIRIT_LASH: + case SPELL_MIND_MIND_BLAST: + case SPELL_MIND_CHARM: + case SPELL_MIND_PSYCHIC_SHOCK: + case SPELL_BODY_HARM: + case SPELL_BODY_FLYING_FIST: + case SPELL_LIGHT_LIGHT_BOLT: + case SPELL_LIGHT_DESTROY_UNDEAD: + case SPELL_LIGHT_SUNRAY: + case SPELL_DARK_TOXIC_CLOUD: + case SPELL_DARK_SHRINKING_RAY: + case SPELL_DARK_SHARPMETAL: + case SPELL_DARK_DRAGON_BREATH: if ( !a6 ) - goto LABEL_9; - break; - case 59: - case 62: - case 66: - case 81: - case 94: -LABEL_9: - v6 = a5 | 8; + a5 |= 0x0008; break; - case 42: - v6 = a5 | 0x40; + case SPELL_MIND_TELEPATHY: + case SPELL_MIND_BERSERK: + case SPELL_MIND_ENSLAVE: + case SPELL_LIGHT_PARALYZE: + case SPELL_DARK_CONTROL_UNDEAD: +//LABEL_9: + //v6 = a5 | 8; + a5 |= 0x0008; break; - case 46: - if ( a4 ) - v8 = (a4 & 0x1C0) == 0; - else - v8 = (player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0; - if ( v8 ) + + case SPELL_EARTH_TELEKINESIS: + a5 |= 0x0040; + break; + + case SPELL_SPIRIT_BLESS: + if (a4 && ~a4 & 0x01C0) + goto LABEL_25; + else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0); goto LABEL_25; break; - case 50: + + case SPELL_SPIRIT_PRESERVATION: v9 = a4; if ( !a4 ) v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; goto LABEL_18; - case 95: + + case SPELL_DARK_PAIN_REFLECTION: v9 = a4; if ( !a4 ) v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; @@ -2295,7 +2302,8 @@ v12 = __OFSUB__(v10, 3); v11 = ((v10 - 3) & 0x80000000u) != 0; goto LABEL_24; - case 73: + + case SPELL_BODY_HAMMERHANDS: v13 = a4; if ( !a4 ) v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; @@ -2306,64 +2314,67 @@ if ( v11 ^ v12 ) goto LABEL_25; break; - case 40: - case 49: - case 53: - case 55: - case 56: - case 61: - case 64: - case 67: - case 71: - case 72: - case 74: + + case SPELL_EARTH_STONE_TO_FLESH: + case SPELL_SPIRIT_REMOVE_CURSE: + case SPELL_SPIRIT_RAISE_DEAD: + case SPELL_SPIRIT_RESSURECTION: + case SPELL_MIND_REMOVE_FEAR: + case SPELL_MIND_CURE_PARALYSIS: + case SPELL_MIND_CURE_INSANITY: + case SPELL_BODY_CURE_WEAKNESS: + case SPELL_BODY_REGENERATION: + case SPELL_BODY_CURE_POISON: + case SPELL_BODY_CURE_DISEASE: LABEL_25: - v6 = a5 | 2; + //v6 = a5 | 2; + a5 |= 0x0002; break; - case 96: - HIBYTE(v6) = HIBYTE(a5) | 2; + + case SPELL_DARK_SACRIFICE: + //HIBYTE(v6) = HIBYTE(a5) | 2; + a5 |= 0x0200; break; default: break; } } - v15 = pStru277; - if ( v6 & 0x3CA ) + + if (a5 & 0x3CA) { - v16 = pStru277; - while ( !(v16->field_8 & 0x3CA) ) - { - ++v16; - if ( (signed int)v16 >= (signed int)&unk_50C190 ) - goto LABEL_33; - } - v16->spellnum = 0; + assert(sizeof(pStru277) / sizeof(*pStru277) == 10); + for (uint i = 0; i < 10; ++i) + if (pStru277[i].field_8 & 0x3CA) + { + pStru277[i].spellnum = 0; + break; + } } - do + + assert(sizeof(pStru277) / sizeof(*pStru277) == 10); + for (uint i = 0; i < 10; ++i) { -LABEL_33: - if ( v15->spellnum ) + auto spell = pStru277 + i; + if (!spell->spellnum) + continue; + + spell->spellnum = 0; + if (spell->field_8 & 0x3CA) { - v8 = (v15->field_8 & 0x3CA) == 0; - v15->spellnum = 0; - if ( !v8 ) - { - pGUIWindow_Settings->Release(); - pGUIWindow_Settings = 0; - pMouse->SetCursorBitmap("MICON1"); - GameUI_StatusBar_TimedStringTimeLeft = 0; - unk_50C9A0 = 0; - back_to_game(); - } + pGUIWindow_Settings->Release(); + pGUIWindow_Settings = nullptr; + pMouse->SetCursorBitmap("MICON1"); + GameUI_StatusBar_TimedStringTimeLeft = 0; + unk_50C9A0 = 0; + back_to_game(); } - ++v15; } - while (v15 < pStru277 + 10); - int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); + + int result = pStru277->PushStru277(a1, uPlayerID, a4, a5, a6); if ( result != -1 ) { - if ( v6 & 2 ) + if ( a5 & 2 ) { if ( pGUIWindow_Settings ) return; @@ -2375,7 +2386,7 @@ sub_421B2C_PlaceInInventory_or_DropPickedItem(); return; } - if ( v6 & 8 ) + if ( a5 & 8 ) { if ( pGUIWindow_Settings ) return; @@ -2399,7 +2410,7 @@ sub_421B2C_PlaceInInventory_or_DropPickedItem(); return; } - if ( v6 & 0x40 ) + if ( a5 & 0x40 ) { if ( pGUIWindow_Settings ) return; @@ -2411,7 +2422,7 @@ v25 = 190; goto LABEL_44; } - if ( (char)v6 < 0 ) + if ( (char)a5 < 0 ) { if ( pGUIWindow_Settings ) return; @@ -2424,7 +2435,7 @@ sub_421B2C_PlaceInInventory_or_DropPickedItem(); return; } - if ( HIBYTE(v6) & 1 ) + if ( HIBYTE(a5) & 1 ) { if ( pGUIWindow_Settings ) return; @@ -2436,7 +2447,7 @@ pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); sub_421B2C_PlaceInInventory_or_DropPickedItem(); } - if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) + if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) { pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( @@ -2503,7 +2514,7 @@ } //----- (00427DA0) -------------------------------------------------------- -unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6) +unsigned int stru277::PushStru277(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int a6) { unsigned int result; // eax@1 stru277 *v7; // edx@1 @@ -2524,9 +2535,9 @@ if ( a5 & 0x10 ) v8->uPlayerID_2 = uPlayerID; v8->field_6 = 0; - *(int *)&v8->field_C = 0; + v8->spell_target_pid = 0; v8->field_8 = a5; - v8->field_A = a4; + v8->forced_spell_skill_level = skill_level; v8->field_10 = a6; LABEL_8: if ( result == 10 ) @@ -2537,22 +2548,22 @@ //----- (00427E01) -------------------------------------------------------- void stru277::_427E01_cast_spell() { - int v1; // esi@1 + //int v1; // esi@1 int v2; // edi@1 stru277 *v3; // ebx@2 - signed int v4; // eax@8 - __int16 v5; // ax@9 + //signed int v4; // eax@8 + //__int16 v5; // ax@9 signed int v6; // eax@14 - __int16 v7; // ax@23 - __int16 v8; // ax@24 - char v9; // al@44 - int v10; // eax@45 + //__int16 v7; // ax@23 + //__int16 v8; // ax@24 + //char v9; // al@44 + //int v10; // eax@45 unsigned __int16 v11; // cx@45 signed int v12; // ecx@48 - int v13; // eax@53 + //int v13; // eax@53 unsigned __int8 v14; // zf@53 - unsigned int v15; // edx@53 - signed int v16; // eax@53 + //unsigned int v15; // edx@53 + //signed int v16; // eax@53 Player *v17; // esi@70 int v18; // eax@72 int v19; // eax@74 @@ -2560,11 +2571,11 @@ signed int i; // esi@76 int v22; // eax@88 __int16 v23; // ax@88 - int v24; // ecx@93 - int v25; // ecx@94 - signed __int64 v26; // qax@100 - char *v27; // ecx@100 - unsigned __int64 v28; // qax@102 + //int v24; // ecx@93 + //int v25; // ecx@94 + //signed __int64 v26; // qax@100 + //char *v27; // ecx@100 + //unsigned __int64 v28; // qax@102 int v29; // ecx@105 int v30; // ecx@106 int v31; // eax@112 @@ -2592,7 +2603,7 @@ int v53; // eax@153 signed __int64 v54; // qax@164 int v55; // edi@164 - stru6 *v56; // eax@165 + //stru6 *v56; // eax@165 int v57; // eax@169 signed __int64 v58; // qax@177 int v59; // edi@177 @@ -2609,41 +2620,41 @@ int v70; // ecx@214 int v71; // ecx@215 int v72; // ecx@216 - __int16 v73; // ST1C_2@222 - __int16 v74; // ST18_2@222 - stru6 *v75; // eax@222 + //__int16 v73; // ST1C_2@222 + //__int16 v74; // ST18_2@222 + //stru6 *v75; // eax@222 int v76; // ecx@223 int v77; // ecx@224 int v78; // ecx@225 int v79; // eax@227 - int v80; // eax@232 - __int16 v81; // ST18_2@245 - stru6 *v82; // eax@245 + //int v80; // eax@232 + //__int16 v81; // ST18_2@245 + //stru6 *v82; // eax@245 signed int v83; // edi@245 - __int16 v84; // ST18_2@245 - stru6 *v85; // eax@245 - __int16 v86; // ST18_2@245 - stru6 *v87; // eax@245 - __int16 v88; // ST18_2@245 - stru6 *v89; // eax@245 + //__int16 v84; // ST18_2@245 + //stru6 *v85; // eax@245 + //__int16 v86; // ST18_2@245 + //stru6 *v87; // eax@245 + //__int16 v88; // ST18_2@245 + //stru6 *v89; // eax@245 double v90; // st7@245 int v91; // eax@250 Player *v92; // eax@255 - __int16 v93; // ST18_2@260 - stru6 *v94; // eax@260 - __int16 v95; // ST18_2@260 - stru6 *v96; // eax@260 - __int16 v97; // ST18_2@260 - stru6 *v98; // eax@260 - __int16 v99; // ST18_2@260 - stru6 *v100; // eax@260 + //__int16 v93; // ST18_2@260 + //stru6 *v94; // eax@260 + //__int16 v95; // ST18_2@260 + //stru6 *v96; // eax@260 + //__int16 v97; // ST18_2@260 + //stru6 *v98; // eax@260 + //__int16 v99; // ST18_2@260 + //stru6 *v100; // eax@260 int v101; // ecx@261 int v102; // ecx@262 int v103; // ecx@263 int v104; // eax@265 int v105; // edi@271 - __int16 v106; // ST18_2@272 - stru6 *v107; // eax@272 + //__int16 v106; // ST18_2@272 + //stru6 *v107; // eax@272 __int16 v108; // ST1C_2@274 __int16 v109; // ST18_2@274 stru6 *v110; // eax@274 @@ -2664,27 +2675,27 @@ int v125; // ecx@290 int v126; // eax@292 int v127; // eax@296 - __int16 v128; // ST18_2@303 - stru6 *v129; // eax@303 - __int16 v130; // ST18_2@303 - stru6 *v131; // eax@303 - __int16 v132; // ST18_2@303 - stru6 *v133; // eax@303 - __int16 v134; // ST18_2@303 - stru6 *v135; // eax@303 - unsigned __int64 v136; // qax@304 - char *v137; // ecx@304 + //__int16 v128; // ST18_2@303 + //stru6 *v129; // eax@303 + //__int16 v130; // ST18_2@303 + //stru6 *v131; // eax@303 + //__int16 v132; // ST18_2@303 + //stru6 *v133; // eax@303 + //__int16 v134; // ST18_2@303 + //stru6 *v135; // eax@303 + //unsigned __int64 v136; // qax@304 + //char *v137; // ecx@304 int v138; // ecx@305 int v139; // ecx@306 int v140; // eax@308 - __int16 v141; // ST18_2@311 - stru6 *v142; // eax@311 - __int16 v143; // ST18_2@311 - stru6 *v144; // eax@311 - __int16 v145; // ST18_2@311 - stru6 *v146; // eax@311 - __int16 v147; // ST18_2@311 - stru6 *v148; // eax@311 + //__int16 v141; // ST18_2@311 + //stru6 *v142; // eax@311 + //__int16 v143; // ST18_2@311 + //stru6 *v144; // eax@311 + //__int16 v145; // ST18_2@311 + //stru6 *v146; // eax@311 + //__int16 v147; // ST18_2@311 + //stru6 *v148; // eax@311 int v149; // ecx@312 int v150; // ecx@313 int v151; // ecx@314 @@ -2702,8 +2713,8 @@ int v163; // eax@340 signed int v164; // eax@340 signed int v165; // edi@340 - stru6 *v166; // eax@340 - stru6 *v167; // eax@340 + //stru6 *v166; // eax@340 + //stru6 *v167; // eax@340 signed int v168; // edi@343 int v169; // eax@344 int v170; // ecx@346 @@ -2711,15 +2722,15 @@ int v172; // ecx@348 int v173; // edi@350 signed int v174; // edi@355 - __int16 v175; // ST18_2@357 - stru6 *v176; // eax@357 - __int16 v177; // ST18_2@357 - stru6 *v178; // eax@357 - __int16 v179; // ST18_2@357 - stru6 *v180; // eax@357 - __int16 v181; // ST18_2@357 - stru6 *v182; // eax@357 - signed __int64 v183; // qax@357 + //__int16 v175; // ST18_2@357 + //stru6 *v176; // eax@357 + //__int16 v177; // ST18_2@357 + //stru6 *v178; // eax@357 + //__int16 v179; // ST18_2@357 + //stru6 *v180; // eax@357 + //__int16 v181; // ST18_2@357 + //stru6 *v182; // eax@357 + //signed __int64 v183; // qax@357 int v184; // ecx@358 int v185; // ecx@359 int v186; // ecx@360 @@ -2733,14 +2744,14 @@ int v194; // ecx@384 int v195; // eax@386 int v196; // eax@387 - __int16 v197; // ST18_2@395 - stru6 *v198; // eax@395 - __int16 v199; // ST18_2@395 - stru6 *v200; // eax@395 - __int16 v201; // ST18_2@395 - stru6 *v202; // eax@395 - __int16 v203; // ST18_2@395 - stru6 *v204; // eax@395 + //__int16 v197; // ST18_2@395 + //stru6 *v198; // eax@395 + //__int16 v199; // ST18_2@395 + //stru6 *v200; // eax@395 + //__int16 v201; // ST18_2@395 + //stru6 *v202; // eax@395 + //__int16 v203; // ST18_2@395 + //stru6 *v204; // eax@395 signed int v205; // edi@405 int v206; // eax@407 __int16 v207; // cx@407 @@ -2766,15 +2777,15 @@ int v227; // esi@453 unsigned int v228; // edi@454 int v229; // edi@466 - __int16 v230; // ST18_2@469 - stru6 *v231; // eax@469 - signed int v232; // esi@469 - __int16 v233; // ST18_2@469 - stru6 *v234; // eax@469 - __int16 v235; // ST18_2@469 - stru6 *v236; // eax@469 - __int16 v237; // ST18_2@469 - stru6 *v238; // eax@469 + //__int16 v230; // ST18_2@469 + //stru6 *v231; // eax@469 + //signed int v232; // esi@469 + //__int16 v233; // ST18_2@469 + //stru6 *v234; // eax@469 + //__int16 v235; // ST18_2@469 + //stru6 *v236; // eax@469 + //__int16 v237; // ST18_2@469 + //stru6 *v238; // eax@469 __int16 v239; // ST1C_2@469 char *v240; // ecx@472 double v241; // st7@478 @@ -2849,7 +2860,7 @@ char v310; // sf@593 unsigned __int8 v311; // of@593 char v312; // cl@597 - char v313; // al@606 + char v313; // al@606pGame->GetStru6() int v314; // edx@607 int j; // esi@607 unsigned int v316; // eax@613 @@ -2867,43 +2878,43 @@ int v328; // ecx@651 int v329; // ecx@652 int v330; // edi@654 - __int16 v331; // ST18_2@658 - stru6 *v332; // eax@658 - __int16 v333; // ST18_2@658 - stru6 *v334; // eax@658 - __int16 v335; // ST18_2@658 - stru6 *v336; // eax@658 - __int16 v337; // ST18_2@658 - stru6 *v338; // eax@658 + //__int16 v331; // ST18_2@658 + //stru6 *v332; // eax@658 + //__int16 v333; // ST18_2@658 + //stru6 *v334; // eax@658 + //__int16 v335; // ST18_2@658 + //stru6 *v336; // eax@658 + //__int16 v337; // ST18_2@658 + //stru6 *v338; // eax@658 int v339; // ecx@659 int v340; // ecx@660 int v341; // eax@663 signed int v342; // edi@668 signed int v343; // edi@670 unsigned __int64 v344; // ST08_8@670 - __int16 v345; // ST1C_2@671 - __int16 v346; // ST18_2@671 - stru6 *v347; // eax@671 + //__int16 v345; // ST1C_2@671 + //__int16 v346; // ST18_2@671 + //stru6 *v347; // eax@671 int v348; // ecx@672 int v349; // ecx@673 int v350; // edi@676 Player *v351; // edi@680 - __int16 v352; // ST18_2@685 - stru6 *v353; // eax@685 + //__int16 v352; // ST18_2@685 + //stru6 *v353; // eax@685 int v354; // ecx@686 int v355; // ecx@687 int v356; // eax@689 Player *v357; // edi@694 - unsigned __int16 v358; // ST1C_2@695 - __int16 v359; // ST18_2@695 - stru6 *v360; // eax@695 - __int16 v361; // ST1C_2@697 - __int16 v362; // ST18_2@697 - stru6 *v363; // eax@697 + //unsigned __int16 v358; // ST1C_2@695 + //__int16 v359; // ST18_2@695 + //stru6 *v360; // eax@695 + //__int16 v361; // ST1C_2@697 + //__int16 v362; // ST18_2@697 + //stru6 *v363; // eax@697 int v364; // ecx@698 int v365; // ecx@699 int v366; // eax@701 - stru6 *v367; // eax@704 + //stru6 *v367; // eax@704 int v368; // eax@704 Actor *v369; // edi@705 int v370; // eax@706 @@ -2925,9 +2936,9 @@ signed int v386; // eax@736 Player *v387; // edi@738 int v388; // edi@740 - unsigned __int16 v389; // ST1C_2@740 - __int16 v390; // ST18_2@740 - stru6 *v391; // eax@740 + //unsigned __int16 v389; // ST1C_2@740 + //__int16 v390; // ST18_2@740 + //stru6 *v391; // eax@740 int v392; // ecx@742 int v393; // ecx@743 int v394; // ecx@744 @@ -2937,22 +2948,22 @@ int v398; // eax@757 int v399; // eax@757 char *v400; // esi@757 - Game *v401; // ecx@759 - __int16 v402; // ST1C_2@759 - __int16 v403; // ST18_2@759 - stru6 *v404; // eax@759 + //Game *v401; // ecx@759 + //__int16 v402; // ST1C_2@759 + //__int16 v403; // ST18_2@759 + //stru6 *v404; // eax@759 int v405; // ecx@761 int v406; // ecx@762 int v407; // edi@765 - __int16 v408; // ST1C_2@769 - __int16 v409; // ST18_2@769 - stru6 *v410; // eax@769 + //__int16 v408; // ST1C_2@769 + //__int16 v409; // ST18_2@769 + //stru6 *v410; // eax@769 int v411; // ecx@772 int v412; // ecx@773 int v413; // edi@775 - __int16 v414; // ST1C_2@781 - __int16 v415; // ST18_2@781 - stru6 *v416; // eax@781 + //__int16 v414; // ST1C_2@781 + //__int16 v415; // ST18_2@781 + //stru6 *v416; // eax@781 int v417; // eax@787 int v418; // ecx@789 __int16 v419; // ax@791 @@ -2967,15 +2978,15 @@ int v428; // ecx@825 int v429; // ecx@826 int v430; // eax@828 - stru6 *v431; // eax@831 + //stru6 *v431; // eax@831 int v432; // eax@831 Actor *v433; // edi@832 int v434; // eax@833 int v435; // ecx@837 int v436; // ecx@838 - __int16 v437; // ST1C_2@843 - __int16 v438; // ST18_2@843 - stru6 *v439; // eax@843 + //__int16 v437; // ST1C_2@843 + //__int16 v438; // ST18_2@843 + //stru6 *v439; // eax@843 int v440; // eax@843 int v441; // eax@847 int v442; // ecx@850 @@ -2990,9 +3001,9 @@ int v451; // ecx@875 int v452; // ecx@876 int v453; // edi@878 - __int16 v454; // ST1C_2@884 - __int16 v455; // ST18_2@884 - stru6 *v456; // eax@884 + //__int16 v454; // ST1C_2@884 + //__int16 v455; // ST18_2@884 + //stru6 *v456; // eax@884 int v457; // ecx@887 int v458; // ecx@888 int v459; // eax@890 @@ -3003,44 +3014,44 @@ int v464; // ecx@905 int v465; // ecx@906 int v466; // edi@909 - __int16 v467; // ST1C_2@913 - __int16 v468; // ST18_2@913 - stru6 *v469; // eax@913 + //__int16 v467; // ST1C_2@913 + //__int16 v468; // ST18_2@913 + //stru6 *v469; // eax@913 int v470; // edi@913 int v471; // eax@917 int v472; // eax@917 char *v473; // esi@918 - __int16 v474; // ST18_2@920 - stru6 *v475; // eax@920 - __int16 v476; // ST18_2@920 - stru6 *v477; // eax@920 - __int16 v478; // ST18_2@920 - stru6 *v479; // eax@920 - __int16 v480; // ST18_2@920 - stru6 *v481; // eax@920 - __int16 v482; // ST18_2@923 - stru6 *v483; // eax@923 - __int16 v484; // ST18_2@923 - stru6 *v485; // eax@923 - __int16 v486; // ST18_2@923 - stru6 *v487; // eax@923 - __int16 v488; // ST18_2@923 - stru6 *v489; // eax@923 - __int16 v490; // ST1C_2@924 - __int16 v491; // ST18_2@924 - stru6 *v492; // eax@924 + //__int16 v474; // ST18_2@920 + //stru6 *v475; // eax@920 + //__int16 v476; // ST18_2@920 + //stru6 *v477; // eax@920 + //__int16 v478; // ST18_2@920 + //stru6 *v479; // eax@920 + //__int16 v480; // ST18_2@920 + //stru6 *v481; // eax@920 + //__int16 v482; // ST18_2@923 + //stru6 *v483; // eax@923 + //__int16 v484; // ST18_2@923 + //stru6 *v485; // eax@923 + //__int16 v486; // ST18_2@923 + //stru6 *v487; // eax@923 + //__int16 v488; // ST18_2@923 + //stru6 *v489; // eax@923 + //__int16 v490; // ST1C_2@924 + //__int16 v491; // ST18_2@924 + //stru6 *v492; // eax@924 int v493; // ecx@925 int v494; // ecx@926 - __int16 v495; // ST1C_2@931 - __int16 v496; // ST18_2@931 - stru6 *v497; // eax@931 + //__int16 v495; // ST1C_2@931 + //__int16 v496; // ST18_2@931 + //stru6 *v497; // eax@931 int v498; // edi@931 int v499; // eax@935 int v500; // eax@935 Player *v501; // edi@939 - __int16 v502; // ST18_2@940 - stru6 *v503; // eax@940 - stru6 *v504; // eax@943 + //__int16 v502; // ST18_2@940 + //stru6 *v503; // eax@940 + //stru6 *v504; // eax@943 int v505; // eax@943 int v506; // eax@943 int v507; // edi@944 @@ -3059,14 +3070,14 @@ int v520; // ecx@968 int v521; // ecx@969 int v522; // eax@971 - __int16 v523; // ST18_2@975 - stru6 *v524; // eax@975 - __int16 v525; // ST18_2@975 - stru6 *v526; // eax@975 - __int16 v527; // ST18_2@975 - stru6 *v528; // eax@975 - __int16 v529; // ST18_2@975 - stru6 *v530; // eax@975 + //__int16 v523; // ST18_2@975 + //stru6 *v524; // eax@975 + //__int16 v525; // ST18_2@975 + //stru6 *v526; // eax@975 + //__int16 v527; // ST18_2@975 + //stru6 *v528; // eax@975 + //__int16 v529; // ST18_2@975 + //stru6 *v530; // eax@975 int v531; // eax@982 int v532; // eax@982 int v533; // edi@983 @@ -3077,36 +3088,36 @@ int v538; // ecx@985 int v539; // ecx@986 int v540; // eax@988 - __int16 v541; // ST18_2@991 - stru6 *v542; // eax@991 - __int16 v543; // ST18_2@991 - stru6 *v544; // eax@991 - __int16 v545; // ST18_2@991 - stru6 *v546; // eax@991 - __int16 v547; // ST18_2@991 + //__int16 v541; // ST18_2@991 + //stru6 *v542; // eax@991 + //__int16 v543; // ST18_2@991 + //stru6 *v544; // eax@991 + //__int16 v545; // ST18_2@991 + //stru6 *v546; // eax@991 + //__int16 v547; // ST18_2@991 stru6 *v548; // eax@991 double v549; // st7@991 unsigned __int16 v550; // di@991 int v551; // ecx@993 int v552; // ecx@994 Player *v553; // edi@1001 - __int16 v554; // ST18_2@1002 - stru6 *v555; // eax@1002 - __int16 v556; // ST18_2@1002 - stru6 *v557; // eax@1002 - __int16 v558; // ST18_2@1002 - stru6 *v559; // eax@1002 - __int16 v560; // ST18_2@1002 - stru6 *v561; // eax@1002 + //__int16 v554; // ST18_2@1002 + //stru6 *v555; // eax@1002 + //__int16 v556; // ST18_2@1002 + //stru6 *v557; // eax@1002 + //__int16 v558; // ST18_2@1002 + //stru6 *v559; // eax@1002 + //__int16 v560; // ST18_2@1002 + //stru6 *v561; // eax@1002 unsigned __int16 v562; // di@1005 signed int v563; // eax@1010 unsigned int v564; // ecx@1011 signed int v565; // eax@1012 Player **v566; // ecx@1012 int v567; // eax@1012 - unsigned __int16 v568; // ST1C_2@1012 - __int16 v569; // ST18_2@1012 - stru6 *v570; // eax@1012 + //unsigned __int16 v568; // ST1C_2@1012 + //__int16 v569; // ST18_2@1012 + //stru6 *v570; // eax@1012 Player *v571; // eax@1013 char *v572; // ecx@1013 int v573; // ecx@1017 @@ -3119,10 +3130,10 @@ int v580; // eax@1031 int v581; // edi@1031 int v582; // eax@1031 - __int16 v583; // ST1C_2@1034 - __int16 v584; // ST18_2@1034 + //__int16 v583; // ST1C_2@1034 + //__int16 v584; // ST18_2@1034 char *v585; // esi@1034 - stru6 *v586; // eax@1034 + //stru6 *v586; // eax@1034 signed int v587; // eax@1035 int v588; // ecx@1036 int v589; // ecx@1037 @@ -3152,13 +3163,13 @@ DDM_DLV_Header *v613; // eax@1108 int v614; // eax@1116 int v615; // edi@1119 - __int16 v616; // ST1C_2@1122 - __int16 v617; // ST18_2@1122 - stru6 *v618; // eax@1122 + //__int16 v616; // ST1C_2@1122 + //__int16 v617; // ST18_2@1122 + //stru6 *v618; // eax@1122 Player *v619; // edi@1123 - unsigned __int16 v620; // ST1C_2@1124 - __int16 v621; // ST18_2@1124 - stru6 *v622; // eax@1124 + //unsigned __int16 v620; // ST1C_2@1124 + //__int16 v621; // ST18_2@1124 + //stru6 *v622; // eax@1124 signed __int64 v623; // qax@1127 int v624; // eax@1127 int v625; // edi@1129 @@ -3172,44 +3183,44 @@ Player *v633; // eax@1140 signed int v634; // eax@1140 int v635; // edi@1142 - unsigned __int16 v636; // ST1C_2@1142 - __int16 v637; // ST18_2@1142 - stru6 *v638; // eax@1142 - stru6 *v639; // eax@1143 + //unsigned __int16 v636; // ST1C_2@1142 + //__int16 v637; // ST18_2@1142 + //stru6 *v638; // eax@1142 + //stru6 *v639; // eax@1143 int v640; // ecx@1146 int v641; // ecx@1147 int v642; // edi@1156 int v643; // eax@1156 int v644; // eax@1156 signed int v645; // eax@1158 - Player *v646; // ebx@1169 - int v647; // edi@1169 - signed int v648; // ST1C_4@1170 - Player *v649; // ecx@1170 - unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 - unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 - unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 - unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 + //Player *v646; // ebx@1169 + //int v647; // edi@1169 + //signed int v648; // ST1C_4@1170 + //Player *v649; // ecx@1170 + //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 + //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 + //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 + //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 int v654; // [sp-4h] [bp-E88h]@124 - unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 + //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 unsigned int v656; // [sp-4h] [bp-E88h]@639 int v657; // [sp-4h] [bp-E88h]@807 - int v658; // [sp+0h] [bp-E84h]@100 + //int v658; // [sp+0h] [bp-E84h]@100 int v659; // [sp+0h] [bp-E84h]@123 int v660; // [sp+0h] [bp-E84h]@146 Actor *v661; // [sp+0h] [bp-E84h]@164 - int v662; // [sp+0h] [bp-E84h]@304 + //int v662; // [sp+0h] [bp-E84h]@304 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639 const char *v664; // [sp+0h] [bp-E84h]@802 int v665; // [sp+0h] [bp-E84h]@807 int v666; // [sp+4h] [bp-E80h]@12 enum PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 - unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 + //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 int v669; // [sp+4h] [bp-E80h]@123 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 int v671; // [sp+4h] [bp-E80h]@146 unsigned int v672; // [sp+4h] [bp-E80h]@164 - unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 + //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 __int16 v674; // [sp+4h] [bp-E80h]@684 const char *v675; // [sp+4h] [bp-E80h]@800 int v676; // [sp+4h] [bp-E80h]@807 @@ -3283,7 +3294,7 @@ LayingItem a1; // [sp+DDCh] [bp-A8h]@1 //LayingItem::LayingItem(&a1); - v1 = 0; + //v1 = 0; v2 = 0; amount = 0; LODWORD(v733) = 0; @@ -3294,10 +3305,12 @@ { v3 = &v711[n]; HIDWORD(v733) = (int)v3; - if ( v3->spellnum == (short)v1 ) + if ( v3->spellnum == 0 ) goto LABEL_1166; - if ( pParty->pPartyBuffs[11].NotExpired() ) - pParty->pPartyBuffs[11].Reset(); + + if (pParty->Invisible()) + pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); + if ( v3->field_8 & 0x3CA ) { if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) @@ -3305,30 +3318,31 @@ goto LABEL_1166; } pPlayer = &pParty->pPlayers[v3->uPlayerID]; - v4 = *(int *)&v3->field_C; - if ( v4 != v1 ) - goto LABEL_18; - v5 = v3->spellnum; - if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) - v666 = 1; - else - v666 = v1; - a2 = stru_50C198.FindClosestActor(5120, 1, v666); - v6 = pMouse->uPointingObjectID; - if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) + + a2 = v3->spell_target_pid; + if (!a2) { - v4 = pMouse->uPointingObjectID; -LABEL_18: - a2 = v4; + if (v3->spellnum == SPELL_LIGHT_DESTROY_UNDEAD || + v3->spellnum == SPELL_SPIRIT_TURN_UNDEAD || + v3->spellnum == SPELL_DARK_CONTROL_UNDEAD ) + v666 = 1; + else + v666 = 0; + + a2 = stru_50C198.FindClosestActor(5120, 1, v666); + v6 = pMouse->uPointingObjectID; + if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) + a2 = pMouse->uPointingObjectID; } - a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; - if ( (short)a1.uItemType != (short)v1 ) + + + a1.uItemType = stru_4E3ACC[v3->spellnum].field_0; + if (a1.uItemType) { if ( (a2 & 7) == OBJECT_Actor) { memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); v2 = v723; - v1 = 0; } else { @@ -3336,94 +3350,46 @@ v715.uPitchAngle = pParty->sRotationX; } } - v7 = v3->field_A; - LODWORD(v725) = v1; - _this = (ItemGen *)v1; - if ( v7 == (short)v1 ) + + LODWORD(v725) = 0; + _this = 0; + if (v3->forced_spell_skill_level) + { + v11 = v3->forced_spell_skill_level; + v723 = v11 & 0x3F; + v2 = v723; + } + else { - v8 = v3->spellnum; - if ( v3->spellnum >= 12 ) - { - if ( v8 >= 23 ) - { - if ( v8 >= 34 ) - { - if ( v8 >= 45 ) - { - if ( v8 >= 56 ) - { - if ( v8 >= 67 ) - { - if ( v8 >= 78 ) - { - if ( v8 >= 89 ) - { - if ( v8 >= 100 ) - { - if ( v8 != 100 ) - { -LABEL_45: - HIWORD(v10) = HIWORD(pPlayer); - v11 = pPlayer->pActiveSkills[LODWORD(v725)]; - goto LABEL_47; - } - v667 = (PLAYER_SKILL_TYPE)5; - } - else - { - v667 = (PLAYER_SKILL_TYPE)20; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)19; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)18; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)17; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)16; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)15; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)14; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)13; - } - } - else - { - v667 = (PLAYER_SKILL_TYPE)12; - } + //v667 = PLAYER_SKILL_STAFF; + if (v3->spellnum < SPELL_AIR_WIZARD_EYE) + v667 = PLAYER_SKILL_FIRE; + else if (v3->spellnum < SPELL_WATER_AWAKEN) + v667 = PLAYER_SKILL_AIR; + else if (v3->spellnum < SPELL_EARTH_STUN) + v667 = PLAYER_SKILL_WATER; + else if (v3->spellnum < SPELL_SPIRIT_DETECT_LIFE) + v667 = PLAYER_SKILL_EARTH; + else if (v3->spellnum < SPELL_MIND_REMOVE_FEAR) + v667 = PLAYER_SKILL_SPIRIT; + else if (v3->spellnum < SPELL_BODY_CURE_WEAKNESS) + v667 = PLAYER_SKILL_MIND; + else if (v3->spellnum < SPELL_LIGHT_LIGHT_BOLT) + v667 = PLAYER_SKILL_BODY; + else if (v3->spellnum < SPELL_DARK_REANIMATE) + v667 = PLAYER_SKILL_LIGHT; + else if (v3->spellnum < SPELL_BOW_ARROW) + v667 = PLAYER_SKILL_DARK; + else if (v3->spellnum == SPELL_BOW_ARROW) + v667 = PLAYER_SKILL_BOW; + else assert(false && "Unknown spell"); + LODWORD(v725) = v667; - v9 = pPlayer->GetActualSkillLevel(v667); - v723 = v9 & 0x3F; - v2 = v9 & 0x3F; - goto LABEL_45; + v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F; + v2 = v723; + v11 = pPlayer->pActiveSkills[LODWORD(v725)]; } - v11 = v7; - v10 = v7 & 0x3F; - v723 = v10; - v2 = v10; -LABEL_47: + if ( HIBYTE(v11) & 1 ) { v12 = 4; @@ -3433,7 +3399,6 @@ { if ( (v11 & 0x80u) == 0 ) { - v10 = ((v11 & 0x40) != 0) + 1; v731 = ((v11 & 0x40) != 0) + 1; } else @@ -3442,50 +3407,64 @@ } v12 = v731; } - LOWORD(v10) = v3->spellnum; - v730 = v10; - v13 = v12 + 10 * (signed __int16)v10; - v14 = v3->field_A == (short)v1; - v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing - v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); - uRequiredMana = v15; - sRecoveryTime = v16; - if ( !v14 ) - uRequiredMana = v1; - if ( pParty->uCurrentHour == v1 ) - { - if ( pParty->uCurrentMinute != v1 ) - goto LABEL_62; - if ( LODWORD(v725) == 20 ) - goto LABEL_61; - } - if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) -LABEL_61: - uRequiredMana = v1; -LABEL_62: - if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) + + v730 = v3->spellnum; + if (v3->forced_spell_skill_level) + uRequiredMana = 0; + else + uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; + sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; + + if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || + LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) + uRequiredMana = 0; + + if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) break; - ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); + + ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" LABEL_203: - v3->spellnum = v1; + v3->spellnum = 0; LABEL_1166: ++n; if ( n >= 10 ) return; } - if ( !pPlayer->pConditions[0] || (signed __int16)v730 >= 100 ) - goto LABEL_69; - if ( rand() % 100 >= 50 ) - { - v12 = v731; -LABEL_69: + + if (pPlayer->Cursed() && v730 < SPELL_BOW_ARROW) + if (rand() % 100 < 50) + { + if ( pParty->bTurnBasedModeOn == 0 ) + { + //v646 = pPlayer; + pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); + //v647 = n; + } + else + { + //v647 = n; + //v646 = pPlayer; + //v648 = sRecoveryTime; + //v649 = pPlayer; + pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; + pPlayer->SetRecoveryTime(sRecoveryTime); + pTurnEngine->_40471C(); + } + + ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed" + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); + v711[n].spellnum = 0; + pPlayer->sMana -= uRequiredMana; + return; + } + switch ( v3->spellnum ) { - case 100: - case 101: + case SPELL_BOW_ARROW: + case SPELL_101: v17 = pPlayer; _this = (ItemGen *)1; - if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[5]) >= 3 ) + if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 ) _this = (ItemGen *)2; sRecoveryTime = v17->GetAttackRecoveryTime(1); a1.stru_24.Reset(); @@ -3526,8 +3505,9 @@ && pParty->bTurnBasedModeOn == 1 ) ++pTurnEngine->field_1C; } - goto LABEL_83; - case 102: + goto play_sound_and_continue; + + case SPELL_LASER_PROJECTILE: sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); a1.stru_24.Reset(); a1.field_48 = v3->spellnum; @@ -3564,31 +3544,27 @@ v3->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) ++pTurnEngine->field_1C; - goto LABEL_83; - case 1: + goto play_sound_and_continue; + + case SPELL_FIRE_TORCH_LIGHT: LODWORD(v733) = 3600 * v2; - v24 = v12 - 2; - if ( v24 ) - { - v25 = v24 - 1; - if ( v25 && v25 != 1 ) - amount = 2; - else - amount = 4; - } - else - { - amount = 3; - } + + switch (v12) + { + case 1: amount = 2; break; + case 2: amount = 3; break; + case 3: + case 4: amount = 4; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v668 = v1; - v658 = v1; - v653 = amount; - v651 = v731; - v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); - v27 = (char *)&pParty->pPartyBuffs[16]; - goto LABEL_101; + goto play_sound_and_continue; + + pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0); + goto LABEL_1056; + case 7: v29 = v12 - 2; if ( v29 ) @@ -3611,16 +3587,16 @@ amount = 5; } v31 = v3->uPlayerID; - HIDWORD(v733) = v1; + HIDWORD(v733) = 0; v32 = 8 * v31; - LOBYTE(v32) = v32 | 4; - if ( (signed int)uNumLayingItems > v1 ) + LOBYTE(v32) = v32 | OBJECT_Player; + if ( (signed int)uNumLayingItems > 0 ) { v33 = (char *)&pLayingItems[0].field_48; v730 = uNumLayingItems; do { - if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) + if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) ++HIDWORD(v733); v33 += 112; --v730; @@ -3630,7 +3606,7 @@ if ( SHIDWORD(v733) > amount ) goto LABEL_200; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -3638,13 +3614,13 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v34 = 8 * v3->uPlayerID; LOBYTE(v34) = v34 | OBJECT_Player; a1.field_58_pid = v34; @@ -3660,27 +3636,27 @@ goto LABEL_124; case 20: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - if ( a2 == v1 ) + goto play_sound_and_continue; + if (!a2) goto LABEL_200; if ( (a2 & 7) != OBJECT_Actor) goto LABEL_1056; - v699 = v1; - v698 = v1; - v697 = v1; + v699 = 0; + v698 = 0; + v697 = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v37 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; v37 *= 8; LOBYTE(v37) = v37 | OBJECT_Player; - a1.uFacing = v1; + a1.uFacing = 0; a1.field_58_pid = v37; v38 = a2 >> 3; a1.uSoundID = LOWORD(v3->field_10); @@ -3690,38 +3666,34 @@ a1.vPosition.z = pActors[v39].vPosition.z; v41 = 8 * (a2 >> 3); a1.vPosition.y = v40; - LOBYTE(v41) = v41 | 3; + LOBYTE(v41) = v41 | OBJECT_Actor; a1.field_5C = v41; - v42 = a1.Create(0, v1, v1, v1); + v42 = a1.Create(0, 0, 0, 0); v43 = &v697; goto LABEL_133; case 44: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v726 = (Player *)(a2 >> 3); HIDWORD(v733) = 836 * (a2 >> 3); if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) goto LABEL_1056; pActors[a2 >> 3].pActorBuffs[10].Apply( - pMiscTimer->uTotalGameTimeElapsed + 128, - v1, - v1, - v1, - v1); - v706 = v1; - v705 = v1; - v704 = v1; + pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); + v706 = 0; + v705 = 0; + v704 = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v44 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v44 *= 8; LOBYTE(v44) = v44 | OBJECT_Player; v38 = (signed int)v726; @@ -3732,22 +3704,22 @@ a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); v46 = 8 * (int)v726; a1.vPosition.y = v45; - LOBYTE(v46) = 8 * (char)v726 | 3; + LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; a1.field_5C = v46; - v42 = a1.Create(0, v1, v1, v1); + v42 = a1.Create(0, 0, 0, 0); v43 = &v704; LABEL_133: v670 = (Vec3_int_ *)v43; v47 = v38; goto LABEL_139; case 79: - if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) - goto LABEL_83; + if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) + goto play_sound_and_continue; v730 = a2 >> 3; - v693 = v1; + v693 = 0; HIDWORD(v733) = (int)&pActors[a2 >> 3]; - v692 = v1; - v691 = v1; + v692 = 0; + v691 = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -3757,9 +3729,9 @@ a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); v48 = *(short *)(HIDWORD(v733) + 138); a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); - a1.uAttributes = v1; + a1.uAttributes = 0; a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v49 = 8 * v3->uPlayerID; LOBYTE(v49) = v49 | OBJECT_Player; a1.field_58_pid = v49; @@ -3769,7 +3741,7 @@ LOWORD(v49) = LOWORD(v3->field_10); LOBYTE(a1.uAttributes) |= 0x80u; a1.uSoundID = v49; - v726 = (Player *)a1.Create(0, v1, v1, v1); + v726 = (Player *)a1.Create(0, 0, 0, 0); if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) goto LABEL_200; v47 = v730; @@ -3792,7 +3764,7 @@ case 78: case 97: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -3800,13 +3772,13 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v50 = 8 * v3->uPlayerID; LOBYTE(v50) = v50 | OBJECT_Player; a1.field_58_pid = v50; @@ -3824,7 +3796,7 @@ case 76: case 90: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -3841,25 +3813,25 @@ goto LABEL_200; if ( pPlayer->CanCastSpell(uRequiredMana) ) goto LABEL_152; - goto LABEL_83; + goto play_sound_and_continue; case 81: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - if ( a2 == v1 + goto play_sound_and_continue; + if ( !a2 || (a2 & 7) != OBJECT_Actor || (v730 = a2 >> 3, v721 = (int)&pActors[a2 >> 3], !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) goto LABEL_1056; - Actor::AI_Stand(v730, 4u, 0x80u, (AIDirection *)v1); + Actor::AI_Stand(v730, 4u, 0x80u, 0); v726 = (Player *)(23040 * v2); v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); v55 = v721; - ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); + ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); *(char *)(v55 + 38) |= 8u; - *(short *)(v55 + 148) = v1; - v672 = v1; - *(short *)(v55 + 150) = v1; + *(short *)(v55 + 148) = 0; + v672 = 0; + *(short *)(v55 + 150) = 0; v661 = (Actor *)v55; goto LABEL_165; case 35: @@ -3887,7 +3859,7 @@ LABEL_174: LODWORD(v733) = v57; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; if ( (a2 & 7) != OBJECT_Actor || (v721 = 836 * (a2 >> 3), LODWORD(v718) = (int)&pActors[a2 >> 3], @@ -3901,15 +3873,15 @@ pParty->uTimePlayed + (signed int)v58, v731, amount, - v1, - v1); + 0, + 0); *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; - v672 = v1; + v672 = 0; v661 = (Actor *)LODWORD(v718); goto LABEL_165; case 60: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v730 = 836 * (a2 >> 3); if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) goto LABEL_1056; @@ -3931,10 +3903,7 @@ //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( pActors[a2 >> 3].pActorBuffs[1].Apply( pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), - v731, - v1, - v1, - v1); + v731, 0, 0, 0); a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -3944,18 +3913,18 @@ goto LABEL_1086; case 92: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; a1.stru_24.Reset(); a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.x = pParty->vPosition.x; a1.vPosition.y = pParty->vPosition.y; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v62 = 8 * v3->uPlayerID; LOBYTE(v62) = v62 | OBJECT_Player; a1.field_58_pid = v62; @@ -3990,12 +3959,12 @@ } if ( v65 == 1 ) { - LODWORD(v733) = v1; + LODWORD(v733) = 0; amount = 12; } LABEL_196: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; v730c->UpdateTempBonus(pParty->uTimePlayed); @@ -4003,9 +3972,9 @@ { if (!v730c->Broken()) { - if ( v730c->uSpecEnchantmentType == v1 ) + if (!v730c->uSpecEnchantmentType) { - if ( v730c->uEncantmentType == v1 ) + if (!v730c->uEncantmentType) { v68 = BYTE4(v726->pConditions[3]); if ( !v68 || v68 == 1 || v68 == 2 ) @@ -4028,7 +3997,7 @@ dword_50C9A8 = 256; LABEL_1056: LODWORD(v727) = 1; -LABEL_83: +play_sound_and_continue: if ( v3->field_8 & 0x20 ) { LABEL_1162: @@ -4067,7 +4036,7 @@ } } v3->spellnum = 0; - v1 = 0; + //v1 = 0; LABEL_1165: v2 = v723; goto LABEL_1166; @@ -4079,7 +4048,7 @@ } LABEL_199: dword_50C9D0 = 113; - dword_50C9D4 = v1; + dword_50C9D4 = 0; dword_50C9D8 = 1; LABEL_200: v66 = pGlobalTXT_LocalizationStrings[428]; @@ -4087,9 +4056,10 @@ v67 = 2; LABEL_202: ShowStatusBarString(v66, v67); - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); goto LABEL_203; - case 71: + + case SPELL_BODY_REGENERATION: v70 = v12 - 1; LODWORD(v733) = 3600 * v2; if ( v70 && (v71 = v70 - 1) != 0 ) @@ -4110,24 +4080,19 @@ amount = 1; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v73 = v3->uPlayerID_2; - v74 = v3->spellnum; - v75 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); - v668 = v1; - v658 = v1; - v653 = amount; - v651 = v731; - v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); - v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; - goto LABEL_103; - case 3: - case 14: - case 25: - case 36: - case 58: - case 69: + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); + + pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0); + goto LABEL_1056; + + case SPELL_FIRE_PROTECTION_FROM_FIRE: + case SPELL_AIR_PROTECTION_FROM_AIR: + case SPELL_WATER_PROTECTION_FROM_WATER: + case SPELL_EARTH_PROTECTION_FROM_EARTH: + case SPELL_MIND_PROTECTION_FROM_MIND: + case SPELL_BODY_PROTECTION_FROM_BODY: v76 = v12 - 1; LODWORD(v733) = 3600 * v2; if ( v76 ) @@ -4158,49 +4123,47 @@ amount = v2; } LABEL_232: - v80 = v3->spellnum; - switch ( v80 ) - { - case 3: - LODWORD(v725) = 6; + //v80 = v3->spellnum; + switch (v3->spellnum) + { + case SPELL_FIRE_PROTECTION_FROM_FIRE: + LODWORD(v725) = PARTY_BUFF_RESIST_FIRE; break; - case 14: - LODWORD(v725) = v1; + case SPELL_AIR_PROTECTION_FROM_AIR: + LODWORD(v725) = PARTY_BUFF_RESIST_AIR; break; - case 25: - LODWORD(v725) = 17; + case SPELL_WATER_PROTECTION_FROM_WATER: + LODWORD(v725) = PARTY_BUFF_RESIST_WATER; + break; + case SPELL_EARTH_PROTECTION_FROM_EARTH: + LODWORD(v725) = PARTY_BUFF_RESIST_EARTH; break; - case 36: - LODWORD(v725) = 4; + case SPELL_MIND_PROTECTION_FROM_MIND: + LODWORD(v725) = PARTY_BUFF_RESIST_MIND; break; - case 58: - LODWORD(v725) = 12; + case SPELL_BODY_PROTECTION_FROM_BODY: + LODWORD(v725) = PARTY_BUFF_RESIST_BODY; break; default: - if ( v80 != 69 ) - goto LABEL_1166; - LODWORD(v725) = 1; - break; + assert(false); + goto LABEL_1166; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v81 = v3->spellnum; - v82 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v83 = 1; - v84 = v3->spellnum; - v85 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); - v86 = v3->spellnum; - v87 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); - v88 = v3->spellnum; - v89 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); + v90 = (double)(signed int)v733 * 4.2666669; - goto LABEL_304; - case 5: - if ( v12 <= v1 ) + pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); + LODWORD(v727) = 1; + goto play_sound_and_continue; + + case SPELL_FIRE_HASTE: + if ( v12 <= 0 ) goto LABEL_254; if ( v12 <= 2 ) { @@ -4228,35 +4191,24 @@ do { if ( v92->pConditions ) - LODWORD(v727) = v1; + LODWORD(v727) = 0; ++v92; } while ( v92 <= &pParty->pPlayers[3] ); - if ( LODWORD(v727) != v1 ) + if (LODWORD(v727)) { v726 = (Player *)((int)v733 << 7); - pParty->pPartyBuffs[8].Apply( - pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), - v731, - v1, - v1, - v1); - v93 = v3->spellnum; - v94 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); - v95 = v3->spellnum; - v96 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); - v97 = v3->spellnum; - v98 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); - v99 = v3->spellnum; - v100 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); + pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); } } - goto LABEL_83; - case 46: + goto play_sound_and_continue; + + case SPELL_SPIRIT_BLESS: v101 = v12 - 1; if ( v101 && (v102 = v101 - 1) != 0 ) { @@ -4280,23 +4232,28 @@ LABEL_269: amount = v2 + 5; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; if ( v731 == 1 ) { v108 = v3->uPlayerID_2; v109 = v3->spellnum; v110 = pGame->GetStru6(); pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); - v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); - v668 = v1; + v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); + //v668 = 0; v716 = v111; - v658 = v111; - v653 = amount; + //v658 = v111; + //v653 = amount; v726 = (Player *)((int)v733 << 7); - v651 = 1; - v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[1]; - goto LABEL_103; + //v651 = 1; + //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); + //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; +//LABEL_103: + //HIDWORD(v650) = HIDWORD(v28); +//LABEL_104: + //LODWORD(v650) = v28; + pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 1, amount, v111, 0); + goto LABEL_1056; } v105 = 0; v726 = (Player *)((int)v733 << 7); @@ -4304,18 +4261,17 @@ v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; do { - v106 = v3->spellnum; - v107 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); - v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); - v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); + v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); + v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); ++v730b; ++v105; } while ( v730b <= &pParty->pPlayers[3] ); goto LABEL_1056; + case 52: - if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) + if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) { v730 = a2 >> 3; v112 = &pActors[a2 >> 3]; @@ -4383,10 +4339,11 @@ } v3 = (stru277 *)HIDWORD(v733); } - goto LABEL_83; - case 17: - case 38: - case 51: + goto play_sound_and_continue; + + case SPELL_AIR_SHIELD: + case SPELL_EARTH_STONESKIN: + case SPELL_SPIRIT_HEROISM: v123 = v12 - 1; if ( v123 && (v124 = v123 - 1) != 0 ) { @@ -4411,7 +4368,7 @@ v127 = v3->spellnum; if ( v127 == 17 ) { - amount = v1; + amount = 0; LODWORD(v725) = 14; } else @@ -4430,31 +4387,20 @@ } } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v128 = v3->spellnum; - v129 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); + goto play_sound_and_continue; + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v83 = 1; - v130 = v3->spellnum; - v131 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); - v132 = v3->spellnum; - v133 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); - v134 = v3->spellnum; - v135 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); v726 = (Player *)((int)v733 << 7); v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; -LABEL_304: - v673 = v1; - v662 = v1; - v655 = amount; - v652 = v731; - v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; - v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; - goto LABEL_977; - case 8: +//LABEL_304: + pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); + LODWORD(v727) = v83; + goto play_sound_and_continue; + + case SPELL_FIRE_IMMOLATION: v138 = v12 - 2; if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) v140 = 600 * v2; @@ -4462,27 +4408,18 @@ v140 = 60 * v2; LODWORD(v733) = v140; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v141 = v3->spellnum; - v142 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); - v143 = v3->spellnum; - v144 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); - v145 = v3->spellnum; - v146 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); - v147 = v3->spellnum; - v148 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); - v668 = v1; + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); + v726 = (Player *)((int)v733 << 7); - v658 = v1; - v653 = v2; - v651 = v731; - v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPartyBuffs[10]; - goto LABEL_102; + + pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); + goto LABEL_1056; + case 9: v149 = v12 - 1; if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) @@ -4500,7 +4437,7 @@ goto LABEL_201; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; LODWORD(v725) = a2 & 7; if ( (a2 & 7) == OBJECT_Actor) { @@ -4520,9 +4457,9 @@ } HIDWORD(v733) = v154; v713 = v154 + 2500; - v721 = v1; - LODWORD(v718) = v1; - if ( (signed int)this > v1 ) + v721 = 0; + LODWORD(v718) = 0; + if ( (signed int)this > 0 ) { *(float *)&y = (double)SHIDWORD(v733); *(float *)&v732 = (double)v713; @@ -4541,8 +4478,8 @@ *(float *)&_this = v158 * v158; if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) { - LODWORD(v687) = v1; - HIDWORD(v687) = v1; + LODWORD(v687) = 0; + HIDWORD(v687) = 0; } else { @@ -4556,12 +4493,12 @@ a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.x = uRequiredMana; a1.vPosition.y = LODWORD(v727); - a1.uSectorID = v1; + a1.uSectorID = 0; a1.vPosition.z = a2 + v713; - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; a1.field_5C = v730; a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); @@ -4573,7 +4510,7 @@ v687, SHIDWORD(v687), pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, - v1) != -1 + 0) != -1 && pParty->bTurnBasedModeOn == 1 ) ++pTurnEngine->field_1C; LODWORD(v718) = rand() % 1024 - 512; @@ -4593,28 +4530,28 @@ goto LABEL_202; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); - v700.z = v1; - v700.y = v1; - v700.x = v1; + v700.z = 0; + v700.y = 0; + v700.x = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v161 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v161 *= 8; LOBYTE(v161) = v161 | OBJECT_Player; a1.field_58_pid = v161; a1.uSoundID = LOWORD(v3->field_10); - a2 = v1; - if ( (signed int)v726 > v1 ) + a2 = 0; + if ( (signed int)v726 > 0 ) { do { @@ -4624,39 +4561,37 @@ v732 = pActors[v162].uActorHeight; a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v163 = 8 * dword_50BF30[a2]; - LOBYTE(v163) = v163 | 3; + LOBYTE(v163) = v163 | OBJECT_Actor; a1.field_5C = v163; - v164 = a1.Create(0, v1, v1, v1); + v164 = a1.Create(0, 0, 0, 0); v165 = a2; DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); - v166 = pGame->GetStru6(); - v166->_4A81CA(&a1); - v167 = pGame->GetStru6(); - v167->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); + pGame->GetStru6()->_4A81CA(&a1); + pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); a2 = v165 + 1; } while ( v165 + 1 < (signed int)v726 ); } goto LABEL_1056; - case 12: + + case SPELL_AIR_WIZARD_EYE: LODWORD(v733) = 3600 * v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v168 = 0; do { - v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); + v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); v716 = v169; } while ( v168 < 4 ); - v668 = v1; + v732 = (int)v733 << 7; - v658 = v1; - v653 = v1; - v651 = v731; - v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - goto LABEL_992; - case 13: + + pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); + goto LABEL_1056; + + case SPELL_AIR_FEATHER_FALL: v170 = v12 - 1; if ( !v170 ) { @@ -4677,33 +4612,22 @@ LODWORD(v733) = v173; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v174 = 0; do - pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); + pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); while ( v174 < 4 ); - v175 = v3->spellnum; - v176 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v83 = 1; - v177 = v3->spellnum; - v178 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); - v179 = v3->spellnum; - v180 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); - v181 = v3->spellnum; - v182 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); - v673 = v1; v732 = (int)v733 << 7; - v662 = v1; - v655 = v1; - v652 = v731; - v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v137 = (char *)&pParty->pPartyBuffs[5]; - goto LABEL_976; - case 15: + pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); + LODWORD(v727) = v83; + goto play_sound_and_continue; + + case SPELL_AIR_SPARKS: v184 = v12 - 1; if ( v184 ) { @@ -4731,7 +4655,7 @@ amount = 3; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); a1.stru_24.Reset(); @@ -4741,13 +4665,13 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v187 = 8 * v3->uPlayerID; LOBYTE(v187) = v187 | OBJECT_Player; a1.field_58_pid = v187; @@ -4778,15 +4702,16 @@ goto LABEL_462; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v191 = 0; do - pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); + pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); while ( v191 < 4 ); BYTE1(pParty->uFlags) |= 1u; pParty->uFallSpeed = 1000; goto LABEL_1056; - case 19: + + case SPELL_AIR_INVISIBILITY: v192 = v12 - 1; if ( !v192 ) { @@ -4823,42 +4748,25 @@ } if ( pPlayer->CanCastSpell(uRequiredMana) ) { - v197 = v3->spellnum; - v198 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v83 = 1; - v199 = v3->spellnum; - v200 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); - v201 = v3->spellnum; - v202 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); - v203 = v3->spellnum; - v204 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); - v673 = v1; v732 = (int)v733 << 7; - v662 = v1; - v655 = amount; - v652 = v731; - v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v137 = (char *)&pParty->pPartyBuffs[11]; -LABEL_976: - v136 = pParty->uTimePlayed + v183; -LABEL_977: - ((SpellBuff *)v137)->Apply(v136, v652, v655, v662, v673); -LABEL_978: + + pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); LODWORD(v727) = v83; } - goto LABEL_83; + goto play_sound_and_continue; case 21: if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) { v190 = pGlobalTXT_LocalizationStrings[494]; LABEL_462: ShowStatusBarString(v190, 2u); - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); - goto LABEL_83; + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); + goto play_sound_and_continue; } if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) { @@ -4867,34 +4775,23 @@ goto LABEL_462; } LODWORD(v733) = 3600 * v2; - if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) + if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) amount = 1; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v205 = 0; do - pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); + pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); while ( v205 < 4 ); - v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); + v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); v207 = v3->uPlayerID + 1; v716 = v206; - v668 = v207; - v658 = v206; - v653 = amount; + v732 = (int)v733 << 7; - v651 = v731; - v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPartyBuffs[7]; -LABEL_101: - v26 = (signed int)v26; -LABEL_102: - v28 = pParty->uTimePlayed + v26; -LABEL_103: - HIDWORD(v650) = HIDWORD(v28); -LABEL_104: - LODWORD(v650) = v28; - ((SpellBuff *)v27)->Apply(v650, v651, v653, v658, v668); + + pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); goto LABEL_1056; + case 22: v67 = 2; if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) @@ -4903,7 +4800,7 @@ goto LABEL_202; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v208 = a2 & 7; LODWORD(v725) = a2 & 7; if ( v208 == 3 ) @@ -4925,10 +4822,10 @@ v208 = LODWORD(v725); } v726 = (Player *)v211; - HIDWORD(v733) = v1; + HIDWORD(v733) = 0; *(float *)&v732 = (double)v211; LODWORD(v725) = v211 + 2500; - v721 = v1; + v721 = 0; *(float *)&y = (double)(v211 + 2500); v730 = v208 == 3 ? a2 : 0; a2 = 20; @@ -4945,8 +4842,8 @@ *(float *)&v726 = v216 * v216; if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) { - LODWORD(v685) = v1; - HIDWORD(v685) = v1; + LODWORD(v685) = 0; + HIDWORD(v685) = 0; } else { @@ -4960,12 +4857,12 @@ a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.x = LODWORD(v718); a1.vPosition.y = v713; - a1.uSectorID = v1; + a1.uSectorID = 0; a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; a1.field_5C = v730; a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); @@ -4977,7 +4874,7 @@ v685, SHIDWORD(v685), pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, - v1) != -1 + 0) != -1 && pParty->bTurnBasedModeOn == 1 ) ++pTurnEngine->field_1C; v721 = rand() % 1024 - 512; @@ -4996,7 +4893,7 @@ { if ( v220 == 1 ) { - amount = v1; + amount = 0; goto LABEL_433; } v221 = 180 * v2; @@ -5013,7 +4910,7 @@ amount = v221; LABEL_433: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v222 = (char *)pParty->pPlayers; HIDWORD(v733) = (int)(char *)&pParty + 2508; break; @@ -5039,7 +4936,7 @@ amount = 3; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; HIDWORD(v733) = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; if ( amount == 1 ) { @@ -5054,11 +4951,11 @@ v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; v660 = pParty->vPosition.y; LABEL_153: - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.x = pParty->vPosition.x; a1.vPosition.z = v51; v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; a1.uSectorID = v52; v53 = 8 * v3->uPlayerID; LOBYTE(v53) = v53 | OBJECT_Player; @@ -5089,13 +4986,13 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v226 = 8 * v3->uPlayerID; LOBYTE(v226) = v226 | OBJECT_Player; a1.field_58_pid = v226; @@ -5134,21 +5031,12 @@ v229 = 3600 * v2; LODWORD(v733) = v229; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); - v230 = v3->spellnum; - v231 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); - v232 = 1; - v233 = v3->spellnum; - v234 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); - v235 = v3->spellnum; - v236 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); - v237 = v3->spellnum; - v238 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); + goto play_sound_and_continue; + v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v239 = v3->uPlayerID + 1; v732 = v229 << 7; pParty->pPartyBuffs[18].Apply( @@ -5159,11 +5047,11 @@ v239); if ( v731 == 4 ) pParty->pPartyBuffs[18].uFlags = 1; - LODWORD(v727) = v232; - goto LABEL_83; + LODWORD(v727) = 1; + goto play_sound_and_continue; case 28: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; y = v240; if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) @@ -5196,23 +5084,23 @@ v243 = y; y[25] = v242; *((int *)v243 + 4) = (unsigned __int8)v242; - if ( (unsigned __int8)v242 <= v1 ) - { - *(int *)v243 = v1; + if ( (unsigned __int8)v242 <= 0 ) + { + *(int *)v243 = 0; dword_50C9D0 = 113; - dword_50C9D4 = v1; + dword_50C9D4 = 0; dword_50C9D8 = 1; ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); - v3->spellnum = v1; + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); + v3->spellnum = 0; goto LABEL_1165; } *((int *)v243 + 5) |= 0x40u; goto LABEL_1055; case 30: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - uRequiredMana = v1; + goto play_sound_and_continue; + uRequiredMana = 0; HIDWORD(v733) = 10 * v2; v730 = 1; v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; @@ -5227,11 +5115,11 @@ LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; if ( (unsigned __int8)(v310 ^ v311) | v14 ) { - if ( *(int *)&v244[36 * a2 + 544] == v1 ) + if ( *(int *)&v244[36 * a2 + 544] == 0 ) { - if ( *(int *)&v244[36 * a2 + 536] == v1 ) + if ( *(int *)&v244[36 * a2 + 536] == 0 ) { - if ( *(int *)&v244[36 * a2 + 540] == v1 ) + if ( *(int *)&v244[36 * a2 + 540] == 0 ) { v312 = v309[28]; if ( v312 ) @@ -5246,11 +5134,11 @@ if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) { uRequiredMana = 1; - v730 = v1; + v730 = 0; } if ( rand() % 100 >= SHIDWORD(v733) ) uRequiredMana = 1; - if ( uRequiredMana == v1 ) + if (!uRequiredMana) { v313 = *(char *)(LODWORD(v725) + 28); if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) @@ -5294,18 +5182,18 @@ } } LABEL_616: - if ( LODWORD(v727) == v1 ) + if ( LODWORD(v727) == 0 ) { v317 = pGlobalTXT_LocalizationStrings[428]; - if ( v730 == v1 ) + if ( v730 == 0 ) v317 = pGlobalTXT_LocalizationStrings[585]; ShowStatusBarString(v317, 2u); - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); v318 = v726; - v3->spellnum = v1; - v318->PlaySound(SPEECH_43, v1); + v3->spellnum = 0; + v318->PlaySound(SPEECH_43, 0); } - goto LABEL_83; + goto play_sound_and_continue; } if ( v731 != 2 ) { @@ -5314,9 +5202,9 @@ v245 = (int)&v244[36 * a2 + 532]; v269 = *(int *)v245; if ( *(int *)v245 > 134 - || *(int *)(v245 + 12) != v1 - || *(int *)(v245 + 4) != v1 - || *(int *)(v245 + 8) != v1 + || *(int *)(v245 + 12) != 0 + || *(int *)(v245 + 4) != 0 + || *(int *)(v245 + 8) != 0 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) goto LABEL_616; v270 = (char *)&pItemsTable->pItems[v269].pIconName; @@ -5329,11 +5217,11 @@ if ( v272 ) { uRequiredMana = 1; - v730 = v1; + v730 = 0; } if ( rand() % 100 >= SHIDWORD(v733) ) uRequiredMana = 1; - if ( uRequiredMana != v1 ) + if (uRequiredMana) goto LABEL_613; v273 = v725; v274 = *(char *)(LODWORD(v725) + 28); @@ -5412,9 +5300,9 @@ { if ( v731 != 4 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) - || v726->pInventoryItems[a2].uSpecEnchantmentType != v1 - || v726->pInventoryItems[a2].uEncantmentType != v1 - || v726->pInventoryItems[a2]._bonus_strength != v1 + || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 + || v726->pInventoryItems[a2].uEncantmentType != 0 + || v726->pInventoryItems[a2]._bonus_strength != 0 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) goto LABEL_616; v247 = (char *)&pItemsTable->pItems[v246].pIconName; @@ -5427,11 +5315,11 @@ if ( v249 ) { uRequiredMana = 1; - v730 = v1; + v730 = 0; } if ( rand() % 100 >= SHIDWORD(v733) ) uRequiredMana = 1; - if ( uRequiredMana != v1 ) + if (uRequiredMana) goto LABEL_613; v250 = v725; v251 = *(char *)(LODWORD(v725) + 28); @@ -5509,7 +5397,7 @@ } } LABEL_615: - v1 = 0; + //v1 = 0; goto LABEL_616; } v289 = (ItemGen *)&v244[36 * a2 + 532]; @@ -5517,9 +5405,9 @@ v290 = v289->uItemID; LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; if ( v290 > 134 - || _this->uSpecEnchantmentType != v1 - || _this->uEncantmentType != v1 - || _this->_bonus_strength != v1 + || _this->uSpecEnchantmentType != 0 + || _this->uEncantmentType != 0 + || _this->_bonus_strength != 0 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 || v291 == 1 || v291 == 2 @@ -5529,13 +5417,13 @@ uRequiredMana = 1; if ( rand() % 100 >= SHIDWORD(v733) ) uRequiredMana = 1; - if ( uRequiredMana != v1 ) + if ( uRequiredMana != 0 ) goto LABEL_199; v292 = *(char *)(LODWORD(v725) + 28); if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) { v2 = v723; - v1 = 0; + //v1 = 0; goto LABEL_199; } if ( rand() % 100 >= 80 ) @@ -5611,11 +5499,11 @@ case 31: amount = 10 * v2; if ( pPlayer->sMana < (signed int)uRequiredMana ) - goto LABEL_83; + goto play_sound_and_continue; if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) goto LABEL_200; byte_50C0C0 = LOBYTE(v3->uPlayerID); - pMessageQueue_50CBD0->AddMessage(UIMSG_C3, v1, v1); + pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); goto LABEL_1056; case 33: LODWORD(v733) = 604800 * v2; @@ -5625,7 +5513,7 @@ if ( pPlayer->sMana >= (signed int)uRequiredMana ) { pEventTimer->Pause(); - pMessageQueue_50CBD0->AddMessage(UIMSG_B1, v1, v1); + pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); qword_506350 = (signed int)v733; _506348_current_lloyd_playerid = v3->uPlayerID; ::uRequiredMana = v319; @@ -5634,7 +5522,7 @@ dword_506338 = v3->spellnum; LOBYTE(v3->field_8) |= 0x20u; } - goto LABEL_83; + goto play_sound_and_continue; case 40: v320 = v12 - 2; if ( !v320 ) @@ -5654,7 +5542,7 @@ amount = v322; LABEL_634: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v323 = v3->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; if ( !pParty->pPlayers[v323].pConditions[15] ) @@ -5667,7 +5555,7 @@ goto LABEL_640; case 41: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -5675,13 +5563,13 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v326 = 8 * v3->uPlayerID; LOBYTE(v326) = v326 | OBJECT_Player; a1.field_58_pid = v326; @@ -5699,7 +5587,7 @@ if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) goto LABEL_200; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; a1.uItemType = 4090; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; @@ -5708,9 +5596,9 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.x = pParty->vPosition.x; a1.vPosition.y = pParty->vPosition.y; - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; v327 = 8 * v3->uPlayerID; LOBYTE(v327) = v327 | OBJECT_Player; @@ -5721,7 +5609,7 @@ a1.uSoundID = LOWORD(v3->field_10); if ( pParty->bTurnBasedModeOn == 1 ) a1.uAttributes = 4; - v669 = v1; + v669 = 0; v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; LABEL_124: @@ -5729,7 +5617,8 @@ LABEL_125: v36 = pParty->sRotationY; goto LABEL_157; - case 45: + + case SPELL_SPIRIT_DETECT_LIFE: v328 = v12 - 2; if ( v328 ) { @@ -5745,29 +5634,21 @@ } LODWORD(v733) = v330; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v331 = v3->spellnum; - v332 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); + goto play_sound_and_continue; + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v83 = 1; - v333 = v3->spellnum; - v334 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); - v335 = v3->spellnum; - v336 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); - v337 = v3->spellnum; - v338 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); - v673 = v1; + v732 = (int)v733 << 7; - v662 = v1; - v655 = v1; - v652 = v731; - v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v137 = (char *)&pParty->pPartyBuffs[3]; - goto LABEL_976; - case 47: + + pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); + LODWORD(v727) = v83; + + goto play_sound_and_continue; + + case SPELL_SPIRIT_FATE: LODWORD(v733) = 300; v339 = v12 - 2; if ( v339 ) @@ -5794,37 +5675,29 @@ amount = v341; LABEL_667: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v342 = *(int *)&v3->field_C; - if ( v342 == v1 ) - { - v345 = v3->uPlayerID_2; - v346 = v3->spellnum; - v347 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); - v668 = v1; - v658 = v1; - v653 = amount; - LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; - v651 = v731; - HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); - v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; - goto LABEL_104; + goto play_sound_and_continue; + v342 = v3->spell_target_pid; + if ( v342 == 0 ) + { + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); + + pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); + goto LABEL_1056; } if ( (v342 & 7) == OBJECT_Actor) { v343 = v342 >> 3; - HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); + HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; - pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); + pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); BYTE2(pActors[v343].uAttributes) |= 8u; - v672 = v1; + v672 = 0; v661 = &pActors[v343]; LABEL_165: - v56 = pGame->GetStru6(); pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); } goto LABEL_1056; + case 49: v348 = v12 - 2; if ( !v348 ) @@ -5834,7 +5707,7 @@ { if ( v349 == 1 ) { - amount = v1; + amount = 0; goto LABEL_679; } LABEL_677: @@ -5847,25 +5720,25 @@ amount = v350; LABEL_679: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v351 = &pParty->pPlayers[v3->uPlayerID_2]; if ( !v351->pConditions[0] ) goto LABEL_1056; if ( v731 == 4 ) { - LODWORD(v351->pConditions[0]) = v1; - HIDWORD(v351->pConditions[0]) = v1; + LODWORD(v351->pConditions[0]) = 0; + HIDWORD(v351->pConditions[0]) = 0; goto LABEL_904; } v732 = amount << 7; v351->DiscardConditionIfLastsLongerThan( - v1, + 0, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) goto LABEL_1056; v674 = v3->uPlayerID_2; goto LABEL_685; - case 50: + case SPELL_SPIRIT_PRESERVATION: v354 = v12 - 2; if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) v356 = 900 * (v2 + 4); @@ -5873,33 +5746,24 @@ v356 = 300 * (v2 + 12); LODWORD(v733) = v356; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; if ( v731 == 1 || v731 == 2 ) { - v361 = v3->uPlayerID_2; - v362 = v3->spellnum; - v363 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); - v668 = v1; + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); + v732 = (int)v733 << 7; - v658 = v1; - v653 = v1; - v651 = v731; - v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; - goto LABEL_103; - } - a2 = v1; + + pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); + goto LABEL_1056; + } + a2 = 0; v732 = (int)v733 << 7; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; do { - v358 = a2; - v359 = v3->spellnum; - v360 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); - v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); + v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); ++a2; ++v357;// = (SpellBuff *)((char *)v357 + 6972); } @@ -5913,9 +5777,8 @@ v366 = 300 * v2 + 180; LODWORD(v733) = v366; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); - v367 = pGame->GetStru6(); pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); ++a1.uItemType; a1.stru_24.Reset(); @@ -5923,17 +5786,17 @@ a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v368 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v368 *= 8; LOBYTE(v368) = v368 | OBJECT_Player; a1.field_58_pid = v368; a1.uSoundID = LOWORD(v3->field_10); - for ( a2 = v1; a2 < (signed int)v726; ++a2 ) + for ( a2 = 0; a2 < (signed int)v726; ++a2 ) { v369 = &pActors[dword_50BF30[a2]]; if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) @@ -5943,28 +5806,25 @@ v732 = v369->uActorHeight; a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v370 = 8 * dword_50BF30[a2]; - LOBYTE(v370) = v370 | 3; + LOBYTE(v370) = v370 | OBJECT_Actor; a1.field_5C = v370; - a1.Create(0, v1, v1, v1); + a1.Create(0, 0, 0, 0); v732 = (int)v733 << 7; v369->pActorBuffs[4].Apply( pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), - v731, - v1, - v1, - v1); + v731, 0, 0, 0); } } goto LABEL_1056; case 53: v371 = v12 - 2; if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) - amount = v1; + amount = 0; else amount = 86400 * v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); + goto play_sound_and_continue; + pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); v373 = v3->uPlayerID_2; if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) goto LABEL_1056; @@ -5973,11 +5833,11 @@ if ( v14 ) { v374 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; - HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; + LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; + HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; v376 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; - HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; + LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; + HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; } else { @@ -6000,7 +5860,7 @@ v380 = 3 * v2; amount = v380; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v381 = 0; HIDWORD(v733) = amount; v730 = 0; @@ -6015,15 +5875,15 @@ while ( v382 <= 4 ); v384 = 0; v730 = v381; - if ( v381 > v1 ) + if ( v381 > 0 ) { do HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; while ( v384 < v381 ); } v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); - HIDWORD(v733) = v1; - if ( v381 > v1 ) + HIDWORD(v733) = 0; + if ( v381 > 0 ) { do { @@ -6034,21 +5894,20 @@ if ( v726->sHealth > v386 ) *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); v387 = *(Player **)v385; - if ( v387->sHealth > v1 ) + if ( v387->sHealth > 0 ) { - LODWORD(v387->pConditions[13]) = v1; - HIDWORD(v387->pConditions[13]) = v1; + LODWORD(v387->pConditions[13]) = 0; + HIDWORD(v387->pConditions[13]) = 0; } v388 = HIDWORD(v733); - v389 = LOWORD(v682[HIDWORD(v733)]) - 1; - v390 = v3->spellnum; - v391 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v390, v389); + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); HIDWORD(v733) = v388 + 1; } while ( v388 + 1 < v730 ); } goto LABEL_1056; + case 55: v392 = v12 - 1; if ( !v392 ) @@ -6071,27 +5930,27 @@ goto LABEL_751; } if ( v394 == 1 ) - amount = v1; + amount = 0; LABEL_751: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v396 = v3->uPlayerID_2; if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) { if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) - pParty->pPlayers[v396].PlaySound(SPEECH_25, v1); + pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); if ( v731 == 4 ) { v397 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; - HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; + LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; + HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; v398 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; - HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; + LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; + HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; v399 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; - HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; + LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; + HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; } else { @@ -6109,18 +5968,18 @@ } v83 = 1; pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); - v401 = pGame; + pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; - v402 = v3->uPlayerID_2; - v403 = v3->spellnum; - v404 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v403, v402); + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); } else { v83 = 1; } - goto LABEL_978; + LODWORD(v727) = v83; + goto play_sound_and_continue; + case 61: v405 = v12 - 2; if ( !v405 ) @@ -6130,7 +5989,7 @@ { if ( v406 == 1 ) { - amount = v1; + amount = 0; goto LABEL_768; } LABEL_766: @@ -6143,11 +6002,9 @@ amount = v407; LABEL_768: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v408 = v3->uPlayerID_2; - v409 = v3->spellnum; - v410 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v409, v408); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); v323 = v3->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; if ( !pParty->pPlayers[v323].pConditions[12] ) @@ -6167,7 +6024,7 @@ { if ( v412 == 1 ) { - amount = v1; + amount = 0; goto LABEL_780; } v413 = 180 * v2; @@ -6184,11 +6041,9 @@ amount = v413; LABEL_780: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v414 = v3->uPlayerID_2; - v415 = v3->spellnum; - v416 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v415, v414); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); v323 = v3->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; if ( !pParty->pPlayers[v323].pConditions[3] ) @@ -6201,8 +6056,8 @@ goto LABEL_640; case 59: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) + goto play_sound_and_continue; + if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) goto LABEL_1056; v417 = (int)&pActors[a2 >> 3]; v730 = v417; @@ -6212,7 +6067,7 @@ v417 = v730; } v418 = *(int *)(v417 + 672); - HIDWORD(v733) = v1; + HIDWORD(v733) = 0; if ( pItemsTable->pItems[v418].uEquipType == 18 ) HIDWORD(v733) = *(int *)(v417 + 684); @@ -6220,14 +6075,14 @@ v683.Reset(); v419 = *(short *)(v730 + 180); - if ( v419 != (short)v1 ) + if (v419) { v683.uItemID = v419; goto LABEL_799; } v420 = 0; v421 = v730 + 564; - while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) + while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) { ++v420; v421 += 36; @@ -6236,12 +6091,12 @@ } memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); v2 = v723; - v1 = 0; + //v1 = 0; LABEL_799: - if ( HIDWORD(v733) != v1 ) + if ( HIDWORD(v733) != 0 ) { v675 = (const char *)HIDWORD(v733); - if ( v683.uItemID != v1 ) + if (v683.uItemID) { v422 = v683.GetDisplayName(); sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); @@ -6250,7 +6105,7 @@ v664 = "%d gold"; goto LABEL_803; } - if ( v683.uItemID != v1 ) + if (v683.uItemID) { v675 = v683.GetDisplayName(); v664 = "(%s)"; @@ -6292,7 +6147,7 @@ } amount = v425; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v426 = a2 >> 3; if ( (a2 & 7) != OBJECT_Actor) goto LABEL_1056; @@ -6304,10 +6159,7 @@ v732 = amount << 7; pActors[v426].pActorBuffs[9].Apply( pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), - v731, - v1, - v1, - v1); + v731, 0, 0, 0); pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; } a1.stru_24.Reset(); @@ -6319,14 +6171,14 @@ goto LABEL_1086; case 66: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; amount = 600 * v2; v427 = a2 >> 3; if ( (a2 & 7) != OBJECT_Actor) goto LABEL_1056; v730 = 836 * v427; if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) - goto LABEL_83; + goto play_sound_and_continue; if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) { pActors[v427].pActorBuffs[9].Reset(); @@ -6334,10 +6186,7 @@ v732 = amount << 7; pActors[v427].pActorBuffs[12].Apply( pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), - v731, - v1, - v1, - v1); + v731, 0, 0, 0); } a1.stru_24.Reset(); a1.field_48 = v3->spellnum; @@ -6354,9 +6203,8 @@ v430 = 180 * v2; amount = v430; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); - v431 = pGame->GetStru6(); pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); ++a1.uItemType; a1.stru_24.Reset(); @@ -6364,17 +6212,17 @@ a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v432 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v432 *= 8; LOBYTE(v432) = v432 | OBJECT_Player; a1.field_58_pid = v432; a1.uSoundID = LOWORD(v3->field_10); - for ( a2 = v1; a2 < (signed int)v726; ++a2 ) + for ( a2 = 0; a2 < (signed int)v726; ++a2 ) { v433 = &pActors[dword_50BF30[a2]]; if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) @@ -6384,43 +6232,38 @@ v732 = v433->uActorHeight; a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v434 = 8 * dword_50BF30[a2]; - LOBYTE(v434) = v434 | 3; + LOBYTE(v434) = v434 | OBJECT_Actor; a1.field_5C = v434; - a1.Create(0, v1, v1, v1); + a1.Create(0, 0, 0, 0); if ( stru_50C198.GetMagicalResistance(v433, 7u) ) { v732 = amount << 7; v433->pActorBuffs[4].Apply( pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), - v731, - v1, - v1, - v1); + v731, 0, 0, 0); } } goto LABEL_1056; case 64: v435 = v12 - 2; if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) - amount = v1; + amount = 0; else amount = 86400 * v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v437 = v3->uPlayerID_2; - v438 = v3->spellnum; - v439 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); v440 = v3->uPlayerID_2; if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) { if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) - pParty->pPlayers[v440].PlaySound(SPEECH_25, v1); + pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); if ( v731 == 4 ) { v441 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; - HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; + LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; + HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; } else { @@ -6431,7 +6274,7 @@ } v377 = &pParty->pPlayers[v3->uPlayerID_2]; LABEL_720: - v377->SetCondition(1u, v1); + v377->SetCondition(1, 0); } goto LABEL_1056; case 42: @@ -6453,7 +6296,7 @@ } amount = v444; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v445 = a2 >> 3; if ( (a2 & 7) == OBJECT_Item) { @@ -6496,7 +6339,7 @@ v447 = &pLevelDecorations[v445]; dword_507CD8 = 1; v448 = v447->field_16_event_id; - if ( v448 != (short)v1 ) + if (v448) { v677 = 1; v446 = v448; @@ -6508,7 +6351,7 @@ { GlobalEventInfo = (int)v447; EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); - GlobalEventInfo = v1; + GlobalEventInfo = 0; } } } @@ -6522,7 +6365,7 @@ { if ( v452 == 1 ) { - amount = v1; + amount = 0; goto LABEL_883; } v453 = 180 * v2; @@ -6539,11 +6382,9 @@ amount = v453; LABEL_883: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v454 = v3->uPlayerID_2; - v455 = v3->spellnum; - v456 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v455, v454); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); v323 = v3->uPlayerID_2; v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; if ( !pParty->pPlayers[v323].pConditions[1] ) @@ -6551,8 +6392,8 @@ if ( v731 == 4 ) { LABEL_637: - *(int *)v324 = v1; - *((int *)v324 + 1) = v1; + *(int *)v324 = 0; + *((int *)v324 + 1) = 0; goto LABEL_1056; } v732 = amount << 7; @@ -6584,17 +6425,15 @@ } amount = v459; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v460 = *(int *)&v3->field_C; - if ( v460 == v1 ) + goto play_sound_and_continue; + v460 = v3->spell_target_pid; + if (!v460) { pParty->pPlayers[v3->uPlayerID_2].Heal(amount); LABEL_904: v674 = v3->uPlayerID_2; LABEL_685: - v352 = v3->spellnum; - v353 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v352, v674); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v674); } else { @@ -6630,7 +6469,7 @@ { if ( v465 == 1 ) { - amount = v1; + amount = 0; goto LABEL_912; } LABEL_910: @@ -6643,11 +6482,9 @@ amount = v466; LABEL_912: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v467 = v3->uPlayerID_2; - v468 = v3->spellnum; - v469 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v468, v467); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); v470 = v3->uPlayerID_2; if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) @@ -6655,14 +6492,14 @@ goto LABEL_1056; if ( v731 == 4 ) { - LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; - HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; + LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; + HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; v471 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; - HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; + LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; + HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; v472 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; - HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; + LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; + HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; goto LABEL_1056; } v732 = amount << 7; @@ -6676,88 +6513,61 @@ v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); v656 = 10; goto LABEL_937; + + case 75: amount = v2; LODWORD(v733) = 3600 * v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v474 = v3->spellnum; - v475 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); - v476 = v3->spellnum; - v477 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); - v478 = v3->spellnum; - v479 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); - v480 = v3->spellnum; - v481 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); - v668 = v1; + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); + v732 = (int)v733 << 7; - v658 = v1; - v653 = v2; - v651 = v731; - v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPartyBuffs[13]; - goto LABEL_101; + + pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); + goto LABEL_1056; + case 73: LODWORD(v733) = 3600 * v2; amount = v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; if ( v731 == 4 ) { - v482 = v3->spellnum; - v483 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); - v484 = v3->spellnum; - v485 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); - v486 = v3->spellnum; - v487 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); - v488 = v3->spellnum; - v489 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v732 = (int)v733 << 7; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); - pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); - pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); - v668 = v1; - v658 = v2; - v653 = v2; - LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; - v651 = 4; - HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; - v27 = (char *)&pParty->pPlayers[3].pPlayerBuffs[6]; - goto LABEL_104; - } - v490 = v3->uPlayerID_2; - v491 = v3->spellnum; - v492 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); - v668 = v1; + pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); + pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); + pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); + + pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); + goto LABEL_1056; + //goto LABEL_104; + } + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); + v732 = (int)v733 << 7; - v658 = v2; - v653 = v2; - v651 = v731; - v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; - goto LABEL_103; + + pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0); + goto LABEL_1056; case 74: v493 = v12 - 2; if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) - amount = v1; + amount = 0; else amount = 86400 * v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v495 = v3->uPlayerID_2; - v496 = v3->spellnum; - v497 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v496, v495); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); v498 = v3->uPlayerID_2; if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) @@ -6765,14 +6575,14 @@ goto LABEL_1056; if ( v731 == 4 ) { - LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; - HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; + LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; + HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; v499 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; - HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; + LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; + HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; v500 = v3->uPlayerID_2; - LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; - HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; + LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; + HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; } else { @@ -6793,50 +6603,51 @@ } goto LABEL_1056; case 77: + { amount = 5 * v2 + 10; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v501 = pParty->pPlayers; + int v1 = 0; do { - v502 = v3->spellnum; - v503 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v1); v501->Heal(amount); ++v501; ++v1; } while ( (signed int)v501 < (signed int)pParty->pHirelings ); goto LABEL_1056; + } case 80: sRecoveryTime -= v2; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v504 = pGame->GetStru6(); + goto play_sound_and_continue; + pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); ++a1.uItemType; HIDWORD(v733) = v505; - v690 = v1; - v689 = v1; - v688 = v1; + v690 = 0; + v689 = 0; + v688 = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v506 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v506 *= 8; LOBYTE(v506) = v506 | OBJECT_Player; a1.field_58_pid = v506; a1.uSoundID = LOWORD(v3->field_10); - a2 = v1; - if ( SHIDWORD(v733) > v1 ) + a2 = 0; + if ( SHIDWORD(v733) > 0 ) { do { @@ -6846,16 +6657,16 @@ v732 = pActors[v507].uActorHeight; a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v508 = 8 * dword_50BF30[a2]; - LOBYTE(v508) = v508 | 3; + LOBYTE(v508) = v508 | OBJECT_Actor; a1.field_5C = v508; - v509 = a1.Create(0, v1, v1, v1); + v509 = a1.Create(0, 0, 0, 0); v510 = a2; - DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); + DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); a2 = v510 + 1; } while ( v510 + 1 < SHIDWORD(v733) ); } - for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) + for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) { v511 = &pActors[dword_50BF30[a2]]; a1.vPosition.x = v511->vPosition.x; @@ -6863,9 +6674,9 @@ v732 = v511->uActorHeight; a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v512 = 8 * dword_50BF30[a2]; - LOBYTE(v512) = v512 | 3; + LOBYTE(v512) = v512 | OBJECT_Actor; a1.field_5C = v512; - a1.Create(0, v1, v1, v1); + a1.Create(0, 0, 0, 0); v513 = v511->pActorBuffs; v726 = (Player *)22; do @@ -6901,10 +6712,10 @@ v516 = 900 * v2; amount = 3; } - v733 = __PAIR__(v1, v516); + v733 = __PAIR__(0, v516); v517 = 8 * v3->uPlayerID; LOBYTE(v517) = v517 | 4; - if ( (signed int)uNumActors > v1 ) + if ( (signed int)uNumActors > 0 ) { v518 = pActors;//[0].uAIState; v726b = uNumActors; @@ -6924,7 +6735,7 @@ goto LABEL_201; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); goto LABEL_1056; case 83: @@ -6953,28 +6764,21 @@ } amount = v522; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v523 = v3->spellnum; - v524 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); v83 = 1; - v525 = v3->spellnum; - v526 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); - v527 = v3->spellnum; - v528 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); - v529 = v3->spellnum; - v530 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); - v673 = v1; + v732 = (int)v733 << 7; - v662 = v1; - v655 = amount; - v652 = v731; - v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v137 = (char *)&pParty->pPartyBuffs[2]; - goto LABEL_976; + + pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); + LODWORD(v727) = v83; + + goto play_sound_and_continue; + case 84: v67 = 2; if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) @@ -6983,30 +6787,30 @@ goto LABEL_202; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); ++a1.uItemType; v726 = (Player *)v531; - v696 = v1; - v695 = v1; - v694 = v1; + v696 = 0; + v695 = 0; + v694 = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v532 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v532 *= 8; LOBYTE(v532) = v532 | OBJECT_Player; a1.field_58_pid = v532; a1.uSoundID = LOWORD(v3->field_10); - a2 = v1; - if ( (signed int)v726 > v1 ) + a2 = 0; + if ( (signed int)v726 > 0 ) { do { @@ -7016,11 +6820,11 @@ v732 = pActors[v533].uActorHeight; a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v534 = 8 * dword_50BF30[a2]; - LOBYTE(v534) = v534 | 3; + LOBYTE(v534) = v534 | OBJECT_Actor; a1.field_5C = v534; - v535 = a1.Create(0, v1, v1, v1); + v535 = a1.Create(0, 0, 0, 0); v536 = a2; - DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); + DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); a2 = v536 + 1; } while ( v536 + 1 < (signed int)v726 ); @@ -7028,7 +6832,8 @@ v537 = pGame->GetStru6(); pGame->GetStru6()->_4A8BFC(); goto LABEL_1056; - case 85: + + case SPELL_LIGHT_DAY_OF_PROTECTION: v538 = v12 - 2; if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) { @@ -7043,44 +6848,31 @@ v730 = v540; LODWORD(v733) = v540; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v541 = v3->spellnum; - v542 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); - v543 = v3->spellnum; - v544 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); - v545 = v3->spellnum; - v546 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); - v547 = v3->spellnum; - v548 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); + goto play_sound_and_continue; + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); + v732 = v730 << 7; v549 = (double)(v730 << 7) * 0.033333335; *((float *)&v733 + 1) = v549; v712 = (signed __int64)v549; - pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); - pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); - pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); - pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); - pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); - pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); + pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); v550 = v2 + 5; - pParty->pPartyBuffs[ 5].Apply( + pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply( (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, - v550, - v1, - v1); - v668 = v1; - v658 = v1; - v653 = v550; - v651 = v731; - v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); -LABEL_992: - v27 = (char *)&pParty->pPartyBuffs[19]; - goto LABEL_103; + v550, 0, 0); + + pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); + goto LABEL_1056; case 86: v551 = v12 - 2; if ( !v551 ) @@ -7105,76 +6897,43 @@ HIDWORD(v733) = v678; LABEL_1000: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); v732 = (300 * amount * v2 + 60) << 7; v730 = v2 + 5; - v726 = (Player *)v1; + v726 = 0; v553 = pParty->pPlayers;//[0].pConditions[1]; *((float *)&v733 + 1) = (double)v732 * 0.033333335; do { - v554 = v3->spellnum; - v555 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); - v556 = v3->spellnum; - v557 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); - v558 = v3->spellnum; - v559 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); - v560 = v3->spellnum; - v561 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); + //((SpellBuff *)(v553 + 6056))->Apply( - v553->pPlayerBuffs[4].Apply( - (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), - v731, - v730, - v1, - v1); + v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); if ( *(_QWORD *)v553 ) v726 = (Player *)1; ++v553; } while ( v553 <= &pParty->pPlayers[3] ); v562 = v731; - pParty->pPartyBuffs[9].Apply( - (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), - v731, - v730, - v1, - v1); - pParty->pPartyBuffs[14].Apply( - (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), - v562, - v1, - v1, - v1); - pParty->pPartyBuffs[15].Apply( - (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), - v562, - v730, - v1, - v1); - if ( v726 != (Player *)v1 ) + pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); + pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); + if (v726) goto LABEL_1056; - v668 = v1; v732 = (int)y << 7; - v658 = v1; - v653 = v730; - v651 = v562; - v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 - + (double)(signed __int64)pParty->uTimePlayed); - v27 = (char *)&pParty->pPartyBuffs[8]; - goto LABEL_103; + pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0); + goto LABEL_1056; case 88: amount = 3; if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) goto LABEL_200; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - a2 = v1; + goto play_sound_and_continue; + a2 = 0; _this = (ItemGen *)&pPlayers[1]; do { @@ -7182,20 +6941,17 @@ do { v564 = _this->uItemID; - *(int *)(v563 + _this->uItemID) = v1; + *(int *)(v563 + _this->uItemID) = 0; v563 += 8; - *(int *)(v563 + v564 - 4) = v1; + *(int *)(v563 + v564 - 4) = 0; } while ( v563 <= 128 ); v565 = ((Player *)_this->uItemID)->GetMaxHealth(); v566 = (Player **)_this; *(int *)(_this->uItemID + 6460) = v565; v567 = (*v566)->GetMaxMana(); - v568 = a2; *(int *)(_this->uItemID + 6464) = v567; - v569 = v3->spellnum; - v570 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v569, v568); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); ++a2; _this = (ItemGen *)((char *)_this + 4); } @@ -7232,15 +6988,12 @@ } amount = v575; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v576 = *(int *)&v3->field_C; - if ( v576 == v1 ) - { - v583 = v3->uPlayerID_2; - v584 = v3->spellnum; + goto play_sound_and_continue; + v576 = v3->spell_target_pid; + if (!v576) + { v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; - v586 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v584, v583); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); if ( *((_QWORD *)v585 + 14) ) { ((Player *)v585)->SetCondition(0x11u, 1); @@ -7248,7 +7001,7 @@ ReloadPlayerPortraits(v3->uPlayerID_2, (v587 != 0) + 23); *((_QWORD *)v585 + 17) = pParty->uTimePlayed; } - goto LABEL_83; + goto play_sound_and_continue; } v577 = (Player *)(v576 >> 3); v726 = v577; @@ -7259,7 +7012,7 @@ } v578 = (int)&pActors[(int)v577]; v721 = v578; - if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) + if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) goto LABEL_200; ++a1.uItemType; a1.stru_24.Reset(); @@ -7267,15 +7020,15 @@ a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v580 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; v581 = v721; v580 *= 8; LOBYTE(v580) = v580 | OBJECT_Player; - a1.uFacing = v1; + a1.uFacing = 0; a1.field_58_pid = v580; a1.uSoundID = LOWORD(v3->field_10); a1.vPosition.x = *(short *)(v721 + 142); @@ -7283,11 +7036,11 @@ v732 = *(short *)(v721 + 138); v582 = 8 * (int)v726; a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); - LOBYTE(v582) = 8 * (char)v726 | 3; + LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; a1.field_5C = v582; - a1.Create(0, v1, v1, v1); + a1.Create(0, 0, 0, 0); if ( *(char *)(v581 + 52) > amount ) - goto LABEL_83; + goto play_sound_and_continue; Actor::Resurrect((unsigned int)v726); *(char *)(v581 + 61) = 0; *(char *)(v581 + 53) = 0; @@ -7297,7 +7050,7 @@ *(char *)(v581 + 57) = 0; *(int *)(v581 + 712) = 9999; *(char *)(v581 + 38) &= 0xF7u; - *(int *)(v581 + 708) = v1; + *(int *)(v581 + 708) = 0; ((SpellBuff *)(v581 + 356))->Reset(); ((SpellBuff *)(v581 + 228))->Reset(); ((SpellBuff *)(v581 + 404))->Reset(); @@ -7310,21 +7063,21 @@ if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) { if ( v590 == 1 ) - LODWORD(v733) = v1; + LODWORD(v733) = 0; } else { LODWORD(v733) = 3600 * v2; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 || *(char *)(HIDWORD(v733) + 20) & 2 - || *(int *)(HIDWORD(v733) + 12) != v1 - || *(int *)(HIDWORD(v733) + 4) != v1 + || *(int *)(HIDWORD(v733) + 12) != 0 + || *(int *)(HIDWORD(v733) + 4) != 0 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) goto LABEL_199; @@ -7358,7 +7111,7 @@ amount = 7; } if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); a1.stru_24.Reset(); @@ -7368,13 +7121,13 @@ a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); a1.vPosition.x = pParty->vPosition.x; a1.vPosition.y = pParty->vPosition.y; - a1.uAttributes = v1; + a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; a1.uSectorID = pIndoor->GetSector( pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v595 = 8 * v3->uPlayerID; LOBYTE(v595) = v595 | OBJECT_Player; a1.field_58_pid = v595; @@ -7405,7 +7158,7 @@ goto LABEL_1056; case 94: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; if ( v731 == 1 || v731 == 2 ) { v598 = 180 * v2; @@ -7426,7 +7179,7 @@ goto LABEL_1056; v730 = 836 * v599; if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) - goto LABEL_83; + goto play_sound_and_continue; if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) goto LABEL_200; pActors[v599].pActorBuffs[9].Reset(); @@ -7434,10 +7187,7 @@ v732 = (int)v733 << 7; pActors[v599].pActorBuffs[12].Apply( pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), - v731, - v1, - v1, - v1); + v731, 0, 0, 0); a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; @@ -7457,9 +7207,9 @@ a1.vPosition.z = v603 + v602; v657 = v601; LABEL_1087: - a1.uAttributes = v1; + a1.uAttributes = 0; a1.uSectorID = pIndoor->GetSector(v657, v665, v676); - a1.uSpriteFrameID = v1; + a1.uSpriteFrameID = 0; v604 = 8 * v3->uPlayerID; LOBYTE(v604) = v604 | OBJECT_Player; a1.field_58_pid = v604; @@ -7469,18 +7219,18 @@ LOWORD(v604) = LOWORD(v3->field_10); LOBYTE(a1.uAttributes) |= 0x80u; a1.uSoundID = v604; - a1.Create(0, v1, v1, v3->uPlayerID + 1); + a1.Create(0, 0, 0, v3->uPlayerID + 1); goto LABEL_1056; case 96: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - HIDWORD(v733) = v1; - memset(&pStru179, v1, 0xFA0u); - _this = (ItemGen *)v1; + goto play_sound_and_continue; + HIDWORD(v733) = 0; + memset(&pStru179, 0, 0xFA0u); + _this = 0; v605 = (char *)pParty->pHirelings; do { - if ( *(int *)v605 != v1 ) + if ( *(int *)v605) { v606 = HIDWORD(v733)++; pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); @@ -7489,16 +7239,16 @@ v605 += 76; } while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); - _this = (ItemGen *)v1; - if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) + _this = 0; + if ( (signed int)pNPCStats->uNumNewNPCs > 0) { v730 = (int)pNPCStats->pNewNPCData; HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; do { if ( *(char *)(v730 + 8) & 0x80 - && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) - && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) + && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) + && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) { v607 = HIDWORD(v733); HIDWORD(v733) += 4; @@ -7511,15 +7261,13 @@ } v608 = v3->uPlayerID_2; if ( v608 != 4 && v608 != 5 - || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) + || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) || v609 >= 3 ) goto LABEL_200; v610 = 76 * v609; - *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; + *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; v611 = pIconsFrameTable->FindIcon("spell96"); - *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( - v611); - v232 = 1; + *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; v612 = pParty->pPlayers; do @@ -7535,10 +7283,10 @@ v613->uReputation += 15; if ( v613->uReputation > 10000 ) v613->uReputation = 10000; - LODWORD(v727) = v232; - goto LABEL_83; + LODWORD(v727) = 1; + goto play_sound_and_continue; case 95: - if ( v12 <= v1 ) + if ( v12 <= 0 ) goto LABEL_1119; if ( v12 <= 3 ) { @@ -7555,33 +7303,24 @@ v615 = v2 + 5; amount = v615; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; if ( v731 != 3 && v731 != 4 ) { - v616 = v3->uPlayerID_2; - v617 = v3->spellnum; - v618 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); - v668 = v1; - v658 = v716; + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); + v732 = (int)v733 << 7; - v653 = v615; - v651 = v731; - v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; - goto LABEL_103; - } - a2 = v1; + + pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v615, v716, 0); + goto LABEL_1056; + } + a2 = 0; v732 = (int)v733 << 7; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; do { - v620 = a2; - v621 = v3->spellnum; - v622 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); - v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); + v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); ++a2; ++v619; } @@ -7589,31 +7328,31 @@ goto LABEL_1056; case 99: if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; - v726 = (Player *)v1; + goto play_sound_and_continue; + v726 = 0; pGame->GetIndoorCamera(); v623 = (signed __int64)GetPickDepth(); HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); - v709 = v1; - v708 = v1; - v707 = v1; + v709 = 0; + v708 = 0; + v707 = 0; a1.stru_24.Reset(); a1.field_48 = v3->spellnum; a1.field_4C = v2; a1.field_50 = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); - a1.uAttributes = v1; - a1.uSectorID = v1; - a1.uSpriteFrameID = v1; + a1.uAttributes = 0; + a1.uSectorID = 0; + a1.uSpriteFrameID = 0; v624 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; - a1.uFacing = v1; + a1.uFacing = 0; v624 *= 8; LOBYTE(v624) = v624 | OBJECT_Player; a1.field_58_pid = v624; a1.uSoundID = LOWORD(v3->field_10); - a2 = v1; - if ( SHIDWORD(v733) > v1 ) + a2 = 0; + if ( SHIDWORD(v733) > 0 ) { v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); do @@ -7624,16 +7363,16 @@ v732 = pActors[v625].uActorHeight; a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); v626 = 8 * dword_50BF30[a2]; - LOBYTE(v626) = v626 | 3; + LOBYTE(v626) = v626 | OBJECT_Actor; a1.field_5C = v626; - v627 = a1.Create(0, v1, v1, v1); + v627 = a1.Create(0, 0, 0, 0); v628 = a2; DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); a2 = v628 + 1; } while ( v628 + 1 < SHIDWORD(v733) ); } - v730 = v1; + v730 = 0; v629 = 1; do { @@ -7652,8 +7391,8 @@ } while ( v629 <= 4 ); v732 = (signed __int64)((double)(signed int)v726 / (double)v730); - HIDWORD(v733) = v1; - if ( v730 > v1 ) + HIDWORD(v733) = 0; + if ( v730 > 0 ) { do { @@ -7665,16 +7404,13 @@ if ( v726->sHealth > v634 ) *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); v635 = HIDWORD(v733); - v636 = WORD2(v733); - v637 = v3->spellnum; - v638 = pGame->GetStru6(); - pGame->GetStru6()->SetPlayerBuffAnim(v637, v636); + + pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); HIDWORD(v733) = v635 + 1; } while ( v635 + 1 < v730 ); } - v639 = pGame->GetStru6(); - pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); + pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); goto LABEL_1056; case 98: if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) @@ -7685,10 +7421,10 @@ v640 = v12 - 2; if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) amount = 3; - if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > v1 ) + if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) goto LABEL_200; if ( !pPlayer->CanCastSpell(uRequiredMana) ) - goto LABEL_83; + goto play_sound_and_continue; pParty->armageddon_timer = 256; pParty->field_16140 = v2; ++pPlayer->uNumArmageddonCasts; @@ -7701,15 +7437,15 @@ v643 = rand(); v721 = v642 + pParty->vPosition.x; y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); - v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); + v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); v644 = rand(); - sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); + sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); v726 = (Player *)((char *)v726 - 1); } while ( *(float *)&v726 != 0.0 ); goto LABEL_1056; default: - goto LABEL_83; + goto play_sound_and_continue; } while ( 2 ) { @@ -7717,8 +7453,8 @@ { if ( *((_QWORD *)v222 + 2) ) { - *((int *)v222 + 4) = v1; - *((int *)v222 + 5) = v1; + *((int *)v222 + 4) = 0; + *((int *)v222 + 5) = 0; goto LABEL_439; } } @@ -7731,7 +7467,7 @@ v222 = (char *)HIDWORD(v733); if ( v223 ) LABEL_439: - ((Player *)v222)->PlaySound(SPEECH_103, v1); + ((Player *)v222)->PlaySound(SPEECH_103, 0); } v222 += 6972; HIDWORD(v733) = (int)v222; @@ -7739,27 +7475,6 @@ goto LABEL_1056; continue; } - } - if ( pParty->bTurnBasedModeOn == v1 ) - { - v646 = pPlayer; - pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); - v647 = n; - } - else - { - v647 = n; - v646 = pPlayer; - v648 = sRecoveryTime; - v649 = pPlayer; - pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; - v649->SetRecoveryTime(v648); - pTurnEngine->_40471C(); - } - ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); - v711[v647].spellnum = v1; - v646->sMana -= uRequiredMana; } //----- (0042EB42) -------------------------------------------------------- __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) @@ -8043,14 +7758,14 @@ if (laser_weapon_item_id) { shotting_laser = true; - _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); + _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); } else if (wand_item_id) { shooting_wand = true; int main_hand_idx = player->pEquipment.uMainHand; - _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); + _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) player->pEquipment.uMainHand = 0; @@ -8074,7 +7789,7 @@ else if (bow_idx) { shooting_bow = true; - _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); + _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); } else { @@ -8938,7 +8653,7 @@ } //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; -LABEL_6: +//LABEL_6: if ( !pEventTimer->bPaused ) { inputAction = (InputAction)0;
--- a/mm7_data.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_data.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -69,201 +69,202 @@ #include "stru159.h" stru159 pAnimatedRooms[196] = //0x4E5F70 { - "", 0x4, 0x1F4, 0, - "Human Armor01", 0x20, 0x2C0, 0x3A02, - "Necromancer Armor01", 0x20, 0x2D7, 0x4602, - "Dwarven Armor01", 0x20, 0x2EE, 0x502, - "Wizard Armor", 0x20, 0x3BD, 0x1302, - "Warlock Armor", 0x20, 0x2D6, 0x2302, - "Elf Armor", 0x20, 0x2BC, 0x4F02, - "Human Alchemisht01", 0xE, 0x2BE, 0x5F04, - "Necromancer Alchemist01", 0xE, 0x2D6, 0x4504, - "Dwarven Achemist01", 0xE, 0x387, 0x404, - "Wizard Alchemist", 0xE, 0x232, 0x1904, - "Warlock Alchemist", 0xE, 0x2BE, 0x2A04, - "Elf Alchemist", 0xE, 0x38A, 0x5404, - "Human Bank01", 0x6, 0x384, 0x3416, - "Necromancer Bank01", 0x6, 0x2D8, 0x4716, - "Dwarven Bank", 0x6, 0x2F3, 0x616, - "Wizard Bank", 0x6, 0x3BA, 0x1416, - "Warlock Bank", 0x6, 0x39F, 0x2416, - "Elf Bank", 0x6, 0x2BC, 0x4716, - "Boat01", 0xF, 0x4C, 0x3351C, - "Boat01d", 0xF, 0x4C, 0x3351C, - "Human Magic Shop01", 0xA, 0x2C8, 0x3603, - "Necromancer Magic Shop01", 0xE, 0x2DC, 0x4203, - "Dwarven Magic Shop01", 0x2A, 0x2EF, 0x5B03, - "Wizard Magic Shop", 0x1E, 0x2DF, 0xF03, - "Warlock Magic Shop", 0x7, 0x3B9, 0x1F03, - "Elf Magic Shop", 0x24, 0x2CC, 0x5203, - "Human Stables01", 0x21, 0x31, 0x3301B, - "Necromancer Stables", 0x21, 0x2DD, 0x3431B, - "", 0x21, 0x2F0, 0x35B1B, - "Wizard Stables", 0x21, 0x3BA, 0x3101B, - "Warlock Stables", 0x21, 0x181, 0x3201B, - "Elf Stables", 0x21, 0x195, 0x34D1B, - "Human Tavern01", 0xD, 0x2C2, 0x3115, - "Necromancer Tavern01", 0xD, 0x3B0, 0x3915, - "Dwarven Tavern01", 0xD, 0x2FE, 0x5E15, - "Wizard Tavern", 0xD, 0x3BB, 0x1115, - "Warlock Tavern", 0xD, 0x3A8, 0x2115, - "Elf Tavern", 0xD, 0x2CD, 0x4E15, - "Human Temple01", 0x24, 0x2DB, 0x33217, - "Necromancer Temple", 0x24, 0x2DF, 0x33C17, - "Dwarven Temple01", 0x24, 0x2F1, 0x35617, - "Wizard Temple", 0x24, 0x2E0, 0x30A17, - "Warlock Temple", 0x24, 0x3A4, 0x31B17, - "Elf Temple", 0x24, 0x2CE, 0x34817, - "Human Town Hall", 0x10, 0x39C, 0xE11, - "Necromancer Town Hall01", 0x10, 0x3A4, 0x3D11, - "Dwarven Town Hall", 0x10, 0x2DB, 0x5811, - "Wizard Town Hall", 0x10, 0x3BD, 0xB11, - "Warlock Town Hall", 0x10, 0x2DB, 0x1C11, - "Elf Town Hall", 0x10, 0x27A, 0x4911, - "Human Training Ground01", 0x18, 0x2C7, 0x2C1E, - "Necromancer Training Ground", 0x18, 0x3AD, 0x3E1E, - "Dwarven Training Ground", 0x18, 0x2F2, 0x591E, - "Wizard Training Ground", 0x18, 0x3A3, 0xC1E, - "Warlock Training Ground", 0x18, 0x3A6, 0x1D1E, - "Elf Training Ground", 0x18, 0x19F, 0x4A1E, - "Human Weapon Smith01", 0x16, 0x2C1, 0x42D01, - "Necromancer Weapon Smith01", 0x16, 0x2D9, 0x43F01, - "Dwarven Weapon Smith01", 0x16, 0x2EE, 0x45201, - "Wizard Weapon Smith", 0x16, 0x2D5, 0x40D01, - "Warlock Weapon Smith", 0x16, 0x2D7, 0x41701, - "Elf Weapon Smith", 0x16, 0x2CA, 0x44B01, - "Air Guild", 0x1D, 0xA4, 0x30106, - "Body Guild", 0x19, 0x3BF, 0x20B, - "DarkGuild", 0x19, 0x2D1, 0x30D, - "EarthGuild", 0x19, 0x2CB, 0x5308, - "Fire Guild", 0x1C, 0x2BF, 0x3805, - "Light Guild", 0x1C, 0x2D5, 0x2E0C, - "Mind Guild", 0x1C, 0xE5, 0x280A, - "Spirit Guild", 0x1C, 0x2D2, 0x2909, - "Water Guild", 0x1B, 0x2D3, 0x1807, - "Lord And Judge Out01", 1, 0, 0x271D, - "Human Poor House 1", 8, 0, 0x1D, - "Human Poor House 2", 8, 0, 0x1D, - "Human Poor House 3", 8, 0, 0x1D, - "Human Medium House 1", 8, 0, 0x1D, - "Human Medium House 2", 8, 0, 0x1D, - "Human Medium House 3", 8, 0, 0x1D, - "Human Rich House 1", 8, 0, 0x1D, - "Human Rich House 2", 8, 0, 0x1D, - "Human Rich House 3", 8, 0, 0x1D, - "Elven Poor House 1", 8, 0, 0x1D, - "Elven Poor House 2", 8, 0, 0x1D, - "Elven Poor House 3", 8, 0, 0x1D, - "Elven Medium House 1", 8, 0, 0x1D, - "Elven Medium House 2", 8, 0, 0x1D, - "Elven Medium House 3", 8, 0, 0x1D, - "Elven Rich House 1", 8, 0, 0x1D, - "Elven Rich House 2", 8, 0, 0x1D, - "Elven Rich House 3", 8, 0, 0x1D, - "Dwarven Poor House 1", 8, 0, 0x1D, - "Dwarven Poor House 2", 8, 0, 0x1D, - "Dwarven Poor House 3", 8, 0, 0x1D, - "Dwarven Medium House 1", 8, 0, 0x1D, - "Dwarven Medium house 2", 8, 0, 0x1D, - "Dwarven Medium House 3", 8, 0, 0x1D, - "Dwarven Rich House 1", 8, 0, 0x1D, - "Dwarven Rich House 2", 8, 0, 0x1D, - "Dwarven Rich House 3", 8, 0, 0x1D, - "Wizard Poor House 1", 8, 0, 0x1D, - "Wizard Poor House 2", 8, 0, 0x1D, - "Wizard Poor House 3", 8, 0, 0x1D, - "Wizard Medium House 1", 8, 0, 0x1D, - "Wizard Medium House 2", 8, 0, 0x1D, - "Wizard Mdeium House 3", 8, 0, 0x1D, - "Wizard Rich House 1", 8, 0, 0x1D, - "Wizard Rich House 2", 8, 0, 0x1D, - "Wizard Rich House 3", 8, 0, 0x1D, - "Necromancer Poor House 1", 8, 0, 0x1D, - "Necromancer Poor House 2", 8, 0, 0x1D, - "Necromancer Poor House 3", 8, 0, 0x1D, - "Necromancer Medium House 1", 8, 0, 0x1D, - "Necromancer Medium House 2", 8, 0, 0x1D, - "Necromancer Mdeium House 3", 8, 0, 0x1D, - "Necromancer Rich House 1", 8, 0, 0x1D, - "Necromancer Rich House 2", 8, 0, 0x1D, - "Necromancer Rich House 3", 8, 0, 0x1D, - "Warlock Poor House 1", 8, 0, 0x1D, - "Warlock Poor House 2", 8, 0, 0x1D, - "Warlock Poor House 3", 8, 0, 0x1D, - "Warlock Medium House 1", 8, 0, 0x1D, - "Warlock Medium House 2", 8, 0, 0x1D, - "Warlock Mdeium House 3", 8, 0, 0x1D, - "Warlock Rich House 1", 8, 0, 0x1D, - "Warlock Rich House 2", 8, 0, 0x1D, - "Warlock Rich House 3", 8, 0, 0x1D, - "Out01 Temple of the Moon", 0x24, 0, 0x19, - "Out01 Dragon Cave", 0x24, 0, 0x19, - "Out02 Castle Harmondy", 0x24, 0, 0x19, - "Out02 White Cliff Cave", 0x24, 0, 0x19, - "Out03 Erathian Sewer", 0x24, 0, 0x19, - "Out03 Fort Riverstride", 0x24, 0, 0x19, - "Out03 Castle Gryphonheart", 0x24, 0, 0x19, - "Out04 Elf Castle", 0x24, 0, 0x19, - "Out04 Tularean Caves", 0x24, 0, 0x19, - "Out04 Clanker's Laboratory", 0x24, 0, 0x19, - "Out05 Hall of the Pit", 0x24, 0, 0x19, - "Out05 Watchtower 6", 0x24, 0, 0x19, - "Out06 School of Sorcery", 0x24, 0, 0x19, - "Out06 Red Dwarf Mines", 0x24, 0, 0x19, - "Out07 Castle Lambert", 0x24, 0, 0x19, - "Out07 Walls of Mist", 0x24, 0, 0x19, - "Out07 Temple of the Light", 0x24, 0, 0x19, - "Out08 Evil Entrance", 0x24, 0, 0x19, - "Out08 Breeding Zone", 0x24, 0, 0x19, - "Out08 Temple of the Dark", 0x24, 0, 0x19, - "Out09 Grand Temple of the Moon", 0x24, 0, 0x19, - "Out09 Grand Tempple of the Sun", 0x24, 0, 0x19, - "Out10 Thunderfist Mountain", 0x24, 0, 0x19, - "Out10 The Maze", 0x24, 0, 0x19, - "Out10 Connecting Tunnel Cave #1", 0x24, 0, 0x19, - "", 0x24, 0, 0x19, - "", 0x24, 0, 0x19, - "Out11 Stone City", 0x24, 0, 0x19, - "", 0x24, 0, 0x19, - "Out12 Colony Zod", 0x24, 0, 0x19, - "Out12 Connecting Tunnel Cave #1", 0x24, 0, 0x19, - "", 0x24, 0, 0x19, - "", 0x24, 0, 0x19, - "Out13 Mercenary Guild", 0x24, 0, 0x19, - "Out13 Tidewater Caverns", 0x24, 0, 0x19, - "Out13 Wine Cellar", 0x24, 0, 0x19, - "Out14 Titan's Stronghold", 0x24, 0, 0x19, - "Out14 Temple Of Baa", 0x24, 0, 0x19, - "Out14 Hall under the Hill", 0x24, 0, 0x19, - "Out15 The Linclon", 0x24, 0, 0x19, - "Jail", 0x24, 0, 0x1F, - "Harmondale Throne Room", 0x24, 0, 0x1D, - "Gryphonheart Throne Room", 0x24, 0, 0x14, - "Elf Castle Throne Room", 0x24, 0, 0x14, - "Wizard Castle Throne Room", 0x24, 0, 0x14, - "Necromancer Casstle Trone Room", 0x24, 0, 0x14, - "Master Thief", 0x24, 0, 0x1D, - "Dwarven King", 0x24, 0, 0x14, - "Arms Master", 0x24, 0, 0x1D, - "Warlock", 0x24, 0, 0x1D, - "Lord Markam", 0x24, 0, 0x14, - "Arbiter Neutral Town", 0x24, 0, 0x1D, - "Arbiter Good Town", 0x24, 0, 0x1D, - "Arbiter Evil Town", 0x24, 0, 0x1D, - "Necromancer Throne Room Empty", 0x24, 0, 0x14, - "", 0x24, 0, 0x1D, - "", 0x24, 0, 0x1D, - "", 0x24, 0, 0x1D, - "", 0x24, 0, 0x1D, - "Boat01", 0xF, 0, 0x3351D, - "", 0x24, 0, 0x1C, - "", 0x24, 0, 0x1D, - "", 0x24, 0, 0x1D, - "Arbiter Room Neutral", 0x24, 0, 0x1D, - "Out02 Castle Harmondy Abandoned", 0x24, 0, 0x19, - "Human Temple02", 0x24, 0x3AB, 0x1B17, - "Player Castle Good", 0x24, 0, 0x19, - "Player Castle Bad", 0x24, 0, 0x19, + {"", 0x4, 0x1F4, 0, 0, 0}, + {"Human Armor01", 0x20, 0x2C0, 2, 58, 0}, +{"Necromancer Armor01", 0x20, 0x2D7, 2, 70, 0 }, +{"Dwarven Armor01", 0x20, 0x2EE, 2, 5, 0 }, +{"Wizard Armor", 0x20, 0x3BD, 2, 19, 0 }, +{"Warlock Armor", 0x20, 0x2D6, 2, 35, 0 }, +{"Elf Armor", 0x20, 0x2BC, 2, 79, 0 }, +{"Human Alchemisht01", 0xE, 0x2BE, 4, 95, 0 }, +{"Necromancer Alchemist01", 0xE, 0x2D6, 4, 69, 0 }, +{"Dwarven Achemist01", 0xE, 0x387, 4, 4, 0 }, +{"Wizard Alchemist", 0xE, 0x232, 4, 25, 0 }, +{"Warlock Alchemist", 0xE, 0x2BE, 4, 42, 0 }, +{"Elf Alchemist", 0xE, 0x38A, 4, 84, 0 }, +{"Human Bank01", 0x6, 0x384, 22, 52, 0 }, +{"Necromancer Bank01", 0x6, 0x2D8, 22, 71, 0 }, +{"Dwarven Bank", 0x6, 0x2F3, 22, 6, 0 }, +{"Wizard Bank", 0x6, 0x3BA, 22, 20, 0 }, +{"Warlock Bank", 0x6, 0x39F, 22, 36, 0 }, +{"Elf Bank", 0x6, 0x2BC, 22, 71, 0 }, +{"Boat01", 0xF, 0x4C, 28, 53, 3 }, +{"Boat01d", 0xF, 0x4C, 28, 53, 3 }, +{"Human Magic Shop01", 0xA, 0x2C8, 3, 54, 0 }, +{"Necromancer Magic Shop01", 0xE, 0x2DC, 3, 66, 0 }, +{"Dwarven Magic Shop01", 0x2A, 0x2EF, 3, 91, 0 }, +{"Wizard Magic Shop", 0x1E, 0x2DF, 3, 15, 0 }, +{"Warlock Magic Shop", 0x7, 0x3B9, 3, 15, 0 }, +{"Elf Magic Shop", 0x24, 0x2CC, 3, 82, 0 }, +{"Human Stables01", 0x21, 0x31, 27, 48, 3 }, +{"Necromancer Stables", 0x21, 0x2DD, 27, 67, 3 }, +{"", 0x21, 0x2F0, 27, 91, 3 }, +{"Wizard Stables", 0x21, 0x3BA, 27, 16, 3 }, +{"Warlock Stables", 0x21, 0x181, 27, 77, 3 }, +{"Elf Stables", 0x21, 0x195, 27, 77, 3 }, +{"Human Tavern01", 0xD, 0x2C2, 21, 49, 0 }, +{"Necromancer Tavern01", 0xD, 0x3B0, 21, 57, 0 }, +{"Dwarven Tavern01", 0xD, 0x2FE, 21, 94, 0 }, +{"Wizard Tavern", 0xD, 0x3BB, 21, 17, 0 }, +{"Warlock Tavern", 0xD, 0x3A8, 21, 33, 0 }, +{"Elf Tavern", 0xD, 0x2CD, 21, 78, 0 }, +{"Human Temple01", 0x24, 0x2DB, 23, 50, 3 }, +{"Necromancer Temple", 0x24, 0x2DF, 23, 60, 3 }, +{"Dwarven Temple01", 0x24, 0x2F1, 23, 86, 3 }, +{"Wizard Temple", 0x24, 0x2E0, 23, 10, 3 }, +{"Warlock Temple", 0x24, 0x3A4, 23, 27, 3 }, +{"Elf Temple", 0x24, 0x2CE, 23, 72, 3 }, +{"Human Town Hall", 0x10, 0x39C, 17, 14, 0 }, +{"Necromancer Town Hall01", 0x10, 0x3A4, 17, 61, 0 }, +{"Dwarven Town Hall", 0x10, 0x2DB, 17, 88, 0 }, +{"Wizard Town Hall", 0x10, 0x3BD, 17, 11, 0 }, +{"Warlock Town Hall", 0x10, 0x2DB, 17, 28, 0 }, +{"Elf Town Hall", 0x10, 0x27A, 17, 73, 0 }, +{"Human Training Ground01", 0x18, 0x2C7, 30, 44, 0 }, +{"Necromancer Training Ground", 0x18, 0x3AD, 30, 62, 0 }, +{"Dwarven Training Ground", 0x18, 0x2F2, 30, 89, 0 }, +{"Wizard Training Ground", 0x18, 0x3A3, 30, 12, 0 }, +{"Warlock Training Ground", 0x18, 0x3A6, 30, 29, 0 }, +{"Elf Training Ground", 0x18, 0x19F, 30, 74, 0 }, +{"Human Weapon Smith01", 0x16, 0x2C1, 1, 45, 4 }, +{"Necromancer Weapon Smith01", 0x16, 0x2D9, 1, 63, 4 }, +{"Dwarven Weapon Smith01", 0x16, 0x2EE, 1, 82, 4 }, +{"Wizard Weapon Smith", 0x16, 0x2D5, 1, 13, 4 }, +{"Warlock Weapon Smith", 0x16, 0x2D7, 1, 23, 4 }, +{"Elf Weapon Smith", 0x16, 0x2CA, 1, 75, 4 }, +{"Air Guild", 0x1D, 0xA4, 6, 1, 3 }, +{"Body Guild", 0x19, 0x3BF, 11, 2, 0 }, +{"DarkGuild", 0x19, 0x2D1, 13, 3, 0 }, +{"EarthGuild", 0x19, 0x2CB, 8, 83, 0 }, +{"Fire Guild", 0x1C, 0x2BF, 5, 56, 0 }, +{"Light Guild", 0x1C, 0x2D5, 12, 46, 0 }, +{"Mind Guild", 0x1C, 0xE5, 10, 40, 0 }, +{"Spirit Guild", 0x1C, 0x2D2, 9, 41, 0 }, +{"Water Guild", 0x1B, 0x2D3, 7, 24, 0 }, +{"Lord And Judge Out01", 1, 0, 29, 39, 0 }, +{"Human Poor House 1", 8, 0, 29, 0, 0 }, +{"Human Poor House 2", 8, 0, 29, 0, 0 }, +{"Human Poor House 3", 8, 0, 29, 0, 0 }, +{"Human Medium House 1", 8, 0, 29, 0, 0 }, +{"Human Medium House 2", 8, 0, 29, 0, 0 }, +{"Human Medium House 3", 8, 0, 29, 0, 0 }, +{"Human Rich House 1", 8, 0, 29, 0, 0 }, +{"Human Rich House 2", 8, 0, 29, 0, 0 }, +{"Human Rich House 3", 8, 0, 29, 0, 0 }, +{"Elven Poor House 1", 8, 0, 29, 0, 0 }, +{"Elven Poor House 2", 8, 0, 29, 0, 0 }, +{"Elven Poor House 3", 8, 0, 29, 0, 0 }, +{"Elven Medium House 1", 8, 0, 29, 0, 0 }, +{"Elven Medium House 2", 8, 0, 29, 0, 0 }, +{"Elven Medium House 3", 8, 0, 29, 0, 0 }, +{"Elven Rich House 1", 8, 0, 29, 0, 0 }, +{"Elven Rich House 2", 8, 0, 29, 0, 0 }, +{"Elven Rich House 3", 8, 0, 29, 0, 0 }, +{"Dwarven Poor House 1", 8, 0, 29, 0, 0 }, +{"Dwarven Poor House 2", 8, 0, 29, 0, 0 }, +{"Dwarven Poor House 3", 8, 0, 29, 0, 0 }, +{"Dwarven Medium House 1", 8, 0, 29, 0, 0 }, +{"Dwarven Medium house 2", 8, 0, 29, 0, 0 }, +{"Dwarven Medium House 3", 8, 0, 29, 0, 0 }, +{"Dwarven Rich House 1", 8, 0, 29, 0, 0 }, +{"Dwarven Rich House 2", 8, 0, 29, 0, 0 }, +{"Dwarven Rich House 3", 8, 0, 29, 0, 0 }, +{"Wizard Poor House 1", 8, 0, 29, 0, 0 }, +{"Wizard Poor House 2", 8, 0, 29, 0, 0 }, +{"Wizard Poor House 3", 8, 0, 29, 0, 0 }, +{"Wizard Medium House 1", 8, 0, 29, 0, 0 }, +{"Wizard Medium House 2", 8, 0, 29, 0, 0 }, +{"Wizard Mdeium House 3", 8, 0, 29, 0, 0 }, +{"Wizard Rich House 1", 8, 0, 29, 0, 0 }, +{"Wizard Rich House 2", 8, 0, 29, 0, 0 }, +{"Wizard Rich House 3", 8, 0, 29, 0, 0 }, +{"Necromancer Poor House 1", 8, 0, 29, 0, 0 }, +{"Necromancer Poor House 2", 8, 0, 29, 0, 0 }, +{"Necromancer Poor House 3", 8, 0, 29, 0, 0 }, +{"Necromancer Medium House 1", 8, 0, 29, 0, 0 }, +{"Necromancer Medium House 2", 8, 0, 29, 0, 0 }, +{"Necromancer Mdeium House 3", 8, 0, 29, 0, 0 }, +{"Necromancer Rich House 1", 8, 0, 29, 0, 0 }, +{"Necromancer Rich House 2", 8, 0, 29, 0, 0 }, +{"Necromancer Rich House 3", 8, 0, 29, 0, 0 }, +{"Warlock Poor House 1", 8, 0, 29, 0, 0 }, +{"Warlock Poor House 2", 8, 0, 29, 0, 0 }, +{"Warlock Poor House 3", 8, 0, 29, 0, 0 }, +{"Warlock Medium House 1", 8, 0, 29, 0, 0 }, +{"Warlock Medium House 2", 8, 0, 29, 0, 0 }, +{"Warlock Mdeium House 3", 8, 0, 29, 0, 0 }, +{"Warlock Rich House 1", 8, 0, 29, 0, 0 }, +{"Warlock Rich House 2", 8, 0, 29, 0, 0 }, +{"Warlock Rich House 3", 8, 0, 29, 0, 0 }, +{"Out01 Temple of the Moon", 0x24, 0, 25, 0, 0 }, +{"Out01 Dragon Cave", 0x24, 0, 25, 0, 0 }, +{"Out02 Castle Harmondy", 0x24, 0, 25, 0, 0 }, +{"Out02 White Cliff Cave", 0x24, 0, 25, 0, 0 }, +{"Out03 Erathian Sewer", 0x24, 0, 25, 0, 0 }, +{"Out03 Fort Riverstride", 0x24, 0, 25, 0, 0 }, +{"Out03 Castle Gryphonheart", 0x24, 0, 25, 0, 0 }, +{"Out04 Elf Castle", 0x24, 0, 25, 0, 0 }, +{"Out04 Tularean Caves", 0x24, 0, 25, 0, 0 }, +{"Out04 Clanker's Laboratory", 0x24, 0, 25, 0, 0 }, +{"Out05 Hall of the Pit", 0x24, 0, 25, 0, 0 }, +{"Out05 Watchtower 6", 0x24, 0, 25, 0, 0 }, +{"Out06 School of Sorcery", 0x24, 0, 25, 0, 0 }, +{"Out06 Red Dwarf Mines", 0x24, 0, 25, 0, 0 }, +{"Out07 Castle Lambert", 0x24, 0, 25, 0, 0 }, +{"Out07 Walls of Mist", 0x24, 0, 25, 0, 0 }, +{"Out07 Temple of the Light", 0x24, 0, 25, 0, 0 }, +{"Out08 Evil Entrance", 0x24, 0, 25, 0, 0 }, +{"Out08 Breeding Zone", 0x24, 0, 25, 0, 0 }, +{"Out08 Temple of the Dark", 0x24, 0, 25, 0, 0 }, +{"Out09 Grand Temple of the Moon", 0x24, 0, 25, 0, 0 }, +{"Out09 Grand Tempple of the Sun", 0x24, 0, 25, 0, 0 }, +{"Out10 Thunderfist Mountain", 0x24, 0, 25, 0, 0 }, +{"Out10 The Maze", 0x24, 0, 25, 0, 0 }, +{"Out10 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 }, +{"", 0x24, 0, 25, 0, 0 }, +{"", 0x24, 0, 25, 0, 0 }, +{"Out11 Stone City", 0x24, 0, 25, 0, 0 }, +{"", 0x24, 0, 25, 0, 0 }, +{"Out12 Colony Zod", 0x24, 0, 25, 0, 0 }, +{"Out12 Connecting Tunnel Cave #1", 0x24, 0, 25, 0, 0 }, +{"", 0x24, 0, 25, 0, 0 }, +{"", 0x24, 0, 25, 0, 0 }, +{"Out13 Mercenary Guild", 0x24, 0, 25, 0, 0 }, +{"Out13 Tidewater Caverns", 0x24, 0, 25, 0, 0 }, +{"Out13 Wine Cellar", 0x24, 0, 25, 0, 0 }, +{"Out14 Titan's Stronghold", 0x24, 0, 25, 0, 0 }, +{"Out14 Temple Of Baa", 0x24, 0, 25, 0, 0 }, +{"Out14 Hall under the Hill", 0x24, 0, 25, 0, 0 }, +{"Out15 The Linclon", 0x24, 0, 25, 0, 0 }, +{"Jail", 0x24, 0, 31, 0, 0 }, +{"Harmondale Throne Room", 0x24, 0, 29, 0, 0 }, +{"Gryphonheart Throne Room", 0x24, 0, 20, 0, 0 }, +{"Elf Castle Throne Room", 0x24, 0, 20, 0, 0 }, +{"Wizard Castle Throne Room", 0x24, 0, 20, 0, 0 }, +{"Necromancer Casstle Trone Room", 0x24, 0, 20, 0, 0 }, +{"Master Thief", 0x24, 0, 29, 0, 0 }, +{"Dwarven King", 0x24, 0, 20, 0, 0 }, +{"Arms Master", 0x24, 0, 29, 0, 0 }, +{"Warlock", 0x24, 0, 29, 0, 0 }, +{"Lord Markam", 0x24, 0, 20, 0, 0 }, +{"Arbiter Neutral Town", 0x24, 0, 29, 0, 0 }, +{"Arbiter Good Town", 0x24, 0, 29, 0, 0 }, +{"Arbiter Evil Town", 0x24, 0, 29, 0, 0 }, +{"Necromancer Throne Room Empty", 0x24, 0, 20, 0, 0 }, +{"", 0x24, 0, 29, 0, 0 }, +{"", 0x24, 0, 29, 0, 0 }, +{"", 0x24, 0, 29, 0, 0 }, +{"", 0x24, 0, 29, 0, 0 }, +{"Boat01", 0xF, 0, 29, 53, 3 }, +{"", 0x24, 0, 28, 0, 0 }, +{"", 0x24, 0, 28, 0, 0 }, +{"", 0x24, 0, 28, 0, 0 }, +{"", 0x24, 0, 29, 0, 0 }, +{"Arbiter Room Neutral", 0x24, 0, 29, 0, 0 }, +{"Out02 Castle Harmondy Abandoned", 0x24, 0, 25, 0, 0 }, +{"Human Temple02", 0x24, 0x3AB, 23, 27, 0 }, +{"Player Castle Good", 0x24, 0, 25, 0, 0 }, +{"Player Castle Bad", 0x24, 0, 25, 0, 0} }; #include "stru160.h" @@ -1663,7 +1664,7 @@ //__int16 word_4F063E[290]; //__int16 word_4F06D8[22]; -int word_4F0704[32]={ +int guild_mambership_flags[32]={ 54, 54, 54, 54, 52, 52, 52, 52, 55, 55, 55, 55, 53, 53, 53, 53, 58, 58, 58, 58, 57, 57, 57, 57, 56, 56, 56, 56, 59, 59, 60, 60}; @@ -1680,7 +1681,7 @@ 0x0EB, 0x25C, 0x0EC, 0x25D, 0x0ED, 0x259, 0x0F1, 0x21E } ; -int price_for_membership[777]; // weak +int price_for_membership[11]={100, 100, 50, 50, 50, 50, 50, 50, 50, 1000, 1000}; // weak char byte_4F09B0[777]; // weak char byte_4F09B1[777]; // weak char byte_4F09B8[777]; // weak @@ -1689,7 +1690,15 @@ char _4F0D38_TravelInfo[777]; // weak int dword_4F0E10[32]; Vec2_int_ pMonsterArenaPlacements[20]; -__int16 word_4F0F30[777]; // weak +__int16 word_4F0F30[32] ={ 4, 7, 10, 11, + 4, 7, 10, 11, + 4, 7, 10, 11, + 4, 7, 10, 11, + 4, 7, 10, 11, + 4, 7, 10, 11, + 4, 7, 10, 11, + 7, 11, + 7, 11}; char aS03d[777]; // idb char byte_4F0F98; // idb char sz[777]; // idb @@ -2342,14 +2351,14 @@ int dword_F8B144; // idb char byte_F8B148[16]; __int16 word_F8B158[777]; // weak -struct Texture *dword_F8B164; // idb +struct Texture *ShopTexture; // idb struct Texture *ItemsInShopTexture[12]; int in_current_building_type; // 0xF8B198 int dword_F8B19C; // weak __int16 word_F8B1A0; // weak const char *dword_F8B1A4; // idb int contract_approved; // weak -int dword_F8B1AC_something_todo_with_awards; // idb +int dword_F8B1AC_award_bit_number; // idb int dword_F8B1B0; // weak int gold_transaction_amount; // F8B1B4 char *pShopOptions[4];
--- a/mm7_data.h Fri Mar 01 18:37:54 2013 +0600 +++ b/mm7_data.h Fri Mar 01 18:38:12 2013 +0600 @@ -1008,7 +1008,7 @@ extern char uItemsAmountPerShopType[]; // weak //extern __int16 word_4F063E[290]; //extern __int16 word_4F06D8[22]; -extern int word_4F0704[32]; +extern int guild_mambership_flags[32]; extern __int16 word_4F0754[49]; //extern __int16 word_4F07B6[88]; extern __int16 word_4F0866[14]; @@ -1022,7 +1022,7 @@ extern char _4F0D38_TravelInfo[]; // weak extern int dword_4F0E10[32]; extern Vec2_int_ pMonsterArenaPlacements[20]; -extern __int16 word_4F0F30[]; // weak +extern __int16 word_4F0F30[32]; // weak extern char aS03d[]; // idb extern char byte_4F0F98; // idb extern char sz[]; // idb @@ -1684,14 +1684,14 @@ extern int dword_F8B144; // idb extern char byte_F8B148[16]; extern __int16 word_F8B158[]; // weak -extern struct Texture *dword_F8B164; // idb +extern struct Texture *ShopTexture; // idb extern struct Texture *ItemsInShopTexture[12]; extern int in_current_building_type; // weak extern int dword_F8B19C; // weak extern __int16 word_F8B1A0; // weak extern const char *dword_F8B1A4; // idb extern int contract_approved; // weak -extern int dword_F8B1AC_something_todo_with_awards; // idb +extern int dword_F8B1AC_award_bit_number; // idb extern int dword_F8B1B0; // weak extern int gold_transaction_amount; // F8B1B4 extern char *pShopOptions[4]; @@ -2045,7 +2045,7 @@ void __thiscall TeleportToStartingPoint(unsigned int uPointType); // idb __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2); // idb unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2); -unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb +void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb void __cdecl sub_44A56A(); void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds); void __cdecl ShowNothingHereStatus(); @@ -2288,7 +2288,7 @@ int __fastcall sub_4AE491(int, int); // weak void __fastcall sub_4AE5F1(unsigned int uFaceID); // idb int __cdecl sub_4AF412(); -void __cdecl stru170_sub_4B0967(); +//void __cdecl stru170_sub_4B0967_draw_face_outlines(); void __cdecl loc_4B0DFB(); // idb void __cdecl nullsub_18(); // idb void __cdecl nullsub_19(); // idb @@ -2305,7 +2305,7 @@ void __cdecl sub_4B1ECE(); void __fastcall ClickNPCTopic(signed int uMessageParam); char *__thiscall _4B254D_SkillMasteryTeacher(int _this); -const char *__fastcall ContractSelectText(int pEventNumber); +const char * ContractSelectText(int pEventCode); char __cdecl SimpleHouseAndBoatsDialog(); void CreateButtonInColumn(int a1, unsigned int a2); void FillAviableSkillsToTeach(int _this); @@ -2313,7 +2313,7 @@ void sub_4B3AD4(signed int a1); void sub_4B3B42(signed int a1); void __cdecl sub_4B3E1E(); -void __fastcall DrawJoinGuildWindow(int pEventNumber); +void DrawJoinGuildWindow(int pEventCode); void __fastcall sub_4B3FE5(int a4); void __cdecl sub_4B40E6(); void _4B4224_UpdateNPCTopics(int _this); @@ -2322,11 +2322,11 @@ int __cdecl TrainingDialog(); char *__cdecl JailDialog(); int __cdecl MagicShopDialog(); -int __cdecl GuildDialog(); +void GuildDialog(); int __cdecl sub_4B6478(); bool __fastcall sub_4B68EA(int a1); void __cdecl TravelByTransport(); -int __cdecl TampleDialog(); +void TempleDialog(); void __cdecl TownHallDialog(); void __cdecl BankDialog(); void __cdecl TavernDialog(); @@ -2339,7 +2339,7 @@ void __cdecl sub_4BBCDD(); void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z); // idb void __cdecl ArenaFight(); -struct Texture *__cdecl sub_4BC8D5(); +void SpellBookGenerator(); struct GUIButton *__cdecl UI_CreateEndConversationButton(); void __fastcall DrawLearnSkillDialog(signed int uMessageParam); signed int __cdecl sub_4BD8B5();
--- a/stru159.h Fri Mar 01 18:37:54 2013 +0600 +++ b/stru159.h Fri Mar 01 18:38:12 2013 +0600 @@ -9,7 +9,9 @@ char *video_name; int field_4; int field_8; - int uBuildingType; + unsigned __int8 uBuildingType; + unsigned __int8 uRoomSoundId; + unsigned __int16 padding_e; }; #pragma pack(pop) extern stru159 pAnimatedRooms[196]; \ No newline at end of file
--- a/stru277.h Fri Mar 01 18:37:54 2013 +0600 +++ b/stru277.h Fri Mar 01 18:38:12 2013 +0600 @@ -18,7 +18,7 @@ } void _427D48(unsigned int uPlayerID); - unsigned int PushStru277(__int16 a2, __int16 uPlayerID, __int16 a4, __int16 a5, int a6); + unsigned int PushStru277(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int a6); struct GUIWindow *sub_4219BE(); void _427E01_cast_spell(); @@ -27,9 +27,8 @@ __int16 uPlayerID_2; __int16 field_6; __int16 field_8; - __int16 field_A; - __int16 field_C; - __int16 field_E; + __int16 forced_spell_skill_level; + int spell_target_pid; int field_10; }; #pragma pack(pop)
--- a/stru6.cpp Fri Mar 01 18:37:54 2013 +0600 +++ b/stru6.cpp Fri Mar 01 18:38:12 2013 +0600 @@ -86,13 +86,13 @@ //----- (004A71FE) -------------------------------------------------------- void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID) { - int v8; // eax@1 + //int v8; // eax@1 - v8 = uNumProjectiles; - if ( v8 != 32 ) + //v8 = uNumProjectiles; + if (uNumProjectiles < 32) { - pProjectiles[v8].srcX = srcX; - *((float *)&this->array_0[0].uSpellAnimLength + 7 * (uNumProjectiles + 21)) = srcY; + pProjectiles[uNumProjectiles].srcX = srcX; + pProjectiles[uNumProjectiles].srcY = srcY; pProjectiles[uNumProjectiles].srcZ = srcZ; pProjectiles[uNumProjectiles].dstX = dstX; pProjectiles[uNumProjectiles].dstY = dstY; @@ -164,10 +164,10 @@ v6 = a2->field_54; if ( v6 ) { - v7 = &v4->array_0[v6 & 0x1F]; - x = ((double)a2->vPosition.x - v7->flt_4) * 0.5 + v7->flt_4; - v8 = ((double)v5->vPosition.y - v7->flt_8) * 0.5 + v7->flt_8; - v9 = ((double)v5->vPosition.z - v7->flt_C) * 0.5 + v7->flt_C; + v7 = &v4->array_4[v6 & 0x1F]; + x = ((double)a2->vPosition.x - v7->flt_0_x) * 0.5 + v7->flt_0_x; + v8 = ((double)v5->vPosition.y - v7->flt_4_y) * 0.5 + v7->flt_4_y; + v9 = ((double)v5->vPosition.z - v7->flt_8_z) * 0.5 + v7->flt_8_z; local_0.bFree = 1036; local_0.uDiffuse = uDiffuse; local_0.x = x + 4.0; @@ -188,16 +188,16 @@ pGame->pParticleEngine->AddParticle(&local_0); local_0.x = (double)v5->vPosition.x - 4.0; pGame->pParticleEngine->AddParticle(&local_0); - v4->array_0[v5->field_54 & 0x1F].flt_4 = (double)v5->vPosition.x; - v4->array_0[v5->field_54 & 0x1F].flt_8 = (double)v5->vPosition.y; - v4->array_0[v5->field_54 & 0x1F].flt_C = (double)v5->vPosition.z; + v4->array_4[v5->field_54 & 0x1F].flt_0_x = (double)v5->vPosition.x; + v4->array_4[v5->field_54 & 0x1F].flt_4_y = (double)v5->vPosition.y; + v4->array_4[v5->field_54 & 0x1F].flt_8_z = (double)v5->vPosition.z; } else { - a2->field_54 = v4->array_0[0].uSpellAnimLength++; - v4->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x; - v4->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y; - v4->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z; + a2->field_54 = v4->field_0++; + v4->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; + v4->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; + v4->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; v10 = (double)a2->vPosition.x; local_0.bFree = 1036; local_0.uDiffuse = uDiffuse; @@ -511,10 +511,10 @@ v5 = &pObjectList->pObjects[a2->uObjectDescID]; if ( v4 ) { - v6 = &v2->array_0[v4 & 0x1F]; - v7 = ((double)a2->vPosition.x - v6->flt_4) * 0.5 + v6->flt_4; - v8 = ((double)a2->vPosition.y - v6->flt_8) * 0.5 + v6->flt_8; - v9 = ((double)a2->vPosition.z - v6->flt_C) * 0.5 + v6->flt_C; + v6 = &v2->array_4[v4 & 0x1F]; + v7 = ((double)a2->vPosition.x - v6->flt_0_x) * 0.5 + v6->flt_0_x; + v8 = ((double)a2->vPosition.y - v6->flt_4_y) * 0.5 + v6->flt_4_y; + v9 = ((double)a2->vPosition.z - v6->flt_8_z) * 0.5 + v6->flt_8_z; local_0.bFree = 2048; local_0.uDiffuse = 0xFFFFFFu; a2a = v9; @@ -536,16 +536,16 @@ local_0.z = (double)v3->vPosition.z; local_0.timeToLive = (rand() & 0x3F) + 64; pGame->pParticleEngine->AddParticle(&local_0); - v2->array_0[v3->field_54 & 0x1F].flt_4 = (double)v3->vPosition.x; - v2->array_0[v3->field_54 & 0x1F].flt_8 = (double)v3->vPosition.y; - v2->array_0[v3->field_54 & 0x1F].flt_C = (double)v3->vPosition.z; + v2->array_4[v3->field_54 & 0x1F].flt_0_x = (double)v3->vPosition.x; + v2->array_4[v3->field_54 & 0x1F].flt_4_y = (double)v3->vPosition.y; + v2->array_4[v3->field_54 & 0x1F].flt_8_z = (double)v3->vPosition.z; } else { - a2->field_54 = v2->array_0[0].uSpellAnimLength++; - v2->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x; - v2->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y; - v2->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z; + a2->field_54 = v2->field_0++; + v2->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; + v2->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; + v2->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; v12 = (double)a2->vPosition.x; local_0.bFree = 2048; local_0.uDiffuse = 0xFFFFFFu; @@ -577,9 +577,9 @@ v6 = (double)a2->vPosition.y; v7 = (double)a2->vPosition.x; DoAddProjectile( - this->array_0[v4 & 0x1F].flt_4, - this->array_0[v4 & 0x1F].flt_8, - this->array_0[v4 & 0x1F].flt_C, + this->array_4[v4 & 0x1F].flt_0_x, + this->array_4[v4 & 0x1F].flt_4_y, + this->array_4[v4 & 0x1F].flt_8_z, v7, v6, v5, @@ -587,10 +587,10 @@ } else { - a2->field_54 = this->array_0[0].uSpellAnimLength++; - this->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x; - this->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y; - this->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z; + a2->field_54 = this->field_0++; + this->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; + this->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; + this->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; } } @@ -1319,119 +1319,104 @@ } //----- (004A89BD) -------------------------------------------------------- -int stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID) +void stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID) { - stru6 *v3; // edi@1 + //stru6 *v3; // edi@1 PlayerBuffAnim *v4; // esi@1 - int result; // eax@1 const char *v6; // [sp-4h] [bp-10h]@2 - v3 = this; - v4 = (PlayerBuffAnim *)((char *)this + 16 * (signed __int16)uPlayerID); - v4[32].uSpellIconID_ = 0; - v4[32].uSpellID = uSpellID; - result = (signed __int16)uSpellID - 3; - switch ( uSpellID ) + //v3 = this; + //v4 = &array_0[uPlayerID]; + //v4[32].uSpellIconID_ = 0; pPlayerBuffs[]::field_4 + //v4[32].uSpellID = uSpellID; pPlayerBuffs[]::bRender + + v4 = &pPlayerBuffs[uPlayerID]; + v4->uSpellAnimTimeElapsed = 0; + v4->bRender = uSpellID != 0; + + switch (uSpellID) { - case (SPELL_WATER_PROTECTION_FROM_WATER|0x80): + case SPELL_153: + __debugbreak(); // spell id == 153 wtf v6 = "zapp"; - goto LABEL_24; + break; + + case BECOME_MAGIC_GUILD_MEMBER: case SPELL_AIR_FEATHER_FALL: case SPELL_SPIRIT_DETECT_LIFE: - case SPELL_SPIRIT_DOOM: - case 0x96u: + case SPELL_SPIRIT_FATE: v6 = "spboost1"; - goto LABEL_24; - case SPELL_AIR_SHIELD|0x2: + break; + + case SPELL_QUEST_COMPLETED: + case SPELL_AIR_INVISIBILITY: case SPELL_WATER_WATER_WALK: - case SPELL_SPIRIT_PRESERVE: - case 0x97u: + case SPELL_SPIRIT_PRESERVATION: v6 = "spboost2"; - goto LABEL_24; - case SPELL_BODY_CURE_WEAKNESS|0x10: - case SPELL_BODY_FIRST_AID|SPELL_AIR_SHIELD: - case 0x56u: - case SPELL_BODY_CURE_POISON|0x10: - case 0x98u: + break; + + case SPELL_152: + __debugbreak(); // spell id == 152 wtf + case SPELL_LIGHT_HOUR_OF_POWER: + case SPELL_LIGHT_DAY_OF_THE_GODS: + case SPELL_LIGHT_DAY_OF_PROTECTION: + case SPELL_LIGHT_DIVINE_INTERVENTION: v6 = "spboost3"; - goto LABEL_24; - case (SPELL_AIR_SHIELD|0x20): + break; + + case SPELL_SPIRIT_REMOVE_CURSE: case SPELL_MIND_REMOVE_FEAR: case SPELL_BODY_CURE_WEAKNESS: v6 = "spheal1"; - goto LABEL_24; - case SPELL_SPIRIT_PRESERVE|0x4: + break; + + case SPELL_SPIRIT_SHARED_LIFE: case SPELL_MIND_CURE_PARALYSIS: - case 0x40u: + case SPELL_MIND_CURE_INSANITY: case SPELL_BODY_FIRST_AID: case SPELL_BODY_CURE_POISON: case SPELL_BODY_CURE_DISEASE: - case 0x60u: + case SPELL_DARK_SACRIFICE: v6 = "spheal2"; - goto LABEL_24; - case SPELL_BODY_HAMMERHANDS|0x4: - case SPELL_BODY_CURE_WEAKNESS|0x20: + break; + + case SPELL_BODY_POWER_CURE: + case SPELL_DARK_SOULDRINKER: v6 = "spheal3"; - goto LABEL_24; + break; + case SPELL_FIRE_PROTECTION_FROM_FIRE: - case SPELL_FIRE_FIRE_RING: + case SPELL_FIRE_IMMOLATION: v6 = "spell03"; - goto LABEL_24; - case SPELL_FIRE_HASTE: - v6 = "spell05"; - goto LABEL_24; - case SPELL_AIR_PROTECTION_FROM_AIR: - v6 = "spell14"; - goto LABEL_24; - case SPELL_AIR_SHIELD: - v6 = "spell17"; - goto LABEL_24; - case SPELL_WATER_PROTECTION_FROM_WATER: - v6 = "spell25"; - goto LABEL_24; - case SPELL_EARTH_PROTECTION_FROM_EARTH: - v6 = "spell36"; - goto LABEL_24; - case SPELL_EARTH_STONESKIN: - v6 = "spell38"; - goto LABEL_24; - case SPELL_SPIRIT_BLESS: - v6 = "spell46"; - goto LABEL_24; - case SPELL_SPIRIT_HEROISM: - v6 = "spell51"; - goto LABEL_24; - case SPELL_SPIRIT_HEROISM|0x4: - v6 = "spell55"; - goto LABEL_24; - case SPELL_MIND_PROTECTION_FROM_MIND: - v6 = "spell58"; - goto LABEL_24; - case SPELL_BODY_FIRST_AID|0x1: - v6 = "spell69"; - goto LABEL_24; - case SPELL_BODY_FIRST_AID|SPELL_FIRE_PROTECTION_FROM_FIRE: - v6 = "spell71"; - goto LABEL_24; - case SPELL_BODY_HAMMERHANDS: - v6 = "spell73"; - goto LABEL_24; - case SPELL_BODY_PROTECTION_FROM_MAGIC: - v6 = "spell75"; -LABEL_24: - result = pIconsFrameTable->FindIcon(v6); - v4[33].uSpellIconID = result; - break; + break; + + case SPELL_FIRE_HASTE: v6 = "spell05"; break; + case SPELL_AIR_PROTECTION_FROM_AIR: v6 = "spell14"; break; + case SPELL_AIR_SHIELD: v6 = "spell17"; break; + case SPELL_WATER_PROTECTION_FROM_WATER: v6 = "spell25"; break; + case SPELL_EARTH_PROTECTION_FROM_EARTH: v6 = "spell36"; break; + case SPELL_EARTH_STONESKIN: v6 = "spell38"; break; + case SPELL_SPIRIT_BLESS: v6 = "spell46"; break; + case SPELL_SPIRIT_HEROISM: v6 = "spell51"; break; + case SPELL_SPIRIT_RESSURECTION: v6 = "spell55"; break; + case SPELL_MIND_PROTECTION_FROM_MIND: v6 = "spell58"; break; + case SPELL_BODY_PROTECTION_FROM_BODY: v6 = "spell69"; break; + case SPELL_BODY_REGENERATION: v6 = "spell71"; break; + case SPELL_BODY_HAMMERHANDS: v6 = "spell73"; break; + case SPELL_BODY_PROTECTION_FROM_MAGIC: v6 = "spell75"; break; + default: - v4[32].uSpellID = 0; - break; + //v4[32].uSpellID = 0; + v4->bRender = false; + return; } - if ( v4[32].uSpellID ) - { - result = 8 * pIconsFrameTable->pIcons[v4[33].uSpellIconID].uAnimLength; - v3->array_0[(signed __int16)uPlayerID + 33].uSpellAnimLength = result; - } - return result; + + //v4[33].uSpellIconID = pIconsFrameTable->FindIcon(v6); + v4->uSpellIconID = pIconsFrameTable->FindIcon(v6); + //if ( v4[32].uSpellID ) + if (v4->bRender) + //v3->array_0[(signed __int16)uPlayerID + 33].uSpellAnimLength = 8 * pIconsFrameTable->pIcons[v4[33].uSpellIconID].uAnimLength; + v4->uSpellAnimTime = 8 * pIconsFrameTable->pIcons[v4->uSpellIconID].uAnimLength; } //----- (004A8BDF) -------------------------------------------------------- @@ -1607,42 +1592,24 @@ //----- (004A902A) -------------------------------------------------------- void stru6::DrawPlayerBuffAnims() { - __int16 *v1; // edi@1 - char *v2; // esi@1 - unsigned int v3; // eax@3 - unsigned __int8 v4; // zf@3 - char v5; // sf@3 - unsigned __int8 v6; // of@3 - IconFrame *v7; // eax@4 + for (uint i = 0; i < 4; ++i) + { + auto buff = pPlayerBuffs + i; + if (!buff->bRender) + continue; - uint _it = 0; - v1 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing; - v2 = (char *)&this->pPlayerBuffs[0].uSpellIconID; - do - { - if ( *((short *)v2 - 2) ) + buff->uSpellAnimTimeElapsed += pEventTimer->uTimeElapsed; + if (buff->uSpellAnimTimeElapsed >= buff->uSpellAnimTime) { - v3 = pEventTimer->uTimeElapsed + *(int *)v2; - v6 = __OFSUB__(v3, *((int *)v2 + 1)); - v4 = v3 == *((int *)v2 + 1); - v5 = ((v3 - *((int *)v2 + 1)) & 0x80000000u) != 0; - *(int *)v2 = v3; - if ( (unsigned __int8)(v5 ^ v6) | v4 ) - { - v7 = pIconsFrameTable->GetFrame(*((int *)v2 + 2), v3); - pRenderer->DrawTextureTransparent(*v1, 0x181u, &pIcons_LOD->pTextures[v7->uTextureID]); - pOtherOverlayList->bRedraw = true; - } - else - { - *((short *)v2 - 2) = 0; - } + buff->bRender = false; + continue; } - v2 += 16; - ++v1; + + auto icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed); + pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 385, pIcons_LOD->GetTexture(icon->uTextureID)); + + pOtherOverlayList->bRedraw = true; } - //while ( (signed int)v1 < (signed int)pBaseHealthByClass ); - while (++_it != 4); } //----- (004A90A0) --------------------------------------------------------
--- a/stru6.h Fri Mar 01 18:37:54 2013 +0600 +++ b/stru6.h Fri Mar 01 18:38:12 2013 +0600 @@ -51,12 +51,15 @@ #pragma pack(push, 1) struct PlayerBuffAnim { + inline PlayerBuffAnim(): + bRender(false), uSpellAnimTime(0), uSpellIconID(0) + {} + __int16 bRender; __int16 field_2; + int uSpellAnimTimeElapsed; + int uSpellAnimTime; int uSpellIconID; - __int16 uSpellID; - __int16 field_A; - int uSpellIconID_; }; #pragma pack(pop) @@ -80,10 +83,11 @@ #pragma pack(push, 1) struct stru6_stru2 { - int uSpellAnimLength; - float flt_4; - float flt_8; - float flt_C; + //int field_0; + float flt_0_x; + float flt_4_y; + float flt_8_z; + int field_C; }; #pragma pack(pop) @@ -96,14 +100,10 @@ //----- (004A7155) -------------------------------------------------------- stru6() { - this->pPlayerBuffs[0].bRender = 0; - this->pPlayerBuffs[1].bRender = 0; - this->pPlayerBuffs[2].bRender = 0; - this->pPlayerBuffs[3].bRender = 0; this->field_204 = 0; this->uFadeTime = 0; this->uNumProjectiles = 0; - this->array_0[0].uSpellAnimLength = 0; + this->field_0 = 0; pStru1 = new stru6_stru1_indoor_sw_billboard; pStru1->Initialize(0xFF3C1Eu); @@ -133,7 +133,7 @@ int _4A806F(struct Actor *pActor); void _4A80DC_some_stuff_sw(struct LayingItem *a2); bool _4A81CA(struct LayingItem *a2); - int SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID); + void SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID); void FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime); int _4A8BFC(); void RenderSpecialEffects(); @@ -141,7 +141,11 @@ void LoadAnimations(); - stru6_stru2 array_0[32]; + int field_0; + stru6_stru2 array_4[31]; + int field_1F4; + int field_1F8; + int field_1FC; int field_200; int field_204; PlayerBuffAnim pPlayerBuffs[4];