# HG changeset patch # User Grumpy7 # Date 1403304154 -7200 # Node ID 56f87a5c402bf6a4a9b72a314475273d02f74fae # Parent e07e297f292dd20c02248f5ef9f1193748e3dcc8# Parent 48dbf99c0f7f3743858741c400a2169fc1756335 Merge diff -r e07e297f292d -r 56f87a5c402b Actor.cpp --- a/Actor.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/Actor.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -240,18 +240,13 @@ int v48; // ecx@110 int v51; // ecx@130 int v54; // ecx@138 - //Player *v57; // esi@145 - //int v58; // eax@146 int v59; // edi@146 - //int v60; // eax@146 int v61; // edi@146 - //int v62; // eax@146 signed int v63; // edi@146 int v68; // edi@168 signed int v70; // ecx@172 int v79; // edx@185 int v80; // eax@185 - //signed int v89; // ecx@192 signed int v91; // eax@200 int v94; // ecx@208 int v96; // ecx@217 @@ -706,11 +701,13 @@ unsigned int v3; // edi@1 v2 = a1->uAlly; - v3 = a2->uAlly; - if ( !v2 ) + if ( !a1->uAlly ) v2 = (a1->pMonsterInfo.uID - 1) / 3 + 1; - if ( !v3 ) + + v3 = a2->uAlly; + if ( !a2->uAlly ) v3 = (a2->pMonsterInfo.uID - 1) / 3 + 1; + if ( v2 >= 39 && v2 <= 44 && v3 >= 39 && v3 <= 44 || v2 >= 45 && v2 <= 50 && v3 >= 45 && v3 <= 50 || v2 >= 51 && v2 <= 62 && v3 >= 51 && v3 <= 62 @@ -760,12 +757,9 @@ //----- (00404874) -------------------------------------------------------- void Actor::AI_RangedAttack( unsigned int uActorID, struct AIDirection *pDir, int type, char a4 ) { - //Actor *actPtr; // esi@1 char specAb; // al@1 int v13; // edx@28 - //actPtr = &pActors[uActorID]; - SpriteObject a1; // [sp+Ch] [bp-74h]@1 switch ( type ) @@ -825,12 +819,12 @@ return; } a1.stru_24.Reset(); + a1.spell_id = 0; a1.vPosition.x = pActors[uActorID].vPosition.x; - a1.spell_id = 0; a1.vPosition.y = pActors[uActorID].vPosition.y; + a1.vPosition.z = pActors[uActorID].vPosition.z - (unsigned int)(pActors[uActorID].uActorHeight * -0.75); a1.spell_level = 0; a1.spell_skill = 0; - a1.vPosition.z = pActors[uActorID].vPosition.z - (unsigned int)(pActors[uActorID].uActorHeight * -0.75); a1.uFacing = pDir->uYawAngle; a1.uSoundID = 0; a1.uAttributes = 0; @@ -1103,7 +1097,6 @@ { AIDirection *v7; // eax@3 AIDirection v1; // eax@3 - //Actor *v9; // ebx@3 AIDirection a3; // [sp+8h] [bp-38h]@4 if ( rand() % 100 >= 5 ) @@ -1133,7 +1126,8 @@ //----- (00403F58) -------------------------------------------------------- void Actor::AI_StandOrBored(unsigned int uActorID, signed int uObjID, int uActionLength, AIDirection *a4) { - if (rand() % 2) + //движется или стоит определяется случайно(1 - движется, 0 - стоит) + if (rand() % 2)//0 or 1 AI_Bored(uActorID, uObjID, a4); else AI_Stand(uActorID, uObjID, uActionLength, a4); @@ -1154,7 +1148,7 @@ pActors[uActorID].uAIState = Standing; if (!uActionLength) - pActors[uActorID].uCurrentActionLength = rand() % 256 + 256; + pActors[uActorID].uCurrentActionLength = rand() % 256 + 256;// от 256 до 256 + 256 else pActors[uActorID].uCurrentActionLength = uActionLength; pActors[uActorID].uCurrentActionTime = 0; @@ -1181,7 +1175,7 @@ //----- (00403C6C) -------------------------------------------------------- void Actor::AI_MeleeAttack(unsigned int uActorID, signed int sTargetPid, struct AIDirection *arg0) { - Actor *v3; // ebx@1 + //Actor *v3; // ebx@1 int16_t v6; // esi@6 int16_t v7; // edi@6 signed int v8; // eax@7 @@ -1192,8 +1186,10 @@ int v23; // [sp+4Ch] [bp-8h]@6 unsigned int v25; // [sp+5Ch] [bp+8h]@13 - v3 = &pActors[uActorID]; - if ( v3->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY && v3->pMonsterInfo.uAIType == 1 ) + assert(uActorID < uNumActors); + + //v3 = &pActors[uActorID]; + if ( pActors[uActorID].pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY && pActors[uActorID].pMonsterInfo.uAIType == 1 ) { Actor::AI_Stand(uActorID, sTargetPid, 0, arg0); return; @@ -1217,9 +1213,10 @@ Error("Should not get here"); return; } - v10.z = (int32_t)(v3->uActorHeight * 0.75 + v3->vPosition.z); - v10.y = v3->vPosition.y; - v10.x = v3->vPosition.x; + + v10.x = pActors[uActorID].vPosition.x; + v10.y = pActors[uActorID].vPosition.y; + v10.z = (int32_t)(pActors[uActorID].uActorHeight * 0.75 + pActors[uActorID].vPosition.z); if ( sub_407A1C((int)v6, (int)v7, v23, v10) ) { @@ -1230,22 +1227,22 @@ Actor::GetDirectionInfo(PID(OBJECT_Actor, uActorID), sTargetPid, &a3, 0); v12 = &a3; } - v3->uYawAngle = LOWORD(v12->uYawAngle); - v3->uCurrentActionLength = pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[ANIM_AtkMelee]].uAnimLength * 8; - v3->uCurrentActionTime = 0; - v3->uAIState = AttackingMelee; + pActors[uActorID].uYawAngle = LOWORD(v12->uYawAngle); + pActors[uActorID].uCurrentActionLength = pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[ANIM_AtkMelee]].uAnimLength * 8; + pActors[uActorID].uCurrentActionTime = 0; + pActors[uActorID].uAIState = AttackingMelee; Actor::PlaySound(uActorID, 0); - v25 = pMonsterStats->pInfos[v3->pMonsterInfo.uID].uRecoveryTime; - if ( v3->pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0 ) + v25 = pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].uRecoveryTime; + if ( pActors[uActorID].pActorBuffs[ACTOR_BUFF_SLOWED].uExpireTime > 0 ) v25 *= 2; if ( pParty->bTurnBasedModeOn != 1 ) - v3->pMonsterInfo.uRecoveryTime = (int)(flt_6BE3A8_debug_recmod2 * v25 * 2.133333333333333); + pActors[uActorID].pMonsterInfo.uRecoveryTime = (int)(flt_6BE3A8_debug_recmod2 * v25 * 2.133333333333333); else - v3->pMonsterInfo.uRecoveryTime = v25; - v3->vVelocity.z = 0; - v3->vVelocity.y = 0; - v3->vVelocity.x = 0; - v3->UpdateAnimation(); + pActors[uActorID].pMonsterInfo.uRecoveryTime = v25; + pActors[uActorID].vVelocity.z = 0; + pActors[uActorID].vVelocity.y = 0; + pActors[uActorID].vVelocity.x = 0; + pActors[uActorID].UpdateAnimation(); } else Actor::AI_Pursue1(uActorID, sTargetPid, rand() % 2, 64, arg0); @@ -4541,51 +4538,19 @@ //----- (004016FA) -------------------------------------------------------- int Actor::MakeActorAIList_BLV() { - //Actor *v0; // esi@2 int v1; // eax@4 - // int v2; // ebx@4 - // unsigned int v3; // ecx@4 - // int v4; // edx@5 - // int v5; // edx@7 - // unsigned int v6; // edx@9 - unsigned int v7; // ST24_4@10 - // int v8; // eax@10 int v9; // edi@10 - // int v10; // ebx@14 - // char v11; // zf@16 - int v12; // eax@22 int v13; // edx@24 - // int v14; // ecx@25 - int v15; // ebx@26 - // unsigned int *v16; // ecx@27 - unsigned int v17; // esi@27 int v18; // ecx@31 signed int v19; // edi@31 - // Actor *v20; // esi@32 - // bool v21; // eax@33 - // int v22; // eax@34 - // signed int v23; // ebx@36 - // Actor *v24; // esi@37 signed int v25; // eax@40 - // int v26; // eax@43 - int v27; // ebx@45 int j; // edi@45 - // unsigned int v29; // eax@46 int v30; // eax@48 - // int v31; // ecx@51 - // int v32; // eax@51 - // signed int v33; // eax@53 - // __int64 v34; // qax@55 - // char *v35; // ecx@56 int v37; // [sp+Ch] [bp-18h]@1 int v38; // [sp+10h] [bp-14h]@4 int v39; // [sp+14h] [bp-10h]@4 - //int v40; // [sp+18h] [bp-Ch]@10 - // int v41; // [sp+18h] [bp-Ch]@29 int i; // [sp+18h] [bp-Ch]@31 - //signed int v43; // [sp+1Ch] [bp-8h]@1 - // signed int v44; // [sp+1Ch] [bp-8h]@25 - int v45; // [sp+20h] [bp-4h]@1 + uint v45; // [sp+20h] [bp-4h]@1 // __debugbreak(); // refactor for blv ai pParty->uFlags &= 0xFFFFFFCFu; @@ -4599,11 +4564,11 @@ pActors[i].uAttributes &= 0xBF00; continue; } - v39 = abs(pParty->vPosition.z - pActors[i].vPosition.z); + v1 = abs(pParty->vPosition.x - pActors[i].vPosition.x); v38 = abs(pParty->vPosition.y - pActors[i].vPosition.y); - v1 = abs(pParty->vPosition.x - pActors[i].vPosition.x); - v7 = int_get_vector_length(v39, v38, v1); - v9 = v7 - pActors[i].uActorRadius; + v39 = abs(pParty->vPosition.z - pActors[i].vPosition.z); + + v9 = int_get_vector_length(v39, v38, v1) - pActors[i].uActorRadius; if ( v9 < 0 ) v9 = 0; if ( v9 < 10240 ) @@ -4617,9 +4582,9 @@ if ( !(pParty->uFlags & 0x20) && v9 < 5120 ) pParty->uFlags |= 0x20; } - v12 = v45++; - ai_near_actors_distances[v12] = v9; - ai_near_actors_ids[v12] = i; + ai_near_actors_distances[v45] = v9; + ai_near_actors_ids[v45] = i; + v45++; } else pActors[i].uAttributes &= 0xBF00; @@ -4631,14 +4596,12 @@ { for ( uint j = 1; j < v45; ++j ) { - v15 = ai_near_actors_distances[v13]; if ( ai_near_actors_distances[v13] > ai_near_actors_distances[j] ) { - v17 = ai_near_actors_ids[v13]; ai_near_actors_ids[v13] = ai_near_actors_ids[j]; - ai_near_actors_ids[j] = v17; + ai_near_actors_ids[j] = ai_near_actors_ids[v13]; ai_near_actors_distances[v13] = ai_near_actors_distances[j]; - ai_near_actors_distances[j] = v15; + ai_near_actors_distances[j] = ai_near_actors_distances[v13]; } } ++v13; @@ -4687,21 +4650,19 @@ } } } - v27 = ai_arrays_size; for ( j = 0; j < v45; ++j ) { - //v29 = ai_near_actors_ids[j]; if ( pActors[ai_near_actors_ids[j]].uAttributes & 0xC000 && pActors[ai_near_actors_ids[j]].CanAct() ) { v30 = 0; - if ( v27 <= 0 ) + if ( ai_arrays_size <= 0 ) ai_array_4F6638_actor_ids[ai_arrays_size++] = ai_near_actors_ids[j]; else { while ( ai_array_4F6638_actor_ids[v30] != ai_near_actors_ids[j] ) { ++v30; - if ( v30 >= v27 ) + if ( v30 >= ai_arrays_size ) { ai_array_4F6638_actor_ids[ai_arrays_size++] = ai_near_actors_ids[j]; break; @@ -4724,20 +4685,13 @@ bool __fastcall sub_4070EF_prolly_detect_player(unsigned int uObjID, unsigned int uObj2ID) { signed int v2; // eax@1 -// int v5; // ecx@2 int obj1_sector; // eax@4 float v8; // ST24_4@5 -// double v9; // ST18_8@5 -// int v11; // ecx@6 signed int v12; // eax@7 -// int v13; // esi@7 -// int v14; // esi@8 -// int v15; // esi@9 int obj2_z; // edi@11 int obj2_x; // esi@11 int obj2_sector; // eax@13 float v20; // ST24_4@14 -// double v21; // ST18_8@14 int dist_x; // ebx@16 signed int dist_3d; // ecx@16 int v25; // eax@18 @@ -4748,10 +4702,7 @@ int v33; // ST54_4@44 int v34; // eax@44 signed int v38; // esi@45 -// signed __int64 v40; // qtt@50 __int16 next_sector; // bx@58 -// int v43; // [sp-8h] [bp-70h]@11 -// int v44; // [sp-4h] [bp-6Ch]@11 int v47; // [sp+18h] [bp-50h]@20 int v48; // [sp+1Ch] [bp-4Ch]@20 int v49; // [sp+20h] [bp-48h]@20 @@ -4909,8 +4860,9 @@ } v32 = fixpoint_mul(v29->pFacePlane_old.vNormal.x,v49); + v34 = fixpoint_mul(v29->pFacePlane_old.vNormal.y,v48); v33 = fixpoint_mul(v29->pFacePlane_old.vNormal.z,v47); - v34 = fixpoint_mul(v29->pFacePlane_old.vNormal.y,v48); + v59 = v32 + v33 + v34; if ( v59 ) { @@ -4989,35 +4941,27 @@ { unsigned int v1; // ebx@1 bool result; // eax@2 - MonsterDesc *v3; // esi@5 - MonsterInfo *v4; // edi@5 - Vec3_int_ v5; // ST08_12@5 unsigned int v6; // ecx@5 - Actor *v7; // eax@7 Actor actor; // [sp+4h] [bp-350h]@5 Vec3_int_ pOut; // [sp+348h] [bp-Ch]@5 v1 = uMonsterID; if ( uNumActors == 499 ) - { result = 0; - } else { if ( (signed int)uMonsterID >= (signed int)pMonsterList->uNumMonsters ) v1 = 0; - v3 = &pMonsterList->pMonsters[v1]; - v4 = &pMonsterStats->pInfos[v1 + 1]; - memset(&actor, 0, 0x344u); - strcpy(actor.pActorName, v4->pName); - actor.sCurrentHP = LOWORD(v4->uHP); - memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], 0x58u); + memset(&actor, 0, sizeof(Actor)); + strcpy(actor.pActorName, pMonsterStats->pInfos[v1 + 1].pName); + actor.sCurrentHP = LOWORD(pMonsterStats->pInfos[v1 + 1].uHP); + memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], sizeof(MonsterInfo)); actor.word_000086_some_monster_id = v1 + 1; - actor.uActorRadius = v3->uMonsterRadius; - actor.uActorHeight = v3->uMonsterHeight; - actor.uMovementSpeed = v3->uMovementSpeed; - v5 = pParty->vPosition; - Vec3_int_::Rotate(200, pParty->sRotationY, 0, v5, &pOut.x, &pOut.z, &pOut.y); + actor.uActorRadius = pMonsterList->pMonsters[v1].uMonsterRadius; + actor.uActorHeight = pMonsterList->pMonsters[v1].uMonsterHeight; + actor.uMovementSpeed = pMonsterList->pMonsters[v1].uMovementSpeed; + + Vec3_int_::Rotate(200, pParty->sRotationY, 0, pParty->vPosition, &pOut.x, &pOut.z, &pOut.y); actor.vInitialPosition.x = pOut.x; actor.vPosition.x = pOut.x; actor.uTetherDistance = 256; @@ -5033,9 +4977,8 @@ dword_5C6DF8 = 0; v6 = uNumActors++; } - v7 = &pActors[v6]; - memcpy(v7, &actor, 0x344u); - v7->PrepareSprites(1); + memcpy(&pActors[v6], &actor, sizeof(Actor)); + pActors[v6].PrepareSprites(1); result = 1; } return result; @@ -5046,163 +4989,99 @@ //----- (0044FA4C) -------------------------------------------------------- signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3) { - signed int v3; // ecx@6 - Actor *v4; // edx@7 signed int result; // eax@13 - Actor *v6; // esi@16 - char *v7; // ebx@16 - MonsterDesc *v8; // edi@16 - unsigned __int16 v9; // ax@16 int v10; // ebx@16 - //int v11; // edi@16 - //int v12; // eax@16 - //int v13; // ecx@16 - //int v14; // ebx@16 const char *v15; // [sp-4h] [bp-24h]@2 - //unsigned __int16 v16; // [sp+0h] [bp-20h]@1 - //int v17; // [sp+4h] [bp-1Ch]@1 unsigned int uFaceID; // [sp+8h] [bp-18h]@16 int v19; // [sp+Ch] [bp-14h]@16 size_t v20; // [sp+10h] [bp-10h]@6 int v21; // [sp+14h] [bp-Ch]@14 - //int v22; // [sp+18h] [bp-8h]@14 unsigned int v23; // [sp+1Ch] [bp-4h]@6 - //v16 = a2; - //v17 = a1; if ( a2 == 4 ) - { v15 = "Elemental Light C"; - } else if ( a2 == 3 ) v15 = "Elemental Light B"; else v15 = "Elemental Light A"; v23 = pMonsterList->GetMonsterIDByName(v15); - v3 = 0; - v20 = uNumActors; - if ( (signed int)uNumActors > 0 ) + v20 = 0; + for ( v20; v20 < uNumActors; v20++ ) { - v4 = pActors.data();//[0].uAIState; - while ( v4->uAIState != Removed ) - { - ++v3; - ++v4; - if ( v3 >= (signed int)uNumActors ) - break; - } - if( v3 < (signed int)uNumActors ) - v20 = v3; + if ( pActors[v20].uAIState == Removed ) + break; } - if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) ) + + result = uNumActors + 1; + if ( v20 != uNumActors || result < 500 ) { v21 = 0; - //v22 = pParty->vPosition.z; if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); - v6 = &pActors[v20]; - v7 = (char *)&pMonsterStats->pInfos[v23 + 1]; v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64; - v6->Reset(); - v8 = &pMonsterList->pMonsters[v23]; - strcpy(v6->pActorName, *(const char **)v7); - v6->sCurrentHP = *((short *)v7 + 32); - memcpy(&v6->pMonsterInfo, v7, 0x58u); - v6->word_000086_some_monster_id = v23 + 1; - v6->uActorRadius = v8->uMonsterRadius; - v6->uActorHeight = v8->uMonsterHeight; - v9 = v8->uMovementSpeed; - v6->pMonsterInfo.uTreasureDiceRolls = 0; - v6->pMonsterInfo.uTreasureType = 0; - v6->pMonsterInfo.uExp = 0; - v6->uMovementSpeed = v9; + pActors[v20].Reset(); + strcpy(pActors[v20].pActorName, pMonsterStats->pInfos[v23 + 1].pName); + pActors[v20].sCurrentHP = pMonsterStats->pInfos[v23 + 1].uHP; + memcpy(&pActors[v20].pMonsterInfo, &pMonsterStats->pInfos[v23 + 1], sizeof(MonsterInfo)); + pActors[v20].word_000086_some_monster_id = v23 + 1; + pActors[v20].uActorRadius = pMonsterList->pMonsters[v23].uMonsterRadius; + pActors[v20].uActorHeight = pMonsterList->pMonsters[v23].uMonsterHeight; + pActors[v20].pMonsterInfo.uTreasureDiceRolls = 0; + pActors[v20].pMonsterInfo.uTreasureType = 0; + pActors[v20].pMonsterInfo.uExp = 0; + pActors[v20].uMovementSpeed = pMonsterList->pMonsters[v23].uMovementSpeed; v10 = rand() % 2048; - //v11 = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v10), v19); - uFaceID = stru_5C6E00->Sin(v10); - //v12 = pParty->vPosition.y; - //v13 = fixpoint_mul(uFaceID, v19); - //v14 = pParty->vPosition.y + fixpoint_mul(uFaceID, v19); - //LOWORD(v12) = v22; - v6->vInitialPosition.x = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v10), v19); - v6->vPosition.x = v6->vInitialPosition.x; - v6->vInitialPosition.y = pParty->vPosition.y + fixpoint_mul(uFaceID, v19); - v6->vPosition.y = v6->vInitialPosition.y; - v6->vInitialPosition.z = pParty->vPosition.z; - v6->vPosition.z = v6->vInitialPosition.z; - //LOWORD(v12) = v21; - v6->uTetherDistance = 256; - v6->uSectorID = v21; - v6->PrepareSprites(0); - v6->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; - v6->uAlly = 9999; - v6->uGroup = 0; - v6->uCurrentActionTime = 0; - v6->uAIState = Summoned; - v6->uCurrentActionLength = 256; - v6->UpdateAnimation(); + pActors[v20].vInitialPosition.x = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v10), v19); + pActors[v20].vPosition.x = pActors[v20].vInitialPosition.x; + pActors[v20].vInitialPosition.y = pParty->vPosition.y + fixpoint_mul(stru_5C6E00->Sin(v10), v19); + pActors[v20].vPosition.y = pActors[v20].vInitialPosition.y; + pActors[v20].vInitialPosition.z = pParty->vPosition.z; + pActors[v20].vPosition.z = pActors[v20].vInitialPosition.z; + pActors[v20].uTetherDistance = 256; + pActors[v20].uSectorID = v21; + pActors[v20].PrepareSprites(0); + pActors[v20].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; + pActors[v20].uAlly = 9999; + pActors[v20].uGroup = 0; + pActors[v20].uCurrentActionTime = 0; + pActors[v20].uAIState = Summoned; + pActors[v20].uCurrentActionLength = 256; + pActors[v20].UpdateAnimation(); + + result = pIndoor->GetSector(pActors[v20].vPosition.x, pActors[v20].vPosition.y, pActors[v20].vPosition.z); if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor - || (result = pIndoor->GetSector(v6->vPosition.x, v6->vPosition.y, v6->vPosition.z), - result == v21) - && (result = BLV_GetFloorLevel(v6->vPosition.x, v6->vPosition.y, v6->vPosition.z, result, &uFaceID), result != -30000) + || result == v21 + && (result = BLV_GetFloorLevel(pActors[v20].vPosition.x, pActors[v20].vPosition.y, pActors[v20].vPosition.z, result, &uFaceID), result != -30000) && (result = abs(result - pParty->vPosition.z), result <= 1024) ) { if ( v20 == uNumActors ) ++uNumActors; - v6->uSummonerID = PID(OBJECT_Player, a1); - result = v6->pActorBuffs[ACTOR_BUFF_SUMMONED].Apply(pParty->uTimePlayed + (a3 * 128) / 30.0f, - a2, - a1, - 0, - 0); + pActors[v20].uSummonerID = PID(OBJECT_Player, a1); + result = pActors[v20].pActorBuffs[ACTOR_BUFF_SUMMONED].Apply(pParty->uTimePlayed + (a3 * 128) / 30.0f, a2, a1, 0, 0); } } return result; } - //----- (0044F57C) -------------------------------------------------------- void SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *spawn, int a3, int a4, int a5) { - //MapInfo *v5; // esi@1 - //SpawnPointMM7 *v6; // ebx@1 int v7; // eax@2 char v8; // zf@5 - // int v9; // edi@9 - // int v10; // eax@9 - // int v11; // ecx@9 int v12; // edx@9 - // int v13; // eax@9 - // int v14; // eax@14 - // int v15; // ecx@14 - // int v16; // eax@19 - // int v17; // ecx@19 int v18; // esi@31 - //int pPosX; // ecx@32 - //int v20; // edx@32 - //int v21; // eax@32 Actor *pMonster; // esi@35 int v23; // edx@36 signed int v24; // edi@36 int v25; // ecx@36 - // unsigned __int16 v26; // ax@47 MonsterDesc *v27; // edi@48 signed int v28; // eax@48 - // __int16 v29; // cx@50 - // __int16 v30; // ax@50 - // __int16 v31; // ax@50 int v32; // eax@50 - // int v33; // edi@50 - // int v34; // eax@50 - // int v35; // eax@50 - // int v36; // eax@50 int v37; // eax@51 int v38; // eax@52 int v39; // edi@52 std::string v40; // [sp-18h] [bp-100h]@60 - // void *v41; // [sp-14h] [bp-FCh]@50 - //void *v42; // [sp-10h] [bp-F8h]@50 - //size_t v43; // [sp-Ch] [bp-F4h]@50 const char *v44; // [sp-8h] [bp-F0h]@13 char *pTexture; // [sp-4h] [bp-ECh]@9 char Str[32]; // [sp+Ch] [bp-DCh]@60 @@ -5355,9 +5234,7 @@ v24 = 2; } else - { v24 = 1; - } if ( v24 == 1 ) { pTexture = Source; diff -r e07e297f292d -r 56f87a5c402b AudioPlayer.h --- a/AudioPlayer.h Sat Jun 21 00:41:20 2014 +0200 +++ b/AudioPlayer.h Sat Jun 21 00:42:34 2014 +0200 @@ -121,6 +121,7 @@ SOUND_CloseBook = 231, SOUND_11090 = 11090, SOUND_12040 = 12040, + SOUND_Arena_Welcome = 14060, SOUND_20001 = 0x4E21, }; diff -r e07e297f292d -r 56f87a5c402b Build/Visual Studio 2010/World of Might and Magic.vcxproj --- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj Sat Jun 21 00:41:20 2014 +0200 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj Sat Jun 21 00:42:34 2014 +0200 @@ -198,6 +198,7 @@ + @@ -208,6 +209,7 @@ true + @@ -225,6 +227,7 @@ + @@ -244,6 +247,7 @@ + @@ -268,6 +272,7 @@ + @@ -451,6 +456,7 @@ + @@ -474,6 +480,7 @@ + @@ -481,6 +488,7 @@ + @@ -500,6 +508,7 @@ + diff -r e07e297f292d -r 56f87a5c402b Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters --- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Sat Jun 21 00:41:20 2014 +0200 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj.filters Sat Jun 21 00:42:34 2014 +0200 @@ -527,6 +527,12 @@ + + + + + UI + @@ -631,6 +637,7 @@ lib\OpenAL\lib\x86 + @@ -952,6 +959,12 @@ + + + + + UI + diff -r e07e297f292d -r 56f87a5c402b Build/Visual Studio 2010/World of Might and Magic.vcxproj.user --- a/Build/Visual Studio 2010/World of Might and Magic.vcxproj.user Sat Jun 21 00:41:20 2014 +0200 +++ b/Build/Visual Studio 2010/World of Might and Magic.vcxproj.user Sat Jun 21 00:42:34 2014 +0200 @@ -1,9 +1,9 @@ п»ї - $(OutDir) + ..\..\..\MM_VII WindowsLocalDebugger - -novideo, -nomarg + -nomarg $(OutDir)$(TargetName)$(TargetExt) \ No newline at end of file diff -r e07e297f292d -r 56f87a5c402b Build/Visual Studio 2012/World of Might and Magic.vcxproj --- a/Build/Visual Studio 2012/World of Might and Magic.vcxproj Sat Jun 21 00:41:20 2014 +0200 +++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj Sat Jun 21 00:42:34 2014 +0200 @@ -228,6 +228,7 @@ + @@ -483,6 +484,7 @@ + diff -r e07e297f292d -r 56f87a5c402b Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters --- a/Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters Sat Jun 21 00:41:20 2014 +0200 +++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters Sat Jun 21 00:42:34 2014 +0200 @@ -388,6 +388,9 @@ + + UI + @@ -962,6 +965,9 @@ + + UI + diff -r e07e297f292d -r 56f87a5c402b GUIWindow.h --- a/GUIWindow.h Sat Jun 21 00:41:20 2014 +0200 +++ b/GUIWindow.h Sat Jun 21 00:42:34 2014 +0200 @@ -237,7 +237,7 @@ { DIALOGUE_USE_NPC_ABILITY = 9, DIALOGUE_13 = 0xD, - DIALOGUE_18 = 0x12, + DIALOGUE_18 = 18, DIALOGUE_EVT_A = 19, DIALOGUE_EVT_B = 20, DIALOGUE_EVT_C = 21, @@ -254,8 +254,8 @@ DIALOGUE_ARENA_SELECT_CHAMPION = 88, DIALOGUE_ARENA_WELCOME = 89, DIALOGUE_ARENA_FIGHT_NOT_OVER_YET = 90, - DIALOGUE_ARENA_REWARD = 0x5B, - DIALOGUE_ARENA_ALREADY_WON = 0x5C, + DIALOGUE_ARENA_REWARD = 91, + DIALOGUE_ARENA_ALREADY_WON = 92, }; diff -r e07e297f292d -r 56f87a5c402b Items.cpp --- a/Items.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/Items.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -1199,7 +1199,7 @@ } } - v46 = rand()%spc_sum+1; + v46 = rand()%spc_sum+1;//случайные значения от 1 до spc_sum j=0; v45 = 0; while (v45EndScene(); pRenderer->Present(); @@ -187,10 +187,14 @@ pIcons_LOD->_inlined_sub2(); + //Создание нового окна + //WINDOW_MainMenu добавлено в GUIWindow.h pWindow_MMT_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); + + //Загрузка кнопок //Texture* MMT_MM6 = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); - sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png"); + sprintf(pContainerName, "data\\New_Icons/%s", "mm6_button_oval.png");//загружаем png из папки Texture* MMT_MM6 = LoadPNG(pContainerName); Texture* MMT_MM7 = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); @@ -206,9 +210,9 @@ pTexture_PCX.Release(); - sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx"); + sprintf(pContainerName, "data\\New_Icons/%s", "MMTTITLE.pcx");//загружаем pcx из папки pTexture_PCX.LoadPCXFile(pContainerName, 0); - SetCurrentMenuID(MENU_MMT_MAIN_MENU); + SetCurrentMenuID(MENU_MMT_MAIN_MENU);//Добавлено в enum MENU_STATE в GUIWindows.h SetForegroundWindow(window->GetApiHandle()); SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); while (GetCurrentMenuID() == MENU_MMT_MAIN_MENU ) @@ -233,7 +237,7 @@ pRenderer->BeginScene(); pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); - MMT_MenuMessageProc(); + MMT_MenuMessageProc();//отдельный для ММТ меню обработчик сообщений GUI_UpdateWindows(); if ( !pModalWindow )// ??? @@ -286,6 +290,8 @@ GUI_UpdateWindows(); pRenderer->EndScene(); pRenderer->Present(); + + //освобождаем ресурсы pTexture_PCX.Release(); if ( pGUIWindow2 ) { diff -r e07e297f292d -r 56f87a5c402b MediaPlayer.cpp --- a/MediaPlayer.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/MediaPlayer.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -489,9 +489,9 @@ // любой, для которых критические частоты в два раза меньше частота дискретизации sample_rate_half = (sample_rate + 1) / 2; //22050 if (dec_ctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) - root = 2.0 / (sqrt(frame_len) * 32768.0); + root = 2.0 / (sqrt(float(frame_len)) * 32768.0); else - root = frame_len / (sqrt(frame_len) * 32768.0); + root = frame_len / (sqrt(float(frame_len)) * 32768.0); for (i = 0; i < 96; i++) { /* constant is result of 0.066399999/log10(M_E) */ @@ -727,7 +727,7 @@ device_buffer = provider->CreateTrack16(audio.dec_ctx->channels, audio.dec_ctx->sample_rate, 2, num_audio_samples, audio_plain_data.Ptr()); - ReleaseAvcodec(); + Release(); return true; } } @@ -813,6 +813,7 @@ delete decoding_frame; if (last_resampled_frame_data[0]) av_freep(&last_resampled_frame_data[0]); + } bool Load(const wchar_t *filename, int dst_width, int dst_height, int cache_ms) //Загрузка @@ -990,7 +991,7 @@ last_resampled_frame_num = desired_frame_number; memcpy(last_resampled_frame_data, rescaled_data, sizeof(rescaled_data)); memcpy(last_resampled_frame_linesize, rescaled_linesize, sizeof(rescaled_linesize)); - //вроде должен быть av_freep(&rescaled_data[0]); + //av_freep(&rescaled_data[0]);//вроде должен быть } } else diff -r e07e297f292d -r 56f87a5c402b NPC.cpp --- a/NPC.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/NPC.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -16,6 +16,9 @@ #include "MapInfo.h" #include "Level/Decoration.h" #include "Actor.h" +#include "AudioPlayer.h" +#include "CastSpellInfo.h" +#include "Overlays.h" int pDialogueNPCCount; std::array pDialogueNPCPortraits; @@ -1890,3 +1893,152 @@ else return pNPCTopics[407].pTopic; } + +//----- (004BB756) -------------------------------------------------------- +int UseNPCSkill(NPCProf profession) +{ + switch (profession) + { + case Healer: + { + for (int i = 0; i < 4; ++i) + pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); + } + break; + + case ExpertHealer: + { + for (int i = 0; i < 4; ++i) + { + __debugbreak(); + pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); + + for (int j = 0; j < 14; ++j) + pParty->pPlayers[i].pConditions[j] = 0; + pParty->pPlayers[i].pConditions[Condition_Good] = 0; + } + } + break; + + case MasterHealer: + { + for (int i = 0; i < 4; ++i) + { + __debugbreak(); //Ritor1:needed cleaned(Необходимо почистить) + Player* player = &pParty->pPlayers[i]; + pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); + + int v5 = LODWORD(player->pConditions[19]);//*((int *)v4 - 32); + int v6 = HIDWORD(player->pConditions[19]);//*((int *)v4 - 31); + memset(&pParty->pPlayers[i].pConditions, 0, sizeof(pParty->pPlayers[i].pConditions)); + + *(int *)&player->pActiveSkills[PLAYER_SKILL_SHIELD] = v5; + *(int *)&player->pActiveSkills[PLAYER_SKILL_CHAIN] = v6; + } + } + break; + + case Cook://Повар + { + if (pParty->uNumFoodRations >= 13) + return 1; + + Party::GiveFood(1); + } + break; + + case Chef: + { + if (pParty->uNumFoodRations >= 13) + return 1; + + if (pParty->uNumFoodRations == 13) + Party::GiveFood(1); + else + Party::GiveFood(2); + } + break; + + case WindMaster: + { + if (uCurrentlyLoadedLevelType == LEVEL_Indoor) + { + ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2);//Нельзя применить знание Полет в помещении! + pAudioPlayer->PlaySound(SOUND_203, 0, 0, -1, 0, 0, 0, 0); + } + else + { + int v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); + pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + 60 * (256 * 2), 3, 1, v19, 0); + pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags |= 1; + pAudioPlayer->PlaySound(SOUND_11090, 0, 0, -1, 0, 0, 0, 0); + } + } + break; + + case WaterMaster: + { + int v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); + pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + 60 * (256 * (2 + 1)), 3, 0, v20, 0); + pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags |= 1; + pAudioPlayer->PlaySound(SOUND_12040, 0, 0, -1, 0, 0, 0, 0); + } + break; + + case GateMaster: + { + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); + dword_50C9DC = 195; + ptr_50C9E0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); + } + break; + + case Acolyte: _42777D_CastSpell_UseWand_ShootArrow(46, 0, 133, 0, 0); break; + case Piper: _42777D_CastSpell_UseWand_ShootArrow(51, 0, 133, 0, 0); break; + case FallenWizard: _42777D_CastSpell_UseWand_ShootArrow(86, 0, 133, 0, 0); break; + + case Teacher: + case Instructor: + case Armsmaster: + case Weaponsmaster: + case Apprentice: + case Mystic: + case Spellmaster: + case Trader: + case Merchant: + case Scout: + case Herbalist: + case Apothecary: + case Tinker: + case Locksmith: + case Fool: + case ChimneySweep: + case Porter: + case QuarterMaster: + case Factor: + case Banker: + case Horseman: + case Bard: + case Enchanter: + case Cartographer: + case Explorer: + case Pirate: + case Squire: + case Psychic: + case Gypsy: + case Diplomat: + case Duper: + case Burglar: + case Acolyte2: + case Initiate: + case Prelate: + case Monk: + case Sage: + case Hunter: + break; + + default: + assert(false && "Invalid enum value"); + } + return 0; +} \ No newline at end of file diff -r e07e297f292d -r 56f87a5c402b OurMath.cpp --- a/OurMath.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/OurMath.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -204,10 +204,13 @@ //----- (00452A9E) -------------------------------------------------------- int integer_sqrt(int val) { +/////////////////////////////// +//Получение квадратного корня// +/////////////////////////////// + signed int result; // eax@2 unsigned int v2; // edx@3 unsigned int v3; // edi@3 - //signed int v4; // ebx@3 int v5; // esi@4 if (val < 1) @@ -216,7 +219,6 @@ v2 = 0; v3 = val; result = 0; - //v4 = 16; for (uint i = 0; i < 16; ++i) { result *= 2; @@ -228,9 +230,7 @@ ++result; v2 -= v5; } - //--v4; } - //while ( v4 ); if ( val - result * result >= (unsigned int)(result - 1) ) ++result; return result; diff -r e07e297f292d -r 56f87a5c402b Spells.cpp --- a/Spells.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/Spells.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -399,7 +399,7 @@ v11 = pParty->vPosition.y - fromy; v12 = (pParty->vPosition.z + pParty->sEyelevel) - fromz; } - v13 = sqrt(v10 * v10 + v11 * v11 + v12 * v12); + v13 = sqrt(long double(v10 * v10 + v11 * v11 + v12 * v12)); if ( v13 <= 1.0 ) { v55 = 1; @@ -411,7 +411,7 @@ v55 = (int)v13; ySquared = v11 * v11; xSquared = v10 * v10; - v14 = (int)sqrt(xSquared + ySquared); + v14 = (int)sqrt(long double(xSquared + ySquared)); yaw = stru_5C6E00->Atan2((int)v10, (int)v11); pitch = stru_5C6E00->Atan2(v14, (int)v12); } diff -r e07e297f292d -r 56f87a5c402b Texture.cpp --- a/Texture.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/Texture.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -283,22 +283,22 @@ //----- (0044E0ED) -------------------------------------------------------- void TextureFrameTable::LoadAnimationSequenceAndPalettes( signed int uIconID ) - { - TextureFrameTable *v3; // ebx@1 +{ + //TextureFrameTable *v3; // ebx@1 unsigned int i; // edi@3 - v3 = this; + //v3 = this; if ( (uIconID <= this->sNumTextures) && uIconID >= 0 ) { for ( i = uIconID; ; ++i ) { - v3->pTextures[i].uTextureID = pBitmaps_LOD->LoadTexture(v3->pTextures[i].pTextureName, TEXTURE_DEFAULT); + this->pTextures[i].uTextureID = pBitmaps_LOD->LoadTexture(this->pTextures[i].pTextureName, TEXTURE_DEFAULT); - if (v3->pTextures[i].uTextureID != -1) - pBitmaps_LOD->pTextures[v3->pTextures[i].uTextureID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v3->pTextures[i].uTextureID].palette_id1); + if (this->pTextures[i].uTextureID != -1) + pBitmaps_LOD->pTextures[this->pTextures[i].uTextureID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[this->pTextures[i].uTextureID].palette_id1); //result = (unsigned int)v3->pTextures; //if ( !(*(char *)(result + i * 20 + 18) & 1) ) - if( v3->pTextures[i].uFlags & 1) + if( this->pTextures[i].uFlags & 1) break; } } diff -r e07e297f292d -r 56f87a5c402b UI/UIArena.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UI/UIArena.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -0,0 +1,310 @@ +#define _CRT_SECURE_NO_WARNINGS + +#include "mm7_data.h" +#include "Sprites.h" + +#include "GUIWindow.h" +#include "GUIFont.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "LOD.h" +#include "Actor.h" +#include "Events.h" +#include "Viewport.h" +#include "texts.h" +#include "MM7.h" + +std::array pMonsterArenaPlacements = + {{ + Vec2_int_(1524, 8332), + Vec2_int_(2186, 8844), + Vec2_int_(3219, 9339), + Vec2_int_(4500, 9339), + Vec2_int_(5323, 9004), + Vec2_int_(0x177D, 0x2098), + Vec2_int_(0x50B, 0x1E15), + Vec2_int_(0x18FF, 0x1E15), + Vec2_int_(0x50B, 0xD69), + Vec2_int_(0x18FF, 0x1B15), + Vec2_int_(0x50B, 0x1021), + Vec2_int_(0x18FF, 0x1848), + Vec2_int_(0x50B, 0x12D7), + Vec2_int_(0x18FF, 0x15A3), + Vec2_int_(0x50B, 0x14DB), + Vec2_int_(0x18FF, 0x12D7), + Vec2_int_(0x50B, 0x1848), + Vec2_int_(0x18FF, 0x1021), + Vec2_int_(0x50B, 0x1B15), + Vec2_int_(0x18FF, 0xD69), + }} +; + +//----- (004BBCDD) -------------------------------------------------------- +void Arena_SelectionFightLevel() +{ + signed int v0; // ebp@3 + GUIButton *v5; // eax@18 + GUIButton *v6; // esi@19 + + if ( pParty->field_7B5_in_arena_quest ) + { + if ( pParty->field_7B5_in_arena_quest == -1 ) + { + uDialogueType = DIALOGUE_ARENA_ALREADY_WON; + } + else + { + v0 = 0; + for (size_t i = 0; i < uNumActors; i++ ) + { + if ( pActors[i].uAIState == Dead + || pActors[i].uAIState == Removed + || pActors[i].uAIState == Disabled + || pActors[i].uSummonerID != 0 && PID_TYPE(pActors[i].uSummonerID) == OBJECT_Player) + ++v0; + } + if ( v0 >= (signed int)uNumActors || (signed int)uNumActors <= 0) + { + uDialogueType = DIALOGUE_ARENA_REWARD; + ++*((char *)&pParty->monster_for_hunting_killed[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1);//Ritor1:I dont know + for ( uint i= 0; i < 4; i++ ) + pParty->pPlayers[i].SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3); + pParty->PartyFindsGold(gold_transaction_amount, 0); + pAudioPlayer->PlaySound(SOUND_Arena_Welcome, 0, 0, -1, 0, 0, 0, 0); + pParty->field_7B5_in_arena_quest = -1; + } + else + { + uDialogueType = DIALOGUE_ARENA_WELCOME; + pParty->vPosition.x = 3849; + pParty->vPosition.y = 5770; + pParty->vPosition.z = 1; + pParty->uFallStartY = 1; + pParty->sRotationY = 512; + pParty->sRotationX = 0; + pParty->uFallSpeed = 0; + pAudioPlayer->PlaySound(SOUND_Arena_Welcome, 0, 0, -1, 0, 0, 0, 0); + } + } + } + else + { + uDialogueType = DIALOGUE_ARENA_WELCOME; + v5 = pDialogueWindow->pControlsHead; + if ( v5 ) + { + do + { + v6 = v5->pNext; + free(v5); + v5 = v6; + } + while ( v6 ); + } + pDialogueWindow->pControlsHead = 0; + pDialogueWindow->pControlsTail = 0; + pDialogueWindow->uNumControls = 0; + pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, + pGlobalTXT_LocalizationStrings[79], //Close, Закрыть + pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 85, 0, "", 0); + pDialogueWindow->CreateButton(480, 190, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 86, 0, "", 0); + pDialogueWindow->CreateButton(480, 220, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 87, 0, "", 0); + pDialogueWindow->CreateButton(480, 250, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 88, 0, "", 0); + pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); + } +} + + +//----- (004BC109) -------------------------------------------------------- +void ArenaFight() +{ + int v0; // edi@1 + char *v1; // eax@7 + int v3; // eax@10 + signed int v4; // esi@10 + signed int v6; // ebx@34 + signed int v13; // eax@49 + int v14; // esi@49 + int v15; // edx@50 + int v16; // eax@51 + signed int v17; // ecx@51 + int v18; // edx@53 + int i; // edi@55 + signed int v22; // [sp-4h] [bp-144h]@51 + __int16 v23[100]; // [sp+Ch] [bp-134h]@39 + GUIWindow window; // [sp+D4h] [bp-6Ch]@1 + __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56 + int v26; // [sp+134h] [bp-Ch]@1 + int num_monsters; // [sp+13Ch] [bp-4h]@17 + + v26 = 0; + pParty->field_7B5_in_arena_quest = uDialogueType; + memcpy(&window, pDialogueWindow, sizeof(window)); + window.uFrameWidth = game_viewport_width; + window.uFrameZ = 452; + v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7;// Пожалуйста, подождите пока я вызываю существ. Удачи. + pRenderer->BeginSceneD3D(); + + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) + pIndoor->Draw(); + else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) + pOutdoor->Draw(); + + pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); + pRenderer->BeginScene(); + //if ( pRenderer->pRenderD3D ) + pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, + pViewport->uViewportBR_X - pViewport->uViewportTL_X, + pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, + 0x7FF); + + Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather); + pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0); + + pRenderer->DrawTextureIndexed(8, 347 - v0, pTexture_591428); + v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);//Пожалуйста, подождите пока я вызываю существ. Удачи. + pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0); + pRenderer->EndScene(); + pRenderer->Present(); + pParty->vPosition.x = 3849; + pParty->vPosition.y = 5770; + pParty->vPosition.z = 1; + pParty->uFallStartY = 1; + pParty->sRotationY = 512; + pParty->sRotationX = 0; + pParty->uFallSpeed = 0; + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); + //v2 = pParty->pPlayers.data(); + for ( uint i = 0; i < 4; i++ ) + { + v3 = pParty->pPlayers[i].GetActualLevel(); + v4 = v26; + if ( v3 > v26 ) + { + v26 = pParty->pPlayers[i].GetActualLevel(); + v4 = pParty->pPlayers[i].GetActualLevel(); + } + //++v2; + } + //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); + if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE ) + { + num_monsters = v4; + v4 /= 2; + } + else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE ) + { + //v5 = (signed __int64)((double)v26 * 1.5); + num_monsters = (int)((double)v26 * 1.5); + v4 /= 2; + } + else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT ) + { + //LODWORD(v5) = 2 * v4; + num_monsters = 2 * v4; + v4 /= 2; + } + else if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION ) + { + num_monsters = 2 * v4; + v4 /= 2; + } + if ( v4 < 1 ) + v4 = 1; + if ( v4 > 100 ) + v4 = 100; + if ( num_monsters > 100 ) + num_monsters = 100; + if ( v4 < 2 ) + v4 = 2; + if ( num_monsters < 2 ) + num_monsters = 2; + v6 = 0; + //v27 = 1; + //v7 = (char *)&pMonsterStats->pInfos[1].uLevel; + for ( uint i = 1; i <= 258; i++ ) + { + if ( pMonsterStats->pInfos[i].uAIType != 1 )//if ( v7[8] != 1 ) + { + if ( !MonsterStats::BelongsToSupertype(pMonsterStats->pInfos[i].uID, MONSTER_SUPERTYPE_8) ) //!MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) + { + //v8 = (unsigned __int8)pMonsterStats->pInfos[i].uLevel; + if ( pMonsterStats->pInfos[i].uLevel >= v4 ) + { + if ( pMonsterStats->pInfos[i].uLevel <= num_monsters ) + v23[v6++] = i; + } + } + } + // ++v27; + //v7 += 88; + } + //while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel ); + num_monsters = 6; + if ( v6 < 6 ) + num_monsters = v6; + //v9 = 0; + if ( num_monsters > 0 ) + { + for ( uint i = 0; i < num_monsters; i++ ) + { + //v10 = rand(); + //++v9; + //v12 = __OFSUB__(v9, num_monsters); + //v11 = v9 - num_monsters < 0; + //*((short *)&window.pControlsTail + v9 + 1) = v23[rand() % v6]; + monster_ids[i] = v23[rand() % v6]; + } + //while ( v11 ^ v12 ); + } + if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE ) + { + v16 = rand(); + v17 = 3; + v22 = 50; + v18 = v16 % v17; + v13 = v22; + v14 = v18 + 6; + } + else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE ) + { + v16 = rand(); + v17 = 7; + v22 = 100; + v18 = v16 % v17; + v13 = v22; + v14 = v18 + 6; + } + else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT ) + { + v15 = rand() % 11; + v13 = 200; + v14 = v15 + 10; + } + else + { + if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION ) + { + v13 = 500; + v14 = 20; + } + //else + //{ + //v14 = v27; + //v13 = gold_transaction_amount; + //} + } + gold_transaction_amount = v26 * v13; + for ( i = 0; i < v14; ++i ) + Actor::Arena_summon_actor(monster_ids[rand() % num_monsters], pMonsterArenaPlacements[i].x, pMonsterArenaPlacements[i].y, 1); + pAudioPlayer->PlaySound(SOUND_Arena_Welcome, 0, 0, -1, 0, 0, 0, 0); +} \ No newline at end of file diff -r e07e297f292d -r 56f87a5c402b UI/UIArena.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UI/UIArena.h Sat Jun 21 00:42:34 2014 +0200 @@ -0,0 +1,9 @@ +#pragma once +#include "VectorTypes.h" +#include + + +extern std::array pMonsterArenaPlacements; + +void Arena_SelectionFightLevel(); +void ArenaFight(); \ No newline at end of file diff -r e07e297f292d -r 56f87a5c402b UI/UICharacter.cpp --- a/UI/UICharacter.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/UI/UICharacter.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -2235,7 +2235,7 @@ if (full_num_items_in_book>0) { for (int i = 0; i< full_num_items_in_book; ++i) - achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16); + achieved_awards[full_num_items_in_book+i] = (AwardType)(rand()%16);//случайные значения от 0 до 15 for (int i = 1; i< full_num_items_in_book; ++i) { for (int j = i; j< full_num_items_in_book; ++j) diff -r e07e297f292d -r 56f87a5c402b UI/UIHouses.cpp --- a/UI/UIHouses.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/UI/UIHouses.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -30,6 +30,8 @@ #include "..\Game.h" #include "..\CastSpellInfo.h" +#include "../Level/Decoration.h" + #include "..\stru159.h" int uHouse_ExitPic; // weak @@ -3299,4 +3301,89 @@ } while ((decode_step<24)&&!break_loop); } -} \ No newline at end of file +} + +//----- (004BD8B5) -------------------------------------------------------- +int HouseDialogPressCloseBtn() +{ + if ( pMessageQueue_50CBD0->uNumMessages ) + pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); + pKeyActionMap->ResetKeys(); + activeLevelDecoration = nullptr; + current_npc_text = 0; + if ( pDialogueNPCCount == 0) + return 0; + + if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture ) + { + ShopTexture->Release(); + ShopTexture = 0; + } + + switch(dialog_menu_id) + { + case -1: + _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1)); + pVideoPlayer->_4BF5B2(); + break; + + case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: + case HOUSE_DIALOGUE_LEARN_SKILLS: + case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN: + pVideoPlayer->_4BF5B2(); + UI_CreateEndConversationButton(); + dialog_menu_id = HOUSE_DIALOGUE_MAIN; + InitializaDialogueOptions(in_current_building_type); + break; + + case HOUSE_DIALOGUE_SHOP_SELL: + case HOUSE_DIALOGUE_SHOP_IDENTIFY: + case HOUSE_DIALOGUE_SHOP_REPAIR: + UI_CreateEndConversationButton(); + dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT; + InitializaDialogueOptions_Shops(in_current_building_type); + break; + + case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES: + case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS: + case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT: + pVideoPlayer->_4BF5B2(); + UI_CreateEndConversationButton(); + dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN; + InitializaDialogueOptions_Tavern(in_current_building_type); + break; + + case HOUSE_DIALOGUE_NULL: + case HOUSE_DIALOGUE_MAIN: + pDialogueNPCCount = 0; + pDialogueWindow->Release(); + dialog_menu_id = HOUSE_DIALOGUE_NULL; + pDialogueWindow = 0; + pIcons_LOD->SyncLoadedFilesCount(); + + if ( uNumDialogueNPCPortraits == 1 ) + return 0; + + pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; + if ( uNumDialogueNPCPortraits > 0 ) + { + for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i ) + { + HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i], + pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i], + 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0); + } + } + + pVideoPlayer->_4BF5B2(); + break; + + default: + pVideoPlayer->_4BF5B2(); + dialog_menu_id = HOUSE_DIALOGUE_MAIN; + InitializaDialogueOptions(in_current_building_type); + break; + } + return 1; +} diff -r e07e297f292d -r 56f87a5c402b UI/UIPopup.cpp --- a/UI/UIPopup.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/UI/UIPopup.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -2032,4 +2032,6 @@ return Color16(255, 255, 155); if ( a1 < 100 ) return Color16(192, 192, 240); + else + __debugbreak(); } \ No newline at end of file diff -r e07e297f292d -r 56f87a5c402b Vis.cpp --- a/Vis.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/Vis.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -399,13 +399,7 @@ //----- (004C1944) -------------------------------------------------------- int Vis::PickClosestActor(int object_id, unsigned int pick_depth, int a4, int a5, int a6) { - //float v6; // ST00_4@3 - //int result; // eax@4 Vis_SelectionFilter v8; // [sp+18h] [bp-20h]@3 - //__int64 v9; // [sp+2Ch] [bp-Ch]@3 - //Vis *v14; // [sp+34h] [bp-4h]@1 - - //v14 = this; static Vis_SelectionList Vis_static_sub_4C1944_stru_F8BDE8; @@ -417,10 +411,7 @@ Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers = 0; PickBillboards_Keyboard(pick_depth, &Vis_static_sub_4C1944_stru_F8BDE8, &v8); Vis_static_sub_4C1944_stru_F8BDE8.create_object_pointers(Vis_SelectionList::Unique); - sort_object_pointers( - Vis_static_sub_4C1944_stru_F8BDE8.object_pointers, - 0, - Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers - 1); + sort_object_pointers(Vis_static_sub_4C1944_stru_F8BDE8.object_pointers, 0, Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers - 1); if (!Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers) return -1; @@ -1278,12 +1269,12 @@ { //stru157 *v3; // esi@1 //int result; // eax@1 - int v5; // edx@2 + //int v5; // edx@2 //int v6; // ecx@2 //char v7; // zf@3 - int v8; // esi@5 + //int v8; // esi@5 // std::string *v9; // ecx@7 - Actor *v10; // edi@18 + //Actor *v10; // edi@18 //const char *v12; // [sp-20h] [bp-2Ch]@7 // int v13; // [sp-1Ch] [bp-28h]@7 //std::string v14; // [sp-18h] [bp-24h]@7 @@ -1297,21 +1288,21 @@ case VisObjectType_Sprite: { - v5 = filter->select_flags; + //v5 = filter->select_flags; int object_idx = PID_ID(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].sParentBillboardID].object_pid); int object_type = PID_TYPE(pBillboardRenderList[pRenderer->pBillboardRenderListD3D[(int)uD3DBillboardIdx_or_pBLVFace_or_pODMFace].sParentBillboardID].object_pid); - if ( v5 & 2 ) + if ( filter->select_flags & 2 ) { if (object_type == filter->object_id) return false; return true; } - if ( v5 & 4 ) + if ( filter->select_flags & 4 ) { - v8 = filter->object_id; + //v8 = filter->object_id; if ( object_type != filter->object_id) return true; - if (v8 != OBJECT_Decoration) + if (filter->object_id != OBJECT_Decoration) { MessageBoxA(nullptr, "Unsupported \"exclusion if no event\" type in CVis::is_part_of_selection", "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Vis.cpp:207", 0); return true; @@ -1328,16 +1319,16 @@ return true; } - v10 = &pActors[object_idx]; - int result = 1 << LOBYTE(v10->uAIState); + //v10 = &pActors[object_idx]; + int result = 1 << LOBYTE(pActors[object_idx].uAIState); if ( result & filter->no_at_ai_state || !(result & filter->at_ai_state) - || v5 & 8 && (result = MonsterStats::BelongsToSupertype(v10->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) == 0 ) + || filter->select_flags & 8 && (result = MonsterStats::BelongsToSupertype(pActors[object_idx].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) == 0 ) return false; if ( !(filter->select_flags & 1) ) return true; - result = v10->GetActorsRelation(nullptr); + result = pActors[object_idx].GetActorsRelation(nullptr); if (result == 0) return false; return true; diff -r e07e297f292d -r 56f87a5c402b mm7_2.cpp --- a/mm7_2.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/mm7_2.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -72,155 +72,6 @@ bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); -//----- (004BB756) -------------------------------------------------------- -int UseNPCSkill(NPCProf profession) -{ - switch (profession) - { - case Healer: - { - for (int i = 0; i < 4; ++i) - pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); - } - break; - - case ExpertHealer: - { - for (int i = 0; i < 4; ++i) - { - Player* player = &pParty->pPlayers[i]; - player->sHealth = player->GetMaxHealth(); - - for (int j = 0; j < 14; ++j) - player->pConditions[i] = 0; - player->pConditions[18] = 0; - } - } - break; - - case MasterHealer: - { - for (int i = 0; i < 4; ++i) - { - Player* player = &pParty->pPlayers[i]; - player->sHealth = player->GetMaxHealth(); - - int v5 = LODWORD(player->pConditions[19]);//*((int *)v4 - 32); - int v6 = HIDWORD(player->pConditions[19]);//*((int *)v4 - 31); - memset(player->pConditions.data(), 0, 0xA0u); - - __debugbreak(); - *(int *)&player->pActiveSkills[PLAYER_SKILL_SHIELD] = v5; - *(int *)&player->pActiveSkills[PLAYER_SKILL_CHAIN] = v6; - } - } - break; - - case Cook://Повар - { - if (pParty->uNumFoodRations >= 13) - return 1; - - Party::GiveFood(1); - } - break; - - case Chef: - { - if (pParty->uNumFoodRations >= 13) - return 1; - - if (pParty->uNumFoodRations == 13) - Party::GiveFood(1); - else - Party::GiveFood(2); - } - break; - - case WindMaster: - { - if (uCurrentlyLoadedLevelType == LEVEL_Indoor) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); - pAudioPlayer->PlaySound(SOUND_203, 0, 0, -1, 0, 0, 0, 0); - } - else - { - int v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); - pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + 60 * (256 * 2), 3, 1, v19, 0); - pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags |= 1u; - pAudioPlayer->PlaySound(SOUND_11090, 0, 0, -1, 0, 0, 0, 0); - } - } - break; - - case WaterMaster: - { - int v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); - pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + 60 * (256 * (2 + 1)), 3, 0, v20, 0); - pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags |= 1u; - pAudioPlayer->PlaySound(SOUND_12040, 0, 0, -1, 0, 0, 0, 0); - } - break; - - case GateMaster: - { - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); - dword_50C9DC = 195; - ptr_50C9E0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); - } - break; - - case Acolyte: _42777D_CastSpell_UseWand_ShootArrow(46, 0, 133, 0, 0); break; - case Piper: _42777D_CastSpell_UseWand_ShootArrow(51, 0, 133, 0, 0); break; - case FallenWizard: _42777D_CastSpell_UseWand_ShootArrow(86, 0, 133, 0, 0); break; - - case Teacher: - case Instructor: - case Armsmaster: - case Weaponsmaster: - case Apprentice: - case Mystic: - case Spellmaster: - case Trader: - case Merchant: - case Scout: - case Herbalist: - case Apothecary: - case Tinker: - case Locksmith: - case Fool: - case ChimneySweep: - case Porter: - case QuarterMaster: - case Factor: - case Banker: - case Horseman: - case Bard: - case Enchanter: - case Cartographer: - case Explorer: - case Pirate: - case Squire: - case Psychic: - case Gypsy: - case Diplomat: - case Duper: - case Burglar: - case Acolyte2: - case Initiate: - case Prelate: - case Monk: - case Sage: - case Hunter: - break; - - default: - assert(false && "Invalid enum value"); - } - return 0; -} - //----- (004BBA85) -------------------------------------------------------- void CheckBountyRespawnAndAward() { @@ -277,400 +128,17 @@ } } -//----- (004BBCDD) -------------------------------------------------------- -void Arena_SelectionFightLevel() -{ - signed int v0; // ebp@3 - Actor *v1; // eax@4 - __int16 v2; // cx@5 - int v3; // esi@8 - Player *v4; // esi@14 - GUIButton *v5; // eax@18 - GUIButton *v6; // esi@19 - size_t v7; // [sp+10h] [bp-4h]@4 - - if ( pParty->field_7B5_in_arena_quest ) - { - if ( pParty->field_7B5_in_arena_quest == -1 ) - { - uDialogueType = 92; - } - else - { - v0 = 0; - if ( (signed int)uNumActors > 0 ) - { - v1 = pActors.data();//[0].uAIState; - v7 = uNumActors; - do - { - v2 = v1->uAIState; - if ( v1->uAIState == Dead || v2 == Removed || v2 == Disabled || (v3 = v1->uSummonerID) != 0 && PID_TYPE(v3) == OBJECT_Player) - ++v0; - ++v1; - --v7; - } - while ( v7 ); - } - if ( v0 >= (signed int)uNumActors || (signed int)uNumActors <= 0) - { - uDialogueType = 91; - v4 = pParty->pPlayers.data(); - ++*((char *)&pParty->monster_for_hunting_killed[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1); - do - { - v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3); - ++v4; - } - while ( (signed int)v4 < (signed int)pParty->pHirelings.data() ); - pParty->PartyFindsGold(gold_transaction_amount, 0); - pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); - pParty->field_7B5_in_arena_quest = -1; - } - else - { - uDialogueType = 90; - pParty->vPosition.x = 3849; - pParty->vPosition.y = 5770; - pParty->vPosition.z = 1; - pParty->uFallStartY = 1; - pParty->sRotationY = 512; - pParty->sRotationX = 0; - pParty->uFallSpeed = 0; - pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); - } - } - } - else - { - uDialogueType = 89; - v5 = pDialogueWindow->pControlsHead; - if ( v5 ) - { - do - { - v6 = v5->pNext; - free(v5); - v5 = v6; - } - while ( v6 ); - } - pDialogueWindow->pControlsHead = 0; - pDialogueWindow->pControlsTail = 0; - pDialogueWindow->uNumControls = 0; - pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], - pIcons_LOD->GetTexture(uExitCancelTextureId), 0); - pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x55u, 0, "", 0); - pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x56u, 0, "", 0); - pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x57u, 0, "", 0); - pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x58u, 0, "", 0); - pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); - } -} - -//----- (004BC109) -------------------------------------------------------- -void ArenaFight() -{ - int v0; // edi@1 - char *v1; // eax@7 -// Player *v2; // edi@9 - int v3; // eax@10 - signed int v4; // esi@10 - //signed __int64 v5; // qax@18 - signed int v6; // ebx@34 - //char *v7; // edi@34 -// int v8; // eax@37 - //int v9; // esi@43 - //int v10; // eax@44 -// unsigned __int8 v11; // sf@44 -// unsigned __int8 v12; // of@44 - signed int v13; // eax@49 - int v14; // esi@49 - int v15; // edx@50 - int v16; // eax@51 - signed int v17; // ecx@51 - int v18; // edx@53 - int i; // edi@55 -// int monster_y; // ST18_4@56 -// int v21; // eax@56 - signed int v22; // [sp-4h] [bp-144h]@51 - __int16 v23[100]; // [sp+Ch] [bp-134h]@39 - GUIWindow window; // [sp+D4h] [bp-6Ch]@1 - __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56 - int v26; // [sp+134h] [bp-Ch]@1 - //int v27; // [sp+138h] [bp-8h]@23 - int num_monsters; // [sp+13Ch] [bp-4h]@17 - - v26 = 0; - pParty->field_7B5_in_arena_quest = uDialogueType; - memcpy(&window, pDialogueWindow, sizeof(window)); - window.uFrameWidth = game_viewport_width; - window.uFrameZ = 452; - v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7; - pRenderer->BeginSceneD3D(); - - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) - pIndoor->Draw(); - else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) - pOutdoor->Draw(); - - pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); - pRenderer->BeginScene(); - //if ( pRenderer->pRenderD3D ) - pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, - pViewport->uViewportBR_X - pViewport->uViewportTL_X, - pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, - 0x7FF); - - Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather); - pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0); - - pRenderer->DrawTextureIndexed(8, 347 - v0, pTexture_591428); - v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);//Пожалуйста, подождите пока я вызываю существ. Удачи. - pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0); - pRenderer->EndScene(); - pRenderer->Present(); - pParty->vPosition.x = 3849; - pParty->vPosition.y = 5770; - pParty->vPosition.z = 1; - pParty->uFallStartY = 1; - pParty->sRotationY = 512; - pParty->sRotationX = 0; - pParty->uFallSpeed = 0; - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); - //v2 = pParty->pPlayers.data(); - for ( uint i = 0; i < 4; i++ ) - { - v3 = pParty->pPlayers[i].GetActualLevel(); - v4 = v26; - if ( v3 > v26 ) - { - v26 = pParty->pPlayers[i].GetActualLevel(); - v4 = pParty->pPlayers[i].GetActualLevel(); - } - //++v2; - } - //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); - if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE ) - { - num_monsters = v4; - v4 /= 2; - } - else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE ) - { - //v5 = (signed __int64)((double)v26 * 1.5); - num_monsters = (int)((double)v26 * 1.5); - v4 /= 2; - } - else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT ) - { - //LODWORD(v5) = 2 * v4; - num_monsters = 2 * v4; - v4 /= 2; - } - else if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION ) - { - num_monsters = 2 * v4; - v4 /= 2; - } - if ( v4 < 1 ) - v4 = 1; - if ( v4 > 100 ) - v4 = 100; - if ( num_monsters > 100 ) - num_monsters = 100; - if ( v4 < 2 ) - v4 = 2; - if ( num_monsters < 2 ) - num_monsters = 2; - v6 = 0; - //v27 = 1; - //v7 = (char *)&pMonsterStats->pInfos[1].uLevel; - for ( uint i = 1; i <= 258; i++ ) - { - if ( pMonsterStats->pInfos[i].uAIType != 1 )//if ( v7[8] != 1 ) - { - if ( !MonsterStats::BelongsToSupertype(pMonsterStats->pInfos[i].uID, MONSTER_SUPERTYPE_8) ) //!MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) - { - //v8 = (unsigned __int8)pMonsterStats->pInfos[i].uLevel; - if ( pMonsterStats->pInfos[i].uLevel >= v4 ) - { - if ( pMonsterStats->pInfos[i].uLevel <= num_monsters ) - v23[v6++] = i; - } - } - } - // ++v27; - //v7 += 88; - } - //while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel ); - num_monsters = 6; - if ( v6 < 6 ) - num_monsters = v6; - //v9 = 0; - if ( num_monsters > 0 ) - { - for ( uint i = 0; i < num_monsters; i++ ) - { - //v10 = rand(); - //++v9; - //v12 = __OFSUB__(v9, num_monsters); - //v11 = v9 - num_monsters < 0; - //*((short *)&window.pControlsTail + v9 + 1) = v23[rand() % v6]; - monster_ids[i] = v23[rand() % v6]; - } - //while ( v11 ^ v12 ); - } - if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE ) - { - v16 = rand(); - v17 = 3; - v22 = 50; - v18 = v16 % v17; - v13 = v22; - v14 = v18 + 6; - } - else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE ) - { - v16 = rand(); - v17 = 7; - v22 = 100; - v18 = v16 % v17; - v13 = v22; - v14 = v18 + 6; - } - else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT ) - { - v15 = rand() % 11; - v13 = 200; - v14 = v15 + 10; - } - else - { - if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION ) - { - v13 = 500; - v14 = 20; - } - //else - //{ - //v14 = v27; - //v13 = gold_transaction_amount; - //} - } - gold_transaction_amount = v26 * v13; - for ( i = 0; i < v14; ++i ) - Actor::Arena_summon_actor(monster_ids[rand() % num_monsters], pMonsterArenaPlacements[i].x, pMonsterArenaPlacements[i].y, 1); - pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); -} - -//----- (004BD8B5) -------------------------------------------------------- -int HouseDialogPressCloseBtn() -{ - if ( pMessageQueue_50CBD0->uNumMessages ) - pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); - pKeyActionMap->ResetKeys(); - activeLevelDecoration = nullptr; - current_npc_text = 0; - if ( pDialogueNPCCount == 0) - return 0; - - if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture ) - { - ShopTexture->Release(); - ShopTexture = 0; - } - - switch(dialog_menu_id) - { - case -1: - _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1)); - pVideoPlayer->_4BF5B2(); - break; - - case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: - case HOUSE_DIALOGUE_LEARN_SKILLS: - case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN: - pVideoPlayer->_4BF5B2(); - UI_CreateEndConversationButton(); - dialog_menu_id = HOUSE_DIALOGUE_MAIN; - InitializaDialogueOptions(in_current_building_type); - break; - - case HOUSE_DIALOGUE_SHOP_SELL: - case HOUSE_DIALOGUE_SHOP_IDENTIFY: - case HOUSE_DIALOGUE_SHOP_REPAIR: - UI_CreateEndConversationButton(); - dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT; - InitializaDialogueOptions_Shops(in_current_building_type); - break; - - case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES: - case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS: - case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT: - pVideoPlayer->_4BF5B2(); - UI_CreateEndConversationButton(); - dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN; - InitializaDialogueOptions_Tavern(in_current_building_type); - break; - - case HOUSE_DIALOGUE_NULL: - case HOUSE_DIALOGUE_MAIN: - pDialogueNPCCount = 0; - pDialogueWindow->Release(); - dialog_menu_id = HOUSE_DIALOGUE_NULL; - pDialogueWindow = 0; - pIcons_LOD->SyncLoadedFilesCount(); - - if ( uNumDialogueNPCPortraits == 1 ) - return 0; - - pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; - if ( uNumDialogueNPCPortraits > 0 ) - { - for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i ) - { - HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i], - pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i], - 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0); - } - } - - pVideoPlayer->_4BF5B2(); - break; - - default: - pVideoPlayer->_4BF5B2(); - dialog_menu_id = HOUSE_DIALOGUE_MAIN; - InitializaDialogueOptions(in_current_building_type); - break; - } - return 1; -} - //----- (004BF91E) -------------------------------------------------------- unsigned int GameOverMenu(void *ecx0) { const char *v1; // eax@2 unsigned int result; // eax@3 -// Player *v3; // eax@7 -// const char *v4; // ST24_4@9 -// int v5; // eax@9 const char *v6; // eax@10 const char *v7; // edx@10 const char *v8; // ecx@12 const char *v9; // eax@14 unsigned int v10; // eax@25 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1 - //MSG Msg; // [sp+88h] [bp-48h]@22 unsigned int v14; // [sp+A4h] [bp-2Ch]@5 void *v15; // [sp+A8h] [bp-28h]@1 const char *pInString; // [sp+ACh] [bp-24h]@5 @@ -678,7 +146,6 @@ unsigned int v18; // [sp+B4h] [bp-1Ch]@5 unsigned int v19; // [sp+B8h] [bp-18h]@5 int v20; // [sp+BCh] [bp-14h]@7 -// Player *i; // [sp+C0h] [bp-10h]@7 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5 @@ -722,9 +189,9 @@ } pInString = v1; v23 = pParty->uTimePlayed - 138240; - v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18; - v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C / 0xC; - v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C % 0xC; + v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24; + v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C / 0xC; + v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C % 0xC; v17 = v19 % 0x1C; if ( !v19 ) v19 = 1; @@ -742,15 +209,19 @@ v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xC, 0); pWindow.DrawTitleText(pFont, 1, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1, v6, 0); strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]);//Total Time: + v7 = pGlobalTXT_LocalizationStrings[56]; if ( v17 != 1 ) v7 = pGlobalTXT_LocalizationStrings[57]; - v8 = pGlobalTXT_LocalizationStrings[146]; + + v8 = pGlobalTXT_LocalizationStrings[146];//Month, Месяц if ( v18 != 1 ) - v8 = pGlobalTXT_LocalizationStrings[148]; + v8 = pGlobalTXT_LocalizationStrings[148];//Months,Месяцев + v9 = pGlobalTXT_LocalizationStrings[245]; if ( v14 != 1 ) v9 = pGlobalTXT_LocalizationStrings[132]; + sprintf(pTmpBuf2.data(), " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7); strcat(pTmpBuf.data(), pTmpBuf2.data()); pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf.data(), 3u); @@ -830,9 +301,6 @@ return result; } - - - //----- (00451007) -------------------------------------------------------- int stru350::sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch, //changing this to some library function might be a good idea unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch, @@ -1225,8 +693,6 @@ + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00)); } - - //----- (004547E4) -------------------------------------------------------- void FactionTable::Initialize() { @@ -1276,8 +742,6 @@ pHostileTXT_Raw = nullptr; } - - //----- (004610AA) -------------------------------------------------------- void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2) { @@ -1295,23 +759,12 @@ //----- (00461103) -------------------------------------------------------- void _461103_load_level_sub() { - //GUIProgressBar *v0; // ebx@1 - //signed int v1; // ebp@1 - //char *v2; // esi@2 - //__int16 v3; // cx@3 int v4; // edx@8 - //size_t v5; // edi@14 signed int v6; // esi@14 - //char *v7; // edx@15 signed int v8; // ecx@16 -// int v9; // ecx@23 -// MonsterInfo *v10; // ebx@23 - //int *v11; // esi@23 int v12; // esi@25 int v13; // eax@26 __int16 v14; // ax@41 - //signed int v15; // [sp+10h] [bp-4Ch]@1 - //signed int v16; // [sp+10h] [bp-4Ch]@14 signed int v17; // [sp+14h] [bp-48h]@3 signed int v18; // [sp+14h] [bp-48h]@23 int v19; // [sp+18h] [bp-44h]@1 @@ -1590,7 +1043,6 @@ pIcons_LOD->RemoveTexturesPackFromTextureList(); } - //----- (00464479) -------------------------------------------------------- void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() { @@ -1688,7 +1140,6 @@ pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); } - //----- (00464866) -------------------------------------------------------- void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box) { @@ -1946,8 +1397,6 @@ } } - - //----- (004651F4) -------------------------------------------------------- bool MM7_Initialize(int game_width, int game_height) { diff -r e07e297f292d -r 56f87a5c402b mm7_3.cpp --- a/mm7_3.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/mm7_3.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -524,9 +524,7 @@ result = 0; } else - { result = 1; - } return result; } @@ -610,9 +608,7 @@ result = 0; } else - { result = 1; - } return result; } @@ -621,7 +617,7 @@ { int v3; // ebx@6 int v5; // eax@10 - int v6; // ecx@10 + //int v6; // ecx@10 signed int v8; // ebx@17 // unsigned __int8 v10; // sf@17 // unsigned __int16 v11; // ax@21 @@ -663,8 +659,10 @@ for (v75 = 0; v75 < uNumActors; ++v75) { - if ( pActors[v75].uAIState == Removed || pActors[v75].uAIState == Disabled || pActors[v75].uAIState == Summoned - || !pActors[v75].uMovementSpeed ) + if ( pActors[v75].uAIState == Removed + || pActors[v75].uAIState == Disabled + || pActors[v75].uAIState == Summoned + || !pActors[v75].uMovementSpeed ) continue; v3 = 0; v69 = 0; @@ -677,10 +675,10 @@ v70 = IsTerrainSlopeTooHigh(pActors[v75].vPosition.x, pActors[v75].vPosition.y); v5 = ODM_GetFloorLevel(pActors[v75].vPosition.x, pActors[v75].vPosition.y, pActors[v75].vPosition.z, pActors[v75].uActorHeight, &uIsOnWater, (int *)&v69, v3); - v6 = pActors[v75].vPosition.z; + //v6 = pActors[v75].vPosition.z; uIsAboveFloor = 0; v67 = v69 == 0; - if ( v6 > v5 + 1 ) + if ( pActors[v75].vPosition.z > v5 + 1 ) uIsAboveFloor = 1; if ( pActors[v75].uAIState == Dead && uIsOnWater && !uIsAboveFloor ) { @@ -967,18 +965,11 @@ //----- (0047253E) -------------------------------------------------------- void UpdateObjects() { -// unsigned int v0; // ebx@0 ObjectDesc *object; // eax@5 int v5; // ecx@6 -// __int16 v6; // cx@7 signed int v7; // eax@9 signed int v11; // eax@17 int v12; // edi@27 -// int v13; // eax@27 -// int v14; // ebx@27 -// unsigned int v15; // ecx@27 -// unsigned int v16; // edx@30 -// unsigned int v17; // edx@32 int v18; // [sp+4h] [bp-10h]@27 int v19; // [sp+8h] [bp-Ch]@27 @@ -2677,9 +2668,7 @@ v3 = v4->uRespawnIntervalDays; } else - { v4 = (MapInfo *)thisa; - } day_attrib &= ~DAY_ATTRIB_FOG; dword_6BE13C_uCurrentlyLoadedLocationID = v2; pOutdoor->Initialize( diff -r e07e297f292d -r 56f87a5c402b mm7_4.cpp --- a/mm7_4.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/mm7_4.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -29,6 +29,7 @@ #include "Lights.h" #include "Level/Decoration.h" #include "mm7_data.h" +#include "UI\UIArena.h" //----- (0046CC4B) -------------------------------------------------------- void check_event_triggers() @@ -142,8 +143,6 @@ array_77EC08[i].field_108 = 0; } - - //----- (00491E3A) -------------------------------------------------------- void sub_491E3A() { @@ -1282,23 +1281,23 @@ case 12: pReputation = npc->rep; if ( pReputation >= 25 ) - pText = pGlobalTXT_LocalizationStrings[379]; + pText = pGlobalTXT_LocalizationStrings[379];//Ненавистный else { if ( pReputation < 6 ) { if ( pReputation >= -5 ) - pText = pGlobalTXT_LocalizationStrings[399]; + pText = pGlobalTXT_LocalizationStrings[399];//Нейтральная else { if ( pReputation < -24 ) - pText = pGlobalTXT_LocalizationStrings[434]; + pText = pGlobalTXT_LocalizationStrings[434];//Почтенная else - pText = pGlobalTXT_LocalizationStrings[402]; + pText = pGlobalTXT_LocalizationStrings[402];//Дружелюбный } } else - pText = pGlobalTXT_LocalizationStrings[392]; + pText = pGlobalTXT_LocalizationStrings[392];//Недружелюбный } strcat(pTmpBuf2.data(), pText); dst = strlen(pTmpBuf2.data()); @@ -1501,10 +1500,6 @@ //----- (0049B04D) -------------------------------------------------------- void stru154::GetFacePlaneAndClassify(ODMFace *a2, BSPVertexBuffer *a3) { - //stru154 *v3; // edi@1 - //signed int v4; // eax@1 - //signed int result; // eax@9 - //signed int v6; // [sp-8h] [bp-18h]@8 Vec3_float_ v; // [sp+4h] [bp-Ch]@1 float v7; @@ -1660,18 +1655,12 @@ void OracleDialogue() { __int16 *v0; // edi@1 -// int v1; // ebx@3 -// Player *v2; // esi@3 -// int v3; // eax@4 signed int v4; // eax@9 int v5; // ebx@11 -// Player *v6; // esi@13 -// ItemGen *v7; // eax@14 signed int v8; // edi@14 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 signed int v10; // [sp+10h] [bp-8h]@13 int v11; // [sp+14h] [bp-4h]@1 -// Player *v12; // [sp+14h] [bp-4h]@11 contract_approved = 0; v11 = 0; @@ -1688,7 +1677,7 @@ for ( uint pl = 0; pl < 4; pl++ ) { //LOBYTE(v3) = pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)); - if ( pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)) ) + if ( pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0 + 1)) ) break; //++v2; //++v1; @@ -2055,7 +2044,7 @@ pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Dialogue, 1, 0); if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) { - pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); + pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее v1 = 1; } pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять diff -r e07e297f292d -r 56f87a5c402b mm7_data.cpp --- a/mm7_data.cpp Sat Jun 21 00:41:20 2014 +0200 +++ b/mm7_data.cpp Sat Jun 21 00:42:34 2014 +0200 @@ -707,30 +707,6 @@ std::array price_for_membership={100, 100, 50, 50, 50, 50, 50, 50, 50, 1000, 1000}; // weak -std::array pMonsterArenaPlacements = - {{ - Vec2_int_(1524, 8332), - Vec2_int_(2186, 8844), - Vec2_int_(3219, 9339), - Vec2_int_(4500, 9339), - Vec2_int_(5323, 9004), - Vec2_int_(0x177D, 0x2098), - Vec2_int_(0x50B, 0x1E15), - Vec2_int_(0x18FF, 0x1E15), - Vec2_int_(0x50B, 0xD69), - Vec2_int_(0x18FF, 0x1B15), - Vec2_int_(0x50B, 0x1021), - Vec2_int_(0x18FF, 0x1848), - Vec2_int_(0x50B, 0x12D7), - Vec2_int_(0x18FF, 0x15A3), - Vec2_int_(0x50B, 0x14DB), - Vec2_int_(0x18FF, 0x12D7), - Vec2_int_(0x50B, 0x1848), - Vec2_int_(0x18FF, 0x1021), - Vec2_int_(0x50B, 0x1B15), - Vec2_int_(0x18FF, 0xD69), - }} -; std::array<__int16, 32> word_4F0F30 ={{ 4, 7, 10, 11, 4, 7, 10, 11, 4, 7, 10, 11, diff -r e07e297f292d -r 56f87a5c402b mm7_data.h --- a/mm7_data.h Sat Jun 21 00:41:20 2014 +0200 +++ b/mm7_data.h Sat Jun 21 00:42:34 2014 +0200 @@ -373,7 +373,6 @@ extern std::array<__int16, 54> _4F0882_evt_VAR_PlayerItemInHands_vals; extern std::array pMaxLevelPerTrainingHallType; extern std::array price_for_membership; // weak -extern std::array pMonsterArenaPlacements; extern std::array<__int16, 32> word_4F0F30; // weak extern std::array ai_array_4F5E68; extern std::array ai_array_4F6638_actor_ids; diff -r e07e297f292d -r 56f87a5c402b mm7_unsorted_subs.h --- a/mm7_unsorted_subs.h Sat Jun 21 00:41:20 2014 +0200 +++ b/mm7_unsorted_subs.h Sat Jun 21 00:42:34 2014 +0200 @@ -57,8 +57,6 @@ void __fastcall DrawTextAtStatusBar(const char *Str, int a5); __int64 GetExperienceRequiredForLevel(int a1); void CheckBountyRespawnAndAward(); -void Arena_SelectionFightLevel(); -void ArenaFight(); int HouseDialogPressCloseBtn(); bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused); void ODM_LoadAndInitialize(const char *pLevelFilename, struct ODMRenderParams *thisa);