Mercurial > mm7
comparison mm7_2.cpp @ 336:ea55d6414029
Event_proceccor preliminary
author | Gloval |
---|---|
date | Thu, 21 Feb 2013 00:33:12 +0400 |
parents | 8e23edf57e27 |
children | c067c5739e1f 672b83584b0f |
comparison
equal
deleted
inserted
replaced
329:f76027321087 | 336:ea55d6414029 |
---|---|
62 const char *v1; // ST10_4@1 | 62 const char *v1; // ST10_4@1 |
63 unsigned __int16 v2; // ST0C_2@1 | 63 unsigned __int16 v2; // ST0C_2@1 |
64 int v3; // eax@1 | 64 int v3; // eax@1 |
65 GUIWindow v5; // [sp+8h] [bp-54h]@1 | 65 GUIWindow v5; // [sp+8h] [bp-54h]@1 |
66 | 66 |
67 memcpy(&v5, ptr_507BC0, sizeof(v5)); | 67 memcpy(&v5, window_SpeakInHouse, sizeof(v5)); |
68 v0 = pGlobalTXT_LocalizationStrings[672]; | 68 v0 = pGlobalTXT_LocalizationStrings[672]; |
69 v1 = pGlobalTXT_LocalizationStrings[672]; | 69 v1 = pGlobalTXT_LocalizationStrings[672]; |
70 v5.uFrameX = 483; | 70 v5.uFrameX = 483; |
71 v5.uFrameWidth = 148; | 71 v5.uFrameWidth = 148; |
72 v5.uFrameZ = 334; | 72 v5.uFrameZ = 334; |
138 int v29; // [sp+10Ch] [bp-10h]@28 | 138 int v29; // [sp+10Ch] [bp-10h]@28 |
139 int v30; // [sp+110h] [bp-Ch]@1 | 139 int v30; // [sp+110h] [bp-Ch]@1 |
140 int v31; // [sp+114h] [bp-8h]@29 | 140 int v31; // [sp+114h] [bp-8h]@29 |
141 GUIFont *pOutString; // [sp+118h] [bp-4h]@21 | 141 GUIFont *pOutString; // [sp+118h] [bp-4h]@21 |
142 | 142 |
143 memcpy(&_this, ptr_507BC0, sizeof(_this)); | 143 memcpy(&_this, window_SpeakInHouse, sizeof(_this)); |
144 _this.uFrameX = 483; | 144 _this.uFrameX = 483; |
145 _this.uFrameWidth = 148; | 145 _this.uFrameWidth = 148; |
146 _this.uFrameZ = 334; | 146 _this.uFrameZ = 334; |
147 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 147 v28 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
148 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 148 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
202 { | 202 { |
203 if ( dword_F8B19C != 99 ) | 203 if ( dword_F8B19C != 99 ) |
204 { | 204 { |
205 if ( dword_F8B19C != 100 ) | 205 if ( dword_F8B19C != 100 ) |
206 return; | 206 return; |
207 v0 = ptr_507BC0; | 207 v0 = window_SpeakInHouse; |
208 if ( ptr_507BC0->field_40 == 1 ) | 208 if ( window_SpeakInHouse->field_40 == 1 ) |
209 { | 209 { |
210 sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); | 210 sprintf(pTmpBuf, "%s\n%s", pGlobalTXT_LocalizationStrings[606], pGlobalTXT_LocalizationStrings[112]); |
211 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u); | 211 _this.DrawTitleText(pFontArrus, 0, 0x92u, v30, pTmpBuf, 3u); |
212 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); | 212 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v28, (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); |
213 v3 = pFontArrus; | 213 v3 = pFontArrus; |
214 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); | 214 v4 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); |
215 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3); | 215 _this.DrawFlashingInputCursor(v4 / 2 + 80, 185, v3); |
216 return; | 216 return; |
217 } | 217 } |
218 if ( ptr_507BC0->field_40 == 2 ) | 218 if ( window_SpeakInHouse->field_40 == 2 ) |
219 { | 219 { |
220 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | 220 v1 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); |
221 v2 = v1; | 221 v2 = v1; |
222 if ( v1 <= 0 ) | 222 if ( v1 <= 0 ) |
223 { | 223 { |
231 } | 231 } |
232 return; | 232 return; |
233 } | 233 } |
234 if ( v1 > pParty->uNumGold ) | 234 if ( v1 > pParty->uNumGold ) |
235 { | 235 { |
236 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); | 236 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
237 v2 = pParty->uNumGold; | 237 v2 = pParty->uNumGold; |
238 } | 238 } |
239 if ( v2 > pParty->uFine ) | 239 if ( v2 > pParty->uFine ) |
240 v2 = pParty->uFine; | 240 v2 = pParty->uFine; |
241 Party::TakeGold(v2); | 241 Party::TakeGold(v2); |
242 pParty->uFine -= v2; | 242 pParty->uFine -= v2; |
243 if ( pParty->uFine < 0 ) | 243 if ( pParty->uFine < 0 ) |
244 pParty->uFine = 0; | 244 pParty->uFine = 0; |
245 if ( uActiveCharacter ) | 245 if ( uActiveCharacter ) |
246 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); | 246 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); |
247 v0 = ptr_507BC0; | 247 v0 = window_SpeakInHouse; |
248 } | 248 } |
249 else | 249 else |
250 { | 250 { |
251 if ( ptr_507BC0->field_40 != 3 ) | 251 if ( window_SpeakInHouse->field_40 != 3 ) |
252 return; | 252 return; |
253 } | 253 } |
254 v0->field_40 = 0; | 254 v0->field_40 = 0; |
255 goto LABEL_8; | 255 goto LABEL_8; |
256 } | 256 } |
303 char *v11; // [sp-4h] [bp-6Ch]@11 | 303 char *v11; // [sp-4h] [bp-6Ch]@11 |
304 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1 | 304 GUIWindow _this; // [sp+Ch] [bp-5Ch]@1 |
305 __int16 v13[2]; // [sp+60h] [bp-8h]@1 | 305 __int16 v13[2]; // [sp+60h] [bp-8h]@1 |
306 __int16 v14[2]; // [sp+64h] [bp-4h]@1 | 306 __int16 v14[2]; // [sp+64h] [bp-4h]@1 |
307 | 307 |
308 memcpy(&_this, ptr_507BC0, sizeof(_this)); | 308 memcpy(&_this, window_SpeakInHouse, sizeof(_this)); |
309 _this.uFrameX = 483; | 309 _this.uFrameX = 483; |
310 _this.uFrameWidth = 148; | 310 _this.uFrameWidth = 148; |
311 _this.uFrameZ = 334; | 311 _this.uFrameZ = 334; |
312 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 312 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
313 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 313 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
315 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); | 315 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); |
316 if ( dword_F8B19C != 1 ) | 316 if ( dword_F8B19C != 1 ) |
317 { | 317 { |
318 if ( dword_F8B19C == 7 ) | 318 if ( dword_F8B19C == 7 ) |
319 { | 319 { |
320 v0 = ptr_507BC0; | 320 v0 = window_SpeakInHouse; |
321 if ( ptr_507BC0->field_40 != 1 ) | 321 if ( window_SpeakInHouse->field_40 != 1 ) |
322 { | 322 { |
323 v1 = ptr_507BC0->field_40 - 2; | 323 v1 = window_SpeakInHouse->field_40 - 2; |
324 if ( ptr_507BC0->field_40 == 2 ) | 324 if ( window_SpeakInHouse->field_40 == 2 ) |
325 { | 325 { |
326 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | 326 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); |
327 v7 = v6; | 327 v7 = v6; |
328 if ( !v6 ) | 328 if ( !v6 ) |
329 { | 329 { |
337 } | 337 } |
338 return; | 338 return; |
339 } | 339 } |
340 if ( v6 > pParty->uNumGold ) | 340 if ( v6 > pParty->uNumGold ) |
341 { | 341 { |
342 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); | 342 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
343 v7 = pParty->uNumGold; | 343 v7 = pParty->uNumGold; |
344 } | 344 } |
345 if ( v7 ) | 345 if ( v7 ) |
346 { | 346 { |
347 Party::TakeGold(v7); | 347 Party::TakeGold(v7); |
348 pParty->uNumGoldInBank += v7; | 348 pParty->uNumGoldInBank += v7; |
349 if ( uActiveCharacter ) | 349 if ( uActiveCharacter ) |
350 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); | 350 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); |
351 } | 351 } |
352 v0 = ptr_507BC0; | 352 v0 = window_SpeakInHouse; |
353 LABEL_16: | 353 LABEL_16: |
354 v0->field_40 = 0; | 354 v0->field_40 = 0; |
355 goto LABEL_17; | 355 goto LABEL_17; |
356 } | 356 } |
357 LABEL_15: | 357 LABEL_15: |
364 } | 364 } |
365 else | 365 else |
366 { | 366 { |
367 if ( dword_F8B19C != 8 ) | 367 if ( dword_F8B19C != 8 ) |
368 return; | 368 return; |
369 v0 = ptr_507BC0; | 369 v0 = window_SpeakInHouse; |
370 if ( ptr_507BC0->field_40 != 1 ) | 370 if ( window_SpeakInHouse->field_40 != 1 ) |
371 { | 371 { |
372 v1 = ptr_507BC0->field_40 - 2; | 372 v1 = window_SpeakInHouse->field_40 - 2; |
373 if ( ptr_507BC0->field_40 == 2 ) | 373 if ( window_SpeakInHouse->field_40 == 2 ) |
374 { | 374 { |
375 ptr_507BC0->field_40 = 0; | 375 window_SpeakInHouse->field_40 = 0; |
376 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | 376 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); |
377 v3 = v2; | 377 v3 = v2; |
378 if ( v2 ) | 378 if ( v2 ) |
379 { | 379 { |
380 if ( v2 > pParty->uNumGoldInBank ) | 380 if ( v2 > pParty->uNumGoldInBank ) |
381 { | 381 { |
382 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); | 382 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
383 v3 = pParty->uNumGoldInBank; | 383 v3 = pParty->uNumGoldInBank; |
384 } | 384 } |
385 if ( v3 ) | 385 if ( v3 ) |
386 { | 386 { |
387 Party::SetGold(pParty->uNumGold + v3); | 387 Party::SetGold(pParty->uNumGold + v3); |
508 unsigned __int8 v88; // [sp+267h] [bp-Dh]@57 | 508 unsigned __int8 v88; // [sp+267h] [bp-Dh]@57 |
509 int v89; // [sp+268h] [bp-Ch]@1 | 509 int v89; // [sp+268h] [bp-Ch]@1 |
510 unsigned __int8 v90; // [sp+26Fh] [bp-5h]@55 | 510 unsigned __int8 v90; // [sp+26Fh] [bp-5h]@55 |
511 GUIFont *pOutString; // [sp+270h] [bp-4h]@3 | 511 GUIFont *pOutString; // [sp+270h] [bp-4h]@3 |
512 | 512 |
513 v0 = ptr_507BC0; | 513 v0 = window_SpeakInHouse; |
514 memcpy(&v79, ptr_507BC0, sizeof(v79)); | 514 memcpy(&v79, window_SpeakInHouse, sizeof(v79)); |
515 v85 = pPlayers[uActiveCharacter]; | 515 v85 = pPlayers[uActiveCharacter]; |
516 v1 = v85; | 516 v1 = v85; |
517 v79.uFrameX = 483; | 517 v79.uFrameX = 483; |
518 v79.uFrameWidth = 148; | 518 v79.uFrameWidth = 148; |
519 v79.uFrameZ = 334; | 519 v79.uFrameZ = 334; |
595 v69 = v26; | 595 v69 = v26; |
596 v67 = v84[0]; | 596 v67 = v84[0]; |
597 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138; | 597 v66 = (174 - pFontArrus->CalcTextHeight(v26, &v79, 0, 0)) / 2 + 138; |
598 goto LABEL_98; | 598 goto LABEL_98; |
599 } | 599 } |
600 strcpy(pTmpBuf, pNPCTopics[(uint)ptr_507BC0->ptr_1C + 247].pText); | 600 strcpy(pTmpBuf, pNPCTopics[(uint)window_SpeakInHouse->ptr_1C + 247].pText); |
601 v78.uFrameWidth = 460; | 601 v78.uFrameWidth = 460; |
602 v78.uFrameZ = 452; | 602 v78.uFrameZ = 452; |
603 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0); | 603 v61 = pFontArrus->CalcTextHeight(pTmpBuf, &v78, 12, 0); |
604 v62 = v61 + 7; | 604 v62 = v61 + 7; |
605 | 605 |
615 v70 = 0; | 615 v70 = 0; |
616 v68 = 0; | 616 v68 = 0; |
617 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0); | 617 v63 = FitTextInAWindow(pTmpBuf, pFontArrus, &v78, 0xCu, 0); |
618 v64 = pFontArrus; | 618 v64 = pFontArrus; |
619 } | 619 } |
620 ptr_507BC0->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); | 620 window_SpeakInHouse->DrawText(v64, 12, 354 - v62, 0, v63, v68, v70, v73); |
621 return; | 621 return; |
622 } | 622 } |
623 if ( dword_F8B19C != 101 ) | 623 if ( dword_F8B19C != 101 ) |
624 { | 624 { |
625 if ( dword_F8B19C != 1 ) | 625 if ( dword_F8B19C != 1 ) |
627 if ( dword_F8B19C == 15 ) | 627 if ( dword_F8B19C == 15 ) |
628 { | 628 { |
629 if ( pParty->uNumGold >= (unsigned int)pOutString ) | 629 if ( pParty->uNumGold >= (unsigned int)pOutString ) |
630 { | 630 { |
631 Party::TakeGold((unsigned int)pOutString); | 631 Party::TakeGold((unsigned int)pOutString); |
632 v27 = (int)ptr_507BC0->ptr_1C; | 632 v27 = (int)window_SpeakInHouse->ptr_1C; |
633 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2); | 633 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); |
634 dword_F8B19C = 0; | 634 dword_F8B19C = 0; |
635 while ( sub_4BD8B5() ) | 635 while ( sub_4BD8B5() ) |
636 ; | 636 ; |
637 sub_4B1D27(); | 637 sub_4B1D27(); |
638 pVideoPlayer->Unload(); | 638 pVideoPlayer->Unload(); |
639 ptr_507BC0->Release(); | 639 window_SpeakInHouse->Release(); |
640 ptr_507BC0 = 0; | 640 window_SpeakInHouse = 0; |
641 if ( pMessageQueue_50CBD0->uNumMessages ) | 641 if ( pMessageQueue_50CBD0->uNumMessages ) |
642 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 642 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
643 pMessageQueue_50CBD0->pMessages[0].eType = (UIMessageType)409; | 643 pMessageQueue_50CBD0->pMessages[0].eType = (UIMessageType)409; |
644 pMessageQueue_50CBD0->pMessages[0].param = v27; | 644 pMessageQueue_50CBD0->pMessages[0].param = v27; |
645 pMessageQueue_50CBD0->pMessages[0].field_8 = 1; | 645 pMessageQueue_50CBD0->pMessages[0].field_8 = 1; |
656 return; | 656 return; |
657 v8 = pDialogueWindow; | 657 v8 = pDialogueWindow; |
658 *(float *)&v89 = 0.0; | 658 *(float *)&v89 = 0.0; |
659 | 659 |
660 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); | 660 //v9 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); |
661 v9 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); | 661 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
662 | 662 |
663 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100); | 663 pOutString = (GUIFont *)(v9 * (100 - v85->GetMerchant()) / 100); |
664 if ( (signed int)pOutString < v9 / 3 ) | 664 if ( (signed int)pOutString < v9 / 3 ) |
665 pOutString = (GUIFont *)(v9 / 3); | 665 pOutString = (GUIFont *)(v9 / 3); |
666 v10 = v8->pStartingPosActiveItem; | 666 v10 = v8->pStartingPosActiveItem; |
737 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); | 737 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); |
738 goto LABEL_97; | 738 goto LABEL_97; |
739 } | 739 } |
740 *(_QWORD *)Str = pParty->uNumFoodRations; | 740 *(_QWORD *)Str = pParty->uNumFoodRations; |
741 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] ) | 741 //if ( (double)pParty->uNumFoodRations >= p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C] ) |
742 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier ) | 742 if ( (double)pParty->uNumFoodRations >= p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier ) |
743 { | 743 { |
744 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u); | 744 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2u); |
745 if ( uActiveCharacter ) | 745 if ( uActiveCharacter ) |
746 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0); | 746 pPlayers[uActiveCharacter]->PlaySound(SPEECH_67, 0); |
747 goto LABEL_43; | 747 goto LABEL_43; |
748 } | 748 } |
749 if ( pParty->uNumGold >= v7 ) | 749 if ( pParty->uNumGold >= v7 ) |
750 { | 750 { |
751 Party::TakeGold(v7); | 751 Party::TakeGold(v7); |
752 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; | 752 //pParty->uNumFoodRations = (signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; |
753 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier; | 753 pParty->uNumFoodRations = (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; |
754 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3); | 754 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 3); |
755 v5 = 1; | 755 v5 = 1; |
756 LABEL_43: | 756 LABEL_43: |
757 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 757 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
758 return; | 758 return; |
759 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 759 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; |
761 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 761 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
762 goto LABEL_51; | 762 goto LABEL_51; |
763 } | 763 } |
764 } | 764 } |
765 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 765 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
766 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 4); | 766 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 4); |
767 goto LABEL_43; | 767 goto LABEL_43; |
768 } | 768 } |
769 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 769 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
770 return; | 770 return; |
771 v28 = *(int *)v84; | 771 v28 = *(int *)v84; |
781 v29 = v81; | 781 v29 = v81; |
782 sprintf(&a1, format_4E2DC8, v29); | 782 sprintf(&a1, format_4E2DC8, v29); |
783 sprintf(pTmpBuf2, | 783 sprintf(pTmpBuf2, |
784 pGlobalTXT_LocalizationStrings[86], | 784 pGlobalTXT_LocalizationStrings[86], |
785 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C], | 785 //(signed __int64)p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C], |
786 (signed __int64)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier, | 786 (signed __int64)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier, |
787 v83); | 787 v83); |
788 strcat(&a1, pTmpBuf2); | 788 strcat(&a1, pTmpBuf2); |
789 v88 = pFontArrus->CalcTextHeight(&a1, &v79, 0, 0); | 789 v88 = pFontArrus->CalcTextHeight(&a1, &v79, 0, 0); |
790 strcat(&a1, "\n \n"); | 790 strcat(&a1, "\n \n"); |
791 v30 = *(int *)v84; | 791 v30 = *(int *)v84; |
795 strcat(&v77, pGlobalTXT_LocalizationStrings[160]); | 795 strcat(&v77, pGlobalTXT_LocalizationStrings[160]); |
796 v82 = pFontArrus->CalcTextHeight(&v77, &v79, 0, 0); | 796 v82 = pFontArrus->CalcTextHeight(&v77, &v79, 0, 0); |
797 strcat(&v77, "\n \n"); | 797 strcat(&v77, "\n \n"); |
798 v75 = 0; | 798 v75 = 0; |
799 v87 = 0; | 799 v87 = 0; |
800 v31 = (signed int)ptr_507BC0->ptr_1C; | 800 v31 = (signed int)window_SpeakInHouse->ptr_1C; |
801 if ( v31 >= 108 && v31 <= 120 ) | 801 if ( v31 >= 108 && v31 <= 120 ) |
802 { | 802 { |
803 v32 = *(int *)v84; | 803 v32 = *(int *)v84; |
804 if ( pDialogueWindow->pCurrentPosActiveItem != 5 ) | 804 if ( pDialogueWindow->pCurrentPosActiveItem != 5 ) |
805 v32 = v81; | 805 v32 = v81; |
937 bool v6; // ebp@5 | 937 bool v6; // ebp@5 |
938 int v7; // ecx@5 | 938 int v7; // ecx@5 |
939 void *result; // eax@15 | 939 void *result; // eax@15 |
940 signed int v9; // [sp-Ch] [bp-14h]@7 | 940 signed int v9; // [sp-Ch] [bp-14h]@7 |
941 | 941 |
942 v0 = ptr_507BC0; | 942 v0 = window_SpeakInHouse; |
943 v1 = 0; | 943 v1 = 0; |
944 v2 = (signed int)ptr_507BC0->ptr_1C; | 944 v2 = (signed int)window_SpeakInHouse->ptr_1C; |
945 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) | 945 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] ) |
946 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] ) | 946 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] ) |
947 { | 947 { |
948 while ( v2 > 14 ) | 948 while ( v2 > 14 ) |
949 { | 949 { |
950 if ( v2 <= 28 ) | 950 if ( v2 <= 28 ) |
951 { | 951 { |
972 v9 = 45; | 972 v9 = 45; |
973 LABEL_12: | 973 LABEL_12: |
974 v5 = v9; | 974 v5 = v9; |
975 LABEL_13: | 975 LABEL_13: |
976 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]); | 976 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]); |
977 v0 = ptr_507BC0; | 977 v0 = window_SpeakInHouse; |
978 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 5] = 1; | 978 pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 5] = 1; |
979 goto LABEL_14; | 979 goto LABEL_14; |
980 } | 980 } |
981 auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]; | 981 auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]; |
982 _t->Reset(); | 982 _t->Reset(); |
983 v0 = ptr_507BC0; | 983 v0 = window_SpeakInHouse; |
984 pParty->field_777C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] = 220; | 984 pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] = 220; |
985 } | 985 } |
986 LABEL_14: | 986 LABEL_14: |
987 v2 = (signed int)v0->ptr_1C; | 987 v2 = (signed int)v0->ptr_1C; |
988 ++v1; | 988 ++v1; |
989 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v0->ptr_1C]] ) | 989 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v0->ptr_1C]] ) |
1119 const char **v109; // [sp+F0h] [bp-8h]@26 | 1119 const char **v109; // [sp+F0h] [bp-8h]@26 |
1120 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16 | 1120 unsigned __int8 v110; // [sp+F7h] [bp-1h]@16 |
1121 | 1121 |
1122 v0 = pPlayers[uActiveCharacter]; | 1122 v0 = pPlayers[uActiveCharacter]; |
1123 _this = pPlayers[uActiveCharacter]; | 1123 _this = pPlayers[uActiveCharacter]; |
1124 memcpy(&v101, ptr_507BC0, sizeof(v101)); | 1124 memcpy(&v101, window_SpeakInHouse, sizeof(v101)); |
1125 v101.uFrameX = 483; | 1125 v101.uFrameX = 483; |
1126 v101.uFrameWidth = 148; | 1126 v101.uFrameWidth = 148; |
1127 v101.uFrameZ = 334; | 1127 v101.uFrameZ = 334; |
1128 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 1128 v105 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
1129 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 1129 v104 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
1189 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); | 1189 result = (char *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); |
1190 if ( result ) | 1190 if ( result ) |
1191 { | 1191 { |
1192 v30 = pDialogueWindow; | 1192 v30 = pDialogueWindow; |
1193 v3 = 0; | 1193 v3 = 0; |
1194 v31 = ptr_507BC0->ptr_1C; | 1194 v31 = window_SpeakInHouse->ptr_1C; |
1195 v106.y = 0; | 1195 v106.y = 0; |
1196 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); | 1196 //v32 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v31] * 500.0); |
1197 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0); | 1197 v32 = (signed __int64)(p2DEvents[(signed int)v31 - 1].flt_24 * 500.0); |
1198 v108 = v32 * (100 - _this->GetMerchant()) / 100; | 1198 v108 = v32 * (100 - _this->GetMerchant()) / 100; |
1199 if ( v108 < v32 / 3 ) | 1199 if ( v108 < v32 / 3 ) |
1307 result = (char *)(9 * (int)result); | 1307 result = (char *)(9 * (int)result); |
1308 if ( _this->field_1F5[4 * (int)result + 15] & 2 ) | 1308 if ( _this->field_1F5[4 * (int)result + 15] & 2 ) |
1309 { | 1309 { |
1310 v85 = 0; | 1310 v85 = 0; |
1311 v83 = 5; | 1311 v83 = 5; |
1312 v81 = ptr_507BC0->ptr_1C; | 1312 v81 = window_SpeakInHouse->ptr_1C; |
1313 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5]; | 1313 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5]; |
1314 v28 = (int)ptr_507BC0->ptr_1C; | 1314 v28 = (int)window_SpeakInHouse->ptr_1C; |
1315 v110 = uActiveCharacter - 1; | 1315 v110 = uActiveCharacter - 1; |
1316 v29 = _this->_490EEE( | 1316 v29 = _this->_490EEE( |
1317 (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5], | 1317 (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * (int)result + 5], |
1318 1, | 1318 1, |
1319 v28, | 1319 v28, |
1405 v3 = 0; | 1405 v3 = 0; |
1406 if ( result ) | 1406 if ( result ) |
1407 { | 1407 { |
1408 v85 = 0; | 1408 v85 = 0; |
1409 v83 = 3; | 1409 v83 = 3; |
1410 v81 = ptr_507BC0->ptr_1C; | 1410 v81 = window_SpeakInHouse->ptr_1C; |
1411 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; | 1411 v79 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; |
1412 v12 = (int)ptr_507BC0->ptr_1C; | 1412 v12 = (int)window_SpeakInHouse->ptr_1C; |
1413 v110 = uActiveCharacter - 1; | 1413 v110 = uActiveCharacter - 1; |
1414 v13 = _this->_490EEE(v79, 1, v12, 3); | 1414 v13 = _this->_490EEE(v79, 1, v12, 3); |
1415 v6 = v110; | 1415 v6 = v110; |
1416 v5 = (char *)pMerchantsSellPhrases[v13]; | 1416 v5 = (char *)pMerchantsSellPhrases[v13]; |
1417 goto LABEL_14; | 1417 goto LABEL_14; |
1446 v85 = 0; | 1446 v85 = 0; |
1447 v83 = 4; | 1447 v83 = 4; |
1448 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; | 1448 v4 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; |
1449 if (!v4->Identified()) | 1449 if (!v4->Identified()) |
1450 { | 1450 { |
1451 v81 = ptr_507BC0->ptr_1C; | 1451 v81 = window_SpeakInHouse->ptr_1C; |
1452 v79 = v4; | 1452 v79 = v4; |
1453 v9 = (int)ptr_507BC0->ptr_1C; | 1453 v9 = (int)window_SpeakInHouse->ptr_1C; |
1454 v110 = uActiveCharacter - 1; | 1454 v110 = uActiveCharacter - 1; |
1455 v10 = _this->_490EEE(v4, 1, v9, 4); | 1455 v10 = _this->_490EEE(v4, 1, v9, 4); |
1456 v6 = v110; | 1456 v6 = v110; |
1457 v5 = (char *)pMerchantsIdentifyPhrases[v10]; | 1457 v5 = (char *)pMerchantsIdentifyPhrases[v10]; |
1458 goto LABEL_14; | 1458 goto LABEL_14; |
1459 } | 1459 } |
1460 v81 = ptr_507BC0->ptr_1C; | 1460 v81 = window_SpeakInHouse->ptr_1C; |
1461 v5 = "%24"; | 1461 v5 = "%24"; |
1462 v79 = v4; | 1462 v79 = v4; |
1463 LABEL_13: | 1463 LABEL_13: |
1464 v6 = uActiveCharacter - 1; | 1464 v6 = uActiveCharacter - 1; |
1465 LABEL_14: | 1465 LABEL_14: |
1489 v48 = 0; | 1489 v48 = 0; |
1490 v108 = 0; | 1490 v108 = 0; |
1491 v109 = 0; | 1491 v109 = 0; |
1492 do | 1492 do |
1493 { | 1493 { |
1494 if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)ptr_507BC0->ptr_1C]] ) | 1494 if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) |
1495 { | 1495 { |
1496 v49 = word_F8B158[(signed int)v48]; | 1496 v49 = word_F8B158[(signed int)v48]; |
1497 v50 = dword_F8B168[(signed int)v48]; | 1497 v50 = dword_F8B168[(signed int)v48]; |
1498 v49 += 30; | 1498 v49 += 30; |
1499 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); | 1499 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); |
1514 { | 1514 { |
1515 v109 = 0; | 1515 v109 = 0; |
1516 v108 = 0; | 1516 v108 = 0; |
1517 do | 1517 do |
1518 { | 1518 { |
1519 if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)ptr_507BC0->ptr_1C] + 724] ) | 1519 if ( pParty->field_C59C[9 * (int)&v109[3 * (unsigned int)window_SpeakInHouse->ptr_1C] + 724] ) |
1520 { | 1520 { |
1521 v52 = word_F8B158[(signed int)v109] + 30; | 1521 v52 = word_F8B158[(signed int)v109] + 30; |
1522 v53 = dword_F8B168[(signed int)v109]; | 1522 v53 = dword_F8B168[(signed int)v109]; |
1523 v54 = 60 - ((signed int)v53->uTextureWidth >> 1); | 1523 v54 = 60 - ((signed int)v53->uTextureWidth >> 1); |
1524 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); | 1524 pRenderer->DrawTextureTransparent(v54 + v108, word_F8B158[(signed int)v109] + 30, v53); |
1540 if ( dword_F8B19C == 2 ) | 1540 if ( dword_F8B19C == 2 ) |
1541 { | 1541 { |
1542 v106.x = 0; | 1542 v106.x = 0; |
1543 do | 1543 do |
1544 { | 1544 { |
1545 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) | 1545 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
1546 ++v106.x; | 1546 ++v106.x; |
1547 ++v55; | 1547 ++v55; |
1548 } | 1548 } |
1549 while ( v55 < 6 ); | 1549 while ( v55 < 6 ); |
1550 } | 1550 } |
1551 else | 1551 else |
1552 { | 1552 { |
1553 do | 1553 do |
1554 { | 1554 { |
1555 if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) | 1555 if ( pParty->field_C59C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) |
1556 ++v106.x; | 1556 ++v106.x; |
1557 ++v55; | 1557 ++v55; |
1558 } | 1558 } |
1559 while ( v55 < 6 ); | 1559 while ( v55 < 6 ); |
1560 } | 1560 } |
1578 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]); | 1578 result = (char *)(v59->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v89)->y]); |
1579 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) | 1579 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) |
1580 { | 1580 { |
1581 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; | 1581 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; |
1582 v106.x = v60; | 1582 v106.x = v60; |
1583 v61 = (int)ptr_507BC0->ptr_1C; | 1583 v61 = (int)window_SpeakInHouse->ptr_1C; |
1584 v62 = 9 * (v60 + 12 * v61); | 1584 v62 = 9 * (v60 + 12 * v61); |
1585 v63 = (ItemGen *)&pParty->field_777C[v62]; | 1585 v63 = (ItemGen *)&pParty->field_777C[v62]; |
1586 if ( dword_F8B19C != 2 ) | 1586 if ( dword_F8B19C != 2 ) |
1587 v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; | 1587 v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; |
1588 if ( !v56 || !Str ) | 1588 if ( !v56 || !Str ) |
1589 { | 1589 { |
1590 v85 = 0; | 1590 v85 = 0; |
1591 v83 = 2; | 1591 v83 = 2; |
1592 v81 = ptr_507BC0->ptr_1C; | 1592 v81 = window_SpeakInHouse->ptr_1C; |
1593 v79 = v63; | 1593 v79 = v63; |
1594 v110 = uActiveCharacter - 1; | 1594 v110 = uActiveCharacter - 1; |
1595 v64 = _this->_490EEE(v63, 1, v61, 2); | 1595 v64 = _this->_490EEE(v63, 1, v61, 2); |
1596 v6 = v110; | 1596 v6 = v110; |
1597 v5 = (char *)pMerchantsBuyPhrases[v64]; | 1597 v5 = (char *)pMerchantsBuyPhrases[v64]; |
1598 goto LABEL_14; | 1598 goto LABEL_14; |
1599 } | 1599 } |
1600 v5 = pGlobalTXT_LocalizationStrings[181]; | 1600 v5 = pGlobalTXT_LocalizationStrings[181]; |
1601 v85 = 0; | 1601 v85 = 0; |
1602 v83 = 2; | 1602 v83 = 2; |
1603 v81 = ptr_507BC0->ptr_1C; | 1603 v81 = window_SpeakInHouse->ptr_1C; |
1604 v79 = v63; | 1604 v79 = v63; |
1605 goto LABEL_13; | 1605 goto LABEL_13; |
1606 } | 1606 } |
1607 } | 1607 } |
1608 else | 1608 else |
1609 { | 1609 { |
1610 result = v101._4B1854( | 1610 result = v101._4B1854( |
1611 __PAIR__( | 1611 __PAIR__( |
1612 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1], | 1612 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1], |
1613 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C]) | 1613 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) |
1614 - pParty->uTimePlayed); | 1614 - pParty->uTimePlayed); |
1615 } | 1615 } |
1616 } | 1616 } |
1617 return result; | 1617 return result; |
1618 } | 1618 } |
1737 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47 | 1737 unsigned __int8 v113; // [sp+D3h] [bp-5h]@47 |
1738 int v114; // [sp+D4h] [bp-4h]@11 | 1738 int v114; // [sp+D4h] [bp-4h]@11 |
1739 | 1739 |
1740 v0 = pPlayers[uActiveCharacter]; | 1740 v0 = pPlayers[uActiveCharacter]; |
1741 _this = pPlayers[uActiveCharacter]; | 1741 _this = pPlayers[uActiveCharacter]; |
1742 memcpy(&v104, ptr_507BC0, sizeof(v104)); | 1742 memcpy(&v104, window_SpeakInHouse, sizeof(v104)); |
1743 v104.uFrameX = 483; | 1743 v104.uFrameX = 483; |
1744 v104.uFrameWidth = 148; | 1744 v104.uFrameWidth = 148; |
1745 v104.uFrameZ = 334; | 1745 v104.uFrameZ = 334; |
1746 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 1746 v108 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
1747 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 1747 v106 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
1817 || (result = pMouse->GetCursorPos(&v100), result->x >= 462) | 1817 || (result = pMouse->GetCursorPos(&v100), result->x >= 462) |
1818 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) ) | 1818 || (result = (POINT *)v0->GetItemIDAtInventoryIndex((int *)&v109), v3 = 0, !result) ) |
1819 return result; | 1819 return result; |
1820 v93 = 0; | 1820 v93 = 0; |
1821 v91 = 3; | 1821 v91 = 3; |
1822 v89 = ptr_507BC0->ptr_1C; | 1822 v89 = window_SpeakInHouse->ptr_1C; |
1823 v87 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; | 1823 v87 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; |
1824 v44 = (int)ptr_507BC0->ptr_1C; | 1824 v44 = (int)window_SpeakInHouse->ptr_1C; |
1825 v113 = uActiveCharacter - 1; | 1825 v113 = uActiveCharacter - 1; |
1826 v45 = _this->_490EEE(v87, 4, v44, 3); | 1826 v45 = _this->_490EEE(v87, 4, v44, 3); |
1827 v39 = v113; | 1827 v39 = v113; |
1828 v38 = (char *)pMerchantsSellPhrases[v45]; | 1828 v38 = (char *)pMerchantsSellPhrases[v45]; |
1829 goto LABEL_45; | 1829 goto LABEL_45; |
1845 v93 = 0; | 1845 v93 = 0; |
1846 v91 = 4; | 1846 v91 = 4; |
1847 v37 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; | 1847 v37 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * (int)result + 5]; |
1848 if (!v37->Identified()) | 1848 if (!v37->Identified()) |
1849 { | 1849 { |
1850 v89 = ptr_507BC0->ptr_1C; | 1850 v89 = window_SpeakInHouse->ptr_1C; |
1851 v87 = v37; | 1851 v87 = v37; |
1852 v41 = (int)ptr_507BC0->ptr_1C; | 1852 v41 = (int)window_SpeakInHouse->ptr_1C; |
1853 v113 = uActiveCharacter - 1; | 1853 v113 = uActiveCharacter - 1; |
1854 v42 = _this->_490EEE(v37, 4, v41, 4); | 1854 v42 = _this->_490EEE(v37, 4, v41, 4); |
1855 v39 = v113; | 1855 v39 = v113; |
1856 v38 = (char *)pMerchantsIdentifyPhrases[v42]; | 1856 v38 = (char *)pMerchantsIdentifyPhrases[v42]; |
1857 goto LABEL_45; | 1857 goto LABEL_45; |
1858 } | 1858 } |
1859 v89 = ptr_507BC0->ptr_1C; | 1859 v89 = window_SpeakInHouse->ptr_1C; |
1860 v38 = "%24"; | 1860 v38 = "%24"; |
1861 v87 = v37; | 1861 v87 = v37; |
1862 LABEL_44: | 1862 LABEL_44: |
1863 v39 = uActiveCharacter - 1; | 1863 v39 = uActiveCharacter - 1; |
1864 LABEL_45: | 1864 LABEL_45: |
1929 if ( dword_F8B19C != 96 | 1929 if ( dword_F8B19C != 96 |
1930 || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 ) | 1930 || (result = (POINT *)sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()) == 0 ) |
1931 return result; | 1931 return result; |
1932 v2 = pDialogueWindow; | 1932 v2 = pDialogueWindow; |
1933 v3 = 0; | 1933 v3 = 0; |
1934 v4 = ptr_507BC0->ptr_1C; | 1934 v4 = window_SpeakInHouse->ptr_1C; |
1935 v112 = 0; | 1935 v112 = 0; |
1936 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0); | 1936 //v5 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v4] * 500.0); |
1937 v5 = (signed __int64)(p2DEvents[(signed int)v4 - 1].flt_24 * 500.0); | 1937 v5 = (signed __int64)(p2DEvents[(signed int)v4 - 1].flt_24 * 500.0); |
1938 v111 = (const char **)(v5 * (100 - _this->GetMerchant()) / 100); | 1938 v111 = (const char **)(v5 * (100 - _this->GetMerchant()) / 100); |
1939 if ( (signed int)v111 < v5 / 3 ) | 1939 if ( (signed int)v111 < v5 / 3 ) |
2027 v114 = 0; | 2027 v114 = 0; |
2028 if ( dword_F8B19C == 2 ) | 2028 if ( dword_F8B19C == 2 ) |
2029 { | 2029 { |
2030 do | 2030 do |
2031 { | 2031 { |
2032 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) | 2032 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
2033 { | 2033 { |
2034 v46 = dword_F8B168[v114]; | 2034 v46 = dword_F8B168[v114]; |
2035 v47 = 152 - v46->uTextureHeight; | 2035 v47 = 152 - v46->uTextureHeight; |
2036 if ( (signed int)v47 < 1 ) | 2036 if ( (signed int)v47 < 1 ) |
2037 v47 = 0; | 2037 v47 = 0; |
2057 } | 2057 } |
2058 while ( v114 < 6 ); | 2058 while ( v114 < 6 ); |
2059 v114 = 0; | 2059 v114 = 0; |
2060 do | 2060 do |
2061 { | 2061 { |
2062 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] ) | 2062 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) |
2063 { | 2063 { |
2064 v50 = dword_F8B168[v114 + 6]; | 2064 v50 = dword_F8B168[v114 + 6]; |
2065 v51 = 308 - v50->uTextureHeight; | 2065 v51 = 308 - v50->uTextureHeight; |
2066 if ( (signed int)v51 < 1 ) | 2066 if ( (signed int)v51 < 1 ) |
2067 v51 = 0; | 2067 v51 = 0; |
2089 } | 2089 } |
2090 else | 2090 else |
2091 { | 2091 { |
2092 do | 2092 do |
2093 { | 2093 { |
2094 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) | 2094 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) |
2095 { | 2095 { |
2096 v54 = dword_F8B168[v114]; | 2096 v54 = dword_F8B168[v114]; |
2097 v55 = 152 - v54->uTextureHeight; | 2097 v55 = 152 - v54->uTextureHeight; |
2098 if ( (signed int)v55 < 1 ) | 2098 if ( (signed int)v55 < 1 ) |
2099 v55 = 0; | 2099 v55 = 0; |
2119 } | 2119 } |
2120 while ( v114 < 6 ); | 2120 while ( v114 < 6 ); |
2121 v114 = 0; | 2121 v114 = 0; |
2122 do | 2122 do |
2123 { | 2123 { |
2124 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] ) | 2124 if ( pParty->field_C59C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 778] ) |
2125 { | 2125 { |
2126 v58 = dword_F8B168[v114 + 6]; | 2126 v58 = dword_F8B168[v114 + 6]; |
2127 v59 = 308 - v58->uTextureHeight; | 2127 v59 = 308 - v58->uTextureHeight; |
2128 if ( (signed int)v59 < 1 ) | 2128 if ( (signed int)v59 < 1 ) |
2129 v59 = 0; | 2129 v59 = 0; |
2156 v109 = 0; | 2156 v109 = 0; |
2157 if ( dword_F8B19C == 2 ) | 2157 if ( dword_F8B19C == 2 ) |
2158 { | 2158 { |
2159 do | 2159 do |
2160 { | 2160 { |
2161 if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) | 2161 if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
2162 ++v109; | 2162 ++v109; |
2163 ++v62; | 2163 ++v62; |
2164 } | 2164 } |
2165 while ( v62 < 12 ); | 2165 while ( v62 < 12 ); |
2166 } | 2166 } |
2167 else | 2167 else |
2168 { | 2168 { |
2169 do | 2169 do |
2170 { | 2170 { |
2171 if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) | 2171 if ( pParty->field_C59C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) |
2172 ++v109; | 2172 ++v109; |
2173 ++v62; | 2173 ++v62; |
2174 } | 2174 } |
2175 while ( v62 < 12 ); | 2175 while ( v62 < 12 ); |
2176 } | 2176 } |
2189 } | 2189 } |
2190 sub_4B46A5(v65, 0); | 2190 sub_4B46A5(v65, 0); |
2191 if ( !v109 ) | 2191 if ( !v109 ) |
2192 return (POINT *)v104._4B1854( | 2192 return (POINT *)v104._4B1854( |
2193 __PAIR__( | 2193 __PAIR__( |
2194 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1], | 2194 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C + 1], |
2195 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C]) | 2195 pParty->field_3C.field_50[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) |
2196 - pParty->uTimePlayed); | 2196 - pParty->uTimePlayed); |
2197 v66 = pMouse->GetCursorPos(&v98); | 2197 v66 = pMouse->GetCursorPos(&v98); |
2198 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); | 2198 result = (POINT *)(v66->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v96)->y]); |
2199 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) | 2199 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) |
2200 { | 2200 { |
2201 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; | 2201 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; |
2202 v109 = v67; | 2202 v109 = v67; |
2203 v68 = (int)ptr_507BC0->ptr_1C; | 2203 v68 = (int)window_SpeakInHouse->ptr_1C; |
2204 v69 = 9 * (v67 + 12 * v68); | 2204 v69 = 9 * (v67 + 12 * v68); |
2205 v70 = (ItemGen *)&pParty->field_777C[v69]; | 2205 v70 = (ItemGen *)&pParty->field_777C[v69]; |
2206 if ( dword_F8B19C != 2 ) | 2206 if ( dword_F8B19C != 2 ) |
2207 v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; | 2207 v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; |
2208 if ( !v63 || !Str ) | 2208 if ( !v63 || !Str ) |
2209 { | 2209 { |
2210 v93 = 0; | 2210 v93 = 0; |
2211 v91 = 2; | 2211 v91 = 2; |
2212 v89 = ptr_507BC0->ptr_1C; | 2212 v89 = window_SpeakInHouse->ptr_1C; |
2213 v87 = v70; | 2213 v87 = v70; |
2214 v113 = uActiveCharacter - 1; | 2214 v113 = uActiveCharacter - 1; |
2215 v71 = _this->_490EEE(v70, 4, v68, 2); | 2215 v71 = _this->_490EEE(v70, 4, v68, 2); |
2216 v39 = v113; | 2216 v39 = v113; |
2217 v38 = (char *)pMerchantsBuyPhrases[v71]; | 2217 v38 = (char *)pMerchantsBuyPhrases[v71]; |
2218 goto LABEL_45; | 2218 goto LABEL_45; |
2219 } | 2219 } |
2220 v38 = pGlobalTXT_LocalizationStrings[181]; | 2220 v38 = pGlobalTXT_LocalizationStrings[181]; |
2221 v93 = 0; | 2221 v93 = 0; |
2222 v91 = 2; | 2222 v91 = 2; |
2223 v89 = ptr_507BC0->ptr_1C; | 2223 v89 = window_SpeakInHouse->ptr_1C; |
2224 v87 = v70; | 2224 v87 = v70; |
2225 goto LABEL_44; | 2225 goto LABEL_44; |
2226 } | 2226 } |
2227 } | 2227 } |
2228 } | 2228 } |
2388 int v152; // [sp+FCh] [bp-8h]@24 | 2388 int v152; // [sp+FCh] [bp-8h]@24 |
2389 int v153; // [sp+100h] [bp-4h]@44 | 2389 int v153; // [sp+100h] [bp-4h]@44 |
2390 | 2390 |
2391 v0 = pPlayers[uActiveCharacter]; | 2391 v0 = pPlayers[uActiveCharacter]; |
2392 _this = pPlayers[uActiveCharacter]; | 2392 _this = pPlayers[uActiveCharacter]; |
2393 memcpy(&v144, ptr_507BC0, sizeof(v144)); | 2393 memcpy(&v144, window_SpeakInHouse, sizeof(v144)); |
2394 v144.uFrameX = 483; | 2394 v144.uFrameX = 483; |
2395 v144.uFrameWidth = 148; | 2395 v144.uFrameWidth = 148; |
2396 v144.uFrameZ = 334; | 2396 v144.uFrameZ = 334; |
2397 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 2397 v148 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
2398 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 2398 v147 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
2406 return; | 2406 return; |
2407 v149 = 0; | 2407 v149 = 0; |
2408 v93 = 0; | 2408 v93 = 0; |
2409 do | 2409 do |
2410 { | 2410 { |
2411 if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) | 2411 if ( pParty->field_C59C[9 * (v93 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) |
2412 ++v149; | 2412 ++v149; |
2413 ++v93; | 2413 ++v93; |
2414 } | 2414 } |
2415 while ( v93 < 8 ); | 2415 while ( v93 < 8 ); |
2416 if ( v149 ) | 2416 if ( v149 ) |
2419 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]]; | 2419 v149 = pRenderer->pActiveZBuffer[v94->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v130)->y]]; |
2420 v95 = v149; | 2420 v95 = v149; |
2421 if ( v149 && v149 != -65536 ) | 2421 if ( v149 && v149 != -65536 ) |
2422 { | 2422 { |
2423 --v149; | 2423 --v149; |
2424 v96 = ptr_507BC0->ptr_1C; | 2424 v96 = window_SpeakInHouse->ptr_1C; |
2425 v97 = uActiveCharacter - 1; | 2425 v97 = uActiveCharacter - 1; |
2426 v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724]; | 2426 v98 = (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724]; |
2427 v99 = _this->_490EEE( | 2427 v99 = _this->_490EEE( |
2428 (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724], | 2428 (ItemGen *)&pParty->field_C59C[9 * (v95 - 1 + 12 * (int)v96) + 724], |
2429 2, | 2429 2, |
2430 (int)ptr_507BC0->ptr_1C, | 2430 (int)window_SpeakInHouse->ptr_1C, |
2431 2); | 2431 2); |
2432 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0); | 2432 v100 = BuilDialogueString((char *)pMerchantsBuyPhrases[v99], v97, v98, (char *)v96, 2, 0); |
2433 v101 = v100; | 2433 v101 = v100; |
2434 v102 = v148; | 2434 v102 = v148; |
2435 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0); | 2435 v103 = pFontArrus->CalcTextHeight(v100, &v144, 0, 0); |
2437 } | 2437 } |
2438 v104 = 0; | 2438 v104 = 0; |
2439 v153 = 0; | 2439 v153 = 0; |
2440 do | 2440 do |
2441 { | 2441 { |
2442 if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] ) | 2442 if ( pParty->field_C59C[9 * (v104 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] ) |
2443 { | 2443 { |
2444 v105 = dword_F8B168[v104]; | 2444 v105 = dword_F8B168[v104]; |
2445 if ( v104 >= 4 ) | 2445 if ( v104 >= 4 ) |
2446 { | 2446 { |
2447 v110 = 90 - ((signed int)v105->uTextureWidth >> 1); | 2447 v110 = 90 - ((signed int)v105->uTextureWidth >> 1); |
2465 ++v104; | 2465 ++v104; |
2466 } | 2466 } |
2467 while ( v104 < 8 ); | 2467 while ( v104 < 8 ); |
2468 return; | 2468 return; |
2469 } | 2469 } |
2470 v72 = ptr_507BC0->ptr_1C; | 2470 v72 = window_SpeakInHouse->ptr_1C; |
2471 goto LABEL_96; | 2471 goto LABEL_96; |
2472 } | 2472 } |
2473 if ( dword_F8B19C == 94 ) | 2473 if ( dword_F8B19C == 94 ) |
2474 { | 2474 { |
2475 draw_leather(); | 2475 draw_leather(); |
2526 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 2526 if ( dword_F8B19C != 96 || !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
2527 return; | 2527 return; |
2528 v152 = 0; | 2528 v152 = 0; |
2529 v37 = pDialogueWindow; | 2529 v37 = pDialogueWindow; |
2530 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); | 2530 //v38 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); |
2531 v38 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); | 2531 v38 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
2532 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100); | 2532 _this = (Player *)(v38 * (100 - v0->GetMerchant()) / 100); |
2533 if ( (signed int)_this < v38 / 3 ) | 2533 if ( (signed int)_this < v38 / 3 ) |
2534 _this = (Player *)(v38 / 3); | 2534 _this = (Player *)(v38 / 3); |
2535 v39 = v37->pStartingPosActiveItem; | 2535 v39 = v37->pStartingPosActiveItem; |
2536 v40 = v37->pNumPresenceButton; | 2536 v40 = v37->pNumPresenceButton; |
2624 { | 2624 { |
2625 v55 = 0; | 2625 v55 = 0; |
2626 v153 = 0; | 2626 v153 = 0; |
2627 do | 2627 do |
2628 { | 2628 { |
2629 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] ) | 2629 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
2630 { | 2630 { |
2631 v56 = dword_F8B168[v55]; | 2631 v56 = dword_F8B168[v55]; |
2632 if ( v55 >= 4 ) | 2632 if ( v55 >= 4 ) |
2633 { | 2633 { |
2634 v60 = 90 - ((signed int)v56->uTextureWidth >> 1); | 2634 v60 = 90 - ((signed int)v56->uTextureWidth >> 1); |
2658 v11 = 0; | 2658 v11 = 0; |
2659 v61 = 0; | 2659 v61 = 0; |
2660 v153 = 0; | 2660 v153 = 0; |
2661 do | 2661 do |
2662 { | 2662 { |
2663 if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 ) | 2663 if ( (char *)pParty->field_C59C[9 * (v61 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) |
2664 { | 2664 { |
2665 v62 = dword_F8B168[v61]; | 2665 v62 = dword_F8B168[v61]; |
2666 if ( v61 >= 4 ) | 2666 if ( v61 >= 4 ) |
2667 { | 2667 { |
2668 v67 = 90 - ((signed int)v62->uTextureWidth >> 1); | 2668 v67 = 90 - ((signed int)v62->uTextureWidth >> 1); |
2694 v149 = (__int32)v11; | 2694 v149 = (__int32)v11; |
2695 if ( dword_F8B19C == 2 ) | 2695 if ( dword_F8B19C == 2 ) |
2696 { | 2696 { |
2697 do | 2697 do |
2698 { | 2698 { |
2699 if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] != v11 ) | 2699 if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 ) |
2700 ++v149; | 2700 ++v149; |
2701 ++v68; | 2701 ++v68; |
2702 } | 2702 } |
2703 while ( v68 < 6 ); | 2703 while ( v68 < 6 ); |
2704 } | 2704 } |
2705 else | 2705 else |
2706 { | 2706 { |
2707 do | 2707 do |
2708 { | 2708 { |
2709 if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] != v11 ) | 2709 if ( (char *)pParty->field_C59C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 724] != v11 ) |
2710 ++v149; | 2710 ++v149; |
2711 ++v68; | 2711 ++v68; |
2712 } | 2712 } |
2713 while ( v68 < 6 ); | 2713 while ( v68 < 6 ); |
2714 } | 2714 } |
2731 v73 = pMouse->GetCursorPos(&v136); | 2731 v73 = pMouse->GetCursorPos(&v136); |
2732 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF; | 2732 v74 = pRenderer->pActiveZBuffer[v73->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v134)->y]] & 0xFFFF; |
2733 if ( !v74 ) | 2733 if ( !v74 ) |
2734 return; | 2734 return; |
2735 v149 = v74 - 1; | 2735 v149 = v74 - 1; |
2736 v75 = (int)ptr_507BC0->ptr_1C; | 2736 v75 = (int)window_SpeakInHouse->ptr_1C; |
2737 v76 = 9 * (v74 - 1 + 12 * v75); | 2737 v76 = 9 * (v74 - 1 + 12 * v75); |
2738 if ( dword_F8B19C == 2 ) | 2738 if ( dword_F8B19C == 2 ) |
2739 v77 = (ItemGen *)&pParty->field_777C[v76]; | 2739 v77 = (ItemGen *)&pParty->field_777C[v76]; |
2740 else | 2740 else |
2741 v77 = (ItemGen *)&pParty->field_C59C[v76 + 724]; | 2741 v77 = (ItemGen *)&pParty->field_C59C[v76 + 724]; |
2742 if ( v69 == (short)v11 || Str == v11 ) | 2742 if ( v69 == (short)v11 || Str == v11 ) |
2743 { | 2743 { |
2744 v124 = (__int64 *)v11; | 2744 v124 = (__int64 *)v11; |
2745 v122 = 2; | 2745 v122 = 2; |
2746 v120 = ptr_507BC0->ptr_1C; | 2746 v120 = window_SpeakInHouse->ptr_1C; |
2747 v116 = v77; | 2747 v116 = v77; |
2748 v78 = uActiveCharacter - 1; | 2748 v78 = uActiveCharacter - 1; |
2749 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)]; | 2749 v15 = (char *)pMerchantsBuyPhrases[_this->_490EEE(v77, 2, v75, 2)]; |
2750 v14 = v78; | 2750 v14 = v78; |
2751 } | 2751 } |
2752 else | 2752 else |
2753 { | 2753 { |
2754 v124 = (__int64 *)v11; | 2754 v124 = (__int64 *)v11; |
2755 v122 = 2; | 2755 v122 = 2; |
2756 v120 = ptr_507BC0->ptr_1C; | 2756 v120 = window_SpeakInHouse->ptr_1C; |
2757 v116 = v77; | 2757 v116 = v77; |
2758 v15 = pGlobalTXT_LocalizationStrings[181]; | 2758 v15 = pGlobalTXT_LocalizationStrings[181]; |
2759 v14 = uActiveCharacter - 1; | 2759 v14 = uActiveCharacter - 1; |
2760 } | 2760 } |
2761 LABEL_36: | 2761 LABEL_36: |
2766 v117 = (int)v11; | 2766 v117 = (int)v11; |
2767 v113 = (int)v11; | 2767 v113 = (int)v11; |
2768 v111 = &v144; | 2768 v111 = &v144; |
2769 goto LABEL_63; | 2769 goto LABEL_63; |
2770 } | 2770 } |
2771 v72 = ptr_507BC0->ptr_1C; | 2771 v72 = window_SpeakInHouse->ptr_1C; |
2772 LABEL_96: | 2772 LABEL_96: |
2773 v144._4B1854( | 2773 v144._4B1854( |
2774 __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72]) | 2774 __PAIR__(pParty->field_3C.field_50[2 * (int)v72 + 1], pParty->field_3C.field_50[2 * (int)v72]) |
2775 - pParty->uTimePlayed); | 2775 - pParty->uTimePlayed); |
2776 return; | 2776 return; |
2788 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32) | 2788 || (v32 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v32) |
2789 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) ) | 2789 || (v33 = 9 * v32, !(v0->field_1F5[4 * v33 + 15] & 2)) ) |
2790 return; | 2790 return; |
2791 v124 = 0; | 2791 v124 = 0; |
2792 v122 = 5; | 2792 v122 = 5; |
2793 v120 = ptr_507BC0->ptr_1C; | 2793 v120 = window_SpeakInHouse->ptr_1C; |
2794 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5]; | 2794 v116 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5]; |
2795 v34 = (int)ptr_507BC0->ptr_1C; | 2795 v34 = (int)window_SpeakInHouse->ptr_1C; |
2796 uPlayerID = uActiveCharacter - 1; | 2796 uPlayerID = uActiveCharacter - 1; |
2797 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5); | 2797 v35 = v0->_490EEE((ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * v33 + 5], 2, v34, 5); |
2798 v14 = uPlayerID; | 2798 v14 = uPlayerID; |
2799 v15 = (char *)pMerchantsRepairPhrases[v35]; | 2799 v15 = (char *)pMerchantsRepairPhrases[v35]; |
2800 goto LABEL_36; | 2800 goto LABEL_36; |
2866 || pMouse->GetCursorPos(&v129)->x >= 462 | 2866 || pMouse->GetCursorPos(&v129)->x >= 462 |
2867 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) ) | 2867 || (v10 = v0->GetItemIDAtInventoryIndex((int *)&v149), v11 = 0, !v10) ) |
2868 return; | 2868 return; |
2869 v124 = 0; | 2869 v124 = 0; |
2870 v122 = 3; | 2870 v122 = 3; |
2871 v120 = ptr_507BC0->ptr_1C; | 2871 v120 = window_SpeakInHouse->ptr_1C; |
2872 v116 = (ItemGen *)&v0->pInventoryItems[v10-1]; | 2872 v116 = (ItemGen *)&v0->pInventoryItems[v10-1]; |
2873 v12 = (int)ptr_507BC0->ptr_1C; | 2873 v12 = (int)window_SpeakInHouse->ptr_1C; |
2874 uPlayerID = uActiveCharacter - 1; | 2874 uPlayerID = uActiveCharacter - 1; |
2875 v13 = v0->_490EEE(v116, 2, v12, 3); | 2875 v13 = v0->_490EEE(v116, 2, v12, 3); |
2876 v14 = uPlayerID; | 2876 v14 = uPlayerID; |
2877 v15 = (char *)pMerchantsSellPhrases[v13]; | 2877 v15 = (char *)pMerchantsSellPhrases[v13]; |
2878 goto LABEL_36; | 2878 goto LABEL_36; |
2894 if ( v2 ) | 2894 if ( v2 ) |
2895 { | 2895 { |
2896 v3 = (ItemGen *)&v0->pInventoryItems[v2-1]; | 2896 v3 = (ItemGen *)&v0->pInventoryItems[v2-1]; |
2897 if (v3->Identified()) | 2897 if (v3->Identified()) |
2898 { | 2898 { |
2899 v118 = ptr_507BC0->ptr_1C; | 2899 v118 = window_SpeakInHouse->ptr_1C; |
2900 v4 = uActiveCharacter - 1; | 2900 v4 = uActiveCharacter - 1; |
2901 v5 = "%24"; | 2901 v5 = "%24"; |
2902 v114 = v3; | 2902 v114 = v3; |
2903 } | 2903 } |
2904 else | 2904 else |
2905 { | 2905 { |
2906 v118 = ptr_507BC0->ptr_1C; | 2906 v118 = window_SpeakInHouse->ptr_1C; |
2907 v114 = v3; | 2907 v114 = v3; |
2908 v7 = (int)ptr_507BC0->ptr_1C; | 2908 v7 = (int)window_SpeakInHouse->ptr_1C; |
2909 uPlayerID = uActiveCharacter - 1; | 2909 uPlayerID = uActiveCharacter - 1; |
2910 v8 = v0->_490EEE(v3, 2, v7, 4); | 2910 v8 = v0->_490EEE(v3, 2, v7, 4); |
2911 v4 = uPlayerID; | 2911 v4 = uPlayerID; |
2912 v5 = (char *)pMerchantsIdentifyPhrases[v8]; | 2912 v5 = (char *)pMerchantsIdentifyPhrases[v8]; |
2913 } | 2913 } |
3164 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); | 3164 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); |
3165 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); | 3165 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); |
3166 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0, 0x53u, 0, "", 0); | 3166 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0, 0x53u, 0, "", 0); |
3167 pDialogueWindow->_41D08F(1, 1, 0, 2); | 3167 pDialogueWindow->_41D08F(1, 1, 0, 2); |
3168 dword_F8B19C = -1; | 3168 dword_F8B19C = -1; |
3169 v0 = (int)((char *)ptr_507BC0->ptr_1C - 102); | 3169 v0 = (int)((char *)window_SpeakInHouse->ptr_1C - 102); |
3170 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v0 + 1], pParty->field_3C.field_0[2 * v0]) < (signed __int64)pParty->uTimePlayed ) | 3170 if ( (signed __int64)__PAIR__(pParty->field_3C.field_0[2 * v0 + 1], pParty->field_3C.field_0[2 * v0]) < (signed __int64)pParty->uTimePlayed ) |
3171 { | 3171 { |
3172 pParty->field_75A[v0] = 0; | 3172 pParty->field_75A[v0] = 0; |
3173 v1 = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) | 3173 v1 = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) |
3174 * 0.033333335); | 3174 * 0.033333335); |
3621 GUIWindow *v5; // ebp@15 | 3621 GUIWindow *v5; // ebp@15 |
3622 Texture *result; // eax@15 | 3622 Texture *result; // eax@15 |
3623 int v7; // [sp+10h] [bp-4h]@0 | 3623 int v7; // [sp+10h] [bp-4h]@0 |
3624 | 3624 |
3625 v0 = v7; | 3625 v0 = v7; |
3626 v1 = (char *)ptr_507BC0->ptr_1C - 139; | 3626 v1 = (char *)window_SpeakInHouse->ptr_1C - 139; |
3627 v2 = 0; | 3627 v2 = 0; |
3628 do | 3628 do |
3629 { | 3629 { |
3630 //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]; | 3630 //v3 = p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
3631 v3 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType; | 3631 v3 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType; |
3632 if ( v3 < 5 ) | 3632 if ( v3 < 5 ) |
3633 goto LABEL_12; | 3633 goto LABEL_12; |
3634 if ( v3 <= 13 ) | 3634 if ( v3 <= 13 ) |
3635 { | 3635 { |
3636 v0 = rand() % word_4F0F30[(signed int)v1] | 3636 v0 = rand() % word_4F0F30[(signed int)v1] |
3637 //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C] | 3637 //+ 11 * p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C] |
3638 + 11 * p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType | 3638 + 11 * p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType |
3639 + 345; | 3639 + 345; |
3640 } | 3640 } |
3641 else | 3641 else |
3642 { | 3642 { |
3643 if ( v3 == 14 ) | 3643 if ( v3 == 14 ) |
3663 if ( v0 == 487 ) | 3663 if ( v0 == 487 ) |
3664 { | 3664 { |
3665 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) ) | 3665 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) ) |
3666 v0 = 486; | 3666 v0 = 486; |
3667 } | 3667 } |
3668 v5 = ptr_507BC0; | 3668 v5 = window_SpeakInHouse; |
3669 | 3669 |
3670 auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)ptr_507BC0->ptr_1C; | 3670 auto _u = (ItemGen *)&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + v2 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C; |
3671 _u->Reset(); | 3671 _u->Reset(); |
3672 *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0; | 3672 *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v2 + 12 * (unsigned int)v5->ptr_1C)) = v0; |
3673 *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1; | 3673 *(&pParty->pPlayers[1].pInstalledBeacons[1].field_10 + 9 * (v2++ + 12 * (unsigned int)v5->ptr_1C)) = 1; |
3674 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)]; | 3674 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pItemsTable->pItems[v0].pIconName, TEXTURE_16BIT_PALETTE)]; |
3675 *(&dword_F8B164 + v2) = result; | 3675 *(&dword_F8B164 + v2) = result; |
3781 { | 3781 { |
3782 do | 3782 do |
3783 v4 += v5++ + 1; | 3783 v4 += v5++ + 1; |
3784 while ( v5 < v7 ); | 3784 while ( v5 < v7 ); |
3785 } | 3785 } |
3786 if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)ptr_507BC0->ptr_1C] | 3786 if ( v7 < (unsigned __int16)word_4F0866[(unsigned int)window_SpeakInHouse->ptr_1C] |
3787 && (signed __int64)v6->uExperience < 1000 * v4 ) | 3787 && (signed __int64)v6->uExperience < 1000 * v4 ) |
3788 return; | 3788 return; |
3789 } | 3789 } |
3790 goto LABEL_9; | 3790 goto LABEL_9; |
3791 } | 3791 } |
3792 v8 = ptr_507BC0; | 3792 v8 = window_SpeakInHouse; |
3793 if ( (dword_F8B198 == 27 || dword_F8B198 == 28) | 3793 if ( (dword_F8B198 == 27 || dword_F8B198 == 28) |
3794 && (v1 = 0, | 3794 && (v1 = 0, |
3795 *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + v2)] | 3795 *(&byte_4F09B1[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)window_SpeakInHouse->ptr_1C] + v2)] |
3796 + pParty->uDaysPlayed % 7)) | 3796 + pParty->uDaysPlayed % 7)) |
3797 || dword_F8B198 != 23 | 3797 || dword_F8B198 != 23 |
3798 || v55 != 10 ) | 3798 || v55 != 10 ) |
3799 { | 3799 { |
3800 LABEL_9: | 3800 LABEL_9: |
3814 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), | 3814 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), |
3815 v1); | 3815 v1); |
3816 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, "", (Texture *)v1); | 3816 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, v1, 0x51u, v1, v1, "", (Texture *)v1); |
3817 LABEL_10: | 3817 LABEL_10: |
3818 v3 = dword_F8B198; | 3818 v3 = dword_F8B198; |
3819 v8 = ptr_507BC0; | 3819 v8 = window_SpeakInHouse; |
3820 goto LABEL_11; | 3820 goto LABEL_11; |
3821 } | 3821 } |
3822 if ( uActiveCharacter != v1 ) | 3822 if ( uActiveCharacter != v1 ) |
3823 { | 3823 { |
3824 if ( !pPlayers[uActiveCharacter]->_4B6FF9() ) | 3824 if ( !pPlayers[uActiveCharacter]->_4B6FF9() ) |
3831 { | 3831 { |
3832 v9 = pIcons_LOD->LoadTexture(off_4F03B8[v3], TEXTURE_16BIT_PALETTE); | 3832 v9 = pIcons_LOD->LoadTexture(off_4F03B8[v3], TEXTURE_16BIT_PALETTE); |
3833 v3 = dword_F8B198; | 3833 v3 = dword_F8B198; |
3834 dword_F8B164 = &pIcons_LOD->pTextures[v9]; | 3834 dword_F8B164 = &pIcons_LOD->pTextures[v9]; |
3835 LABEL_13: | 3835 LABEL_13: |
3836 v8 = ptr_507BC0; | 3836 v8 = window_SpeakInHouse; |
3837 } | 3837 } |
3838 if ( v3 > 21 ) | 3838 if ( v3 > 21 ) |
3839 { | 3839 { |
3840 if ( v3 == 22 ) | 3840 if ( v3 == 22 ) |
3841 { | 3841 { |
3867 if ( v33 ) | 3867 if ( v33 ) |
3868 { | 3868 { |
3869 v34 = pIcons_LOD->LoadTexture( | 3869 v34 = pIcons_LOD->LoadTexture( |
3870 pItemsTable->pItems[v33].pIconName, | 3870 pItemsTable->pItems[v33].pIconName, |
3871 TEXTURE_16BIT_PALETTE); | 3871 TEXTURE_16BIT_PALETTE); |
3872 v8 = ptr_507BC0; | 3872 v8 = window_SpeakInHouse; |
3873 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34]; | 3873 dword_F8B168[v32] = &pIcons_LOD->pTextures[v34]; |
3874 } | 3874 } |
3875 ++v32; | 3875 ++v32; |
3876 } | 3876 } |
3877 while ( v32 < 12 ); | 3877 while ( v32 < 12 ); |
3878 } | 3878 } |
3879 else | 3879 else |
3880 { | 3880 { |
3881 sub_4BC8D5(); | 3881 sub_4BC8D5(); |
3882 v30 = ptr_507BC0->ptr_1C; | 3882 v30 = window_SpeakInHouse->ptr_1C; |
3883 v31 = pParty->uTimePlayed | 3883 v31 = pParty->uTimePlayed |
3884 + (signed __int64)((double)(0xA8C000 | 3884 + (signed __int64)((double)(0xA8C000 |
3885 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) | 3885 //* (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) |
3886 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C) | 3886 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) |
3887 * 0.033333335); | 3887 * 0.033333335); |
3888 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31; | 3888 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44468] = v31; |
3889 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31); | 3889 *(int *)&stru_AA1058[3].pSounds[8 * (int)v30 + 44472] = HIDWORD(v31); |
3890 } | 3890 } |
3891 return; | 3891 return; |
3908 pParty->field_75A[v12] = 0; | 3908 pParty->field_75A[v12] = 0; |
3909 *(_QWORD *)v11 = (signed __int64)((double)(309657600 | 3909 *(_QWORD *)v11 = (signed __int64)((double)(309657600 |
3910 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) | 3910 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) |
3911 * 0.033333335); | 3911 * 0.033333335); |
3912 v14 = rand() % 258; | 3912 v14 = rand() % 258; |
3913 v15 = ptr_507BC0; | 3913 v15 = window_SpeakInHouse; |
3914 pParty->field_750[v12] = v14 + 1; | 3914 pParty->field_750[v12] = v14 + 1; |
3915 v16 = (int)((char *)v15->ptr_1C - 102); | 3915 v16 = (int)((char *)v15->ptr_1C - 102); |
3916 if ( v16 ) | 3916 if ( v16 ) |
3917 { | 3917 { |
3918 v17 = v16 - 1; | 3918 v17 = v16 - 1; |
4179 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); | 4179 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); |
4180 if ( dword_F8B198 == 30 || dword_F8B198 == 21 ) | 4180 if ( dword_F8B198 == 30 || dword_F8B198 == 21 ) |
4181 v39 = 4; | 4181 v39 = 4; |
4182 else | 4182 else |
4183 v39 = 2; | 4183 v39 = 2; |
4184 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v39); | 4184 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v39); |
4185 } | 4185 } |
4186 else | 4186 else |
4187 { | 4187 { |
4188 Party::TakeGold(v37); | 4188 Party::TakeGold(v37); |
4189 dword_F8B1E4 = 1; | 4189 dword_F8B1E4 = 1; |
4215 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1], | 4215 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C + 1], |
4216 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed ) | 4216 pParty->field_3C.field_50[2 * (unsigned int)v8->ptr_1C]) < (signed __int64)pParty->uTimePlayed ) |
4217 { | 4217 { |
4218 GenerateShopItems(); | 4218 GenerateShopItems(); |
4219 sub_4B8F94(); | 4219 sub_4B8F94(); |
4220 v8 = ptr_507BC0; | 4220 v8 = window_SpeakInHouse; |
4221 v40 = ptr_507BC0->ptr_1C; | 4221 v40 = window_SpeakInHouse->ptr_1C; |
4222 v3 = dword_F8B198; | 4222 v3 = dword_F8B198; |
4223 v41 = pParty->uTimePlayed | 4223 v41 = pParty->uTimePlayed |
4224 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) | 4224 //+ (signed __int64)((double)(11059200 * (signed int)p2DEvents_minus1[26 * (unsigned int)ptr_507BC0->ptr_1C]) |
4225 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].field_1C) | 4225 + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) |
4226 * 0.033333335); | 4226 * 0.033333335); |
4227 pParty->field_3C.field_50[2 * (int)v40] = v41; | 4227 pParty->field_3C.field_50[2 * (int)v40] = v41; |
4228 pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41); | 4228 pParty->field_3C.field_50[2 * (int)v40 + 1] = HIDWORD(v41); |
4229 } | 4229 } |
4230 v42 = v8->ptr_1C; | 4230 v42 = v8->ptr_1C; |
4240 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)]; | 4240 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)]; |
4241 if ( v45 ) | 4241 if ( v45 ) |
4242 { | 4242 { |
4243 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE); | 4243 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE); |
4244 v3 = dword_F8B198; | 4244 v3 = dword_F8B198; |
4245 v8 = ptr_507BC0; | 4245 v8 = window_SpeakInHouse; |
4246 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46]; | 4246 dword_F8B168[v43] = &pIcons_LOD->pTextures[v46]; |
4247 } | 4247 } |
4248 v42 = v8->ptr_1C; | 4248 v42 = v8->ptr_1C; |
4249 ++v43; | 4249 ++v43; |
4250 } | 4250 } |
4261 do | 4261 do |
4262 { | 4262 { |
4263 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] ) | 4263 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] ) |
4264 { | 4264 { |
4265 v49 = rand(); | 4265 v49 = rand(); |
4266 v8 = ptr_507BC0; | 4266 v8 = window_SpeakInHouse; |
4267 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight); | 4267 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight); |
4268 } | 4268 } |
4269 v47 = v8->ptr_1C; | 4269 v47 = v8->ptr_1C; |
4270 ++v48; | 4270 ++v48; |
4271 } | 4271 } |
4283 v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724]; | 4283 v50 = pParty->field_C59C[9 * (v43 + 12 * (int)v42) + 724]; |
4284 if ( v50 ) | 4284 if ( v50 ) |
4285 { | 4285 { |
4286 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE); | 4286 v51 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v50].pIconName, TEXTURE_16BIT_PALETTE); |
4287 v3 = dword_F8B198; | 4287 v3 = dword_F8B198; |
4288 v8 = ptr_507BC0; | 4288 v8 = window_SpeakInHouse; |
4289 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51]; | 4289 dword_F8B168[v43] = &pIcons_LOD->pTextures[v51]; |
4290 } | 4290 } |
4291 v42 = v8->ptr_1C; | 4291 v42 = v8->ptr_1C; |
4292 ++v43; | 4292 ++v43; |
4293 } | 4293 } |
4304 do | 4304 do |
4305 { | 4305 { |
4306 if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] ) | 4306 if ( pParty->field_C59C[9 * (v53 + 12 * (int)v52) + 724] ) |
4307 { | 4307 { |
4308 v54 = rand(); | 4308 v54 = rand(); |
4309 v8 = ptr_507BC0; | 4309 v8 = window_SpeakInHouse; |
4310 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight); | 4310 word_F8B158[v53] = v54 % (300 - dword_F8B168[v53]->uTextureHeight); |
4311 } | 4311 } |
4312 v52 = v8->ptr_1C; | 4312 v52 = v8->ptr_1C; |
4313 ++v53; | 4313 ++v53; |
4314 } | 4314 } |
4392 pIcons_LOD->_40F9C5(); | 4392 pIcons_LOD->_40F9C5(); |
4393 v1 = uNumDialogueNPCPortraits; | 4393 v1 = uNumDialogueNPCPortraits; |
4394 if ( uNumDialogueNPCPortraits != 1 ) | 4394 if ( uNumDialogueNPCPortraits != 1 ) |
4395 { | 4395 { |
4396 v2 = 0; | 4396 v2 = 0; |
4397 pBtn_ExitCancel = ptr_507BC0->pControlsHead; | 4397 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; |
4398 if ( uNumDialogueNPCPortraits > 0 ) | 4398 if ( uNumDialogueNPCPortraits > 0 ) |
4399 { | 4399 { |
4400 v3 = byte_591180; | 4400 v3 = byte_591180; |
4401 do | 4401 do |
4402 { | 4402 { |
4403 array_5913D8[v2 + 7] = (NPCData *)ptr_507BC0->CreateButton(*(&pNPCPortraits_x + v2 + 6 * v1 - 6), *(&pNPCPortraits_y + v2 + 6 * v1 - 6), | 4403 array_5913D8[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(*(&pNPCPortraits_x + v2 + 6 * v1 - 6), *(&pNPCPortraits_y + v2 + 6 * v1 - 6), |
4404 0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, v3, 0, 0, 0); | 4404 0x3Fu, 0x49u, 1, 0, 0x19Au, v2, 0, v3, 0, 0, 0); |
4405 v1 = uNumDialogueNPCPortraits; | 4405 v1 = uNumDialogueNPCPortraits; |
4406 ++v2; | 4406 ++v2; |
4407 v3 += 100; | 4407 v3 += 100; |
4408 } | 4408 } |
4525 return; | 4525 return; |
4526 if ( dword_F8B19C <= 72 ) | 4526 if ( dword_F8B19C <= 72 ) |
4527 { | 4527 { |
4528 v42 = dword_F8B19C - 36; | 4528 v42 = dword_F8B19C - 36; |
4529 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); | 4529 //v43 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0); |
4530 v43 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0); | 4530 v43 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
4531 v44 = v43 * (100 - v0->GetMerchant()) / 100; | 4531 v44 = v43 * (100 - v0->GetMerchant()) / 100; |
4532 if ( v44 < v43 / 3 ) | 4532 if ( v44 < v43 / 3 ) |
4533 v44 = v43 / 3; | 4533 v44 = v43 / 3; |
4534 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v42] ) | 4534 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->classType][v42] ) |
4535 { | 4535 { |
4537 if ( !*pSkill ) | 4537 if ( !*pSkill ) |
4538 { | 4538 { |
4539 if ( pParty->uNumGold < v44 ) | 4539 if ( pParty->uNumGold < v44 ) |
4540 { | 4540 { |
4541 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" | 4541 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold" |
4542 v13 = ptr_507BC0->ptr_1C; | 4542 v13 = window_SpeakInHouse->ptr_1C; |
4543 if ( dword_F8B198 == 30 ) | 4543 if ( dword_F8B198 == 30 ) |
4544 v55 = 4; | 4544 v55 = 4; |
4545 else | 4545 else |
4546 v55 = 2; | 4546 v55 = 2; |
4547 goto LABEL_84; | 4547 goto LABEL_84; |
4571 { | 4571 { |
4572 v17 = pMouse->GetCursorPos(&v63); | 4572 v17 = pMouse->GetCursorPos(&v63); |
4573 v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF; | 4573 v18 = pRenderer->pActiveZBuffer[v17->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v61)->y]] & 0xFFFF; |
4574 if ( !v18 ) | 4574 if ( !v18 ) |
4575 return; | 4575 return; |
4576 v19 = ptr_507BC0->ptr_1C; | 4576 v19 = window_SpeakInHouse->ptr_1C; |
4577 v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19)); | 4577 v20 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v18 + 12 * (int)v19)); |
4578 //v21 = p2DEvents_minus1__20[13 * (signed int)v19]; | 4578 //v21 = p2DEvents_minus1__20[13 * (signed int)v19]; |
4579 v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier; | 4579 v21 = p2DEvents[(signed int)v19 - 1].fPriceMultiplier; |
4580 _this = v20; | 4580 _this = v20; |
4581 v22 = v20->GetValue(); | 4581 v22 = v20->GetValue(); |
4584 GetAsyncKeyState(VK_CONTROL); | 4584 GetAsyncKeyState(VK_CONTROL); |
4585 if ( pParty->uNumGold < v23 ) | 4585 if ( pParty->uNumGold < v23 ) |
4586 { | 4586 { |
4587 v24 = 2; | 4587 v24 = 2; |
4588 LABEL_62: | 4588 LABEL_62: |
4589 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v24); | 4589 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, v24); |
4590 v9 = pGlobalTXT_LocalizationStrings[155]; | 4590 v9 = pGlobalTXT_LocalizationStrings[155]; |
4591 v54 = 2; | 4591 v54 = 2; |
4592 goto LABEL_71; | 4592 goto LABEL_71; |
4593 } | 4593 } |
4594 v25 = v0->AddItem(0xFFFFFFFFu, v20->uItemID); | 4594 v25 = v0->AddItem(0xFFFFFFFFu, v20->uItemID); |
4610 LABEL_49: | 4610 LABEL_49: |
4611 v28 = pMouse->GetCursorPos(&v59); | 4611 v28 = pMouse->GetCursorPos(&v59); |
4612 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF; | 4612 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF; |
4613 if ( !v29 ) | 4613 if ( !v29 ) |
4614 return; | 4614 return; |
4615 v30 = ptr_507BC0->ptr_1C; | 4615 v30 = window_SpeakInHouse->ptr_1C; |
4616 v31 = 9 * (v29 - 1 + 12 * (int)v30); | 4616 v31 = 9 * (v29 - 1 + 12 * (int)v30); |
4617 if ( dword_F8B19C == 2 ) | 4617 if ( dword_F8B19C == 2 ) |
4618 { | 4618 { |
4619 v32 = (ItemGen *)&pParty->field_777C[v31]; | 4619 v32 = (ItemGen *)&pParty->field_777C[v31]; |
4620 _this = (ItemGen *)&pParty->field_777C[v31]; | 4620 _this = (ItemGen *)&pParty->field_777C[v31]; |
4644 if ( (short)v74 ) | 4644 if ( (short)v74 ) |
4645 { | 4645 { |
4646 uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6); | 4646 uNumSeconds = v0->StealFromShop(v32, a3, v38, 0, &a6); |
4647 if ( !uNumSeconds ) | 4647 if ( !uNumSeconds ) |
4648 { | 4648 { |
4649 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, 0, a6); | 4649 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, 0, a6); |
4650 return; | 4650 return; |
4651 } | 4651 } |
4652 } | 4652 } |
4653 } | 4653 } |
4654 if ( pParty->uNumGold < v80 ) | 4654 if ( pParty->uNumGold < v80 ) |
4673 { | 4673 { |
4674 v41 = uNumSeconds; | 4674 v41 = uNumSeconds; |
4675 if ( uNumSeconds == 1 || uNumSeconds == 2 ) | 4675 if ( uNumSeconds == 1 || uNumSeconds == 2 ) |
4676 { | 4676 { |
4677 *(char *)(v40 + 517) |= 1u; | 4677 *(char *)(v40 + 517) |= 1u; |
4678 sub_4B1447_party_fine((int)ptr_507BC0->ptr_1C, v41, a6); | 4678 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, v41, a6); |
4679 goto LABEL_43; | 4679 goto LABEL_43; |
4680 } | 4680 } |
4681 } | 4681 } |
4682 } | 4682 } |
4683 LABEL_42: | 4683 LABEL_42: |
4704 v79 = (v14 >> 5) + 14 * ((pMouse->GetCursorPos(&v69)->y - 17) >> 5); | 4704 v79 = (v14 >> 5) + 14 * ((pMouse->GetCursorPos(&v69)->y - 17) >> 5); |
4705 if ( pMouse->GetCursorPos(&v67)->x <= 13 | 4705 if ( pMouse->GetCursorPos(&v67)->x <= 13 |
4706 || pMouse->GetCursorPos(&v65)->x >= 462 | 4706 || pMouse->GetCursorPos(&v65)->x >= 462 |
4707 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) ) | 4707 || (v15 = v0->GetItemIDAtInventoryIndex((int *)&v79), (v77 = (Player *)v15) == 0) ) |
4708 return; | 4708 return; |
4709 v16 = ptr_507BC0; | 4709 v16 = window_SpeakInHouse; |
4710 if ( sub_4BDAAF((ItemGen *)&v0->pInventoryItems[v15-1], (int)ptr_507BC0->ptr_1C) ) | 4710 if ( sub_4BDAAF((ItemGen *)&v0->pInventoryItems[v15-1], (int)window_SpeakInHouse->ptr_1C) ) |
4711 { | 4711 { |
4712 dword_F8B1E4 = 1; | 4712 dword_F8B1E4 = 1; |
4713 v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C); | 4713 v0->_4BE2DD(v79, (int)((char *)v77 - 1), (int)v16->ptr_1C); |
4714 viewparams->bRedrawGameUI = 1; | 4714 viewparams->bRedrawGameUI = 1; |
4715 pRenderer->ClearZBuffer(0, 479); | 4715 pRenderer->ClearZBuffer(0, 479); |
4739 { | 4739 { |
4740 v11 = v0->GetItemIDAtInventoryIndex((int *)&v79); | 4740 v11 = v0->GetItemIDAtInventoryIndex((int *)&v79); |
4741 if ( v11 ) | 4741 if ( v11 ) |
4742 { | 4742 { |
4743 //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]); | 4743 //v80 = v0->_4B8179(p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]); |
4744 v80 = v0->_4B8179(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier); | 4744 v80 = v0->_4B8179(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier); |
4745 v12 = (int)&v0->pInventoryItems[v11-1]; | 4745 v12 = (int)&v0->pInventoryItems[v11-1]; |
4746 if ( !(*(char *)(v12 + 20) & 1) ) | 4746 if ( !(*(char *)(v12 + 20) & 1) ) |
4747 { | 4747 { |
4748 _this = (ItemGen *)ptr_507BC0->ptr_1C; | 4748 _this = (ItemGen *)window_SpeakInHouse->ptr_1C; |
4749 if ( sub_4BDAAF((ItemGen *)v12, (int)_this) ) | 4749 if ( sub_4BDAAF((ItemGen *)v12, (int)_this) ) |
4750 { | 4750 { |
4751 if ( pParty->uNumGold >= v80 ) | 4751 if ( pParty->uNumGold >= v80 ) |
4752 { | 4752 { |
4753 dword_F8B1E4 = 1; | 4753 dword_F8B1E4 = 1; |
4784 v2 = v0->GetItemIDAtInventoryIndex((int *)&v79); | 4784 v2 = v0->GetItemIDAtInventoryIndex((int *)&v79); |
4785 if ( v2 ) | 4785 if ( v2 ) |
4786 { | 4786 { |
4787 v3 = (int)&v0->pInventoryItems[v2-1]; | 4787 v3 = (int)&v0->pInventoryItems[v2-1]; |
4788 //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; | 4788 //v4 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C]; |
4789 v4 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier; | 4789 v4 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier; |
4790 | 4790 |
4791 auto _v = (ItemGen *)&v0->pInventoryItems[v2-1]; | 4791 auto _v = (ItemGen *)&v0->pInventoryItems[v2-1]; |
4792 v5 = _v->GetValue(); | 4792 v5 = _v->GetValue(); |
4793 | 4793 |
4794 v6 = v0->_4B81C3(v5, v4); | 4794 v6 = v0->_4B81C3(v5, v4); |
4795 v7 = (*(char *)(v3 + 20) & 2) == 0; | 4795 v7 = (*(char *)(v3 + 20) & 2) == 0; |
4796 v80 = v6; | 4796 v80 = v6; |
4797 if ( !v7 ) | 4797 if ( !v7 ) |
4798 { | 4798 { |
4799 _this = (ItemGen *)ptr_507BC0->ptr_1C; | 4799 _this = (ItemGen *)window_SpeakInHouse->ptr_1C; |
4800 if ( sub_4BDAAF((ItemGen *)v3, (int)_this) ) | 4800 if ( sub_4BDAAF((ItemGen *)v3, (int)_this) ) |
4801 { | 4801 { |
4802 if ( pParty->uNumGold >= v80 ) | 4802 if ( pParty->uNumGold >= v80 ) |
4803 { | 4803 { |
4804 dword_F8B1E4 = 1; | 4804 dword_F8B1E4 = 1; |
5097 pRenderer->BeginScene(); | 5097 pRenderer->BeginScene(); |
5098 pRenderer->DrawTextureRGB(0, 0, &_this); | 5098 pRenderer->DrawTextureRGB(0, 0, &_this); |
5099 pRenderer->EndScene(); | 5099 pRenderer->EndScene(); |
5100 free(_this.pPixels); | 5100 free(_this.pPixels); |
5101 _this.pPixels = 0; | 5101 _this.pPixels = 0; |
5102 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); | 5102 window_SpeakInHouse = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); |
5103 pWindow.uFrameX = 75; | 5103 pWindow.uFrameX = 75; |
5104 pWindow.uFrameY = 60; | 5104 pWindow.uFrameY = 60; |
5105 pWindow.uFrameWidth = 469; | 5105 pWindow.uFrameWidth = 469; |
5106 pWindow.uFrameHeight = 338; | 5106 pWindow.uFrameHeight = 338; |
5107 pWindow.uFrameZ = 543; | 5107 pWindow.uFrameZ = 543; |
5173 pRenderer->Present(); | 5173 pRenderer->Present(); |
5174 if ( pRenderer->pRenderD3D ) | 5174 if ( pRenderer->pRenderD3D ) |
5175 pRenderer->pBeforePresentFunction(); | 5175 pRenderer->pBeforePresentFunction(); |
5176 pRenderer->_49F1BC("MM7_Win.Pcx"); | 5176 pRenderer->_49F1BC("MM7_Win.Pcx"); |
5177 pAllocator->FreeChunk(pFont); | 5177 pAllocator->FreeChunk(pFont); |
5178 ptr_507BC0->Release(); | 5178 window_SpeakInHouse->Release(); |
5179 ptr_507BC0 = 0; | 5179 window_SpeakInHouse = 0; |
5180 if ( v15 == (void *)2 ) | 5180 if ( v15 == (void *)2 ) |
5181 { | 5181 { |
5182 result = pMessageQueue_50CBD0->uNumMessages; | 5182 result = pMessageQueue_50CBD0->uNumMessages; |
5183 } | 5183 } |
5184 else | 5184 else |
11973 } | 11973 } |
11974 if ( wParam == 27 ) | 11974 if ( wParam == 27 ) |
11975 { | 11975 { |
11976 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 11976 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
11977 { | 11977 { |
11978 v12 = ptr_507BC0 == 0; | 11978 v12 = window_SpeakInHouse == 0; |
11979 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 11979 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; |
11980 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12; | 11980 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = !v12; |
11981 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 11981 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
11982 ++pMessageQueue_50CBD0->uNumMessages; | 11982 ++pMessageQueue_50CBD0->uNumMessages; |
11983 } | 11983 } |