Do you mean this function?
When I set breakpoint on it and click "Trade and repair service" in NPC dialogue box the game freezes. So that means that this function is related with clicking the dialogue options. It looks like there's many subfunctions of this function. Maybe we need to call only one of subfunctions? And there's too many parameters to send in this function. I don't even imagine where to start search. (
.text:0050E7E0 sub_50E7E0 proc near ; DATA XREF: .text:0050AC03o
.text:0050E7E0
.text:0050E7E0 Str= dword ptr -94h
.text:0050E7E0 var_90= dword ptr -90h
.text:0050E7E0 var_8C= dword ptr -8Ch
.text:0050E7E0 Str1= dword ptr -88h
.text:0050E7E0 var_81= byte ptr -81h
.text:0050E7E0 var_80= dword ptr -80h
.text:0050E7E0 var_78= dword ptr -78h
.text:0050E7E0 Str2= dword ptr -74h
.text:0050E7E0 var_70= byte ptr -70h
.text:0050E7E0 var_6C= dword ptr -6Ch
.text:0050E7E0 var_68= dword ptr -68h
.text:0050E7E0 var_64= dword ptr -64h
.text:0050E7E0 var_60= dword ptr -60h
.text:0050E7E0 var_5C= dword ptr -5Ch
.text:0050E7E0 var_58= dword ptr -58h
.text:0050E7E0 var_54= dword ptr -54h
.text:0050E7E0 var_50= dword ptr -50h
.text:0050E7E0 var_4C= dword ptr -4Ch
.text:0050E7E0 var_48= dword ptr -48h
.text:0050E7E0 var_44= dword ptr -44h
.text:0050E7E0 var_40= dword ptr -40h
.text:0050E7E0 var_3C= dword ptr -3Ch
.text:0050E7E0 var_38= dword ptr -38h
.text:0050E7E0 var_34= dword ptr -34h
.text:0050E7E0 var_30= dword ptr -30h
.text:0050E7E0 var_2C= dword ptr -2Ch
.text:0050E7E0 var_28= dword ptr -28h
.text:0050E7E0 var_24= dword ptr -24h
.text:0050E7E0 var_20= dword ptr -20h
.text:0050E7E0 var_1C= dword ptr -1Ch
.text:0050E7E0 var_18= dword ptr -18h
.text:0050E7E0 var_14= dword ptr -14h
.text:0050E7E0 var_10= dword ptr -10h
.text:0050E7E0 var_C= dword ptr -0Ch
.text:0050E7E0 var_4= dword ptr -4
.text:0050E7E0 arg_4= dword ptr 8
.text:0050E7E0 arg_8= dword ptr 0Ch
.text:0050E7E0
.text:0050E7E0 mov eax, large fs:0
.text:0050E7E6 push 0FFFFFFFFh
.text:0050E7E8 push offset SEH_50E7E0
.text:0050E7ED push eax
.text:0050E7EE mov large fs:0, esp
.text:0050E7F5 sub esp, 88h
.text:0050E7FB lea eax, [esp+94h+var_6C]
.text:0050E7FF push ebx
.text:0050E800 push ebp
.text:0050E801 push esi
.text:0050E802 push edi
.text:0050E803 mov esi, ecx
.text:0050E805 push 0
.text:0050E807 mov ecx, [esp+0A8h+arg_8]
.text:0050E80E push eax
.text:0050E80F call sub_722530
.text:0050E814 mov ecx, [esi+0Ch]
.text:0050E817 mov ebx, [esp+0A4h+var_6C]
.text:0050E81B mov edx, [ecx+0A8h]
.text:0050E821 mov ecx, [esp+0A4h+arg_4]
.text:0050E828 movsx eax, cx
.text:0050E82B mov ebp, [edx+14h]
.text:0050E82E shr ecx, 10h
.text:0050E831 movsx ecx, cx
.text:0050E834 sub eax, ebp
.text:0050E836 mov ebp, [edx+18h]
.text:0050E839 sub eax, ebx
.text:0050E83B mov ebx, [esp+0A4h+var_68]
.text:0050E83F sub ecx, ebp
.text:0050E841 sub ecx, ebx
.text:0050E843 push ecx
.text:0050E844 mov ecx, [esi+168h]
.text:0050E84A push eax
.text:0050E84B call sub_728460
.text:0050E850 test eax, eax
.text:0050E852 jnz loc_50FB3A
.text:0050E858 mov ecx, [esi+168h]
.text:0050E85E call sub_728090
.text:0050E863 mov edi, eax
.text:0050E865 test edi, edi
.text:0050E867 mov [esp+0A4h+Str1], edi
.text:0050E86B jl loc_50FB3A
.text:0050E871 mov ecx, [esi+168h]
.text:0050E877 call sub_728080
.text:0050E87C cmp edi, eax
.text:0050E87E jge loc_50FB3A
.text:0050E884 mov edx, off_95C968
.text:0050E88A mov [esp+0A4h+Str], edx
.text:0050E88E mov ecx, esi
.text:0050E890 mov [esp+0A4h+var_4], 0
.text:0050E89B call sub_4BFBB0
.text:0050E8A0 push ecx
.text:0050E8A1 mov ecx, esp
.text:0050E8A3 mov [esp+0A8h+var_8C], esp
.text:0050E8A7 push offset buf
.text:0050E8AC call sub_743F70
.text:0050E8B1 mov ecx, esi
.text:0050E8B3 call sub_7152A0
.text:0050E8B8 cmp eax, 2
.text:0050E8BB jz loc_50F77A
.text:0050E8C1 push ecx
.text:0050E8C2 mov ecx, esp
.text:0050E8C4 mov [esp+0A8h+var_8C], esp
.text:0050E8C8 push offset buf
.text:0050E8CD call sub_743F70
.text:0050E8D2 mov ecx, esi
.text:0050E8D4 call sub_7152A0
.text:0050E8D9 cmp eax, 4
.text:0050E8DC jz loc_50F77A
.text:0050E8E2 push ecx
.text:0050E8E3 mov ecx, esp
.text:0050E8E5 mov [esp+0A8h+var_8C], esp
.text:0050E8E9 push offset buf
.text:0050E8EE call sub_743F70
.text:0050E8F3 mov ecx, esi
.text:0050E8F5 call sub_7152A0
.text:0050E8FA cmp eax, 3
.text:0050E8FD jnz loc_50E99E
.text:0050E903 mov ecx, [esi+168h]
.text:0050E909 call sub_728080
.text:0050E90E dec eax
.text:0050E90F cmp edi, eax
.text:0050E911 jnz short loc_50E933
.text:0050E913 mov ecx, esi
.text:0050E915 call sub_525390
.text:0050E91A mov ecx, eax
.text:0050E91C call sub_588320
.text:0050E921 push 1
.text:0050E923 push 0
.text:0050E925 push 0
.text:0050E927 mov ecx, esi
.text:0050E929 call sub_712EE0
.text:0050E92E jmp loc_50FB26
.text:0050E7E0
.text:0050E7E0 Str= dword ptr -94h
.text:0050E7E0 var_90= dword ptr -90h
.text:0050E7E0 var_8C= dword ptr -8Ch
.text:0050E7E0 Str1= dword ptr -88h
.text:0050E7E0 var_81= byte ptr -81h
.text:0050E7E0 var_80= dword ptr -80h
.text:0050E7E0 var_78= dword ptr -78h
.text:0050E7E0 Str2= dword ptr -74h
.text:0050E7E0 var_70= byte ptr -70h
.text:0050E7E0 var_6C= dword ptr -6Ch
.text:0050E7E0 var_68= dword ptr -68h
.text:0050E7E0 var_64= dword ptr -64h
.text:0050E7E0 var_60= dword ptr -60h
.text:0050E7E0 var_5C= dword ptr -5Ch
.text:0050E7E0 var_58= dword ptr -58h
.text:0050E7E0 var_54= dword ptr -54h
.text:0050E7E0 var_50= dword ptr -50h
.text:0050E7E0 var_4C= dword ptr -4Ch
.text:0050E7E0 var_48= dword ptr -48h
.text:0050E7E0 var_44= dword ptr -44h
.text:0050E7E0 var_40= dword ptr -40h
.text:0050E7E0 var_3C= dword ptr -3Ch
.text:0050E7E0 var_38= dword ptr -38h
.text:0050E7E0 var_34= dword ptr -34h
.text:0050E7E0 var_30= dword ptr -30h
.text:0050E7E0 var_2C= dword ptr -2Ch
.text:0050E7E0 var_28= dword ptr -28h
.text:0050E7E0 var_24= dword ptr -24h
.text:0050E7E0 var_20= dword ptr -20h
.text:0050E7E0 var_1C= dword ptr -1Ch
.text:0050E7E0 var_18= dword ptr -18h
.text:0050E7E0 var_14= dword ptr -14h
.text:0050E7E0 var_10= dword ptr -10h
.text:0050E7E0 var_C= dword ptr -0Ch
.text:0050E7E0 var_4= dword ptr -4
.text:0050E7E0 arg_4= dword ptr 8
.text:0050E7E0 arg_8= dword ptr 0Ch
.text:0050E7E0
.text:0050E7E0 mov eax, large fs:0
.text:0050E7E6 push 0FFFFFFFFh
.text:0050E7E8 push offset SEH_50E7E0
.text:0050E7ED push eax
.text:0050E7EE mov large fs:0, esp
.text:0050E7F5 sub esp, 88h
.text:0050E7FB lea eax, [esp+94h+var_6C]
.text:0050E7FF push ebx
.text:0050E800 push ebp
.text:0050E801 push esi
.text:0050E802 push edi
.text:0050E803 mov esi, ecx
.text:0050E805 push 0
.text:0050E807 mov ecx, [esp+0A8h+arg_8]
.text:0050E80E push eax
.text:0050E80F call sub_722530
.text:0050E814 mov ecx, [esi+0Ch]
.text:0050E817 mov ebx, [esp+0A4h+var_6C]
.text:0050E81B mov edx, [ecx+0A8h]
.text:0050E821 mov ecx, [esp+0A4h+arg_4]
.text:0050E828 movsx eax, cx
.text:0050E82B mov ebp, [edx+14h]
.text:0050E82E shr ecx, 10h
.text:0050E831 movsx ecx, cx
.text:0050E834 sub eax, ebp
.text:0050E836 mov ebp, [edx+18h]
.text:0050E839 sub eax, ebx
.text:0050E83B mov ebx, [esp+0A4h+var_68]
.text:0050E83F sub ecx, ebp
.text:0050E841 sub ecx, ebx
.text:0050E843 push ecx
.text:0050E844 mov ecx, [esi+168h]
.text:0050E84A push eax
.text:0050E84B call sub_728460
.text:0050E850 test eax, eax
.text:0050E852 jnz loc_50FB3A
.text:0050E858 mov ecx, [esi+168h]
.text:0050E85E call sub_728090
.text:0050E863 mov edi, eax
.text:0050E865 test edi, edi
.text:0050E867 mov [esp+0A4h+Str1], edi
.text:0050E86B jl loc_50FB3A
.text:0050E871 mov ecx, [esi+168h]
.text:0050E877 call sub_728080
.text:0050E87C cmp edi, eax
.text:0050E87E jge loc_50FB3A
.text:0050E884 mov edx, off_95C968
.text:0050E88A mov [esp+0A4h+Str], edx
.text:0050E88E mov ecx, esi
.text:0050E890 mov [esp+0A4h+var_4], 0
.text:0050E89B call sub_4BFBB0
.text:0050E8A0 push ecx
.text:0050E8A1 mov ecx, esp
.text:0050E8A3 mov [esp+0A8h+var_8C], esp
.text:0050E8A7 push offset buf
.text:0050E8AC call sub_743F70
.text:0050E8B1 mov ecx, esi
.text:0050E8B3 call sub_7152A0
.text:0050E8B8 cmp eax, 2
.text:0050E8BB jz loc_50F77A
.text:0050E8C1 push ecx
.text:0050E8C2 mov ecx, esp
.text:0050E8C4 mov [esp+0A8h+var_8C], esp
.text:0050E8C8 push offset buf
.text:0050E8CD call sub_743F70
.text:0050E8D2 mov ecx, esi
.text:0050E8D4 call sub_7152A0
.text:0050E8D9 cmp eax, 4
.text:0050E8DC jz loc_50F77A
.text:0050E8E2 push ecx
.text:0050E8E3 mov ecx, esp
.text:0050E8E5 mov [esp+0A8h+var_8C], esp
.text:0050E8E9 push offset buf
.text:0050E8EE call sub_743F70
.text:0050E8F3 mov ecx, esi
.text:0050E8F5 call sub_7152A0
.text:0050E8FA cmp eax, 3
.text:0050E8FD jnz loc_50E99E
.text:0050E903 mov ecx, [esi+168h]
.text:0050E909 call sub_728080
.text:0050E90E dec eax
.text:0050E90F cmp edi, eax
.text:0050E911 jnz short loc_50E933
.text:0050E913 mov ecx, esi
.text:0050E915 call sub_525390
.text:0050E91A mov ecx, eax
.text:0050E91C call sub_588320
.text:0050E921 push 1
.text:0050E923 push 0
.text:0050E925 push 0
.text:0050E927 mov ecx, esi
.text:0050E929 call sub_712EE0
.text:0050E92E jmp loc_50FB26