comparison mm7_4.cpp @ 439:6b8118542175

recipie item
author Gloval
date Sun, 24 Feb 2013 14:51:43 +0400
parents 0a1ea44b4a0a
children 4946b3ed74be
comparison
equal deleted inserted replaced
438:17c90e543e28 439:6b8118542175
4913 memset(pTmpBuf2, 0, sizeof(pTmpBuf2)); 4913 memset(pTmpBuf2, 0, sizeof(pTmpBuf2));
4914 4914
4915 NPCData *npc = nullptr; 4915 NPCData *npc = nullptr;
4916 if ( dword_5C35D4 ) 4916 if ( dword_5C35D4 )
4917 { 4917 {
4918 __debugbreak(); // fix 4918 __debugbreak(); // fix
4919 npc = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; 4919 npc = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
4920 } 4920 }
4921 else 4921 else
4922 npc = GetNPCData(uDialogue_SpeakingActorNPC_ID); 4922 npc = GetNPCData(uDialogue_SpeakingActorNPC_ID);
4923 //v65 = v9; 4923 //v65 = v9;
9110 if ( !v5 ) 9110 if ( !v5 )
9111 return; 9111 return;
9112 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C); 9112 v6 = 9 * (v5 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C);
9113 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4); 9113 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
9114 if ( dword_F8B19C != 2 ) 9114 if ( dword_F8B19C != 2 )
9115 v7 = (ItemGen *)&pParty->field_C59C[v6 + 715]; 9115 // v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
9116 v7 =&pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v5];
9116 goto LABEL_15; 9117 goto LABEL_15;
9117 } 9118 }
9118 if ( dword_F8B198 <= 16 && dword_F8B19C == 18 ) 9119 if ( dword_F8B198 <= 16 && dword_F8B19C == 18 )
9119 { 9120 {
9120 v1 = pMouse->GetCursorPos(&a2); 9121 v1 = pMouse->GetCursorPos(&a2);
12269 } 12270 }
12270 else 12271 else
12271 { 12272 {
12272 do 12273 do
12273 { 12274 {
12274 if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 12275 // if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
12276 if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uItemID)
12275 { 12277 {
12276 v58 = dword_F8B168[v49]; 12278 v58 = dword_F8B168[v49];
12277 v59 = 152 - v58->uTextureHeight; 12279 v59 = 152 - v58->uTextureHeight;
12278 if ( (signed int)v59 < 1 ) 12280 if ( (signed int)v59 < 1 )
12279 v59 = 0; 12281 v59 = 0;
12301 } 12303 }
12302 while ( v49 < 6 ); 12304 while ( v49 < 6 );
12303 v122 = 0; 12305 v122 = 0;
12304 do 12306 do
12305 { 12307 {
12306 if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) 12308 //if ( pParty->Spell_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49] + 778] ) //weak
12309 if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v49].uAttributes)
12307 { 12310 {
12308 v62 = dword_F8B168[v122 + 6]; 12311 v62 = dword_F8B168[v122 + 6];
12309 v63 = 306 - v62->uTextureHeight; 12312 v63 = 306 - v62->uTextureHeight;
12310 if ( (signed int)v63 < 1 ) 12313 if ( (signed int)v63 < 1 )
12311 v63 = 0; 12314 v63 = 0;
12348 } 12351 }
12349 else 12352 else
12350 { 12353 {
12351 do 12354 do
12352 { 12355 {
12353 if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) 12356 //if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] )
12357 if (pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v66].uItemID)
12354 ++v117; 12358 ++v117;
12355 ++v66; 12359 ++v66;
12356 } 12360 }
12357 while ( v66 < 12 ); 12361 while ( v66 < 12 );
12358 } 12362 }
12384 v117 = v71; 12388 v117 = v71;
12385 v72 = (int)window_SpeakInHouse->ptr_1C; 12389 v72 = (int)window_SpeakInHouse->ptr_1C;
12386 v73 = 9 * (v71 + 12 * v72); 12390 v73 = 9 * (v71 + 12 * v72);
12387 v74 = (ItemGen *)&pParty->field_777C[v73]; 12391 v74 = (ItemGen *)&pParty->field_777C[v73];
12388 if ( dword_F8B19C != 2 ) 12392 if ( dword_F8B19C != 2 )
12389 v74 = (ItemGen *)&pParty->field_C59C[v73 + 724]; 12393 // v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
12394 v74 =&pParty->Recipes_Item[v72][v71];
12390 if ( v67 && Str ) 12395 if ( v67 && Str )
12391 { 12396 {
12392 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24" 12397 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
12393 v96 = 0; 12398 v96 = 0;
12394 v94 = 2; 12399 v94 = 2;
13481 } 13486 }
13482 13487
13483 13488
13484 13489
13485 //----- (004B8F94) -------------------------------------------------------- 13490 //----- (004B8F94) --------------------------------------------------------
13486 void *__cdecl sub_4B8F94() 13491 void sub_4B8F94()
13487 { 13492 {
13488 GUIWindow *v0; // edi@1 13493 GUIWindow *v0; // edi@1
13489 signed int v1; // ebp@1 13494 signed int v1; // ebp@1
13490 int v2; // ebx@1 13495 int v2; // ebx@1
13491 signed int v3; // esi@1 13496 signed int v3; // esi@1
13531 v5 = word_4F07B6[v3 + 1]; 13536 v5 = word_4F07B6[v3 + 1];
13532 v12 = 44; 13537 v12 = 44;
13533 LABEL_12: 13538 LABEL_12:
13534 v6 = v12; 13539 v6 = v12;
13535 LABEL_13: 13540 LABEL_13:
13536 pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]); 13541 pItemsTable->GenerateItem(v5, v6,&pParty->Recipes_Item[v3][v1]);//(ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
13537 v0 = window_SpeakInHouse; 13542 v0 = window_SpeakInHouse;
13538 v2 = (int)&window_SpeakInHouse->ptr_1C; 13543 v2 = (int)&window_SpeakInHouse->ptr_1C;
13539 pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1; 13544 // pParty->field_C59C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 729] = 1;
13545 pParty->Recipes_Item[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes= 1;
13540 goto LABEL_14; 13546 goto LABEL_14;
13541 } 13547 }
13542 auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]; 13548 // auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724];
13549 auto _a =&pParty->Recipes_Item[v3][v1];
13543 _a->Reset(); 13550 _a->Reset();
13544 v2 = (int)&v0->ptr_1C; 13551 // v2 = (int)&v0->ptr_1C;
13545 v10 = rand(); 13552 //v10 = rand();
13546 v0 = window_SpeakInHouse; 13553 // v0 = window_SpeakInHouse;
13547 pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740; 13554 // pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740;
13555 pParty->Recipes_Item[(int)v0->ptr_1C][v1].uItemID= rand() % 32 + 740;
13548 } 13556 }
13549 LABEL_14: 13557 LABEL_14:
13550 v3 = *(int *)v2; 13558 v3 = *(int *)v2;
13551 ++v1; 13559 ++v1;
13552 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] ) 13560 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] )
13559 v6 = word_4F063E[5 * v3 + rand() % 4 + 1]; 13567 v6 = word_4F063E[5 * v3 + rand() % 4 + 1];
13560 goto LABEL_13; 13568 goto LABEL_13;
13561 } 13569 }
13562 LABEL_15: 13570 LABEL_15:
13563 result = v0->ptr_1C; 13571 result = v0->ptr_1C;
13564 *(int *)&pParty->field_16154[4 * (int)result] = 0; 13572 pParty->field_16154[(int)v0->ptr_1C] = 0;
13565 return result;
13566 } 13573 }
13567 13574
13568 13575
13569 //----- (004B6478) -------------------------------------------------------- 13576 //----- (004B6478) --------------------------------------------------------
13570 int __cdecl sub_4B6478() 13577 int __cdecl sub_4B6478()