Mercurial > mm7
changeset 331:72de4ad353c6
Слияние
author | Ritor1 |
---|---|
date | Tue, 19 Feb 2013 22:37:58 +0600 |
parents | 2503214e5258 (current diff) f16ac5e65438 (diff) |
children | e8fcde8ba3fc |
files | Player.cpp |
diffstat | 27 files changed, 1661 insertions(+), 1513 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Actor.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -200,7 +200,7 @@ pDialogueNPCPortraits[0] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)]; dword_591084 = areWeLoadingTexture; uTextureID_507B04 = uTextureID_right_panel; - if ( !v5->Hired() && v5->house >= 0 ) + if ( !v5->Hired() && v5->Location2D >= 0 ) { if ( (signed int)pParty->GetPartyFame() <= v5->fame || (v10 = v5->uFlags & 0xFFFFFF7F, (v5->uFlags & 0xFFFFFF7F & 0x80000000u) != 0) ) @@ -297,16 +297,16 @@ } //----- (004089C7) -------------------------------------------------------- -bool Actor::IsAlive() +bool Actor::IsNotAlive() { signed int v1; // esi@1 - unsigned __int16 v2; // ax@3 + //unsigned __int16 v2; // ax@3 v1 = 0; - if ( (signed __int64)this->pActorBuffs[5].uExpireTime > 0 ) + if (pActorBuffs[5].uExpireTime) v1 = 1; - v2 = this->uAIState; - return (v1 | (v2 == Dying) | (v2 == Dead) | (v2 == Removed) | (v2 == Summoned) | (v2 == Disabled)) != 0; + //v2 = this->uAIState; + return (v1 | (uAIState == Dying) | (uAIState == Dead) | (uAIState == Removed) | (uAIState == Summoned) | (uAIState == Disabled)) != 0; } //----- (004086E9) -------------------------------------------------------- @@ -589,7 +589,7 @@ a1.uSectorID = pIndoor->GetSector(v13, v14, v15); v18 = 8 * LODWORD(v120); LOBYTE(v18) = 8 * LOBYTE(v120) | AI_OBJECT_ACTOR; - a1.field_58 = v18; + a1.field_58_pid = v18; a1.uSpriteFrameID = 0; a1.field_5C = 0; a1.field_60_distance_related_prolly_lod = 3; @@ -672,9 +672,9 @@ a1.uSectorID = v88; LODWORD(v119) = v89; v90 = 8 * LODWORD(v120); - LOBYTE(v90) = 8 * LOBYTE(v120) | 3; + LOBYTE(v90) = 8 * LOBYTE(v120) | OBJECT_Actor; a1.uSpriteFrameID = 0; - a1.field_58 = v90; + a1.field_58_pid = v90; a1.field_5C = 0; a1.field_60_distance_related_prolly_lod = 3; if ( (double)v89 >= 307.2 ) @@ -809,7 +809,7 @@ a1.uAttributes = 0; a1.uSectorID = 0; a1.uSpriteFrameID = 0; - a1.field_58 = v116; + a1.field_58_pid = v116; a1.field_5C = 0; a1.field_60_distance_related_prolly_lod = stru_50C198._427546(v30 + 2500); a1.uFacing = v32; @@ -1361,8 +1361,8 @@ a1.uAttributes = 0; a1.uSectorID = pIndoor->GetSector(v73, v74, v75); v78 = 8 * LODWORD(v120); - LOBYTE(v78) = 8 * LOBYTE(v120) | 3; - a1.field_58 = v78; + LOBYTE(v78) = 8 * LOBYTE(v120) | OBJECT_Actor; + a1.field_58_pid = v78; a1.uSpriteFrameID = 0; a1.field_5C = 0; a1.field_60_distance_related_prolly_lod = 3; @@ -1579,7 +1579,7 @@ v12 = 8 * v15; LOBYTE(v12) = 8 * v15 | AI_OBJECT_ACTOR; a1.uSpriteFrameID = 0; - a1.field_58 = v12; + a1.field_58_pid = v12; a1.field_5C = 0; if ( (double)v11 >= 307.2 ) { @@ -1683,9 +1683,9 @@ a1.uAttributes = 0; a1.uSectorID = pIndoor->GetSector(v5, a1.vPosition.y, v6); v7 = 8 * v10; - LOBYTE(v7) = 8 * v10 | 3; + LOBYTE(v7) = 8 * v10 | OBJECT_Actor; a1.uSpriteFrameID = 0; - a1.field_58 = v7; + a1.field_58_pid = v7; a1.field_5C = 0; a1.field_60_distance_related_prolly_lod = 3; a1.field_61 = 4; @@ -3868,7 +3868,7 @@ continue; } } - else if ( v7->IsAlive() == 1 ) + else if (v7->IsNotAlive()) { v24 = v4; v3->uLastCharacterIDToHit = v4;
--- a/Actor.h Tue Feb 19 22:37:39 2013 +0600 +++ b/Actor.h Tue Feb 19 22:37:58 2013 +0600 @@ -194,7 +194,7 @@ signed int GetActorsRelation(Actor *a2); void SetRandomGoldIfTheresNoItem(); bool CanAct(); - bool IsAlive(); + bool IsNotAlive(); void InitializeDialogue(int bPlayerSaysHello); char _438B9B();
--- a/AudioPlayer.h Tue Feb 19 22:37:39 2013 +0600 +++ b/AudioPlayer.h Tue Feb 19 22:37:58 2013 +0600 @@ -78,6 +78,14 @@ SOUND_8 = 0x8, SOUND_27 = 0x1B, SOUND_Button = 66, + SOUND_67 = 67, + SOUND_71 = 71, + SOUND_78 = 78, + SOUND_80 = 80, + SOUND_81 = 81, + SOUND_83 = 83, + SOUND_84 = 84, + SOUND_85 = 85, SOUND_Arcomage_LoseResources = 0x78, SOUND_Arcomage_AddResources = 0x79, SOUND_Arcomage_TowerWallDamage = 0x7A,
--- a/GUIWindow.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/GUIWindow.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -1843,7 +1843,7 @@ pWindow->CreateButton(480, 130, 140, v11, 1, 0, 0x88u, 0xDu, 0, "", 0); a4a = 1; } - v13 = (void *)v12->bDrawSomeAnim; + v13 = (void *)v12->evt_A; if ( v13 ) { if ( a4a < 4 ) @@ -1853,7 +1853,7 @@ pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x13u, 0, "", 0); } } - v15 = (void *)v12->_anim_current_time; + v15 = (void *)v12->evt_B; if ( v15 ) { if ( a4a < 4 ) @@ -1863,7 +1863,7 @@ pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x14u, 0, "", 0); } } - v17 = (void *)v12->_anim_end_time; + v17 = (void *)v12->evt_C; if ( v17 ) { if ( a4a < 4 ) @@ -1873,7 +1873,7 @@ pWindow->CreateButton( 0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x15u, 0, "", 0); } } - v19 = (void *)v12->evtd; + v19 = (void *)v12->evt_D; if ( v19 ) { if ( a4a < 4 ) @@ -1883,7 +1883,7 @@ pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x16u, 0, "", 0); } } - v21 = (void *)v12->evte; + v21 = (void *)v12->evt_E; if ( v21 ) { if ( a4a < 4 ) @@ -1893,7 +1893,7 @@ pWindow->CreateButton(0x1E0u, a4a++ * v11 + 130, 0x8Cu, v11, 1, 0, 0x88u, 0x17u, 0, "", 0); } } - v23 = (void *)v12->evtf; + v23 = (void *)v12->evt_F; if ( v23 ) { if ( a4a < 4 )
--- a/Game.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Game.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -154,7 +154,7 @@ pOtherOverlayList->bRedraw = 0; GameUI_DrawPartySpells(); - if (v4 || pParty->pHirelings[0]._anim_end_time || pParty->pHirelings[1]._anim_end_time ) + if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C ) DrawHiredNPCs(); GameUI_DrawPortraits(v4); GameUI_DrawLifeManaBars(); @@ -370,7 +370,7 @@ continue; } pAudioPlayer->StopChannels(-1, -1);// - memset(pParty->pHirelings, 0, 0x4Cu); + memset(&pParty->pHirelings[0], 0, 0x4Cu); memset(&pParty->pHirelings[1], 0, 0x4Cu); pNewNPCsCount = 0; if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
--- a/Indoor.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Indoor.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -4225,7 +4225,7 @@ { if ( (v36 & 7) == OBJECT_Decoration) { - _this = sub_452A9E(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); + _this = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); v45 = stru_5C6E00->Atan2( v0->vPosition.x - pLevelDecorations[v37].vPosition.x, v0->vPosition.y - pLevelDecorations[v37].vPosition.y);
--- a/Items.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Items.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -1518,8 +1518,9 @@ //----- (00456620) -------------------------------------------------------- void ItemsTable::GenerateItem(int treasure_level, int a3, ItemGen *out_item) { - //ItemGen *v4; // esi@1 - //ItemsTable *v5; // edi@1 + +ItemGen *v4; // esi@1 + ItemsTable *v5; // edi@1 int v6; // ebx@3 int *v7; // ecx@33 //int v8; // eax@34 @@ -1567,8 +1568,8 @@ int v50; // eax@123 int Dst[800]; // [sp+Ch] [bp-C88h]@33 int v52; // [sp+C8Ch] [bp-8h]@33 - //int v53; // [sp+C90h] [bp-4h]@1 - //int v54; // [sp+C9Ch] [bp+8h]@3 + int v53; // [sp+C90h] [bp-4h]@1 + int v54; // [sp+C9Ch] [bp+8h]@3 //int v55; // [sp+CA0h] [bp+Ch]@34 signed int v56; // [sp+CA0h] [bp+Ch]@55 int v57; // [sp+CA0h] [bp+Ch]@62 @@ -1578,14 +1579,13 @@ int a2b; // [sp+CA4h] [bp+10h]@101 int a2c; // [sp+CA4h] [bp+10h]@120 - //v53 = -1; - //v4 = pItem; - //v5 = this; + v53 = -1; + v5 = this; if (!out_item) out_item = (ItemGen *)pAllocator->AllocNamedChunk(out_item, sizeof(*out_item), "newItemGen"); memset(out_item, 0, sizeof(*out_item)); - auto v4 = out_item; + v4 = out_item; v6 = treasure_level - 1; //v54 = treasure_level - 1; if ( a3 ) @@ -1616,7 +1616,7 @@ case 39: requested_equip = EQUIP_BOOTS; break; case 40: requested_equip = EQUIP_RING; break; case 41: requested_equip = EQUIP_AMULET; break; - case 42: requested_equip = EQUIP_C; break; + case 42: requested_equip = EQUIP_WAND; break; case 43: requested_equip = EQUIP_F; break; case 44: requested_equip = EQUIP_POTION; break; case 45: requested_equip = EQUIP_REAGENT; break; @@ -1705,7 +1705,7 @@ return; } v57 = 0; - v18 = rand() % 10;// v5->field_11684[v54]; + v18 = rand() % v5->uChanceByTreasureLvlSumm[v54];// v5->field_11684[v54]; v4->uItemID = 0; if ( v18 > 0 ) { @@ -1746,7 +1746,7 @@ v20 = pItems[v4->uItemID].uEquipType; if ( v20 <= EQUIP_BOW ) { - v37 = 10;//(int)&v5->field_1169C[4 * v54 + 48]; + v37 = v5->uBonusChanceWpSpecial[v54]; if ( !*(unsigned int *)v37 ) return; v38 = rand() % 100; @@ -1757,7 +1757,7 @@ { if ( v20 > EQUIP_AMULET ) { - if ( v20 == EQUIP_C ) + if ( v20 == EQUIP_WAND ) { v21 = rand() % 6 + pItemsTable->pItems[v4->uItemID].uDamageMod + 1; v4->uNumCharges = v21;
--- a/Items.h Tue Feb 19 22:37:39 2013 +0600 +++ b/Items.h Tue Feb 19 22:37:58 2013 +0600 @@ -74,7 +74,7 @@ EQUIP_BOOTS = 0x9, EQUIP_RING = 0xA, EQUIP_AMULET = 0xB, - EQUIP_C = 0xC, + EQUIP_WAND = 12, EQUIP_REAGENT = 0xD, EQUIP_POTION = 0xE, EQUIP_F = 0xF,
--- a/LayingItem.h Tue Feb 19 22:37:39 2013 +0600 +++ b/LayingItem.h Tue Feb 19 22:37:58 2013 +0600 @@ -33,7 +33,7 @@ int field_4C; int field_50; int field_54; - int field_58; + int field_58_pid; int field_5C; char field_60_distance_related_prolly_lod; char field_61;
--- a/MM7.h Tue Feb 19 22:37:39 2013 +0600 +++ b/MM7.h Tue Feb 19 22:37:58 2013 +0600 @@ -281,43 +281,9 @@ /* 369 */ #pragma pack(push, 1) -struct stru329 -{ - int field_0; - float field_4; - int field_8; - int field_C; - int equip_x; - int equip_y; - int field_18; - int field_1C; - int field_20; - int field_24; - int field_28; - int field_2C; - int field_30; - int field_34; - int field_38; - int field_3C; - int field_40; - int field_44; - int field_48; - int field_4C; - int field_50; - int field_54; - int field_58; - int field_5C; - int field_60; - int field_64; - int field_68; - int field_6C; - int field_70; - int field_74; - int field_78; - int field_7C; -}; + #pragma pack(pop) -extern stru329 array_4E4C30[4]; +extern int paperdoll_Weapon[4][16][2]; /* 371 */ #pragma pack(push, 1)
--- a/NPC.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/NPC.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -18,10 +18,10 @@ void InitializeTransitions(); void InitializeAutonotes(); void InitializeQuests(); - +bool CheckPortretAgainsSex(int portret_num, int sex); //----- (00476977) -------------------------------------------------------- -void NPCStats::Initialize2() +void NPCStats::InitializeNPCText() { int i; char* test_string; @@ -136,11 +136,11 @@ { if ((decode_step>0)&&(decode_step<77)) { - array_16544[decode_step].field_4[i]=atoi(test_string); + pProfessionChance[decode_step].professionChancePerArea[i]=atoi(test_string); } else if (decode_step==0) { - array_16544[0].field_4[i]=10; + pProfessionChance[0].professionChancePerArea[i]=10; } } else @@ -154,11 +154,13 @@ for (i=0; i<78; ++i) { - array_16544[i].field_0=0; + pProfessionChance[i].uTotalprofChance=0; for (int ii=1; ii<59; ++ii) { - array_16544[i].field_0+=array_16544[i].field_4[ii]; + pProfessionChance[i].uTotalprofChance+=pProfessionChance[i].professionChancePerArea[ii]; } + pProfessionChance[i].professionChancePerArea[0]=0; + pProfessionChance[i].professionChancePerArea[59]=0; } if (pNPCDistTXT_Raw) @@ -172,7 +174,7 @@ void NPCStats::_476C60() { for (unsigned int i = 1; i < uNumNewNPCs; ++i) - pNewNPCData[i].pName = pNPCNames2[i - 1]; + pNewNPCData[i].pName = pNPCUnicNames[i - 1]; if (pParty->pHirelings[0].pName) pParty->pHirelings[0].pName = pParty->pHireling1Name; @@ -181,617 +183,491 @@ } //----- (00476CB5) -------------------------------------------------------- -void NPCStats::Initialize1() +void NPCStats::InitializeNPCData() { - NPCStats *pNPCStats; // esi@1 - char *pRaw; // eax@1 - char *pHouse; // edi@1 - char *v4; // eax@2 - char v5; // dl@3 - int v6; // ecx@3 - char *v7; // eax@11 - char *v8; // eax@26 - char *v9; // ecx@27 - char v10; // dl@28 - int v11; // eax@28 - int v12; // edi@32 - char *v13; // eax@42 - char *v14; // eax@43 - char v15; // dl@44 - int v16; // ecx@44 - int v17; // edi@48 - char *v18; // eax@56 - char *v19; // eax@57 - char v20; // cl@58 - int v21; // edi@58 - int v22; // esi@62 - int v23; // [sp+Ch] [bp-14h]@7 - signed int v24; // [sp+10h] [bp-10h]@1 - signed int v25; // [sp+10h] [bp-10h]@26 - signed int v26; // [sp+10h] [bp-10h]@42 - signed int v27; // [sp+10h] [bp-10h]@56 - char *Str; // [sp+14h] [bp-Ch]@1 - NPCGreeting *pGreetings; // [sp+14h] [bp-Ch]@26 - unsigned __int16 *pGroups; // [sp+14h] [bp-Ch]@42 - char **pCatchPhrase; // [sp+14h] [bp-Ch]@56 - signed int v32; // [sp+18h] [bp-8h]@2 - signed int v33; // [sp+18h] [bp-8h]@27 - signed int v34; // [sp+18h] [bp-8h]@43 - signed int v35; // [sp+18h] [bp-8h]@57 - signed int v36; // [sp+1Ch] [bp-4h]@2 - signed int v37; // [sp+1Ch] [bp-4h]@27 - signed int v38; // [sp+1Ch] [bp-4h]@43 - signed int v39; // [sp+1Ch] [bp-4h]@57 + int i; + char* test_string; + unsigned char c; + bool break_loop; + unsigned int temp_str_len; + char* tmp_pos; + int decode_step; + + pNPCDataTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0); + strtok(pNPCDataTXT_Raw, "\r"); + strtok(NULL, "\r"); - pNPCStats = this; - pRaw = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0); - pNPCStats->pNPCDataTXT_Raw = pRaw; - strtok(pRaw, "\r"); - strtok(0, "\r"); - pHouse = (char *)&pNPCStats->pNPCData[1].house; - Str = (char *)pNPCStats->pNPCNames2; - v24 = 500; - do + for (i=0; i<500; ++i) { - v32 = 0; - v4 = strtok(0, "\r") + 1; - v36 = -1; - do + test_string = strtok(NULL, "\r") + 1; + break_loop = false; + decode_step=0; + do { - v5 = *v4; - v6 = 0; - while ( v5 != 9 && v5 ) + c = *(unsigned char*)test_string; + temp_str_len = 0; + while((c!='\t')&&(c>0)) { - ++v6; - v5 = v4[v6]; - } - v23 = (int)&v4[v6]; - if ( !v4[v6] ) - v32 = 1; - v4[v6] = 0; - if ( v6 ) - { - switch ( v36 ) + ++temp_str_len; + c=test_string[temp_str_len]; + } + tmp_pos=test_string+temp_str_len; + if (*tmp_pos == 0) + break_loop = true; + *tmp_pos = 0; + if (temp_str_len) + { //i+1 + switch (decode_step) { - case 0: - v7 = RemoveQuotes(v4); - *((int *)pHouse - 5) = (int)v7; - *(int *)Str = (int)v7; + case 1: + pNPCUnicNames[i] = RemoveQuotes(test_string); + pNPCData[i+1].pName=pNPCUnicNames[i]; break; - case 1: - *((int *)pHouse - 4) = atoi(v4); - break; - case 5: - *(int *)pHouse = atoi(v4); + case 2: + pNPCData[i+1].uPortraitID = atoi(test_string); break; case 6: - *((int *)pHouse + 1) = atoi(v4); + pNPCData[i+1].Location2D = atoi(test_string); break; case 7: - *((int *)pHouse + 2) = atoi(v4); + pNPCData[i+1].uProfession = atoi(test_string); break; case 8: - *((int *)pHouse + 3) = *v4 == 121; + pNPCData[i+1].greet = atoi(test_string); break; case 9: - *((int *)pHouse + 5) = atoi(v4); + pNPCData[i+1].joins = (*test_string == 'y')?1:0; break; case 10: - *((int *)pHouse + 6) = atoi(v4); + pNPCData[i+1].evt_A = atoi(test_string); break; case 11: - *((int *)pHouse + 7) = atoi(v4); + pNPCData[i+1].evt_B = atoi(test_string); break; case 12: - *((int *)pHouse + 8) = atoi(v4); + pNPCData[i+1].evt_C = atoi(test_string); break; case 13: - *((int *)pHouse + 9) = atoi(v4); + pNPCData[i+1].evt_D = atoi(test_string); break; case 14: - *((int *)pHouse + 10) = atoi(v4); + pNPCData[i+1].evt_E = atoi(test_string); break; - default: + case 15: + pNPCData[i+1].evt_F = atoi(test_string); break; } } - ++v36; - v4 = (char *)(v23 + 1); - } - while ( v36 + 1 <= 15 && !v32 ); - Str += 4; - pHouse += 76; - --v24; + ++decode_step; + test_string=tmp_pos+1; + } while ((decode_step<16)&&!break_loop); } - while ( v24 ); - pNPCStats->uNumNewNPCs = 501; - v8 = (char *)pEvents_LOD->LoadRaw("npcgreet.txt", 0); - pNPCStats->pNPCGreetTXT_Raw = v8; - strtok(v8, "\r"); - pGreetings = pNPCStats->pNPCGreetings; - v25 = 205; - do + uNumNewNPCs = 501; + pNPCGreetTXT_Raw = (char*)pEvents_LOD->LoadRaw("npcgreet.txt", 0); + strtok(pNPCGreetTXT_Raw, "\r"); + for (i=0; i<205; ++i) + { + test_string = strtok(NULL, "\r") + 1; + break_loop = false; + decode_step=0; + do { - v37 = 0; - v33 = 0; - v9 = strtok(0, "\r") + 1; - do - { - v10 = *v9; - v11 = 0; - while ( v10 != 9 && v10 ) - { - ++v11; - v10 = v9[v11]; - } - v12 = (int)&v9[v11]; - if ( !v9[v11] ) - v33 = 1; - *(char *)v12 = 0; - if ( v11 ) - { - if ( v37 == 1 ) - { - pGreetings->pGreeting1 = (char *)RemoveQuotes(v9); - } - else - { - if ( v37 == 2 ) - pGreetings->pGreeting2 = (char *)RemoveQuotes(v9); - } - } - ++v37; - v9 = (char *)(v12 + 1); - } - while ( v37 <= 2 && !v33 ); - ++pGreetings; - --v25; - } - while ( v25 ); - v13 = (char *)pEvents_LOD->LoadRaw("npcgroup.txt", 0); - pNPCStats->pNCPGroupTXT_Raw = v13; - strtok(v13, "\r"); - pGroups = pNPCStats->pGroups; - v26 = 51; - do + c = *(unsigned char*)test_string; + temp_str_len = 0; + while((c!='\t')&&(c>0)) { - v14 = strtok(0, "\r") + 1; - v38 = 0; - v34 = 0; - do + ++temp_str_len; + c=test_string[temp_str_len]; + } + tmp_pos=test_string+temp_str_len; + if (*tmp_pos == 0) + break_loop = true; + *tmp_pos = 0; + if (temp_str_len) + { //i+1 + switch (decode_step) { - v15 = *v14; - v16 = 0; - while ( v15 != 9 && v15 ) - { - ++v16; - v15 = v14[v16]; - } - v17 = (int)&v14[v16]; - if ( !v14[v16] ) - v34 = 1; - *(char *)v17 = 0; - if ( v16 && v38 == 1 ) - *pGroups = atoi(v14); - ++v38; - v14 = (char *)(v17 + 1); + case 1: + pNPCGreetings[i].pGreeting1 = RemoveQuotes(test_string); + break; + case 2: + pNPCGreetings[i].pGreeting2 = RemoveQuotes(test_string); + break; } - while ( v38 <= 1 && !v34 ); - ++pGroups; - --v26; } - while ( v26 ); - v18 = (char *)pEvents_LOD->LoadRaw("npcnews.txt", 0); - pNPCStats->pNPCNewsTXT_Raw = v18; - strtok(v18, "\r"); - pCatchPhrase = pNPCStats->pCatchPhrases; - v27 = 51; - do + ++decode_step; + test_string=tmp_pos+1; + } while ((decode_step<3)&&!break_loop); + } + + pNCPGroupTXT_Raw = (char*)pEvents_LOD->LoadRaw("npcgroup.txt", 0); + strtok(pNCPGroupTXT_Raw, "\r"); + + for (i=0; i<51; ++i) + { + test_string = strtok(NULL, "\r") + 1; + break_loop = false; + decode_step=0; + do + { + c = *(unsigned char*)test_string; + temp_str_len = 0; + while((c!='\t')&&(c>0)) + { + ++temp_str_len; + c=test_string[temp_str_len]; + } + tmp_pos=test_string+temp_str_len; + if (*tmp_pos == 0) + break_loop = true; + *tmp_pos = 0; + if (temp_str_len) + { //i+1 + if (decode_step==1) { - v19 = strtok(0, "\r") + 1; - v39 = 0; - v35 = 0; - do - { - v20 = *v19; - v21 = 0; - while ( v20 != 9 && v20 ) - { - ++v21; - v20 = v19[v21]; - } - v22 = (int)&v19[v21]; - if ( !v19[v21] ) - v35 = 1; - *(char *)v22 = 0; - if ( v21 && v39 == 1 ) - *pCatchPhrase = (char *)RemoveQuotes(v19); - ++v39; - v19 = (char *)(v22 + 1); - } - while ( v39 <= 1 && !v35 ); - ++pCatchPhrase; - --v27; + pGroups[i] = atoi(test_string); } - while ( v27 ); + } + ++decode_step; + test_string=tmp_pos+1; + } while ((decode_step<2)&&!break_loop); + } + + pNPCNewsTXT_Raw = (char*)pEvents_LOD->LoadRaw("npcnews.txt", 0); + strtok(pNPCNewsTXT_Raw, "\r"); + + + for (i=0; i<51; ++i) + { + test_string = strtok(NULL, "\r") + 1; + break_loop = false; + decode_step=0; + do + { + c = *(unsigned char*)test_string; + temp_str_len = 0; + while((c!='\t')&&(c>0)) + { + ++temp_str_len; + c=test_string[temp_str_len]; + } + tmp_pos=test_string+temp_str_len; + if (*tmp_pos == 0) + break_loop = true; + *tmp_pos = 0; + if (temp_str_len) + { //i+1 + if (decode_step==1) + pCatchPhrases[i] = RemoveQuotes(test_string); + } + ++decode_step; + test_string=tmp_pos+1; + } while ((decode_step<2)&&!break_loop); + } } //----- (0047702F) -------------------------------------------------------- void NPCStats::Initialize() - { - //NPCStats *v1; // edi@1 - char *v2; // ebx@1 - //char *v3; // eax@1 - char *v4; // ebx@3 - char v5; // al@4 - int v6; // ecx@4 - //char *v7; // eax@18 - char *v8; // ebx@18 - char *v9; // ecx@19 - char v10; // dl@20 - int v11; // eax@20 - char v12; // zf@41 - signed int v13; // [sp+Ch] [bp-14h]@18 - int v14; // [sp+10h] [bp-10h]@4 - int v15; // [sp+10h] [bp-10h]@24 - char *v16; // [sp+14h] [bp-Ch]@1 - signed int v17; // [sp+14h] [bp-Ch]@19 - unsigned int v18; // [sp+18h] [bp-8h]@1 - char *v19; // [sp+18h] [bp-8h]@18 - signed int v20; // [sp+1Ch] [bp-4h]@3 - signed int v21; // [sp+1Ch] [bp-4h]@19 - //v1 = this; + { + int i; + char* test_string; + unsigned char c; + bool break_loop; + unsigned int temp_str_len; + char* tmp_pos; + int decode_step; - Initialize1(); - Initialize2(); + InitializeNPCData(); + InitializeNPCText(); + InitializeQuests(); + InitializeAutonotes(); + InitializeAwards(); + InitializeTransitions(); + InitializeMerchants(); + InitializeScrolls(); - InitializeQuests(); - InitializeAutonotes(); - InitializeAwards(); - InitializeTransitions(); - InitializeMerchants(); - InitializeScrolls(); - v2 = 0; - field_17FC0 = 0; - pNPCNamesTXT_Raw = 0; - //v3 = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0); - pNPCNamesTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0); - strtok(pNPCNamesTXT_Raw, "\r"); - v18 = 0; - v16 = (char *)pNPCNames; - while ( 1 ) - { - v4 = strtok(v2, "\r") + 1; - v20 = 0; - do + pNPCNamesTXT_Raw = NULL; + pNPCNamesTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0); + strtok(pNPCNamesTXT_Raw, "\r"); + + uNewlNPCBufPos = 0; + + for (i=0; i<540; ++i) { - v5 = *v4; - v6 = 0; - v14 = 0; - if ( *v4 == 9 ) - goto LABEL_45; - do + test_string = strtok(NULL, "\r") + 1; + break_loop = false; + decode_step=0; + do { - if ( !v5 ) - break; - if ( v5 == 10 ) - break; - ++v6; - v14 = v6; - v5 = v4[v6]; - } - while ( v5 != 9 ); - if ( v6 ) + c = *(unsigned char*)test_string; + temp_str_len = 0; + if (c=='\t') { - v4[v6] = 0; - if ( v20 ) - { - if ( v20 == 1 ) - *((int *)v16 + 1) = (int)RemoveQuotes(v4); - } - else - { - *(int *)v16 = (int)RemoveQuotes(v4); - } + if ( (decode_step == 1)&&(!uNumNPCNames[1])) + uNumNPCNames[1]=i; } else { -LABEL_45: - if ( v20 == 1 && !uNumNPCNames[1] ) - uNumNPCNames[1] = v18; - } - ++v20; - v4 += v14 + 1; - } - while ( v20 <= 1 ); - ++v18; - v16 += 8; - if ( (signed int)v18 >= 540 ) - break; - v2 = 0; - } - pNPCProfTXT_Raw = 0; - uNumNPCNames[0] = v18; - //v7 = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0); - pNPCProfTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0); - strtok(pNPCProfTXT_Raw, "\r"); - strtok(0, "\r"); - strtok(0, "\r"); - strtok(0, "\r"); - v8 = (char *)&pProfessions[0].pJoinText; - v19 = (char *)&pProfessions[0].pJoinText; - v13 = 58; - do - { - v21 = 0; - v9 = strtok(0, "\r") + 1; - v17 = 0; - do - { - v10 = *v9; - v11 = 0; - if ( *v9 != 9 ) - { - do - { - if ( !v10 ) - break; - ++v11; - v10 = v9[v11]; + while((c!='\n')&&(c!='\t')&&(c>0)) + { + ++temp_str_len; + c=test_string[temp_str_len]; + } + tmp_pos=test_string+temp_str_len; + if (*tmp_pos == 0) + break_loop = true; + + if (temp_str_len) + { + *tmp_pos = 0; + if ( decode_step == 0) + pNPCNames[i][0] =RemoveQuotes(test_string); + else if ( decode_step == 1) + pNPCNames[i][1] =RemoveQuotes(test_string); + } + else + { + if ( (decode_step == 1)&&(!uNumNPCNames[1])) + uNumNPCNames[1]=i; + } } - while ( v10 != 9 ); - v8 = v19; - } - v15 = (int)&v9[v11]; - if ( !v9[v11] ) - v17 = 1; - *(char *)v15 = 0; - if ( v11 ) + ++decode_step; + test_string=tmp_pos+1; + } while ((decode_step<2)&&!break_loop); + } + uNumNPCNames[0] = i; + + pNPCProfTXT_Raw = NULL; + pNPCProfTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0); + strtok(pNPCProfTXT_Raw, "\r"); + strtok(NULL, "\r"); + strtok(NULL, "\r"); + strtok(NULL, "\r"); + + for (i=1; i<59; ++i) + { + test_string = strtok(NULL, "\r") + 1; + break_loop = false; + decode_step=0; + do { - switch ( v21 ) + c = *(unsigned char*)test_string; + temp_str_len = 0; + while((c!='\t')&&(c>0)) { - case 2: - *((int *)v8 - 3) = atoi(v9); - break; - case 3: - *((int *)v8 - 1) = (int)RemoveQuotes(v9); - break; - case 4: - *((int *)v8 - 2) = (int)RemoveQuotes(v9); - break; - case 5: - *(int *)v8 = (int)RemoveQuotes(v9); - break; - case 6: - *((int *)v8 + 1) = (int)RemoveQuotes(v9); - break; + ++temp_str_len; + c=test_string[temp_str_len]; + } + tmp_pos=test_string+temp_str_len; + if (*tmp_pos == 0) + break_loop = true; + *tmp_pos = 0; + if (temp_str_len) + { + switch(decode_step) + { + case 2: + pProfessions[i].uHirePrice = atoi(test_string); + break; + case 3: + pProfessions[i].pActionText = RemoveQuotes(test_string); + break; + case 4: + pProfessions[i].pBenefits= RemoveQuotes(test_string); + break; + case 5: + pProfessions[i].pJoinText = RemoveQuotes(test_string); + break; + case 6: + pProfessions[i].pDismissText = RemoveQuotes(test_string); + } } - } - else - { - if ( !v21 ) - v17 = 1; - } - ++v21; - v9 = (char *)(v15 + 1); + else + { + if (!decode_step) + break_loop = true; + } + ++decode_step; + test_string=tmp_pos+1; + } while ((decode_step<7)&&!break_loop); } - while ( v21 <= 6 && !v17 ); - v8 += 20; - v12 = v13-- == 1; - v19 = v8; + uNumNPCProfessions = 59; } - while ( !v12 ); - uNumNPCProfessions = 59; - } //----- (00477266) -------------------------------------------------------- void NPCStats::Release() { - NPCStats *v1; // esi@1 - void *v2; // ST00_4@1 - int v3; // ebx@1 - - v1 = this; - pAllocator->FreeChunk(this->pNPCTopicTXT_Raw); - v2 = v1->pNPCTextTXT_Raw; - v1->pNPCNewsTXT_Raw = 0; - pAllocator->FreeChunk(v2); - v1->pNPCNewsTXT_Raw = 0; - pAllocator->FreeChunk(0); - v1->pNPCNewsTXT_Raw = 0; - pAllocator->FreeChunk(v1->pNPCProfTXT_Raw); - v1->pNPCProfTXT_Raw = 0; - pAllocator->FreeChunk(v1->pNPCNamesTXT_Raw); - v1->pNPCNamesTXT_Raw = 0; - pAllocator->FreeChunk(v1->pNPCDataTXT_Raw); - v1->pNPCDataTXT_Raw = 0; - pAllocator->FreeChunk(v1->pNPCDistTXT_Raw); - v1->pNPCDistTXT_Raw = 0; - v3 = (int)&v1->pNPCGreetTXT_Raw; - pAllocator->FreeChunk(v1->pNPCGreetTXT_Raw); - v1 = (NPCStats *)((char *)v1 + 98296); - *(int *)v3 = 0; - pAllocator->FreeChunk(v1->pNPCData[0].pName); - v1->pNPCData[0].pName = 0; + pAllocator->FreeChunk(pNPCTopicTXT_Raw); + pNPCTopicTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCTextTXT_Raw); + pNPCTextTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCNewsTXT_Raw); + pNPCNewsTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCProfTXT_Raw); + pNPCProfTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCNamesTXT_Raw); + pNPCNamesTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCDataTXT_Raw); + pNPCDataTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCDistTXT_Raw); + pNPCDistTXT_Raw = NULL; + pAllocator->FreeChunk(pNPCGreetTXT_Raw); + pNPCGreetTXT_Raw = NULL; + pAllocator->FreeChunk(pNCPGroupTXT_Raw); + pNCPGroupTXT_Raw = NULL; } //----- (0047730C) -------------------------------------------------------- -int __fastcall const_1(int a1, int) +bool CheckPortretAgainsSex(int a1, int) { - return 1; + return true; } // 47730C: using guessed type int __stdcall const_1(int); //----- (0047732C) -------------------------------------------------------- -bool NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5) +void NPCStats::InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId) { - //NPCStats *v5; // ebx@1 - signed __int64 v6; // qax@1 - int v7; // esi@1 - int v8; // edx@1 - NPCData *v9; // edi@1 - int v10; // eax@1 - //int v11; // eax@23 - int v12; // ecx@23 - int v13; // edx@28 - int v14; // esi@37 - int v15; // edx@37 - int v16; // ecx@37 - int v17; // eax@37 - int v18; // edx@37 + int rep_gen; + int uNPCSex; // esi@1 + int uGeneratedPortret; // ecx@23 + int test_prof_summ; // ecx@37 + int gen_profession; // eax@37 + int max_prof_cap; // edx@37 signed int result; // eax@39 - int v20; // [sp+Ch] [bp-Ch]@1 - signed int v21; // [sp+10h] [bp-8h]@1 - signed int v22; // [sp+14h] [bp-4h]@1 - int v23; // [sp+24h] [bp+Ch]@1 + int uRace; // [sp+Ch] [bp-Ch]@1 + bool break_gen; // [sp+10h] [bp-8h]@1 + signed int gen_attempts; // [sp+14h] [bp-4h]@1 + int uPortretMin; // [sp+24h] [bp+Ch]@1 + int uPortretMax; + + static const unsigned __int8 NPCSexGenTable[86] ={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0 }; + static const unsigned __int8 NPCRaceGenTable[86] ={ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0}; + + unsigned __int8 seed = (unsigned __int8)((double)(npc_uid - 1) * 0.33333334); + uNPCSex = NPCSexGenTable[seed]; + uRace = NPCRaceGenTable[seed]; + pNPCDataBuff->uSex = uNPCSex; + pNPCDataBuff->pName = pNPCNames[rand() % uNumNPCNames[uNPCSex]][uNPCSex]; + gen_attempts = 0; + break_gen = false; - v23 = a3 - 1; - //v5 = this; - v6 = (signed __int64)((double)v23 * -0.33333334); - v7 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 28]; - v20 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 116]; - v8 = rand() % uNumNPCNames[v7]; - v9 = a2; - a2->uSex = v7; - a2->pName = pNPCNames[v8][v7]; - v10 = 0; - v22 = 0; - v21 = 0; - - while ( 1 ) + do { - if ( v20 == v10 ) + switch ( uRace ) { - if ( v7 == v10 ) + case 0: + if ( uNPCSex == 0 ) + { + uPortretMin = 2; + uPortretMax = 100; + } + else + { + uPortretMin = 201; + uPortretMax = 250; + } + case 1: + if ( uNPCSex == 0 ) { - v23 = 2; - a2 = (NPCData *)100; + uPortretMin = 400; + uPortretMax = 430; + } + else + { + uPortretMin = 460; + uPortretMax = 490; + } + break; + case 2: + if ( uNPCSex == 0 ) + { + uPortretMin = 500; + uPortretMax = 520; } else { - if ( v7 - v10 == 1 ) - { - v23 = 201; - a2 = (NPCData *)250; - } + uPortretMin = 530; + uPortretMax = 550; } - } - else - { - switch ( v20 - v10 ) + break; + case 3: + if ( uNPCSex == 0 ) { - case 1: - if ( v7 == v10 ) - { - v23 = 400; - a2 = (NPCData *)430; - } - else - { - if ( v7 - v10 == 1 ) - { - v23 = 460; - a2 = (NPCData *)490; - } - } - break; - case 2: - if ( v7 == v10 ) - { - v23 = 500; - a2 = (NPCData *)520; - } - else - { - if ( v7 - v10 == 1 ) - { - v23 = 530; - a2 = (NPCData *)550; - } - } - break; - case 3: - if ( v7 == v10 ) - { - v23 = 300; - a2 = (NPCData *)330; - } - else - { - if ( v7 - v10 == 1 ) - { - v23 = 360; - a2 = (NPCData *)387; - } - } - break; - } - } - v12 = v23 + rand() % ((int)a2 - v23 + 1); - if ( const_1(v12, v7) == 1 ) - v21 = 1; - ++v22; - if ( v22 >= 4 ) - { - v12 = v23; - v21 = 1; - } - if ( v21 ) - break; - v10 = 0; - } - - v9->uPortraitID = v12; - v9->uFlags = 0; - v9->fame = 0; - v13 = rand() % 100 + 1; - - if ( v13 >= 60 ) - { - if ( v13 >= 90 ) - { - if ( v13 >= 95 ) - { - if ( v13 >= 98 ) - v9->rep = -600; - else - v9->rep = 400; + uPortretMin = 300; + uPortretMax = 330; } else { - v9->rep = -300; + uPortretMin = 360; + uPortretMax = 387; } + + break; } - else + + uGeneratedPortret = uPortretMin + rand() % (uPortretMax - uPortretMin + 1); + if ( CheckPortretAgainsSex(uGeneratedPortret, uNPCSex)) + break_gen = true; + ++gen_attempts; + if ( gen_attempts >= 4 ) { - v9->rep = 200; + uGeneratedPortret = uPortretMin; + break_gen = true; } } - else - { - v9->rep = 0; - } + while(!break_gen); - //v14 = (int)((char *)v5 + 64 * a5); - //v15 = rand() % *(_DWORD *)(v14 + 91460); - v15 = rand() % array_16544[a5].field_0; - v16 = 0; - v17 = 0; - v18 = v15 + 1; + pNPCDataBuff->uPortraitID = uGeneratedPortret; + pNPCDataBuff->uFlags = 0; + pNPCDataBuff->fame = 0; + //generate reputation + rep_gen = rand() % 100 + 1; - if ( v18 > 0 ) - { - do - //v14 += *(char *)(v14 + v17++ + 0x16548); - v16 += array_16544[a5].field_4[v17++]; - while ( v16 < v18 ); - } - v9->uProfession = v17 - 1; - v9->house = a4; - v9->field_24 = 1; - v9->joins = 1; - return true; + if ( rep_gen >= 60 ) + { + if ( rep_gen >= 90 ) + { + if ( rep_gen >= 95 ) + { + if ( rep_gen >= 98 ) + pNPCDataBuff->rep = -600; + else + pNPCDataBuff->rep = 400; + } + else + pNPCDataBuff->rep = -300; + } + else + pNPCDataBuff->rep = 200; + } + else + pNPCDataBuff->rep = 0; + + max_prof_cap = rand() % pProfessionChance[uMapId].uTotalprofChance+1; + test_prof_summ = 0; + gen_profession = 0; + + if ( max_prof_cap > 0 ) + { + do + test_prof_summ += pProfessionChance[uMapId].professionChancePerArea[gen_profession++]; + while ( test_prof_summ < max_prof_cap ); + } + pNPCDataBuff->uProfession = gen_profession - 1; + pNPCDataBuff->Location2D = uLocation2D; + pNPCDataBuff->field_24 = 1; + pNPCDataBuff->joins = 1; } @@ -850,7 +726,6 @@ unsigned int temp_str_len; char* tmp_pos; int decode_step; - int item_counter; if ( pAwardsTXT_Raw ) pAllocator->FreeChunk(pAwardsTXT_Raw); @@ -906,7 +781,6 @@ unsigned int temp_str_len; char* tmp_pos; int decode_step; - int item_counter; if ( pScrollsTXT_Raw ) pAllocator->FreeChunk(pScrollsTXT_Raw); @@ -957,7 +831,6 @@ unsigned int temp_str_len; char* tmp_pos; int decode_step; - int item_counter; if ( pMerchantsTXT_Raw ) pAllocator->FreeChunk(pMerchantsTXT_Raw); @@ -1022,7 +895,6 @@ unsigned int temp_str_len; char* tmp_pos; int decode_step; - int item_counter; if ( pTransitionsTXT_Raw ) pAllocator->FreeChunk(pTransitionsTXT_Raw); @@ -1073,7 +945,6 @@ unsigned int temp_str_len; char* tmp_pos; int decode_step; - int item_counter; if ( pAutonoteTXT_Raw ) pAllocator->FreeChunk(pAutonoteTXT_Raw); @@ -1159,7 +1030,6 @@ unsigned int temp_str_len; char* tmp_pos; int decode_step; - int item_counter; if ( pQuestsTXT_Raw ) pAllocator->FreeChunk(pQuestsTXT_Raw);
--- a/NPC.h Tue Feb 19 22:37:39 2013 +0600 +++ b/NPC.h Tue Feb 19 22:37:58 2013 +0600 @@ -10,34 +10,31 @@ extern NPCTopic pNPCTopics[789]; - - - /* 136 */ #pragma pack(push, 1) -struct NPCData +struct NPCData //4Ch { inline bool Hired() {return uFlags & 0x80;} - char *pName; - unsigned int uPortraitID; - unsigned int uFlags; // & 0x80 no greeting on dialogue start; looks like hired - int fame; - int rep; - int house; - unsigned int uProfession; - int greet; - int joins; + char *pName; //0 + unsigned int uPortraitID; //4 + unsigned int uFlags; //8 // & 0x80 no greeting on dialogue start; looks like hired + int fame; //c + int rep; //10 + unsigned int Location2D; //14 + unsigned int uProfession; //18 + int greet; //1c + int joins; //20 int field_24; - unsigned int bDrawSomeAnim; - int _anim_current_time; //evtb - int _anim_end_time; //evtc - int evtd; - int evte; - int evtf; - int uSex; - int bHasUsedTheAbility; - int news_topic; + unsigned int evt_A; //28 + unsigned int evt_B; //2c evtb + unsigned int evt_C; // 30 evtc + unsigned int evt_D; //34 + unsigned int evt_E; //38 + unsigned int evt_F; //3c + unsigned int uSex; //40 + int bHasUsedTheAbility; //44 + int news_topic; //48 }; #pragma pack(pop) @@ -57,10 +54,10 @@ /* 139 */ #pragma pack(push, 1) -struct NPCStats_stru0 +struct NPCProfessionChance { - int field_0; //summ - char field_4[60]; //prof position + unsigned int uTotalprofChance; //summ + char professionChancePerArea[60]; //prof position }; #pragma pack(pop) @@ -74,7 +71,6 @@ #pragma pack(pop) - /* 137 */ #pragma pack(push, 1) struct NPCStats @@ -85,37 +81,32 @@ uNumNPCNames[0] = uNumNPCNames[1] = 0; } - void Initialize2(); - void Initialize1(); + void InitializeNPCText(); + void InitializeNPCData(); void Initialize(); void Release(); - bool InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5); + void InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId); void _476C60(); - NPCData pNPCData[501]; - NPCData pNewNPCData[501]; + NPCData pNPCData[501]; //0 - 94BCh count from 1 + NPCData pNewNPCData[501]; //94BCh- 12978h count from 1 char *pNPCNames[540][2]; - int field_13A58; - int field_13A5C; - int field_13A60; - int field_13A64; - int field_13A68; - NPCProfession pProfessions[58]; - NPCData array_13EF4[100]; - char *pCatchPhrases[52]; - char *pNPCNames2[500]; - NPCStats_stru0 array_16544[77]; //16544h proffesion position in area + NPCProfession pProfessions[59]; //count from 1 + NPCData pAdditionalNPC[100]; + char *pCatchPhrases[52]; //15CA4h + char *pNPCUnicNames[500]; //from first batch + NPCProfessionChance pProfessionChance[77]; //16544h profession chance in each area int field_17884; int field_17888; NPCGreeting pNPCGreetings[205]; unsigned __int16 pGroups[51]; unsigned __int16 pGroups_copy[51]; - int field_17FC0; + unsigned int uNewlNPCBufPos; unsigned int uNumNewNPCs; int field_17FC8; unsigned int uNumNPCProfessions; - unsigned int uNumNPCNames[2]; + unsigned int uNumNPCNames[2]; //0 male 1 female char *pNPCDataTXT_Raw; char *pNPCNamesTXT_Raw; char *pNPCProfTXT_Raw;
--- a/Party.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Party.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -974,15 +974,15 @@ for (int i = 0; i < 2; ++i) { auto hireling = pParty->pHirelings + i; - if (!hireling->_anim_end_time) + if (!hireling->evt_C) continue; - hireling->_anim_current_time += pMiscTimer->uTimeElapsed; - if (hireling->_anim_current_time >= hireling->_anim_end_time) + hireling->evt_B += pMiscTimer->uTimeElapsed; + if (hireling->evt_B >= hireling->evt_C) { - hireling->bDrawSomeAnim = false; - hireling->_anim_current_time = 0; - hireling->_anim_end_time = 0; + hireling->evt_A = 0; + hireling->evt_B = 0; + hireling->evt_C = 0; assert(sizeof(NPCData) == 0x4C); memset(hireling, 0, sizeof(*hireling));
--- a/Player.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Player.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -6818,18 +6818,18 @@ } //----- (004907E7) -------------------------------------------------------- -__int16 Player::GetStatColor(unsigned int uStat) +unsigned int Player::GetStatColor(int uStat) { __int16 uWhite; // si@1 int attribute_value; // edx@1 - unsigned __int8 pBaseValue; // of@1 + unsigned __int8 pBaseAttrValue; // of@1 __int16 uGreen; // [sp+8h] [bp-8h]@1 __int16 uRed; // [sp+Ch] [bp-4h]@1 uRed = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0); uGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); uWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - pBaseValue = StatTable[GetRace()][uStat].uBaseValue; + pBaseAttrValue = StatTable[GetRace()][uStat].uBaseValue; switch (uStat) { @@ -6842,9 +6842,9 @@ case 6: attribute_value = uLuck; break; }; - if ( attribute_value == pBaseValue ) + if ( attribute_value == pBaseAttrValue ) return uWhite; - else if ( attribute_value > pBaseValue ) + else if ( attribute_value > pBaseAttrValue ) return uGreen; else return uRed;
--- a/Player.h Tue Feb 19 22:37:39 2013 +0600 +++ b/Player.h Tue Feb 19 22:37:58 2013 +0600 @@ -514,7 +514,7 @@ void DecreaseAttribute(int eAttribute); int IncreaseAttribute(int eAttribute); void Player::Zero(); - __int16 GetStatColor(unsigned int uStat); + unsigned int GetStatColor(int uStat); bool DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime); int _490EEE(ItemGen *pItem, int a3, int a4, int a5); int GetBodybuilding(); @@ -560,6 +560,7 @@ bool Recover(signed int a2); bool CanCastSpell(unsigned int uRequiredMana); + inline bool Weak() {return pConditions[Condition::Condition_Weak] != 0;} 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;}
--- a/Vis.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/Vis.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -428,37 +428,34 @@ //{return DoesRayIntersectBillboard(fDepth, uD3DBillboardIdx);} //----- (004C1944) -------------------------------------------------------- -int Vis::_4C1944(int object_id, unsigned int a3, int a4, int a5, int a6) +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 + //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 + //__int64 v9; // [sp+2Ch] [bp-Ch]@3 + //Vis *v14; // [sp+34h] [bp-4h]@1 - v14 = this; + //v14 = this; static Vis_SelectionList Vis_static_sub_4C1944_stru_F8BDE8; - + + v8.object_type = VisObjectType_Sprite; v8.object_id = object_id; v8.field_8 = a6; v8.field_C = a5; v8.field_10 = a4; - v9 = a3; Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers = 0; - v6 = (double)a3; - v8.object_type = VisObjectType_Sprite; - PickBillboards_Keyboard(v6, &Vis_static_sub_4C1944_stru_F8BDE8, &v8); + 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); - if ( (signed int)Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers <= 0 ) - result = -1; - else - result = Vis_static_sub_4C1944_stru_F8BDE8.object_pointers[0]->sZValue; - return result; + + if (!Vis_static_sub_4C1944_stru_F8BDE8.uNumPointers) + return -1; + return Vis_static_sub_4C1944_stru_F8BDE8.object_pointers[0]->sZValue; } //----- (004C1A02) --------------------------------------------------------
--- a/Vis.h Tue Feb 19 22:37:39 2013 +0600 +++ b/Vis.h Tue Feb 19 22:37:58 2013 +0600 @@ -105,7 +105,7 @@ void GetPolygonCenter(struct RenderVertexD3D3 *pVertices, unsigned int uNumVertices, float *pCenterX, float *pCenterY); void GetPolygonScreenSpaceCenter(struct RenderVertexSoft *vertices, int num_vertices, float *out_center_x, float *out_center_y); bool IsPointInsideD3DBillboard(struct RenderBillboardD3D *a1, float x, float y); - int _4C1944(int object_id, unsigned int a3, int a4, int a5, int a6); + int PickClosestActor(int object_id, unsigned int pick_depth, int a4, int a5, int a6); void _4C1A02(); bool SortVectors_x(RenderVertexSoft *a2, int a3, int a4); int get_object_zbuf_val(Vis_ObjectInfo *info);
--- a/mm7_1.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_1.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -4489,7 +4489,7 @@ a1.uAttributes = 48; a1.uSectorID = pIndoor->GetSector(pOut.x, pOut.z, pOut.y); a1.uSpriteFrameID = 0; - a1.field_58 = 0; + a1.field_58_pid = 0; a1.field_5C = 0; a1.uFacing = 0; a1.Create(0, 0, 0, 0); @@ -4778,7 +4778,7 @@ v12 = &pParty->pHirelings[v11]; v13 = v12->uProfession; if ( v13 ) - v3 += *(&pNPCStats->field_13A58 + 5 * v13); + v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); ++v2; } while ( (signed int)v2 < v14 ); @@ -5694,7 +5694,7 @@ } } } - a1.field_58 = 4; + a1.field_58_pid = OBJECT_Player; a1.uObjectDescID = v6; a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; @@ -6077,7 +6077,7 @@ } a1.uObjectDescID = v6; a1.vPosition.y = pParty->vPosition.y; - a1.field_58 = 4; + a1.field_58_pid = OBJECT_Player; a1.vPosition.x = pParty->vPosition.x; a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; a1.uSoundID = 0;
--- a/mm7_2.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_2.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -8065,7 +8065,7 @@ a1a.field_48 = 0; v30 = pIndoor->GetSector(v28, v27, v29); a1a.field_5C = 0; - a1a.field_58 = 0; + a1a.field_58_pid = 0; a1a.uSpriteFrameID = 0; a1a.uSectorID = v30; return a1a.Create(0, 0, 0, 0); @@ -9124,20 +9124,20 @@ } //----- (00452A9E) -------------------------------------------------------- -int sub_452A9E(int square_distance) +int integer_sqrt(int val) { signed int result; // eax@2 - int v2; // edx@3 + unsigned int v2; // edx@3 unsigned int v3; // edi@3 //signed int v4; // ebx@3 int v5; // esi@4 - if (square_distance < 1) - return square_distance; + if (val < 1) + return val; v2 = 0; - v3 = square_distance; + v3 = val; result = 0; //v4 = 16; for (uint i = 0; i < 16; ++i) @@ -9146,7 +9146,7 @@ v2 = (v3 >> 30) | 4 * v2; v5 = 2 * result + 1; v3 *= 4; - if ( v2 >= (unsigned int)v5 ) + if ( v2 >= v5 ) { ++result; v2 -= v5; @@ -9154,8 +9154,9 @@ //--v4; } //while ( v4 ); - if ( square_distance - result * result >= (unsigned int)(result - 1) ) + if ( val - result * result >= (unsigned int)(result - 1) ) ++result; + return result; } //----- (00452AE2) -------------------------------------------------------- @@ -11275,7 +11276,7 @@ pParty->field_7B5_in_arena_quest = 0; //v1 = 0; dword_5C6DF8 = 1; - pNPCStats->field_17FC0 = 0; + pNPCStats->uNewlNPCBufPos = 0; v19 = pMapStats->GetMapInfo(pCurrentMapName); //v15 = 0; @@ -11310,9 +11311,9 @@ continue; if ( v17 ) { - pNPCStats->InitializeAdditionalNPCs(&pNPCStats->array_13EF4[pNPCStats->field_17FC0], v3, 0, v19); - v14 = LOWORD(pNPCStats->field_17FC0) + 5000; - ++pNPCStats->field_17FC0; + pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], v3, 0, v19); + v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000; + ++pNPCStats->uNewlNPCBufPos; pActor->uNPC_ID = v14; continue; } @@ -12871,7 +12872,7 @@ _wgetcwd(pCurrentDir, 1024); wchar_t pMM6IniFile[1024]; - wsprintf(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir); + wsprintfW(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir); bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile); if (bNoCD) @@ -16033,12 +16034,12 @@ v151 = a2 & 7; if ( (a2 & 7) == OBJECT_Actor) { - if ( (v2->field_58 & 7) == OBJECT_Actor && !pActors[v2->field_58 >> 3].GetActorsRelation(&pActors[a2 >> 3]) ) + if ( (v2->field_58_pid & 7) == OBJECT_Actor && !pActors[v2->field_58_pid >> 3].GetActorsRelation(&pActors[a2 >> 3]) ) return 1; } else { - if ( (a2 & 7) == OBJECT_Player && (v2->field_58 & 7) == OBJECT_Player) + if ( (a2 & 7) == OBJECT_Player && (v2->field_58_pid & 7) == OBJECT_Player) return 1; } if ( pParty->bTurnBasedModeOn == 1 ) @@ -16050,8 +16051,8 @@ v2->uAttributes = v5 & 0xFFFB; } } - if ( v151 == OBJECT_BModel && (v2->field_58 & 7) != OBJECT_Player) - BYTE2(pActors[v2->field_58 >> 3].uAttributes) |= 4u; + if ( v151 == OBJECT_BModel && (v2->field_58_pid & 7) != OBJECT_Player) + BYTE2(pActors[v2->field_58_pid >> 3].uAttributes) |= 4u; v6 = v2->uItemType; v7 = v2->uItemType; if ( v7 > 3060 )
--- a/mm7_3.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_3.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -680,7 +680,7 @@ result = v9 + pParty->vPosition.z; if ( v6 <= (signed int)(v9 + pParty->vPosition.z) || v8 ) { - result = sub_452A9E(v3 * v3 - v4 * v4); + result = integer_sqrt(v3 * v3 - v4 * v4); v7 = v5 - result; if ( v7 < 0 ) v7 = 0; @@ -820,7 +820,7 @@ int v28; // [sp+14h] [bp+8h]@5 v2 = this; - v3 = sub_452A9E(this->field_24 * this->field_24 + this->field_20 * this->field_20 + this->field_1C * this->field_1C); + v3 = integer_sqrt(this->field_24 * this->field_24 + this->field_20 * this->field_20 + this->field_1C * this->field_1C); v4 = v3 | 1; v5 = v2->field_1C; v2->field_64 = v3 | 1; @@ -1260,7 +1260,7 @@ viewparams->bRedrawGameUI = 1; break; case 5: - v47 = sub_452A9E(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); + v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); v48 = stru_5C6E00->Atan2( v0->vPosition.x - pLevelDecorations[v39].vPosition.x, v0->vPosition.y - pLevelDecorations[v39].vPosition.y); @@ -1484,9 +1484,9 @@ { _46E44E_collide_against_faces_and_portals(0); _46E0B2_collide_against_decorations(); - if ( (v1->field_58 & 7) != OBJECT_Player) + if ( (v1->field_58_pid & 7) != OBJECT_Player) _46EF01_collision_chech_player(1); - v13 = v1->field_58; + v13 = v1->field_58_pid; v42 = v8; if ( (v13 & 7) == OBJECT_Actor) { @@ -1499,7 +1499,7 @@ //v14 = (signed __int64)((double)v41 * 0.3333333333333333); //v41 = *(short *)(v39 - 38) - 1; //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) ) - if( pActors[v1->field_58 >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID ) + if( pActors[v1->field_58_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID ) //not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius _46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[v39b->word_000086_some_monster_id] - 73)); ++v42; @@ -1578,7 +1578,7 @@ v15 = (signed int)stru_721530.uFaceID >> 3; if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) { - v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); + v40 = integer_sqrt(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); v23 = stru_5C6E00->Atan2( v1->vPosition.x - pLevelDecorations[v15].vPosition.x, v1->vPosition.y - pLevelDecorations[v15].vPosition.y); @@ -1988,11 +1988,11 @@ v58 = v16; v18 = WorldPosToGridCellX(v17); _46E26D_collide_against_sprites(v18, v58); - if ( (v1->field_58 & 7) != OBJECT_Player) + if ( (v1->field_58_pid & 7) != OBJECT_Player) _46EF01_collision_chech_player(0); - if ( (v1->field_58 & 7) == OBJECT_Actor) - { - v19 = v1->field_58 >> 3; + if ( (v1->field_58_pid & 7) == OBJECT_Actor) + { + v19 = v1->field_58_pid >> 3; if ( v19 >= 0 ) { if ( v19 < (signed int)(uNumActors - 1) ) @@ -2161,7 +2161,7 @@ if ( !(v42 ^ v43) ) return; } - v57 = sub_452A9E(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x); + v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x); v38 = stru_5C6E00->Atan2( v1->vPosition.x - pLevelDecorations[v30].vPosition.x, v1->vPosition.y - pLevelDecorations[v30].vPosition.y); @@ -2825,7 +2825,7 @@ } if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) { - v53 = sub_452A9E(v2 * v2 + v1 * v1); + v53 = integer_sqrt(v2 * v2 + v1 * v1); v80 = v53; v54 = stru_5C6E00->Atan2( new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, @@ -2919,7 +2919,7 @@ } if ( bWalkSound && pParty->field_6F8 <= 0 ) { - if ( sub_452A9E((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y) + if ( integer_sqrt((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y) * (pParty->vPosition.y - new_party_y) + (pParty->vPosition.z - new_party_z) * (pParty->vPosition.z - new_party_z)) <= 16 ) @@ -3756,7 +3756,7 @@ } if ( (stru_721530.uFaceID & 7) == OBJECT_Decoration) { - v56 = sub_452A9E(v2 * v2 + v128 * v128); + v56 = integer_sqrt(v2 * v2 + v128 * v128); v118 = v56; v57 = stru_5C6E00->Atan2( _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, @@ -3877,7 +3877,7 @@ v122 = abs(pParty->vPosition.x - v116); v126 = abs(pParty->vPosition.y - v117); v62 = abs(pParty->vPosition.z - v123); - if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 ) + if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) < 8 ) goto LABEL_344; if ( v114 && (!bJumping || v101) ) { @@ -15230,7 +15230,7 @@ else if (v16 == 24) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evtf - 1].pTopic;//(&dword_721660)[8 * v23]; + auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; if (!topic) { v14->pButtonName[0] = 0; @@ -15244,7 +15244,7 @@ else if (v16 == 19) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->bDrawSomeAnim - 1].pTopic;//(&dword_721660)[8 * v23]; + auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; if (!topic) { v14->pButtonName[0] = 0; @@ -15255,7 +15255,7 @@ else if (v16 == 20) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->_anim_current_time - 1].pTopic;//(&dword_721660)[8 * v23]; + auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; if (!topic) { v14->pButtonName[0] = 0; @@ -15266,7 +15266,7 @@ else if (v16 == 21) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->_anim_end_time - 1].pTopic;//(&dword_721660)[8 * v23]; + auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; if (!topic) { v14->pButtonName[0] = 0; @@ -15277,7 +15277,7 @@ else if (v16 == 22) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evtd - 1].pTopic;//(&dword_721660)[8 * v23]; + auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; if (!topic) { v14->pButtonName[0] = 0; @@ -15288,7 +15288,7 @@ else if (v16 == 23) { __debugbreak(); // learn conditions of this event - auto topic = pNPCTopics[pNPC->evte - 1].pTopic;//(&dword_721660)[8 * v23]; + auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; if (!topic) { v14->pButtonName[0] = 0; @@ -15477,12 +15477,12 @@ } return &pNPCStats->pNewNPCData[v1];// - 1]; } - return &pNPCStats->array_13EF4[npcid - 5000]; + return &pNPCStats->pAdditionalNPC[npcid - 5000]; } if ( npcid >= 5000 ) - return &pNPCStats->array_13EF4[npcid - 5000]; + return &pNPCStats->pAdditionalNPC[npcid - 5000]; if (uDialogue_SpeakingActorNPC_ID >= 0) { result = 0; @@ -15558,7 +15558,7 @@ } LABEL_7: *(int *)a2 = npcid - 5000; - return &pNPCStats->array_13EF4[npcid - 5000]; + return &pNPCStats->pAdditionalNPC[npcid - 5000]; } if ( npcid >= 5000 ) goto LABEL_7; @@ -16314,31 +16314,31 @@ if ( v37 ) { if ( v37 == 1 ) - v33->evtf = v30; + v33->evt_F = v30; } else { - v33->evte = v30; + v33->evt_E = v30; } } else { - v33->evtd = v30; + v33->evt_D = v30; } } else { - v33->_anim_end_time = v30; + v33->evt_C = v30; } } else { - v33->_anim_current_time = v30; + v33->evt_B = v30; } } else { - v33->bDrawSomeAnim = v30; + v33->evt_A = v30; } if ( v29 == 8 ) { @@ -16448,7 +16448,7 @@ //v7 = ""; break; case EVENT_MoveNPC: - pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].house = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); + pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].Location2D = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8); if ( ptr_507BC0 ) { v46 = ptr_507BC0->ptr_1C; @@ -18187,7 +18187,7 @@ a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); a1.field_60_distance_related_prolly_lod = v55; a1.uSpriteFrameID = 0; - a1.field_58 = 8002; + a1.field_58_pid = 8000 | OBJECT_Item; a1.field_5C = 4; a1.uSoundID = 0; for ( i = a7c / -2; i <= a7c / 2; i += a8b ) @@ -18228,7 +18228,7 @@ a1.field_60_distance_related_prolly_lod = v55; v20 = yaw; a1.uSpriteFrameID = 0; - a1.field_58 = 8002; + a1.field_58_pid = 8000 | OBJECT_Item; a1.field_5C = 0; a1.uFacing = yaw; a1.uSoundID = 0; @@ -18282,7 +18282,7 @@ a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); a1.field_60_distance_related_prolly_lod = v55; a1.uSpriteFrameID = 0; - a1.field_58 = 8002; + a1.field_58_pid = 8000 | OBJECT_Item; a1.field_5C = 4; a1.uSoundID = 0; for ( j = a7d / -2; j <= a7d / 2; j += a8c ) @@ -18438,7 +18438,7 @@ a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); a1.field_60_distance_related_prolly_lod = v55; a1.uSpriteFrameID = 0; - a1.field_58 = 8002; + a1.field_58_pid = 8000 | OBJECT_Item; a1.field_5C = 4; a1.uSoundID = 0; v51 = 0;
--- a/mm7_4.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_4.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -1117,7 +1117,7 @@ } else { - v13 = v12 - sub_452A9E(v17 * v17 - v11 * v11); + v13 = v12 - integer_sqrt(v17 * v17 - v11 * v11); if ( v13 < 0 ) v13 = 0; if ( v13 < stru_721530.field_7C ) @@ -1200,7 +1200,7 @@ { if ( v11 <= v18 + v10 ) { - v12 = v9 - sub_452A9E(v8 * v8 - v17 * v17); + v12 = v9 - integer_sqrt(v8 * v8 - v17 * v17); if ( v12 < 0 ) v12 = 0; if ( v12 < stru_721530.field_7C ) @@ -1309,7 +1309,7 @@ { if ( v16 <= v22 + v15 ) { - v17 = v14 - sub_452A9E(v13 * v13 - v21 * v21); + v17 = v14 - integer_sqrt(v13 * v13 - v21 * v21); if ( v17 < 0 ) v17 = 0; if ( v17 < stru_721530.field_7C ) @@ -3089,9 +3089,9 @@ v9 = v23; pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0)); v10 = (unsigned __int8)pTmpBuf[i]; - if ( pParty->pHirelings[v10].bDrawSomeAnim == 1 ) - { - uFrameID = pParty->pHirelings[v10]._anim_current_time; + if ( pParty->pHirelings[v10].evt_A == 1 ) + { + uFrameID = pParty->pHirelings[v10].evt_B; v11 = pHiredNPCsIconsOffsetsX[v9]; v12 = pHiredNPCsIconsOffsetsY[v9]; v17 = v11; @@ -3489,11 +3489,11 @@ a1.uObjectDescID = v10; a1.field_60_distance_related_prolly_lod = 0; v12 = 8 * pParty->pPartyBuffs[10].uCaster; - LOBYTE(v12) = v12 | 4; + LOBYTE(v12) = v12 | OBJECT_Player; a1.uAttributes = 0; a1.uSectorID = 0; a1.uSpriteFrameID = 0; - a1.field_58 = v12; + a1.field_58_pid = v12; a1.uFacing = 0; a1.uSoundID = 0; v13 = sub_46A89E((int)v41, 100, 307); @@ -8716,7 +8716,7 @@ } v64 = v62 * v62 + v60; if ( v64 ) - stru_F8AD28.field_34 = sub_452A9E(v64) << 16; + stru_F8AD28.field_34 = integer_sqrt(v64) << 16; else stru_F8AD28.field_34 = 0; v68 = (BLVFaceExtra *)abs(stru_F8AD28.rotated_normal.y); @@ -9416,13 +9416,13 @@ { if ( a1 == 23 ) { - v3 = v2->evte; + v3 = v2->evt_E; } else { if ( a1 == 13 ) { - ptr_F8B1E8 = (char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); + ptr_F8B1E8 = pNPCStats->pProfessions[v2->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); ptr_F8B1E8 = BuilDialogueString((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); sub_4B40E6(); dialogue_show_profession_details = false; @@ -9431,18 +9431,18 @@ switch ( a1 ) { case 19: - v3 = v2->bDrawSomeAnim; + v3 = v2->evt_A; break; case 20: - v3 = v2->_anim_current_time; + v3 = v2->evt_B; break; case 21: - v3 = v2->_anim_end_time; + v3 = v2->evt_C; break; default: if ( a1 != 22 ) goto _return; - v3 = v2->evtd; + v3 = v2->evt_D; break; } } @@ -9450,7 +9450,7 @@ } if ( a1 == 24 ) { - v3 = v2->evtf; + v3 = v2->evt_F; LABEL_84: if ( v3 < 200 || v3 > 310 ) { @@ -9553,36 +9553,36 @@ switch ( dword_F8B1D8 ) { case 19: - v10 = v2->bDrawSomeAnim; + v10 = v2->evt_A; if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 ) - v2->bDrawSomeAnim = 0; + v2->evt_A = 0; break; case 20: - v9 = v2->_anim_current_time; + v9 = v2->evt_B; if ( v9 >= 400 && v9 <= 416 ) - v2->_anim_current_time = 0; + v2->evt_B = 0; break; case 21: - v8 = v2->_anim_end_time; + v8 = v2->evt_C; if ( v8 >= 400 && v8 <= 416 ) - v2->_anim_end_time = 0; + v2->evt_C = 0; break; case 22: - v7 = v2->evtd; + v7 = v2->evt_D; if ( v7 >= 400 && v7 <= 416 ) - v2->evtd = 0; + v2->evt_D = 0; break; case 23: - v6 = v2->evte; + v6 = v2->evt_E; if ( v6 >= 400 && v6 <= 416 ) - v2->evte = 0; + v2->evt_E = 0; break; case 24: - v5 = v2->evtf; + v5 = v2->evt_F; if ( v5 >= 400 ) { if ( v5 <= 416 ) - v2->evtf = 0; + v2->evt_F = 0; } break; } @@ -10228,7 +10228,7 @@ { if ( v17 == 24 ) { - v23 = v58->evtf; + v23 = v58->evt_F; LABEL_33: v15 = (char *)pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; if ( !v15 ) @@ -10244,13 +10244,13 @@ v19 = v18 - 6; if ( !v19 ) { - v23 = v58->bDrawSomeAnim; + v23 = v58->evt_A; goto LABEL_33; } v20 = v19 - 1; if ( !v20 ) { - v15 = (char *)pNPCTopics[v58->_anim_current_time-1].pTopic;//(&dword_721660)[8 * v58->evtb]; + v15 = (char *)pNPCTopics[v58->evt_B-1].pTopic;//(&dword_721660)[8 * v58->evtb]; if ( !v15 ) { v16->uControlParam = 0; @@ -10266,18 +10266,18 @@ v21 = v20 - 1; if ( !v21 ) { - v23 = v58->_anim_end_time; + v23 = v58->evt_C; goto LABEL_33; } v22 = v21 - 1; if ( !v22 ) { - v23 = v58->evtd; + v23 = v58->evt_D; goto LABEL_33; } if ( v22 == 1 ) { - v23 = v58->evte; + v23 = v58->evt_E; goto LABEL_33; } LABEL_41: @@ -11052,7 +11052,7 @@ pDialogueWindow->eWindowType = WINDOW_MainMenu; pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 1, 0); - if ( *(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) + if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) { pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, 136, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); v1 = 1; @@ -11163,7 +11163,7 @@ (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); - if ( *(&pNPCStats->field_13A5C + 5 * v1->uProfession) ) + if ( pNPCStats->pProfessions[v1->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v1->uProfession) ) { pDialogueWindow->CreateButton( 0x1E0u, @@ -11303,7 +11303,7 @@ v1 = 1; pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0xAFu, 0xDu, 0, "", 0); } - v5 = (void *)v17->bDrawSomeAnim; + v5 = (void *)v17->evt_A; if ( v5 ) { if ( v1 < 4 ) @@ -11324,7 +11324,7 @@ 0); } } - v7 = (void *)v17->_anim_current_time; + v7 = (void *)v17->evt_B; if ( v7 ) { if ( v1 < 4 ) @@ -11345,7 +11345,7 @@ 0); } } - v9 = (void *)v17->_anim_end_time; + v9 = (void *)v17->evt_C; if ( v9 ) { if ( v1 < 4 ) @@ -11366,7 +11366,7 @@ 0); } } - v11 = (void *)v17->evtd; + v11 = (void *)v17->evt_D; if ( v11 ) { if ( v1 < 4 ) @@ -11387,7 +11387,7 @@ 0); } } - v13 = (void *)v17->evte; + v13 = (void *)v17->evt_E; if ( v13 ) { if ( v1 < 4 ) @@ -11408,7 +11408,7 @@ 0); } } - v15 = (void *)v17->evtf; + v15 = (void *)v17->evt_F; if ( v15 ) { if ( v1 < 4 ) @@ -12567,12 +12567,12 @@ { if ( newDialogueType == DIALOGUE_23 ) { - v4 = v2->evte; + v4 = v2->evt_E; goto LABEL_74; } if (newDialogueType == DIALOGUE_24) { - v4 = v2->evtf; + v4 = v2->evt_F; goto LABEL_74; } if (newDialogueType != DIALOGUE_76) @@ -12691,7 +12691,7 @@ } if (newDialogueType == DIALOGUE_22) { - v4 = v2->evtd; + v4 = v2->evt_D; goto LABEL_74; } if (newDialogueType == DIALOGUE_9) @@ -12739,17 +12739,17 @@ } if (newDialogueType == DIALOGUE_19) { - v4 = v2->bDrawSomeAnim; + v4 = v2->evt_A; goto LABEL_74; } if (newDialogueType == DIALOGUE_20) { - v4 = v2->_anim_current_time; + v4 = v2->evt_B; goto LABEL_74; } if (newDialogueType == DIALOGUE_21) { - v4 = v2->_anim_end_time; + v4 = v2->evt_C; LABEL_74: if ( v4 < 200 || v4 > 310 ) {
--- a/mm7_5.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_5.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -1,3 +1,5 @@ +#include <assert.h> + #include "mm7.h" #include "MapInfo.h" @@ -2263,8 +2265,8 @@ _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags; _5B65AC_npcdata_fame_or_other = pNPCData4->fame; _5B65B0_npcdata_rep_or_other = pNPCData4->rep; - _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->house); - _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->house); + _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->Location2D); + _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->Location2D); dword_5B65C0 = v0; } else @@ -2273,8 +2275,8 @@ pParty->vPosition.y = pNPCData4->fame; pParty->vPosition.z = pNPCData4->rep; pParty->uFallStartY = pParty->vPosition.z; - pParty->sRotationY = LOWORD(pNPCData4->house); - pParty->sRotationX = HIWORD(pNPCData4->house); + pParty->sRotationY = LOWORD(pNPCData4->Location2D); + pParty->sRotationX = HIWORD(pNPCData4->Location2D); } if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) { @@ -2303,8 +2305,8 @@ pNPCData2->uFlags = pParty->vPosition.x; pNPCData2->fame = pParty->vPosition.y; pNPCData2->rep = pParty->vPosition.z; - LOWORD(pNPCData2->house) = LOWORD(pParty->sRotationY); - HIWORD(pNPCData2->house) = LOWORD(pParty->sRotationX); + LOWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationY); + HIWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationX); if ( (signed int)pGames_LOD->uNumSubIndices / 2 <= 0 ) continue; uAction = 0; @@ -4981,7 +4983,7 @@ { v4 = &pLayingItems[v3]; v36 = v4; - v5 = v4->field_58; + v5 = v4->field_58_pid; v2 = v5 & 7; v3 = v5 >> 3; } @@ -5110,14 +5112,14 @@ v35->z = v44; switch ( v41 ) { - case 4: + case OBJECT_Player: DamageMonsterFromParty(*((short *)v1 - 300), uActorID, v35); break; - case 3: + case OBJECT_Actor: if ( v36 && pActors[v37].GetActorsRelation(v28) ) sub_43B1B0(*((short *)v1 - 300), uActorID, pVelocity, v36->field_61); break; - case 2: + case OBJECT_Item: sub_43B057(*((short *)v1 - 300), uActorID, v35); break; } @@ -5144,11 +5146,11 @@ //----- (00439474) -------------------------------------------------------- void DamageMonsterFromParty(signed int a1, unsigned int uActorID_Monster, Vec3_int_ *pVelocity) { - signed int v3; // eax@1 + //signed int v3; // eax@1 LayingItem *v4; // ebx@1 - int v5; // edx@3 - bool uPlayerID; // eax@3 - Player *pPlayer; // edi@4 + //int v5; // edx@3 + //bool uPlayerID; // eax@3 + //Player *pPlayer; // edi@4 Actor *pMonster; // esi@7 LayingItem *v9; // ebx@12 int v10; // eax@12 @@ -5168,8 +5170,8 @@ unsigned __int8 v24; // sf@44 int v25; // edx@51 int v26; // ecx@51 - signed int v27; // eax@51 - int v28; // eax@53 + //signed int v27; // eax@51 + //int v28; // eax@53 signed int v29; // eax@76 signed int v30; // eax@84 signed int v31; // eax@92 @@ -5192,14 +5194,14 @@ char *pPlayerName; // [sp+18h] [bp-54h]@12 char *pMonsterName; // [sp+1Ch] [bp-50h]@6 int v50; // [sp+20h] [bp-4Ch]@6 - unsigned __int64 *v51; // [sp+30h] [bp-3Ch]@6 + //unsigned __int64 *v51; // [sp+30h] [bp-3Ch]@6 int v52; // [sp+34h] [bp-38h]@12 - int v53; // [sp+38h] [bp-34h]@10 - int v54; // [sp+3Ch] [bp-30h]@1 - int v55; // [sp+40h] [bp-2Ch]@12 + //int v53; // [sp+38h] [bp-34h]@10 + //int v54; // [sp+3Ch] [bp-30h]@1 + //int v55; // [sp+40h] [bp-2Ch]@12 signed int a4; // [sp+44h] [bp-28h]@1 PlayerEquipment *v57; // [sp+48h] [bp-24h]@10 - int v58; // [sp+4Ch] [bp-20h]@10 + //int v58; // [sp+4Ch] [bp-20h]@10 int v59; // [sp+50h] [bp-1Ch]@1 unsigned int uActorID_Monster_; // [sp+54h] [bp-18h]@1 int v61; // [sp+58h] [bp-14h]@1 @@ -5208,10 +5210,10 @@ int a2; // [sp+64h] [bp-8h]@27 int a3; // [sp+6Bh] [bp-1h]@6 - v3 = a1; + //v3 = a1; v4 = 0; uActorID_Monster_ = uActorID_Monster; - v54 = a1; + //v54 = a1; uDamageAmount = 0; a4 = 0; v61 = 0; @@ -5220,94 +5222,96 @@ if ( (a1 & 7) == OBJECT_Item) { v4 = &pLayingItems[a1 >> 3]; - uDamageAmount = (int)v4; + //uDamageAmount = (int)v4; v61 = v4->field_60_distance_related_prolly_lod; - v3 = v4->field_58; - v54 = v4->field_58; - } - v5 = v3 & 7; - uPlayerID = v3 >> 3; - if (v5 != OBJECT_Player) + a1 = v4->field_58_pid; + //v54 = v4->field_58_pid; + } + //v5 = a1 & 7; + //uPlayerID = a1 >> 3; + if ((a1 & 7) != OBJECT_Player) return; - pPlayer = &pParty->pPlayers[uPlayerID]; - if ( uPlayerID < 0 && uPlayerID > 3 ) - { - MessageBoxW(nullptr, L"Invalid player in damageMonsterFromParty!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Damage.cpp:457", 0); - } + + assert(abs(a1 >> 3) < 4); + auto player = &pParty->pPlayers[a1 >> 3]; pMonster = &pActors[uActorID_Monster_]; - uPlayerID = pMonster->IsAlive(); - if ( uPlayerID ) + //uPlayerID = pMonster->IsAlive(); + if (pMonster->IsNotAlive()) return; + BYTE1(pMonster->uAttributes) |= 0xC0u; if ( pMonster->uAIState == Fleeing ) pMonster->uAttributes |= 0x20000u; - v58 = 0; - v53 = 0; - v57 = 0; + //v57 = 0; + //v53 = 0; + //v58 = 0; + bool hit_will_stun = false, + hit_will_paralyze = false; if ( !v4 ) { - v51 = (unsigned __int64 *)pPlayer->pEquipment.uMainHand; + //v51 = (unsigned __int64 *)player->pEquipment.uMainHand; + int main_hand_idx = player->pEquipment.uMainHand; v59 = 1; - if ( pPlayer->HasItemEquipped(EQUIP_TWO_HANDED) ) - { - v55 = pItemsTable->pItems[*(int *)&pPlayer->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)v51 + 5]].uSkillType; - v28 = SkillToMastery(pPlayer->pActiveSkills[v55]); - uDamageAmount = v28; - if ( v55 ) - { - if ( v55 == 6 ) - { - if ( v28 >= 3 ) - { - LOBYTE(v51) = pPlayer->GetActualSkillLevel(PLAYER_SKILL_MACE) & 0x3F; - v51 = (unsigned __int64 *)(unsigned __int8)v51; - if ( rand() % 100 < (unsigned __int8)v51 ) - v58 = 1; - } - if ( uDamageAmount >= 4 ) - { - LOBYTE(v51) = pPlayer->GetActualSkillLevel(PLAYER_SKILL_MACE) & 0x3F; - v51 = (unsigned __int64 *)(unsigned __int8)v51; - if ( rand() % 100 < (unsigned __int8)v51 ) - v53 = 1; - } - } - } - else - { - if ( uDamageAmount >= 3 ) - { - LOBYTE(v51) = pPlayer->GetActualSkillLevel((PLAYER_SKILL_TYPE)0) & 0x3F; - v51 = (unsigned __int64 *)(unsigned __int8)v51; - if ( rand() % 100 < (unsigned __int8)v51 ) - v58 = 1; - } + if ( player->HasItemEquipped(EQUIP_TWO_HANDED) ) + { + auto main_hand_skill = pItemsTable->pItems[player->pInventoryItems[main_hand_idx - 1].uItemID].uSkillType; + //v55 = pItemsTable->pItems[player->pInventoryItems[main_hand_idx - 1].uItemID].uSkillType; + //v28 = SkillToMastery(player->pActiveSkills[v55]); + auto main_hand_mastery = SkillToMastery(player->pActiveSkills[main_hand_skill]); + //uDamageAmount = v28; + switch (main_hand_skill) + { + case PLAYER_SKILL_STAFF: + if (main_hand_mastery >= 3) + { + if (rand() % 100 < player->GetActualSkillLevel(PLAYER_SKILL_STAFF) & 0x3F) // stun chance when mastery >= 3 + hit_will_stun = true; + } + break; + + case PLAYER_SKILL_MACE: + if (main_hand_mastery >= 3) + { + if (rand() % 100 < player->GetActualSkillLevel(PLAYER_SKILL_MACE) & 0x3F) + hit_will_stun = true; + } + if (main_hand_mastery >= 4) + { + if (rand() % 100 < player->GetActualSkillLevel(PLAYER_SKILL_MACE) & 0x3F) + hit_will_paralyze = true; + } + break; } } v50 = pMonster->pMonsterInfo.uID; a2 = 4; - v27 = pPlayer->CalculateMeleeDamageTo(0, 0, v50); - goto LABEL_65; - } + //v27 = player->CalculateMeleeDamageTo(0, 0, v50); + uDamageAmount = player->CalculateMeleeDamageTo(0, 0, v50); + //if ( !v57 ) + goto LABEL_67; + //goto LABEL_69; + } + + v19 = v4->field_48 == 99; v61 = v4->field_60_distance_related_prolly_lod; if ( !v19 ) { v9 = (LayingItem *)uDamageAmount; v50 = pParty->vPosition.x - *(int *)(uDamageAmount + 4); - v55 = abs(v50); + //v55 = abs(v50); pMonsterName = (char *)(pParty->vPosition.y - v9->vPosition.y); - v51 = (unsigned __int64 *)abs((int)pMonsterName); + //v51 = (unsigned __int64 *)abs((int)pMonsterName); pPlayerName = (char *)(pParty->vPosition.z - v9->vPosition.z); v52 = abs((int)pPlayerName); - v61 = v55; - v10 = v55; - v11 = (int)v51; + v61 = abs(v50); + v10 = abs(v50); + v11 = (int)abs((int)pMonsterName); v12 = v52; - if ( v55 < (signed int)v51 ) - { - v10 = (int)v51; - v11 = v55; + if ( v10 < v11) + { + v10 = (int)v11; + v11 = v10; } if ( v10 < v52 ) { @@ -5321,9 +5325,9 @@ v12 = v11; v11 = v14; } - uPlayerID = ((unsigned int)(11 * v11) >> 5) + (v12 >> 2) + v10; - v61 = uPlayerID; - if ( uPlayerID >= 2560 ) + //uPlayerID = ((unsigned int)(11 * v11) >> 5) + (v12 >> 2) + v10; + v61 = ((unsigned int)(11 * v11) >> 5) + (v12 >> 2) + v10; + if ( v61 >= 2560 ) { if ( v61 >= 5120 && !(BYTE1(pMonster->uAttributes) & 4) ) return; @@ -5335,15 +5339,16 @@ } v4 = (LayingItem *)uDamageAmount; } + v15 = v4->field_48; if ( v15 == 102 ) { - v16 = pPlayer->pActiveSkills[7]; + v16 = player->pActiveSkills[7]; v61 = 1; if ( (signed int)SkillToMastery(v16) >= 3 ) - a4 = pPlayer->pActiveSkills[7] & 0x3F; + a4 = player->pActiveSkills[7] & 0x3F; a2 = 4; - uDamageAmount = pPlayer->CalculateMeleeDamageTo(1, 1, 0); + uDamageAmount = player->CalculateMeleeDamageTo(1, 1, 0); goto LABEL_67; } if ( v15 != 100 ) @@ -5351,7 +5356,7 @@ if ( v15 == 101 ) { a2 = 0; - v18 = pPlayer->CalculateRangedDamageTo(0); + v18 = player->CalculateRangedDamageTo(0); v19 = HIDWORD(pMonster->pActorBuffs[15].uExpireTime) == 0; v20 = SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) < 0; uDamageAmount = v18; @@ -5363,7 +5368,7 @@ if ( v15 == 39 ) { a4 = 5 * v4->field_4C; - a2 = pPlayer->GetSpellSchool(0x27u); + a2 = player->GetSpellSchool(0x27u); v21 = v4->field_4C; v50 = pMonster->sCurrentHP; pMonsterName = (char *)v4->field_50; @@ -5375,10 +5380,10 @@ uDamageAmount >>= 1; v59 = 0; LABEL_67: - if ( !stru_50C198.PlayerHitOrMiss(pPlayer, pMonster, v61, a4) ) - { -LABEL_68: - pPlayer->PlaySound(SPEECH_52, 0); + if ( !stru_50C198.PlayerHitOrMiss(player, pMonster, v61, a4) ) + { +//LABEL_68: + player->PlaySound(SPEECH_52, 0); return; } goto LABEL_69; @@ -5387,27 +5392,30 @@ { uDamageAmount = 0; a2 = 4; - v58 = 1; + hit_will_stun = 1; goto LABEL_67; } v50 = v4->field_48; - a2 = pPlayer->GetSpellSchool(v50); + a2 = player->GetSpellSchool(v50); v25 = v4->field_4C; v26 = v4->field_48; v50 = pMonster->sCurrentHP; pMonsterName = (char *)v4->field_50; - v27 = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50); + //v27 = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50); v59 = 0; - v57 = (PlayerEquipment *)1; -LABEL_65: - uDamageAmount = v27; - goto LABEL_66; + //v57 = (PlayerEquipment *)1; +//LABEL_65: + uDamageAmount = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50); + //if ( !v57 ) + // goto LABEL_67; + goto LABEL_69; } v50 = pMonster->word_000086_some_monster_id; a2 = 4; - v17 = pPlayer->CalculateRangedDamageTo(v50); + v17 = player->CalculateRangedDamageTo(v50); v19 = v4->stru_24.uItemID == 0; uDamageAmount = v17; + v57 = 0; if ( !v19 && v4->stru_24.uAdditionalValue == 3 ) { a2 = 0; @@ -5417,18 +5425,18 @@ && (SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) > 0 || LODWORD(pMonster->pActorBuffs[15].uExpireTime)) ) uDamageAmount >>= 1; v59 = 1; -LABEL_66: +//LABEL_66: if ( !v57 ) goto LABEL_67; LABEL_69: - if ( pPlayer->pConditions[1] ) - uDamageAmount >>= 1; + if (player->Weak()) + uDamageAmount /= 1; if ( (signed __int64)pMonster->pActorBuffs[5].uExpireTime > 0 ) uDamageAmount = 0; v61 = stru_50C198.CalcMagicalDamageToActor(pMonster, a2, uDamageAmount); - if ( !v4 && pPlayer->IsUnarmed() && (signed __int64)pPlayer->pPlayerBuffs[6].uExpireTime > 0 ) - { - v50 = pPlayer->pPlayerBuffs[6].uPower; + if ( !v4 && player->IsUnarmed() && (signed __int64)player->pPlayerBuffs[6].uExpireTime > 0 ) + { + v50 = player->pPlayerBuffs[6].uPower; v29 = stru_50C198.CalcMagicalDamageToActor(pMonster, 8, v50); v61 += v29; } @@ -5440,9 +5448,9 @@ a4 = v4->stru_24._439DF3_get_additional_damage(&a2, &v62); if ( v62 && pMonster->sCurrentHP > 0 ) { - pPlayer->sHealth += v61 / 5; - if ( pPlayer->sHealth > pPlayer->GetMaxHealth() ) - pPlayer->sHealth = pPlayer->GetMaxHealth(); + player->sHealth += v61 / 5; + if ( player->sHealth > player->GetMaxHealth() ) + player->sHealth = player->GetMaxHealth(); v62 = 0; } v30 = stru_50C198.CalcMagicalDamageToActor(pMonster, a2, a4); @@ -5451,18 +5459,18 @@ else { v59 = 0; - v57 = &pPlayer->pEquipment; + v57 = &player->pEquipment; do { - if ( pPlayer->HasItemEquipped((ITEM_EQUIP_TYPE)v59) ) - { - auto _s = (ItemGen *)&pPlayer->pInventoryItems[v57->uOffHand-1]; + if ( player->HasItemEquipped((ITEM_EQUIP_TYPE)v59) ) + { + auto _s = (ItemGen *)&player->pInventoryItems[v57->uOffHand-1]; a4 = _s->_439DF3_get_additional_damage(&a2, &v62); if ( v62 && pMonster->sCurrentHP > 0 ) { - pPlayer->sHealth += v61 / 5; - if ( pPlayer->sHealth > pPlayer->GetMaxHealth() ) - pPlayer->sHealth = pPlayer->GetMaxHealth(); + player->sHealth += v61 / 5; + if ( player->sHealth > player->GetMaxHealth() ) + player->sHealth = player->GetMaxHealth(); v62 = 0; } v31 = stru_50C198.CalcMagicalDamageToActor(pMonster, a2, a4); @@ -5476,22 +5484,25 @@ } v32 = uDamageAmount; pMonster->sCurrentHP -= uDamageAmount; - if ( !v32 && !v58 ) - goto LABEL_68; + if ( !v32 && !hit_will_stun ) + { + player->PlaySound(SPEECH_52, 0); + return; + } if ( pMonster->sCurrentHP > 0 ) { - Actor::_4030AD(uActorID_Monster_, v54, 0); + Actor::_4030AD(uActorID_Monster_, a1, 0); Actor::_43AC45(uActorID_Monster_, 1); if ( bShowDamage ) { v50 = uDamageAmount; pMonsterName = (char *)pMonster; - pPlayerName = pPlayer->pName; + pPlayerName = player->pName; if ( v4 ) v47 = pGlobalTXT_LocalizationStrings[189];// "%s shoots %s for %lu points" else v47 = pGlobalTXT_LocalizationStrings[164];// "%s hits %s for %lu damage" - sprintf(pTmpBuf, v47, pPlayerName, pMonsterName, v50); + sprintfex(pTmpBuf, v47, pPlayerName, pMonsterName, v50); ShowStatusBarString(pTmpBuf, 2u); } v41 = 0; @@ -5501,7 +5512,7 @@ if ( pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].bQuestMonster & 1 ) { v33 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * pMonster->uActorRadius : pMonster->uActorRadius; - v55 = v33; + //v55 = v33; if ( pRenderer->pRenderD3D ) { if ( pGame->uFlags2 & 0x20 ) @@ -5509,18 +5520,18 @@ v50 = 0; pMonsterName = 0; v34 = pMonster->vPosition.z; - *(float *)&pPlayerName = (double)v55; - v51 = (unsigned __int64 *)v34; + *(float *)&pPlayerName = (double)v33; + //v51 = (unsigned __int64 *)v34; *(float *)&v47 = 0.0; v35 = pMonster->vPosition.y; *((float *)&v46 + 1) = 0.0; *(float *)&v46 = 1.0; - v36 = (double)(signed int)v51; - v51 = (unsigned __int64 *)v35; + v36 = (double)(signed int)pMonster->vPosition.z; + //v51 = (unsigned __int64 *)v35; v37 = v36; - v51 = (unsigned __int64 *)pMonster->vPosition.x; + //v51 = (unsigned __int64 *)pMonster->vPosition.x; v38 = (double)v35; - v39 = (double)(signed int)v51; + v39 = (double)(signed int)pMonster->vPosition.x; pDecalBuilder->AddBloodsplat(v39, v38, v37, 1.0, 0.0, 0.0, *(float *)&pPlayerName, 0, 0); } } @@ -5533,14 +5544,14 @@ v40 = SPEECH_51; if ( rand() % 100 < 20 ) v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1; - pPlayer->PlaySound((PlayerSpeech)v40, 0); + player->PlaySound((PlayerSpeech)v40, 0); v41 = 0; if ( bShowDamage ) { v50 = (int)pMonster; pMonsterName = (char *)uDamageAmount; - pPlayerName = pPlayer->pName; // "%s inflicts %lu points killing %s" - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[175], pPlayer->pName, uDamageAmount, pMonster); + pPlayerName = player->pName; // "%s inflicts %lu points killing %s" + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[175], player->pName, uDamageAmount, pMonster); ShowStatusBarString(pTmpBuf, 2u); } } @@ -5548,10 +5559,10 @@ && (SHIDWORD(pMonster->pActorBuffs[20].uExpireTime) > (signed int)v41 || LODWORD(pMonster->pActorBuffs[20].uExpireTime) > v41) && uDamageAmount != v41 ) - pPlayer->ReceiveDamage(uDamageAmount, a2); + player->ReceiveDamage(uDamageAmount, a2); v50 = 24; v59 = 20 * v61 / (signed int)pMonster->pMonsterInfo.uHP; - if ( (pPlayer->_48EA46_calc_special_bonus_by_items(24) || v58 != v41) + if ( (player->_48EA46_calc_special_bonus_by_items(24) || hit_will_stun != v41) && stru_50C198.GetMagicalResistance(pMonster, 3u) ) { LODWORD(v42) = 20; @@ -5562,28 +5573,28 @@ if ( bShowDamage != v41 ) { v50 = (int)pMonster; - pMonsterName = pPlayer->pName; // "%s stuns %s" - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[635], pPlayer->pName, pMonster); + pMonsterName = player->pName; // "%s stuns %s" + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[635], player->pName, pMonster); ShowStatusBarString(pTmpBuf, 2u); } } - if ( v53 != v41 ) + if ( hit_will_paralyze != v41 ) { if ( pMonster->CanAct() ) { - if ( stru_50C198.GetMagicalResistance(pMonster, 3u) ) - { - LOBYTE(v43) = pPlayer->GetActualSkillLevel(PLAYER_SKILL_MACE); + if ( stru_50C198.GetMagicalResistance(pMonster, 3) ) + { + LOBYTE(v43) = player->GetActualSkillLevel(PLAYER_SKILL_MACE); v44 = v43; v45 = SkillToMastery(v43); - v51 = (unsigned __int64 *)(7680 * (v44 & 0x3F)); - v46 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v51 * 0.033333335); + //v51 = (unsigned __int64 *)(7680 * (v44 & 0x3F)); + v46 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(7680 * (v44 & 0x3F)) * 0.033333335); pMonster->pActorBuffs[6].Apply(v46, v45, 0, 0, 0); if ( bShowDamage ) { v50 = (int)pMonster; - pMonsterName = pPlayer->pName; // "%s paralyzes %s" - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[636], pPlayer->pName, pMonster); + pMonsterName = player->pName; // "%s paralyzes %s" + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[636], player->pName, pMonster); ShowStatusBarString(pTmpBuf, 2u); } } @@ -5883,10 +5894,10 @@ return; } v37 = &pLayingItems[uActorID]; - v38 = v37->field_58 & 7; - v39 = v37->field_58 >> 3; - v40 = v37->field_58 & 7; - uActorID = v37->field_58 >> 3; + v38 = v37->field_58_pid & 7; + v39 = v37->field_58_pid >> 3; + v40 = v37->field_58_pid & 7; + uActorID = v37->field_58_pid >> 3; v41 = v40 - 2; if ( !v41 ) goto LABEL_80; @@ -6072,7 +6083,7 @@ v43 = &pParty->pPlayers[a4]; LABEL_168: a4b = v43; - if ( v38 != 4 || v37->field_48 != 100 ) + if ( v38 != OBJECT_Player || v37->field_48 != 100 ) { v70 = v43->GetMaxHealth(); v68 = _43AFE3_calc_spell_damage(v37->field_48, v37->field_4C, v37->field_50, v70); @@ -6084,7 +6095,7 @@ v69 = 0; } a4b->ReceiveDamage(v68, v69); - if ( v38 == 4 && !qword_A750D8 ) + if ( v38 == OBJECT_Player && !qword_A750D8 ) { qword_A750D8 = 256i64; word_A750E0 = 44; @@ -6124,7 +6135,7 @@ v6 = uLayingItemID; v2 = uLayingItemID; v3 = a2 >> 3; - v4 = pLayingItems[uLayingItemID].field_58 & 7; + v4 = pLayingItems[uLayingItemID].field_58_pid & 7; v5 = (a2 & 7) - 3; if ( v5 ) { @@ -6196,7 +6207,7 @@ v3 = x; v4 = y; - v5 = sub_452A9E(*y * *y + *z * *z + *x * *x); + v5 = integer_sqrt(*y * *y + *z * *z + *x * *x); *v3 *= 65536 / (v5 | 1); *v4 *= 65536 / (v5 | 1); *z *= 65536 / (v5 | 1); @@ -6296,7 +6307,7 @@ uActorIDa = uActorID; pActor = &pActors[uActorID]; a2 = uObjID; - if ( !pActors[uActorID].IsAlive() ) + if ( !pActors[uActorID].IsNotAlive() ) { if ( (a2 & 7) == OBJECT_Item) { @@ -6361,14 +6372,14 @@ { v5 = &pLayingItems[a1 >> 3]; v4 = v5->field_60_distance_related_prolly_lod; - v17 = v5->field_58; + v17 = v5->field_58_pid; } LOWORD(v6) = v17 & 7; - if ( v6 == 3 ) + if ( v6 == OBJECT_Actor) { v7 = &pActors[a2]; v8 = &pActors[v17 >> 3]; - v6 = pActors[a2].IsAlive(); + v6 = pActors[a2].IsNotAlive(); if ( !v6 ) { v9 = v7->uAIState == 7; @@ -6455,7 +6466,6 @@ return v6; } - //----- (0043BCA7) -------------------------------------------------------- int __cdecl CharacterUI_LoadPaperdollTextures() { @@ -7292,8 +7302,8 @@ v230 = pPlayer->pEquipment.uBow; v22 = (int)&v217->pInventoryItems[v21-1]; v23 = *(int *)v22; - v24 = pPaperdoll_BodyX + array_4E4C30[pBodyComplection].equip_x - pItemsTable->pItems[v23].uEquipX; - a3b = pPaperdoll_BodyY + array_4E4C30[pBodyComplection].equip_y - pItemsTable->pItems[v23].uEquipY; + v24 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[v23].uEquipX; + a3b = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[v23].uEquipY; v241 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v23].pIconName, TEXTURE_16BIT_PALETTE); v25 = *(int *)(v22 + 20); if ( !(*(int *)(v22 + 20) & 0xF0) ) @@ -7350,9 +7360,9 @@ goto LABEL_93; LABEL_74: v34 = v33 + 10 * pBodyComplection; - v35 = paperdoll_array_511828[0][v34]; - a2c = pPaperdoll_BodyX + paperdoll_array_4E5570[0][v34][0];// TODO indexing - v36 = pPaperdoll_BodyY + paperdoll_array_4E5570[0][v34][1]; + v35 = paperdoll_array_511828[0][v34];//Texture_Cloak + a2c = pPaperdoll_BodyX + paperdoll_Cloak[0][v34][0]; + v36 = pPaperdoll_BodyY + paperdoll_Cloak[0][v34][1]; v37 = *(int *)(v32 + 20); a3c = v36; if ( !(v37 & 0xF0) ) @@ -7402,9 +7412,9 @@ goto LABEL_127; LABEL_106: v46 = 17 * pBodyComplection + v45; - a2d = pPaperdoll_BodyX + paperdoll_array_4E4E30[0][v46][0];// TODO indexing - v47 = pPaperdoll_BodyY + paperdoll_array_4E4E30[0][v46][1]; - v48 = paperdoll_array_511290[0][v46][0]; + a2d = pPaperdoll_BodyX + paperdoll_Armor[0][v46][0]; + v47 = pPaperdoll_BodyY + paperdoll_Armor[0][v46][1]; + v48 = paperdoll_array_511290[0][v46][0];//Texture_Armor v49 = *(int *)(v44 + 20); a3d = v47; if ( !(v49 & 0xF0) ) @@ -7442,16 +7452,16 @@ v58 = *(int *)v57; if ( *(int *)v57 == 529 ) { - a3e = pPaperdoll_BodyY + paredoll_array_4E54B8[pBodyComplection][1]; - a2e = pPaperdoll_BodyX + paredoll_array_4E54B8[pBodyComplection][0]; + a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][5][1]; + a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][5][0]; v59 = papredoll_flying_feet[v244]; } else { if ( v58 == 512 ) { - a3e = pPaperdoll_BodyY + paredoll_array_4E54B8[pBodyComplection][3]; - a2e = pPaperdoll_BodyX + paredoll_array_4E54B8[pBodyComplection][2]; + a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][6][1]; + a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][6][0]; v59 = dword_511638[pBodyComplection][5]; } else @@ -7466,8 +7476,8 @@ else { v61 = v60 + 7 * pBodyComplection; - a3e = pPaperdoll_BodyY + dword_4E5490[0][v61][1]; - a2e = pPaperdoll_BodyX + dword_4E5490[0][v61][0]; + a3e = pPaperdoll_BodyY + paperdoll_Boot[0][v61][1]; + a2e = pPaperdoll_BodyX + paperdoll_Boot[0][v61][0]; v59 = dword_511638[0][v60 + 6 * pBodyComplection]; } } @@ -7501,11 +7511,10 @@ v68 = v217; v69 = v217->pEquipment.uMainHand; uPlayerID_a = 2 * pBodyComplection; - if ( !v69 || (v70 = *(int *)&v217->pInventoryItems[v69-1], - pItemsTable->pItems[v70].uEquipType != 1) + if ( !v69 || (v70 = *(int *)&v217->pInventoryItems[v69-1], pItemsTable->pItems[v70].uEquipType != 1) && (pItemsTable->pItems[v70].uSkillType != 4 || v217->pEquipment.uOffHand) ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[2 * pBodyComplection], - pPaperdoll_BodyY + pPaperdoll_LeftHand[2 * pBodyComplection + 1], + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], + pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); v71 = v217->pEquipment.uBelt; if ( v71 ) @@ -7530,8 +7539,8 @@ { LABEL_168: v74 = 7 * pBodyComplection + v73; - a2f = pPaperdoll_BodyX + dword_4E57F0[0][v74][0]; - a3f = pPaperdoll_BodyY + dword_4E57F0[0][v74][1]; + a2f = pPaperdoll_BodyX + paperdoll_Belt[0][v74][0]; + a3f = pPaperdoll_BodyY + paperdoll_Belt[0][v74][1]; if ( IsDwarf != 1 || v73 == 5 ) v75 = stru_511718.texids[v74]; else @@ -7561,24 +7570,30 @@ } if ( !bRingsShownInCharScreen ) pRenderer->_4A612A(a2f, a3f, v81, v234); - goto LABEL_191; + v68 = v217; + goto LABEL_192; } if ( (*(int *)&v217->field_1F5[36 * v71 + 15] & 0xF0) != 16 ) { if ( (*(int *)&v217->field_1F5[36 * v71 + 15] & 0xF0) == 32 ) { v172 = "sp28a"; - goto LABEL_181; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + v68 = v217; + goto LABEL_192; } if ( (*(int *)&v217->field_1F5[36 * v71 + 15] & 0xF0) == 64 ) { v172 = "sp30a"; - goto LABEL_181; - } - if ( (*(int *)&v217->field_1F5[36 * v71 + 15] & 0xF0) == 128 ) - { - v172 = "sp91a"; -LABEL_181: v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -7588,15 +7603,40 @@ ptr_50C9A4 = 0; } v78 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), - v77, (signed __int64)v78, 0, 255); -LABEL_191: + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + v68 = v217; + goto LABEL_192; + } + if ( (*(int *)&v217->field_1F5[36 * v71 + 15] & 0xF0) == 128 ) + { + v172 = "sp91a"; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); v68 = v217; goto LABEL_192; } } v172 = "sptext01"; - goto LABEL_181; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + v68 = v217; + goto LABEL_192; } } LABEL_192: @@ -7606,8 +7646,8 @@ v83 = *(int *)&v68->pInventoryItems[v82-1]; if ( pItemsTable->pItems[v83].uEquipType == 1 || pItemsTable->pItems[v83].uSkillType == 4 && !v68->pEquipment.uOffHand ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[uPlayerID_a + 1], + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a], + pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1], (Texture *)(*(unsigned int *)((char *)papredoll_dlaus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlaus + v240)] : 0)); } v84 = v68->pEquipment.uBody; @@ -7674,9 +7714,8 @@ { v122 = papredoll_dbrds[v244]; if ( v122 != pIcons_LOD->FindTextureByName("Pending") ) - pRenderer->DrawTextureTransparent( - pPaperdoll_BodyX + dword_4E5AD0[2 * v244 - 24], - pPaperdoll_BodyY + dword_4E5AD4[2 * v244 - 24], + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_Beards[2 * v244 - 24], + pPaperdoll_BodyY + pPaperdoll_Beards[2 * v244 - 23], (Texture *)(v122 != -1 ? (int)&pIcons_LOD->pTextures[v122] : 0)); } v123 = v68->pEquipment.uHelm; @@ -7702,7 +7741,6 @@ if ( *(int *)v124 != 544 ) { v125 = *(int *)v124 - 89; -LABEL_310: if ( v125 < 0 || v125 >= 16 ) goto LABEL_335; goto LABEL_312; @@ -7727,17 +7765,22 @@ if ( (*(int *)(v124 + 20) & 0xF0) == 32 ) { v180 = "sp28a"; - goto LABEL_325; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; } if ( (*(int *)(v124 + 20) & 0xF0) == 64 ) { v180 = "sp30a"; - goto LABEL_325; - } - if ( (*(int *)(v124 + 20) & 0xF0) == 128 ) - { - v180 = "sp91a"; -LABEL_325: v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -7747,19 +7790,40 @@ ptr_50C9A4 = 0; } v130 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - a2j, - a3i, - (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), - v129, - (signed __int64)v130, - 0, - 255); + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; + } + if ( (*(int *)(v124 + 20) & 0xF0) == 128 ) + { + v180 = "sp91a"; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); goto LABEL_335; } } v180 = "sptext01"; - goto LABEL_325; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; } v131 = v127 + 1; v132 = (char *)&pIcons_LOD->pTextures[v127]; @@ -7792,12 +7856,8 @@ v227 = v135; v136 = *(int *)v135; v137 = *(int *)v135; - a2k = pPaperdoll_BodyX - + array_4E4C30[pBodyComplection].field_8 - - pItemsTable->pItems[v137].uEquipX; - a3j = pPaperdoll_BodyY - + array_4E4C30[pBodyComplection].field_C - - pItemsTable->pItems[v137].uEquipY; + a2k = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v137].uEquipX; + a3j = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v137].uEquipY; if ( v136 == 64 ) v181 = "item64v1"; else @@ -7841,13 +7901,8 @@ if ( v149 != 2 && v149 != 1 ) { v245 = 0; -LABEL_362: - v150 = pPaperdoll_BodyX - + array_4E4C30[pBodyComplection].field_0 - - pItemsTable->pItems[v148].uEquipX; - a3k = pPaperdoll_BodyY - + LODWORD(array_4E4C30[pBodyComplection].field_4) - - pItemsTable->pItems[v148].uEquipY; + v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX; + a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY; goto LABEL_370; } v151 = v147 - 400; @@ -7858,7 +7913,11 @@ if ( v152 ) { if ( v152 != 12 ) - goto LABEL_362; + { + v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX; + a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY; + goto LABEL_370; + } v150 = 595; a3k = 33; LABEL_370: @@ -7880,23 +7939,22 @@ if ( v29 ) { v159 = (Texture *)(v243 != -1 ? (int)v160 : 0); - pRenderer->DrawTransparentGreenShade( - v150, - a3k, - (Texture *)(v243 != -1 ? (int)v160 : 0)); + pRenderer->DrawTransparentGreenShade(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0)); } else { v159 = (Texture *)(v243 != -1 ? (int)v160 : 0); - pRenderer->DrawTextureTransparent( - v150, - a3k, - (Texture *)(v243 != -1 ? (int)v160 : 0)); + pRenderer->DrawTextureTransparent(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0)); } } if ( !bRingsShownInCharScreen ) pRenderer->_4A612A(v150, a3k, v159, v249); - goto LABEL_391; + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; } if ( (*(int *)(v228 + 20) & 0xF0) != 16 ) { @@ -7912,10 +7970,7 @@ if ( (*(int *)(v228 + 20) & 0xF0) == 128 ) { v183 = "sp91a"; -LABEL_381: - v157 = &pIcons_LOD->pTextures[v156->LoadTexture( - v183, - TEXTURE_16BIT_PALETTE)]; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) { @@ -7924,34 +7979,74 @@ ptr_50C9A4 = 0; } v158 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - v150, - a3k, - (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), - v157, - (signed __int64)v158, - 0, - 255); -LABEL_391: + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); if ( v245 ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX - + pPaperdollLeftEmptyHand[uPlayerID_a], + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); goto LABEL_393; } -LABEL_380: v183 = "sptext01"; - goto LABEL_381; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; } v183 = "sp30a"; } v156 = pIcons_LOD; - goto LABEL_381; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; } v156 = pIcons_LOD; - goto LABEL_380; + v183 = "sptext01"; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; } a3k = 28; } @@ -7967,17 +8062,38 @@ if ( (*(int *)(v227 + 20) & 0xF0) == 32 ) { v182 = "sp28a"; - goto LABEL_348; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; } if ( (*(int *)(v227 + 20) & 0xF0) == 64 ) { v182 = "sp30a"; - goto LABEL_348; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; } if ( (*(int *)(v227 + 20) & 0xF0) == 128 ) { v182 = "sp91a"; -LABEL_348: v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -7993,10 +8109,23 @@ } } v182 = "sptext01"; - goto LABEL_348; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; } v125 = 11; - goto LABEL_310; + if ( v125 < 0 || v125 >= 16 ) + goto LABEL_335; + goto LABEL_312; } if ( !(*(int *)(v225 + 20) & 0xF0) ) { @@ -8021,17 +8150,22 @@ if ( (*(int *)(v225 + 20) & 0xF0) == 32 ) { v179 = "sp28a"; - goto LABEL_284; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; } if ( (*(int *)(v225 + 20) & 0xF0) == 64 ) { v179 = "sp30a"; - goto LABEL_284; - } - if ( (*(int *)(v225 + 20) & 0xF0) == 128 ) - { - v179 = "sp91a"; -LABEL_284: a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8041,19 +8175,40 @@ ptr_50C9A4 = 0; } v118 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - v117, - a3h, - (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), - a2i, - (signed __int64)v118, - 0, - 255); + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; + } + if ( (*(int *)(v225 + 20) & 0xF0) == 128 ) + { + v179 = "sp91a"; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); goto LABEL_292; } } v179 = "sptext01"; - goto LABEL_284; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; } v191 = 9; break; @@ -8077,8 +8232,8 @@ { v93 = 2 * v91; v94 = paperdoll_array_511290[0][v92][1]; - a2g = pPaperdoll_BodyX + dword_4E5050[v93]; - v95 = dword_4E5050[v93 + 1]; + a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][0][v93]; + v95 = paperdoll_shoulder[0][0][v93 + 1]; } else { @@ -8088,7 +8243,10 @@ } a3g = pPaperdoll_BodyY + v95; if ( v94 == pIcons_LOD->FindTextureByName("pending") ) - goto LABEL_258; + { + v68 = v217; + goto LABEL_259; + } if ( *(int *)(v242 + 516) & 0xF0 ) { if ( (*(int *)(v242 + 516) & 0xF0) != 16 ) @@ -8096,17 +8254,44 @@ if ( (*(int *)(v242 + 516) & 0xF0) == 32 ) { v173 = "sp28a"; - goto LABEL_226; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; } if ( (*(int *)(v242 + 516) & 0xF0) == 64 ) { v173 = "sp30a"; - goto LABEL_226; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; } if ( (*(int *)(v242 + 516) & 0xF0) == 128 ) { v173 = "sp91a"; -LABEL_226: v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8118,14 +8303,28 @@ v187 = 255; v174 = 0; v97 = (double)GetTickCount(); -LABEL_249: pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_258; + v68 = v217; + goto LABEL_259; } } v173 = "sptext01"; - goto LABEL_226; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; } v98 = v94 + 1; v99 = (char *)&pIcons_LOD->pTextures[v94]; @@ -8136,9 +8335,11 @@ v188 = v101; v175 = a3g; v163 = a2g; -LABEL_231: v100->_4A6776(v163, v175, v188); - goto LABEL_256; + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + v68 = v217; + goto LABEL_259; } if ( *(char *)(v242 + 516) & 1 ) { @@ -8146,30 +8347,35 @@ v189 = v101; v176 = a3g; v164 = a2g; -LABEL_234: pRenderer->DrawTextureTransparent(v164, v176, v189); - goto LABEL_256; + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + v68 = v217; + goto LABEL_259; } v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); v190 = v101; v177 = a3g; v165 = a2g; - goto LABEL_255; + pRenderer->DrawTransparentGreenShade(v165, v177, v190); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + v68 = v217; + goto LABEL_259; } v102 = 17 * pBodyComplection + v90; v94 = paperdoll_array_511290[0][v102][1]; if ( v94 == pIcons_LOD->FindTextureByName("pending") ) { -LABEL_258: v68 = v217; goto LABEL_259; } - v103 = pPaperdoll_BodyX + dword_4E5050[2 * v102]; - v104 = pPaperdoll_BodyY + dword_4E5050[2 * v102 + 1]; + v103 = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0]; + v104 = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1]; v224 = *(int *)(v242 + 516); v105 = *(int *)(v242 + 516) & 0xF0; - a2g = pPaperdoll_BodyX + dword_4E5050[2 * v102]; - a3g = pPaperdoll_BodyY + dword_4E5050[2 * v102 + 1]; + a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0]; + a3g = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1]; if ( !v105 ) { v109 = v94 + 1; @@ -8181,7 +8387,11 @@ v175 = v104; v163 = v103; v100 = pRenderer; - goto LABEL_231; + v100->_4A6776(v163, v175, v188); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + v68 = v217; + goto LABEL_259; } if ( v224 & 1 ) { @@ -8190,19 +8400,22 @@ v176 = v104; v164 = v103; v100 = pRenderer; - goto LABEL_234; + pRenderer->DrawTextureTransparent(v164, v176, v189); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + v68 = v217; + goto LABEL_259; } v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); v190 = v101; v177 = v104; v165 = v103; v100 = pRenderer; -LABEL_255: pRenderer->DrawTransparentGreenShade(v165, v177, v190); -LABEL_256: if ( !bRingsShownInCharScreen ) pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_258; + v68 = v217; + goto LABEL_259; } v106 = v105 - 16; if ( v106 ) @@ -8211,18 +8424,6 @@ if ( !v107 ) { v178 = "sp28a"; - goto LABEL_246; - } - v108 = v107 - 32; - if ( !v108 ) - { - v178 = "sp30a"; - goto LABEL_246; - } - if ( v108 == 64 ) - { - v178 = "sp91a"; -LABEL_246: v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8234,11 +8435,67 @@ v187 = 255; v174 = 0; v97 = (double)GetTickCount(); - goto LABEL_249; + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; + } + v108 = v107 - 32; + if ( !v108 ) + { + v178 = "sp30a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; + } + if ( v108 == 64 ) + { + v178 = "sp91a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; } } v178 = "sptext01"; - goto LABEL_246; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + v68 = v217; + goto LABEL_259; } v186 = 16; } @@ -8262,17 +8519,22 @@ if ( (*(int *)(v57 + 20) & 0xF0) == 32 ) { v171 = "sp28a"; - goto LABEL_145; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; } if ( (*(int *)(v57 + 20) & 0xF0) == 64 ) { v171 = "sp30a"; - goto LABEL_145; - } - if ( (*(int *)(v57 + 20) & 0xF0) == 128 ) - { - v171 = "sp91a"; -LABEL_145: v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8282,19 +8544,40 @@ ptr_50C9A4 = 0; } v64 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - a2e, - a3e, - (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), - v63, - (signed __int64)v64, - 0, - 255); + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; + } + if ( (*(int *)(v57 + 20) & 0xF0) == 128 ) + { + v171 = "sp91a"; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); goto LABEL_155; } } v171 = "sptext01"; - goto LABEL_145; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; } if ( (*(int *)(v44 + 20) & 0xF0) != 16 ) { @@ -8310,7 +8593,6 @@ if ( (*(int *)(v44 + 20) & 0xF0) == 128 ) { v170 = "sp91a"; -LABEL_117: v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8324,17 +8606,50 @@ v51, (signed __int64)v52, 0, 255); goto LABEL_127; } -LABEL_116: v170 = "sptext01"; - goto LABEL_117; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; } v170 = "sp30a"; } v50 = pIcons_LOD; - goto LABEL_117; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; } v50 = pIcons_LOD; - goto LABEL_116; + v170 = "sptext01"; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; } v185 = 16; } @@ -8359,7 +8674,6 @@ if ( (*(int *)(v32 + 20) & 0xF0) == 128 ) { v169 = "sp91a"; -LABEL_85: v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8369,27 +8683,54 @@ ptr_50C9A4 = 0; } v40 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - a2c, - a3c, - (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), - v39, - (signed __int64)v40, - 0, - 255); + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); goto LABEL_93; } -LABEL_84: v169 = "sptext01"; - goto LABEL_85; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; } v169 = "sp30a"; } v38 = pIcons_LOD; - goto LABEL_85; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; } v38 = pIcons_LOD; - goto LABEL_84; + v169 = "sptext01"; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; } v184 = 9; break; @@ -8414,7 +8755,6 @@ if ( (*(int *)(v22 + 20) & 0xF0) == 128 ) { v168 = "sp91a"; -LABEL_49: a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) @@ -8428,33 +8768,58 @@ pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); goto LABEL_57; } -LABEL_48: v168 = "sptext01"; - goto LABEL_49; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57; } v168 = "sp30a"; } v26 = pIcons_LOD; - goto LABEL_49; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57; } v26 = pIcons_LOD; - goto LABEL_48; + v168 = "sptext01"; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57;; } a3 = pPaperdoll_BodyY; a2 = pPaperdoll_BodyX; v240 = 4 * uPlayerID_ - 4; pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0)); - //(Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? 72 - // * *(unsigned int *)((char *)papredoll_dbods - // + v240) - // + 7145548 : 0)); if ( !bRingsShownInCharScreen ) pRenderer->_4A612A(a2, a3, - //(Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? 72 - // * *(unsigned int *)((char *)papredoll_dbods - // + v240) - // + 7145548 : 0), (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0), pPlayer->pEquipment.uBody); uPlayerID_a = 2 * v5; @@ -8462,12 +8827,8 @@ if ( !v6 || (v7 = *(int *)&pPlayer->pInventoryItems[v6-1], pItemsTable->pItems[v7].uEquipType != 1) && (pItemsTable->pItems[v7].uSkillType != 4 || pPlayer->pEquipment.uOffHand) ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[2 * v5], pPaperdoll_BodyY + pPaperdoll_LeftHand[2 * v5 + 1], + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[v5][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[v5][1], (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); - //(Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? 72 - // * *(unsigned int *)((char *)papredoll_dlads - // + v240) - // + 7145548 : 0)); v8 = pPlayer->pEquipment.uMainHand; if ( v8 ) { @@ -8477,9 +8838,9 @@ v218 = v9; v11 = *(int *)v9; v12 = *(int *)v9; - v13 = pPaperdoll_BodyX + array_4E4C30[v5].field_8 - pItemsTable->pItems[v12].uEquipX; + v13 = pPaperdoll_BodyX + paperdoll_Weapon[v5][1][0] - pItemsTable->pItems[v12].uEquipX; a2a = v13; - a3a = pPaperdoll_BodyY + *(int *)((char *)&array_4E4C30[0].field_C + v10) - pItemsTable->pItems[v12].uEquipY; + a3a = pPaperdoll_BodyY + *(int *)((char *)&paperdoll_Weapon[0][1][1] + v10) - pItemsTable->pItems[v12].uEquipY; if ( v11 == 64 ) v166 = "item64v1"; else @@ -8493,20 +8854,24 @@ if ( (*(int *)(v218 + 20) & 0xF0) == 32 ) { v167 = "sp28a"; - goto LABEL_27; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393;; } if ( (*(int *)(v218 + 20) & 0xF0) == 64 ) { v167 = "sp30a"; - goto LABEL_27; - } - if ( (*(int *)(v218 + 20) & 0xF0) == 128 ) - { - v167 = "sp91a"; -LABEL_27: //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; if ( dword_50C9A8 <= 0 ) { @@ -8515,19 +8880,39 @@ ptr_50C9A4 = 0; } v17 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - v13, - a3a, - (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), - v16, - (signed __int64)v17, - 0, - 255); + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393; + } + if ( (*(int *)(v218 + 20) & 0xF0) == 128 ) + { + v167 = "sp91a"; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); goto LABEL_393; } } v167 = "sptext01"; - goto LABEL_27; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393; } v18 = v14 + 1; v19 = (char *)&pIcons_LOD->pTextures[v14]; @@ -8556,22 +8941,14 @@ pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[uPlayerID_a], pPaperdoll_BodyY + pPaperdoll_RightHand[uPlayerID_a + 1], (Texture *)(*(unsigned int *)((char *)papredoll_drhs + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_drhs + v240)] : 0)); - //(Texture *)(*(unsigned int *)((char *)papredoll_drhs + v240) != -1 ? 72 - // * *(unsigned int *)((char *)papredoll_drhs + v240) - // + 7145548 : 0)); v161 = v217->pEquipment.uMainHand; if ( v161 ) { v162 = *(int *)&v217->pInventoryItems[v161-1]; - if ( pItemsTable->pItems[v162].uEquipType == 1 - || pItemsTable->pItems[v162].uSkillType == 4 && !v217->pEquipment.uOffHand ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[uPlayerID_a + 1], + if ( pItemsTable->pItems[v162].uEquipType == 1 || pItemsTable->pItems[v162].uSkillType == 4 && !v217->pEquipment.uOffHand ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a], + pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1], (Texture *)(*(unsigned int *)((char *)papredoll_dlhus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhus + v240)] : 0)); - //(Texture *)(*(unsigned int *)((char *)papredoll_dlhus + v240) != -1 ? 72 - // * *(unsigned int *)((char *)papredoll_dlhus - // + v240) - // + 7145548 : 0)); } if ( !bRingsShownInCharScreen ) pRenderer->DrawTextureTransparent(0x25Bu, 0x12Bu, @@ -10814,7 +11191,7 @@ v62 = v19; v23 = v18 - v63; v50 = v17 - v65; - v24 = sub_452A9E(v23 * v23 + (v60 - v64) * (v60 - v64) + v50 * v50); + v24 = integer_sqrt(v23 * v23 + (v60 - v64) * (v60 - v64) + v50 * v50); if ( v24 > 5120 ) return 0; if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) @@ -11410,7 +11787,7 @@ v46 = outy - pOut.y; v47 = v163 - outz; v48 = outx - pOut.x; - v49 = sub_452A9E(v48 * v48 + v46 * v46 + v47 * v47); + v49 = integer_sqrt(v48 * v48 + v46 * v46 + v47 * v47); v50 = 65536; if ( v49 ) v50 = 65536 / v49; @@ -11562,7 +11939,7 @@ v74 = outy - pOut.y; v75 = v163 - outz; v76 = outx - pOut.x; - v77 = sub_452A9E(v76 * v76 + v74 * v74 + v75 * v75); + v77 = integer_sqrt(v76 * v76 + v74 * v74 + v75 * v75); v78 = 65536; if ( v77 ) v78 = 65536 / v77; @@ -11721,7 +12098,7 @@ v6 = outy - pOut.y; v7 = v163 - outz; v8 = outx - pOut.x; - v9 = sub_452A9E(v8 * v8 + v6 * v6 + v7 * v7); + v9 = integer_sqrt(v8 * v8 + v6 * v6 + v7 * v7); v10 = 65536; if ( v9 ) v10 = 65536 / v9; @@ -11852,7 +12229,7 @@ v29 = outy - pOut.y; v30 = v163 - outz; v31 = outx - pOut.x; - v32 = sub_452A9E(v31 * v31 + v29 * v29 + v30 * v30); + v32 = integer_sqrt(v31 * v31 + v29 * v29 + v30 * v30); v33 = 65536; if ( v32 ) v33 = 65536 / v32; @@ -12055,7 +12432,7 @@ v7 = a3 - a1; v11 = abs(a3 - a1); v8 = abs(a4 - v10); - result = sub_452A9E(v11 * v11 + v8 * v8); + result = integer_sqrt(v11 * v11 + v8 * v8); if ( result ) result = abs((v7 * (v10 - a6) - (a4 - v10) * (v6 - a5)) / result); return result; @@ -12088,7 +12465,7 @@ if ( (v6 & 0x100000) == v8 ) { ++*v1; - if ( v5->IsAlive() == 1 ) + if ( v5->IsNotAlive() == 1 ) ++v3; } ++v4; @@ -12127,7 +12504,7 @@ if ( v4->pMonsterInfo.field_33 == v7 ) { ++*v2; - if ( v4->IsAlive() == 1 ) + if ( v4->IsNotAlive() == 1 ) ++v9; } } @@ -12167,7 +12544,7 @@ if ( v4->uGroup == v7 ) { ++*v2; - if ( v4->IsAlive() == 1 ) + if ( v4->IsNotAlive() == 1 ) ++v9; } } @@ -12197,7 +12574,7 @@ if ( (v6 & 0x100000) == v4 ) { *v3 = 1; - if ( pActors[v2].IsAlive() == 1 ) + if ( pActors[v2].IsNotAlive() == 1 ) v5 = 1; } return v5; @@ -13534,7 +13911,7 @@ a1.uFrameX = 8; a1.uFrameY = 8; a1.uFrameHeight = 344; - v3 = (const char *)pStorylineText->StoreLine[v2].pText;//field_4[]; + v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[]; a1.uFrameZ = 467; a1.uFrameW = 351; if ( v3 )
--- a/mm7_6.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_6.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -3512,8 +3512,8 @@ a1.uSpriteFrameID = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; v19 = 8 * v3->uPlayerID; - LOBYTE(v19) = v19 | 4; - a1.field_58 = v19; + LOBYTE(v19) = v19 | OBJECT_Player; + a1.field_58_pid = v19; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3550,8 +3550,8 @@ a1.uSpriteFrameID = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; v22 = 8 * v3->uPlayerID; - LOBYTE(v22) = v22 | 4; - a1.field_58 = v22; + LOBYTE(v22) = v22 | OBJECT_Player; + a1.field_58_pid = v22; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3656,8 +3656,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); a1.uSpriteFrameID = v1; v34 = 8 * v3->uPlayerID; - LOBYTE(v34) = v34 | 4; - a1.field_58 = v34; + LOBYTE(v34) = v34 | OBJECT_Player; + a1.field_58_pid = v34; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3689,9 +3689,9 @@ v37 = v3->uPlayerID; a1.field_60_distance_related_prolly_lod = 0; v37 *= 8; - LOBYTE(v37) = v37 | 4; + LOBYTE(v37) = v37 | OBJECT_Player; a1.uFacing = v1; - a1.field_58 = v37; + a1.field_58_pid = v37; v38 = a2 >> 3; a1.uSoundID = LOWORD(v3->field_10); v39 = a2 >> 3; @@ -3733,9 +3733,9 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v44 *= 8; - LOBYTE(v44) = v44 | 4; + LOBYTE(v44) = v44 | OBJECT_Player; v38 = (signed int)v726; - a1.field_58 = v44; + a1.field_58_pid = v44; a1.uSoundID = LOWORD(v3->field_10); a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); @@ -3771,8 +3771,8 @@ a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); a1.uSpriteFrameID = v1; v49 = 8 * v3->uPlayerID; - LOBYTE(v49) = v49 | 4; - a1.field_58 = v49; + LOBYTE(v49) = v49 | OBJECT_Player; + a1.field_58_pid = v49; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3818,8 +3818,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); a1.uSpriteFrameID = v1; v50 = 8 * v3->uPlayerID; - LOBYTE(v50) = v50 | 4; - a1.field_58 = v50; + LOBYTE(v50) = v50 | OBJECT_Player; + a1.field_58_pid = v50; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3967,8 +3967,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); a1.uSpriteFrameID = v1; v62 = 8 * v3->uPlayerID; - LOBYTE(v62) = v62 | 4; - a1.field_58 = v62; + LOBYTE(v62) = v62 | OBJECT_Player; + a1.field_58_pid = v62; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -4369,9 +4369,9 @@ a1.uSectorID = 0; a1.uSpriteFrameID = 0; v120 = 8 * *(short *)(v119 + 2); - LOBYTE(v120) = v120 | 4; + LOBYTE(v120) = v120 | OBJECT_Player; a1.field_60_distance_related_prolly_lod = 0; - a1.field_58 = v120; + a1.field_58_pid = v120; a1.uFacing = 0; a1.uSoundID = *(short *)(v119 + 16); a1.vPosition.x = v112->vPosition.x; @@ -4572,7 +4572,7 @@ a1.uSectorID = v1; a1.vPosition.z = a2 + v713; a1.uSpriteFrameID = v1; - a1.field_58 = 8 * v3->uPlayerID | 4; + 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); a1.uFacing = v687; @@ -4620,8 +4620,8 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v161 *= 8; - LOBYTE(v161) = v161 | 4; - a1.field_58 = v161; + LOBYTE(v161) = v161 | OBJECT_Player; + a1.field_58_pid = v161; a1.uSoundID = LOWORD(v3->field_10); a2 = v1; if ( (signed int)v726 > v1 ) @@ -4759,8 +4759,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); a1.uSpriteFrameID = v1; v187 = 8 * v3->uPlayerID; - LOBYTE(v187) = v187 | 4; - a1.field_58 = v187; + LOBYTE(v187) = v187 | OBJECT_Player; + a1.field_58_pid = v187; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uSoundID = LOWORD(v3->field_10); @@ -4976,7 +4976,7 @@ a1.uSectorID = v1; a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); a1.uSpriteFrameID = v1; - a1.field_58 = 8 * v3->uPlayerID | 4; + 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); a1.uFacing = v685; @@ -5071,8 +5071,8 @@ a1.uSpriteFrameID = v1; a1.uSectorID = v52; v53 = 8 * v3->uPlayerID; - LOBYTE(v53) = v53 | 4; - a1.field_58 = v53; + LOBYTE(v53) = v53 | OBJECT_Player; + a1.field_58_pid = v53; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -5107,8 +5107,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); a1.uSpriteFrameID = v1; v226 = 8 * v3->uPlayerID; - LOBYTE(v226) = v226 | 4; - a1.field_58 = v226; + LOBYTE(v226) = v226 | OBJECT_Player; + a1.field_58_pid = v226; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uSoundID = LOWORD(v3->field_10); @@ -5693,8 +5693,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); a1.uSpriteFrameID = v1; v326 = 8 * v3->uPlayerID; - LOBYTE(v326) = v326 | 4; - a1.field_58 = v326; + LOBYTE(v326) = v326 | OBJECT_Player; + a1.field_58_pid = v326; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(pParty->sRotationY); @@ -5723,9 +5723,9 @@ a1.uSpriteFrameID = v1; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; v327 = 8 * v3->uPlayerID; - LOBYTE(v327) = v327 | 4; + LOBYTE(v327) = v327 | OBJECT_Player; a1.field_60_distance_related_prolly_lod = 0; - a1.field_58 = v327; + a1.field_58_pid = v327; a1.field_5C = a2; a1.uFacing = LOWORD(pParty->sRotationY); a1.uSoundID = LOWORD(v3->field_10); @@ -5940,8 +5940,8 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v368 *= 8; - LOBYTE(v368) = v368 | 4; - a1.field_58 = v368; + LOBYTE(v368) = v368 | OBJECT_Player; + a1.field_58_pid = v368; a1.uSoundID = LOWORD(v3->field_10); for ( a2 = v1; a2 < (signed int)v726; ++a2 ) { @@ -6381,8 +6381,8 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v432 *= 8; - LOBYTE(v432) = v432 | 4; - a1.field_58 = v432; + LOBYTE(v432) = v432 | OBJECT_Player; + a1.field_58_pid = v432; a1.uSoundID = LOWORD(v3->field_10); for ( a2 = v1; a2 < (signed int)v726; ++a2 ) { @@ -6842,8 +6842,8 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v506 *= 8; - LOBYTE(v506) = v506 | 4; - a1.field_58 = v506; + LOBYTE(v506) = v506 | OBJECT_Player; + a1.field_58_pid = v506; a1.uSoundID = LOWORD(v3->field_10); a2 = v1; if ( SHIDWORD(v733) > v1 ) @@ -7012,8 +7012,8 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v532 *= 8; - LOBYTE(v532) = v532 | 4; - a1.field_58 = v532; + LOBYTE(v532) = v532 | OBJECT_Player; + a1.field_58_pid = v532; a1.uSoundID = LOWORD(v3->field_10); a2 = v1; if ( (signed int)v726 > v1 ) @@ -7284,9 +7284,9 @@ a1.field_60_distance_related_prolly_lod = 0; v581 = v721; v580 *= 8; - LOBYTE(v580) = v580 | 4; + LOBYTE(v580) = v580 | OBJECT_Player; a1.uFacing = v1; - a1.field_58 = v580; + a1.field_58_pid = v580; a1.uSoundID = LOWORD(v3->field_10); a1.vPosition.x = *(short *)(v721 + 142); a1.vPosition.y = *(short *)(v721 + 144); @@ -7386,8 +7386,8 @@ pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); a1.uSpriteFrameID = v1; v595 = 8 * v3->uPlayerID; - LOBYTE(v595) = v595 | 4; - a1.field_58 = v595; + LOBYTE(v595) = v595 | OBJECT_Player; + a1.field_58_pid = v595; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uSoundID = LOWORD(v3->field_10); @@ -7471,8 +7471,8 @@ a1.uSectorID = pIndoor->GetSector(v657, v665, v676); a1.uSpriteFrameID = v1; v604 = 8 * v3->uPlayerID; - LOBYTE(v604) = v604 | 4; - a1.field_58 = v604; + LOBYTE(v604) = v604 | OBJECT_Player; + a1.field_58_pid = v604; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -7619,8 +7619,8 @@ a1.field_60_distance_related_prolly_lod = 0; a1.uFacing = v1; v624 *= 8; - LOBYTE(v624) = v624 | 4; - a1.field_58 = v624; + LOBYTE(v624) = v624 | OBJECT_Player; + a1.field_58_pid = v624; a1.uSoundID = LOWORD(v3->field_10); a2 = v1; if ( SHIDWORD(v733) > v1 ) @@ -7837,39 +7837,39 @@ //unsigned int v0; // ebx@1 //Player *v1; // esi@1 //bool result; // eax@1 - int v3; // edi@2 + //int v3; // edi@2 //unsigned int v4; // eax@7 char *v5; // eax@8 //int v6; // ecx@9 //signed int v7; // eax@16 - Actor *v8; // edi@20 + //Actor *v8; // edi@20 unsigned int v9; // ecx@21 - char *v10; // eax@26 + //char *v10; // eax@26 char *v11; // eax@26 unsigned int v12; // eax@47 - char *v13; // eax@47 - char *v14; // eax@47 - unsigned int v15; // ebx@54 - int v16; // [sp-10h] [bp-4Ch]@24 - int v17; // [sp-10h] [bp-4Ch]@44 - unsigned int v18; // [sp-Ch] [bp-48h]@24 - unsigned int v19; // [sp-Ch] [bp-48h]@44 - __int16 v20; // [sp-8h] [bp-44h]@24 - __int16 v21; // [sp-8h] [bp-44h]@44 - int v22; // [sp-4h] [bp-40h]@24 - int v23; // [sp-4h] [bp-40h]@44 + //char *v13; // eax@47 + //char *v14; // eax@47 + //unsigned int v15; // ebx@54 + //int v16; // [sp-10h] [bp-4Ch]@24 + //int v17; // [sp-10h] [bp-4Ch]@44 + //unsigned int v18; // [sp-Ch] [bp-48h]@24 + //unsigned int v19; // [sp-Ch] [bp-48h]@44 + //__int16 v20; // [sp-8h] [bp-44h]@24 + //__int16 v21; // [sp-8h] [bp-44h]@44 + //int v22; // [sp-4h] [bp-40h]@24 + //int v23; // [sp-4h] [bp-40h]@44 SoundID v24; // [sp-4h] [bp-40h]@58 - Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 + //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 //unsigned int a2; // [sp+18h] [bp-24h]@20 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 - int v28; // [sp+20h] [bp-1Ch]@9 + //int v28; // [sp+20h] [bp-1Ch]@9 //unsigned int *v28b; - int v29; // [sp+24h] [bp-18h]@16 - int v30; // [sp+28h] [bp-14h]@16 + //int v29; // [sp+24h] [bp-18h]@16 + //int v30; // [sp+28h] [bp-14h]@16 //int v31; // [sp+2Ch] [bp-10h]@4 - int v32; // [sp+30h] [bp-Ch]@7 + //int v32; // [sp+30h] [bp-Ch]@7 //int v33; // [sp+34h] [bp-8h]@7 - int v34; // [sp+38h] [bp-4h]@17 + //int v34; // [sp+38h] [bp-4h]@17 //v0 = uActiveCharacter; //v27 = 6972 * uActiveCharacter; @@ -7880,7 +7880,7 @@ return; pStru277->_427D48(uActiveCharacter); - v3 = 0; + //v3 = 0; if (pParty->Invisible()) pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); @@ -7889,7 +7889,8 @@ if (bow_idx && player->pInventoryItems[bow_idx - 1].Broken()) bow_idx = 0; - v32 = 0; + //v32 = 0; + int wand_item_id = 0; //v33 = 0; //v4 = v1->pEquipment.uMainHand; int laser_weapon_item_id = 0; @@ -7903,21 +7904,21 @@ { //v28b = &v1->pInventoryItems[v4].uItemID; //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); - if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_C) + if (pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_WAND) { - if (item->_bonus_type <= 0) - player->pEquipment.uMainHand = 0; + if (item->uNumCharges <= 0) + player->pEquipment.uMainHand = 0; // wand discharged - unequip else - v32 = item->uItemID;//*((int *)v5 + 124); + wand_item_id = item->uItemID;//*((int *)v5 + 124); } else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); } } - v30 = 0; - v29 = 0; - v28 = 0; + //v30 = 0; + //v29 = 0; + //v28 = 0; //v7 = pMouse->uPointingObjectID; int target_pid = pMouse->uPointingObjectID; @@ -7929,199 +7930,105 @@ target_type = target_pid & 7; target_id = target_pid >> 3; } - - - a3.z = 0; - a3.y = 0; - a3.x = 0; + + auto actor = &pActors[target_id]; + int actor_distance = 0; if (target_type == OBJECT_Actor) { - //a2 = target_id; - v8 = &pActors[target_id]; - int distance_x = v8->vPosition.x - pParty->vPosition.x, - distance_y = v8->vPosition.y - pParty->vPosition.y, - distance_z = v8->vPosition.z - pParty->vPosition.z; - v34 = sub_452A9E(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - v8->uActorRadius; - if ( v34 >= 0 ) - { - v9 = 0; - } - else - { - v9 = 0; - v34 = 0; - } - if ( laser_weapon_item_id != v9 ) - { - v28 = 1; - v22 = uActiveCharacter + 8; - v20 = v9; - v18 = v9; - v16 = 102; -LABEL_34: - _42777D_CastSpell_UseWand_ShootArrow(v16, uActiveCharacter - 1, v18, v20, v22); -LABEL_28: - v3 = 0; - goto LABEL_29; - } - if ( v32 != v9 ) - { - v29 = 1; - _42777D_CastSpell_UseWand_ShootArrow( - *((int *)&pSpellDatas[66].field_8 - + *(int *)(&stru_AA1058[3].pSounds[36 * *(int *)&pParty->pArtifactsFound[6972 * uActiveCharacter + 22] + 41048] + 6972 * uActiveCharacter)), - uActiveCharacter - 1, - 8u, - v9, - uActiveCharacter + 8); - v10 = &player->field_1F5[36 * player->pEquipment.uMainHand + 11]; - --*(int *)v10; - v11 = (char *)player + 36 * player->pEquipment.uMainHand; - if ( *((int *)v11 + 128) <= 0 ) - { - *((int *)v11 + 124) = 0; - player->pEquipment.uMainHand = 0; - } - goto LABEL_28; - } - if ( (double)v34 <= 407.2 ) - { - a3.x = v8->vPosition.x - pParty->vPosition.x; - a3.y = v8->vPosition.y - pParty->vPosition.y; - a3.z = v8->vPosition.z - pParty->vPosition.z; - Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); - DamageMonsterFromParty((8 * uActiveCharacter - 8) | OBJECT_Player, target_id, &a3); - if ( player->WearsItem(506, 1) || player->WearsItem(506, 0) ) + int distance_x = actor->vPosition.x - pParty->vPosition.x, + distance_y = actor->vPosition.y - pParty->vPosition.y, + distance_z = actor->vPosition.z - pParty->vPosition.z; + actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; + if (actor_distance < 0) + actor_distance = 0; + } + + bool shooting_bow = false, + shotting_laser = false, + shooting_wand = false; + if (laser_weapon_item_id) + { + shotting_laser = true; + _42777D_CastSpell_UseWand_ShootArrow(102, 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); + + if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) + player->pEquipment.uMainHand = 0; + } + else if (target_type == OBJECT_Actor && actor_distance <= 407.2) + { + Vec3_int_ a3; + a3.x = actor->vPosition.x - pParty->vPosition.x; + a3.y = actor->vPosition.y - pParty->vPosition.y; + a3.z = actor->vPosition.z - pParty->vPosition.z; + Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); + + DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); + if (player->WearsItem(506, 1) || player->WearsItem(506, 0)) _42FA66_do_explosive_impact( - v8->vPosition.x, - v8->vPosition.y, - v8->vPosition.z + v8->uActorHeight / 2, - 0, - 512, - uActiveCharacter); - } - else - { - if ( bow_idx != v9 ) - { - v30 = 1; - v22 = 0; - v20 = 0; - v18 = 0; - v16 = 100; - goto LABEL_34; - } - } - v3 = 0; - goto LABEL_39; - } - - if ( laser_weapon_item_id ) - { - v28 = 1; - v23 = uActiveCharacter + 8; - v21 = 0; - v19 = 0; - v17 = 102; - } - else - { - if ( v32 ) - { - v12 = player->pEquipment.uMainHand; - v29 = 1; - _42777D_CastSpell_UseWand_ShootArrow( - *((int *)&pSpellDatas[66].field_8 + *(int *)&player->pInventoryItems[v12-1]), - uActiveCharacter - 1, - 8u, - 0, - uActiveCharacter + 8); - v13 = &player->field_1F5[36 * player->pEquipment.uMainHand + 11]; - --*(int *)v13; - v14 = (char *)player + 36 * player->pEquipment.uMainHand; - if ( *((int *)v14 + 128) <= 0 ) - { - *((int *)v14 + 124) = 0; - player->pEquipment.uMainHand = 0; - } -LABEL_29: - v34 = v3; - if ( v30 == v3 ) - { - if ( v29 != v3 ) - return; - if ( v28 == v3 ) - { - v15 = player->pEquipment.uMainHand; - if ( player->HasItemEquipped(EQUIP_TWO_HANDED) ) - v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[v15-1]].uSkillType; - pTurnEngine->_40471C(); - } - else - { - v34 = 7; - } - } - else - { - v34 = 5; - player->PlaySound(SPEECH_50, v3); - } - switch ( v34 ) - { - case 0: - v24 = (SoundID)81; - goto LABEL_66; - case 1: - v24 = (SoundID)84; - goto LABEL_66; - case 2: - v24 = (SoundID)85; - goto LABEL_66; - case 3: - v24 = (SoundID)78; - goto LABEL_66; - case 4: - v24 = (SoundID)80; - goto LABEL_66; - case 5: - v24 = (SoundID)71; - goto LABEL_66; - case 6: - v24 = (SoundID)83; - goto LABEL_66; - case 7: - v24 = (SoundID)67; -LABEL_66: - pAudioPlayer->PlaySound(v24, v3, v3, -1, v3, v3, v3, v3); - break; - default: - return; - } - return; - } - if ( !bow_idx ) - { -LABEL_39: - int v31 = player->GetAttackRecoveryTime(v3); - if ( v31 < 30 ) - v31 = 30; - if ( pParty->bTurnBasedModeOn == v3 ) - player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v31 * 2.133333333333333)); - goto LABEL_29; - } - v23 = 0; - v21 = 0; - v19 = 0; - v30 = 1; - v17 = 100; - } - _42777D_CastSpell_UseWand_ShootArrow(v17, uActiveCharacter - 1, v19, v21, v23); - goto LABEL_29; + actor->vPosition.x, + actor->vPosition.y, + actor->vPosition.z + actor->uActorHeight / 2, + 0, 512, uActiveCharacter); + } + else if (bow_idx) + { + shooting_bow = true; + _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); + } + else + { + ; // actor out of range or no actor; no ranged weapon so melee attacking air + } + + if (!pParty->bTurnBasedModeOn) + { + int recovery = player->GetAttackRecoveryTime(0); + if (recovery < 30 ) + recovery = 30; + player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); + } + + + int v34 = 0; + if (shooting_wand) + return; + else if (shooting_bow) + { + v34 = 5; + player->PlaySound(SPEECH_50, 0); + } + if (shotting_laser) + v34 = 7; + else + { + int main_hand_idx = player->pEquipment.uMainHand; + if (player->HasItemEquipped(EQUIP_TWO_HANDED)) + v34 = pItemsTable->pItems[*(int *)&player->pInventoryItems[main_hand_idx - 1]].uSkillType; + pTurnEngine->_40471C(); + } + + switch (v34) + { + case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; + case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; + case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; + case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; + case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; + case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; + case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; + case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; + } } //----- (0042F184) -------------------------------------------------------- -int stru319::FindClosestActor(int a2, int a3, int a4) +int stru319::FindClosestActor(int pick_depth, int a3, int a4) { int v4; // edi@1 stru319 *v5; // esi@1 @@ -8161,9 +8068,10 @@ v6 = a3 != 0; if ( a4 ) LOBYTE(v6) = v6 | 8; - v7 = pGame->pVisInstance->_4C1944(OBJECT_Actor, a2, v6, 657456, -1); + v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); if ( v7 != -1 ) return (unsigned __int16)v7; + else return 0; } else { @@ -8201,7 +8109,7 @@ && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) { if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) - && v22 <= a2 << 16 ) + && v22 <= pick_depth << 16 ) { v14 = 0; if ( v10 > 0 ) @@ -8583,7 +8491,7 @@ a1a.uAttributes = attributes; a1a.uSectorID = pIndoor->GetSector(v21, y, z); a1a.uSpriteFrameID = 0; - a1a.field_58 = 0; + a1a.field_58_pid = 0; a1a.field_5C = 0; if ( !(a1a.uAttributes & 0x10) ) { @@ -8689,7 +8597,7 @@ a1.uAttributes = 0; a1.uSectorID = pIndoor->GetSector(v3, v4, z); a1.uSpriteFrameID = 0; - a1.field_58 = 0; + a1.field_58_pid = 0; a1.field_5C = 0; v8 = a1.Create(0, 0, 0, 0); if ( v8 != -1 ) @@ -8789,12 +8697,12 @@ if ( a6 >= 1 || a6 <= 4 ) { v10 = 8 * a6 - 8; - LOBYTE(v10) = v10 | 4; - a1a.field_58 = v10; + LOBYTE(v10) = v10 | OBJECT_Player; + a1a.field_58_pid = v10; } else { - a1a.field_58 = 0; + a1a.field_58_pid = 0; } result = a1a.Create(0, 0, 0, 0); if ( result != -1 )
--- a/mm7_data.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_data.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -281,11 +281,11 @@ #include "MM7.h" stru161 stru_4ECBB8[6]; stru289 stru_6BE158; -stru329 array_4E4C30[4] ={ - {0x80, 0xCD, 0x1E, 0x90, 0x58, 0x55, 0, 0, 0, 0, 0, 0, 0x11, 0x68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0x83, 0xC9, 0x26, 0x9E, 0x62, 0x57, 0, 0, 0, 0, 0, 0, 0x15, 0x64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0x83, 0xD8, 0x1D, 0xBA, 0x58, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {0x7B, 0xD8, 0x23, 0xB8, 0x62, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +int paperdoll_Weapon[4][16][2] = {//4E4C30 + 0x80, 0xCD, 0x1E, 0x90, 0x58, 0x55, 0, 0, 0, 0, 0, 0, 0x11, 0x68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x83, 0xC9, 0x26, 0x9E, 0x62, 0x57, 0, 0, 0, 0, 0, 0, 0x15, 0x64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x83, 0xD8, 0x1D, 0xBA, 0x58, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x7B, 0xD8, 0x23, 0xB8, 0x62, 0x77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; stru332 stru_511698; stru333 stru_511718; @@ -650,45 +650,74 @@ char aErrorNoMouseFo[22]; // weak int pPaperdoll_BodyX = 481; int pPaperdoll_BodyY = 0; -int paperdoll_array_4E4E30[4][17][2] = +int paperdoll_Armor[4][17][2] = //0x4E4E30 { -0x2C, 0x67, 0x30, 0x69, 0x2D, 0x67, 0x2C, 0x64, 0x14, 0x66, 0x22, -0x67, 0x20, 0x66, 0x25, 0x66, 0x12, 0x66, 0x0A, 0x66, 0x13, 0x64, -0x0E, 0x64, 0x0A, 0x63, 0x14, 0x66, 0x0A, 0x63, 0x0A, 0x66, 0x25, -0x66, 0x32, 0x68, 0x32, 0x69, 0x35, 0x69, 0x33, 0x68, 0x24, 0x67, -0x30, 0x69, 0x33, 0x68, 0x31, 0x69, 0x19, 0x69, 0x19, 0x6A, 0x16, -0x66, 0x16, 0x65, 0x0F, 0x6B, 0x24, 0x67, 0x0F, 0x6B, 0x19, 0x6A, -0x31, 0x69, 0x2A, 0x8C, 0x29, 0x8C, 0x2A, 0x89, 0x29, 0x86, 0x12, -0x87, 0x2D, 0x89, 0x2A, 0x88, 0x25, 0x87, 0x12, 0x8B, 0x12, 0x8B, -0x11, 0x8A, 0x15, 0x87, 0x09, 0x89, 0x12, 0x87, 0x09, 0x89, 0x12, 0x8B, -0x25, 0x87, 0x33, 0x90, 0x32, 0x90, 0x34, 0x91, 0x32, 0x8E, 0x21, -0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D, 0x18, 0x8C, -0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18, -0x8C, 0x2F, 0x8F +// X Y + 0x2C, 0x67, 0x30, 0x69, 0x2D, 0x67, 0x2C, 0x64, 0x14, 0x66, 0x22, 0x67, 0x20, 0x66, 0x25, 0x66, 0x12, 0x66,//Human + 0x0A, 0x66, 0x13, 0x64, 0x0E, 0x64, 0x0A, 0x63, 0x14, 0x66, 0x0A, 0x63, 0x0A, 0x66, 0x25, 0x66, + + 0x32, 0x68, 0x32, 0x69, 0x35, 0x69, 0x33, 0x68, 0x24, 0x67, 0x30, 0x69, 0x33, 0x68, 0x31, 0x69, 0x19, 0x69, + 0x19, 0x6A, 0x16, 0x66, 0x16, 0x65, 0x0F, 0x6B, 0x24, 0x67, 0x0F, 0x6B, 0x19, 0x6A, 0x31, 0x69, + + 0x2A, 0x8C, 0x29, 0x8C, 0x2A, 0x89, 0x29, 0x86, 0x12, 0x87, 0x2D, 0x89, 0x2A, 0x88, 0x25, 0x87, 0x12, 0x8B, + 0x12, 0x8B, 0x11, 0x8A, 0x15, 0x87, 0x09, 0x89, 0x12, 0x87, 0x09, 0x89, 0x12, 0x8B, 0x25, 0x87, + + 0x33, 0x90, 0x32, 0x90, 0x34, 0x91, 0x32, 0x8E, 0x21, 0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D, + 0x18, 0x8C, 0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18, 0x8C, 0x2F, 0x8F, }; -int dword_4E5050[8] = +int paperdoll_shoulder[4][17][2] = { -0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74 + 0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74, 0x6C, 0x68, 0x61, 0x67, 0x66, 0x68, 0x6C, 0x6A, 0x6E, 0x6D, + 0x67, 0x69, 0x70, 0x67, 0x6E, 0x6D, 0x6C, 0x6F, 0x6C, 0x68, 0x6C, 0x6F, 0x67, 0x69, 0x6C, 0x6A, + + 0x60, 0x6B, 0x60, 0x6C, 0x60, 0x6B, 0x61, 0x6A, 0x60, 0x69, 0x60, 0x6A, 0x60, 0x6A, 0x61, 0x69, 0x63, 0x6A, + 0x64, 0x6A, 0x61, 0x66, 0x66, 0x67, 0x64, 0x6C, 0x60, 0x69, 0x64, 0x6C, 0x64, 0x6A, 0x61, 0x69, + + 0x6D, 0x8C, 0x75, 0x8C, 0, 0, 0x72, 0x8D, 0x6A, 0x89, 0, 0, 0x73, 0x8C, 0x69, 0x8C, 0x6E, 0x8D, + 0x71, 0x8D, 0x70, 0x8D, 0x72, 0x8D, 0x74, 0x8E, 0x6A, 0x89, 0x74, 0x8E, 0x71, 0x8D, 0x69, 0x8C, + + 0x72, 0x91, 0x72, 0x91, 0, 0, 0x6E, 0x92, 0x6F, 0x91, 0, 0, 0, 0, 0x6E, 0x91, 0x71, 0x90, + 0x72, 0x8D, 0x72, 0x90, 0x73, 0x93, 0x73, 0x90, 0x6F, 0x91, 0x73, 0x90, 0x72, 0x8D, 0x6E, 0x91, }; int dword_4E5270[8]; -int dword_4E5490[4][7][2]; -int paredoll_array_4E54B8[3][14]; -int paperdoll_array_4E5570[4][10][2]; +int paperdoll_Boot[4][7][2] = //4E5490 +{ + 0xE, 0x11D, 0xD, 0x11D, 0xC, 0x10A, 0xA, 0xFF, 0xD, 0xF9, 0xD, 0x137, 0xC, 0x10E, + 0x14, 0x125, 0x13, 0x122, 0x15, 0x120, 0x15, 0x114, 0x13, 0x10A, 0x11, 0x13E, 0x11, 0x116, + 0x1D, 0x121, 0x1C, 0x11F, 0x1B, 0x11B, 0x1C, 0x117, 0x16, 0x116, 0x1B, 0x137, 0x1B, 0x11B, + 0x1F, 0x127, 0x1F, 0x122, 0x1B, 0x11B, 0x1D, 0x117, 0x1D, 0x116, 0x1D, 0x137, 0x1B, 0x11F, +}; +int paperdoll_Cloak[4][10][2] = //0x4E5570 +{ + 0x11, 0x68, 0xF, 0x68, 0x14, 0x71, 0x19, 0x6B, 0x21, 0x6F, 0x5, 0x68, 0x5, 0x68, 0x14, 0x71, 0x3, 0x6B, 0xF, 0x6F, + 0x15, 0x64, 0xB, 0x6B, 0xE, 0x67, 0x15, 0x6B, 0x1B, 0x6F, 0x3, 0x6B, 0, 0x6B, 0xE, 0x67, 0, 0x6B, 0x3, 0x6F, + 0x10, 0x8A, 0x9, 0x8B, 0x18, 0x98, 0x25, 0x91, 0x29, 0x90, 0x8, 0x8A, 0x9, 0x8B, 0x18, 0x98, 0x3, 0x91, 0x3, 0x90, + 0x14, 0x92, 0x10, 0x92, 0x15, 0x98, 0x1F, 0x91, 0x22, 0x90, 0x8, 0x92, 0xC, 0x92, 0x15, 0x98, 0x3, 0x91, 0x3, 0x90, +}; int dword_4E56B0; // weak int dword_4E56B4; // weak -int dword_4E57F0[4][7][2]; -int dword_4E58D0[777]; // weak -int dword_4E58D4[777]; // weak -int dword_4E5AD0[777]; // weak 52 +int paperdoll_Belt[4][7][2] = //0x4E57F0 +{ + 0x3A, 0xB6, 0x37, 0xB2, 0x34, 0xB9, 0x3A, 0xB9, 0x37, 0xB7, 0x38, 0xAC, 0x37, 0xB7, + 0x3E, 0xAD, 0x3A, 0xAC, 0x37, 0xB0, 0x3A, 0xB1, 0x39, 0xB0, 0x3C, 0xA5, 0x39, 0xB0, + 0x3B, 0xD5, 0x37, 0xD2, 0x31, 0xD5, 0x39, 0xD6, 0x37, 0xD8, 0x37, 0xD1, 0x37, 0xD8, + 0x42, 0xD2, 0x3F, 0xD0, 0x3B, 0xD7, 0x3C, 0xD5, 0x3B, 0xD6, 0x3E, 0xCF, 0x36, 0xD6, +}; +int dword_4E58D0[777]; // HelmX 62 maybe array??? +int dword_4E58D4[777]; // HelmY 31 +int pPaperdoll_Beards[4] = //0x4E5AD0 +{ + 52, 130, 56, 136, +}; int dword_4E5AD4[777]; // weak -int pPaperdoll_LeftHand[8] = +int pPaperdoll_LeftHand[4][2] = { 0x67, 0x6A, 0x65, 0x6C, 0x74, 0x8D, 0x74, 0x93, }; -int pPaperdoll_SecondLeftHand[8] = +int pPaperdoll_SecondLeftHand[4][2] = { 0x1A, 0x6B, 0x28, 0x6D,
--- a/mm7_data.h Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7_data.h Tue Feb 19 22:37:58 2013 +0600 @@ -629,21 +629,20 @@ extern char aErrorNoMouseFo[22]; // weak extern int pPaperdoll_BodyX; // weak extern int pPaperdoll_BodyY; // weak -extern int paperdoll_array_4E4E30[4][17][2]; -extern int dword_4E5050[8]; +extern int paperdoll_Armor[4][17][2]; +extern int paperdoll_shoulder[4][17][2]; extern int dword_4E5270[8]; -extern int dword_4E5490[4][7][2]; -extern int paredoll_array_4E54B8[3][14]; -extern int paperdoll_array_4E5570[4][10][2]; +extern int paperdoll_Boot[4][7][2]; +extern int paperdoll_Cloak[4][10][2]; extern int dword_4E56B0; // weak extern int dword_4E56B4; // weak -extern int dword_4E57F0[4][7][2]; +extern int paperdoll_Belt[4][7][2]; extern int dword_4E58D0[]; // weak extern int dword_4E58D4[]; // weak -extern int dword_4E5AD0[]; // weak +extern int pPaperdoll_Beards[4]; // weak extern int dword_4E5AD4[]; // weak -extern int pPaperdoll_LeftHand[8]; -extern int pPaperdoll_SecondLeftHand[8]; +extern int pPaperdoll_LeftHand[4][2]; +extern int pPaperdoll_SecondLeftHand[4][2]; extern int pPaperdoll_RightHand[8]; extern int pPaperdollLeftEmptyHand[8]; extern int pPaperdollRingsX[6]; @@ -2061,7 +2060,7 @@ bool __fastcall SpawnActor(unsigned int uMonsterID); int __cdecl GetAlertStatus(); unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4); -int sub_452A9E(int a1); +int integer_sqrt(int val); int __fastcall MakeColorMaskFromBitDepth(int a1); void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels); int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides); // idb @@ -2181,7 +2180,7 @@ bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4); bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4); bool __fastcall sub_475F30(int *a1, BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9); -int __fastcall const_1(int, int); // weak + int __cdecl GetPartyReputation(); void __cdecl sub_4783FA_construct_global_73D150(); void __cdecl loc_4789D4(); // idb
--- a/mm7text_ru.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/mm7text_ru.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -1096,7 +1096,8 @@ else left = match; } - assert(false); + + Log::Warning(L"sprintfex: unknown gender: %S", name); return 0; }
--- a/stru6.cpp Tue Feb 19 22:37:39 2013 +0600 +++ b/stru6.cpp Tue Feb 19 22:37:58 2013 +0600 @@ -865,7 +865,7 @@ result = AddMobileLight(a2, 0xFF3C1Eu, 256);// fireball hit if ( pRenderer->pRenderD3D ) { - result = a2->field_58 & 7; + result = a2->field_58_pid & 7; if ( result != 3 ) { if ( result != 2 )