comparison UI/UIShops.cpp @ 1407:d4f57df4c299

PlayerSpeechID and uSpeakingCharacter
author Ritor1
date Tue, 23 Jul 2013 16:34:00 +0600
parents d071e0e9ba75
children c9e3b93ec570
comparison
equal deleted inserted replaced
1406:d071e0e9ba75 1407:d4f57df4c299
2640 if ( v5 ) 2640 if ( v5 )
2641 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)); 2641 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C));
2642 } 2642 }
2643 } 2643 }
2644 //----- (004B1D27) -------------------------------------------------------- 2644 //----- (004B1D27) --------------------------------------------------------
2645 void __cdecl sub_4B1D27() 2645 void __cdecl GetHouseGoodbyeSpeech()
2646 { 2646 {
2647 int v0; // edx@2
2648 unsigned int v1; // ecx@7
2649 signed int v2; // edi@10 2647 signed int v2; // edi@10
2650 int v3; // esi@10
2651 __int16 v4; // ax@15
2652 signed int v5; // edi@20 2648 signed int v5; // edi@20
2653 int v6; // esi@20
2654 int v7[4]; // [sp+Ch] [bp-10h]@12 2649 int v7[4]; // [sp+Ch] [bp-10h]@12
2655 2650
2656 if ( in_current_building_type > 0 ) 2651 if ( in_current_building_type > 0 )
2657 { 2652 {
2658 v0 = 3;
2659 if ( in_current_building_type > BildingType_MagicShop ) 2653 if ( in_current_building_type > BildingType_MagicShop )
2660 { 2654 {
2661 if ( in_current_building_type == BildingType_Bank ) 2655 if ( in_current_building_type == BildingType_Bank )
2662 { 2656 {
2663 if ( !dword_F8B1E4 ) 2657 if ( !dword_F8B1E4 )
2666 else 2660 else
2667 { 2661 {
2668 if ( in_current_building_type != BildingType_Temple ) 2662 if ( in_current_building_type != BildingType_Temple )
2669 return; 2663 return;
2670 } 2664 }
2671 v1 = (unsigned int)window_SpeakInHouse->ptr_1C; 2665 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Greeting_2);
2672 PlayHouseSound(v1, (HouseSoundID)v0);
2673 return; 2666 return;
2674 } 2667 }
2675 v1 = (unsigned int)window_SpeakInHouse->ptr_1C; 2668 if ( (signed __int64)pParty->field_3C._shop_ban_times[(unsigned int)window_SpeakInHouse->ptr_1C]<= (signed __int64)pParty->uTimePlayed )
2676 if ( (signed __int64)pParty->field_3C._shop_ban_times[v1 ]<= (signed __int64)pParty->uTimePlayed ) 2669 {
2677 { 2670 if ( pParty->uNumGold <= 10000 )
2678 if ( pParty->uNumGold <= 0x2710 )
2679 { 2671 {
2680 if ( !dword_F8B1E4 ) 2672 if ( !dword_F8B1E4 )
2681 return; 2673 return;
2682 v0 = 4; 2674 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_Goodbye);
2683 PlayHouseSound(v1, (HouseSoundID)v0); 2675 return;
2684 return; 2676 }
2685 } 2677 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)(dword_F8B1E4 + 3));
2686 PlayHouseSound(v1, (HouseSoundID)(dword_F8B1E4 + 3));
2687 if ( !dword_F8B1E4 && !qword_A750D8 ) 2678 if ( !dword_F8B1E4 && !qword_A750D8 )
2688 { 2679 {
2689 v5 = 0; 2680 v5 = 0;
2690 v6 = 1; 2681 for ( uint i = 1; i <= 4; ++i )
2691 do 2682 {
2692 { 2683 if ( pPlayers[i]->CanAct() )
2693 if ( pPlayers[v6]->CanAct() ) 2684 v7[v5++] = i;
2694 v7[v5++] = v6; 2685 }
2695 ++v6;
2696 }
2697 while ( v6 <= 4 );
2698 if ( v5 ) 2686 if ( v5 )
2699 { 2687 {
2700 qword_A750D8 = 256i64; 2688 qword_A750D8 = 256i64;
2701 PlayerSpeechID = SPEECH_80; 2689 PlayerSpeechID = SPEECH_80;
2702 v4 = LOWORD(v7[rand() % v5]); 2690 uSpeakingCharacter = v7[rand() % v5];
2703 word_A750E2 = v4;
2704 return; 2691 return;
2705 } 2692 }
2706 } 2693 }
2707 } 2694 }
2708 else 2695 else
2709 { 2696 {
2710 if ( !qword_A750D8 ) 2697 if ( !qword_A750D8 )
2711 { 2698 {
2712 v2 = 0; 2699 v2 = 0;
2713 v3 = 1; 2700 for ( uint i = 1; i <= 4; ++i )
2714 do 2701 {
2715 { 2702 if ( pPlayers[i]->CanAct() )
2716 if ( pPlayers[v3]->CanAct() ) 2703 v7[v2++] = i;
2717 v7[v2++] = v3; 2704 }
2718 ++v3;
2719 }
2720 while ( v3 <= 4 );
2721 if ( v2 ) 2705 if ( v2 )
2722 { 2706 {
2723 qword_A750D8 = 256i64; 2707 qword_A750D8 = 256i64;
2724 PlayerSpeechID = SPEECH_80; 2708 PlayerSpeechID = SPEECH_80;
2725 v4 = LOWORD(v7[rand() % v2]); 2709 uSpeakingCharacter = v7[rand() % v2];
2726 word_A750E2 = v4;
2727 return; 2710 return;
2728 } 2711 }
2729 } 2712 }
2730 } 2713 }
2731 } 2714 }