follower_add proc near ; CODE XREF: orc_follower+99p
.text:080763E0 ; store_to_char+156p
.text:080763E0 ; item_special_skeleton_summon+DAp
.text:080763E0 ; item_special_sphinx_summon+A0p
.text:080763E0 ; item_perform_special+193Dp
.text:080763E0
.text:080763E0 var_38 = dword ptr -38h
.text:080763E0 var_34 = dword ptr -34h
.text:080763E0 var_30 = dword ptr -30h
.text:080763E0 var_2C = dword ptr -2Ch
.text:080763E0 var_28 = dword ptr -28h
.text:080763E0 var_24 = dword ptr -24h
.text:080763E0 var_14 = dword ptr -14h
.text:080763E0 var_10 = dword ptr -10h
.text:080763E0 arg_0 = dword ptr 8
.text:080763E0 arg_4 = dword ptr 0Ch
.text:080763E0 arg_8 = word ptr 10h
.text:080763E0 arg_C = dword ptr 14h
.text:080763E0
.text:080763E0 push ebp
.text:080763E1 mov ebp, esp
.text:080763E3 push edi
.text:080763E4 push esi
.text:080763E5 push ebx
.text:080763E6 sub esp, 2Ch
.text:080763E9 xor ebx, ebx
.text:080763EB movzx eax, [ebp+arg_8]
.text:080763EF mov esi, dword ptr follower_proto //调用外观值函数
.text:080763F5 test esi, esi
.text:080763F7 mov word ptr [ebp+var_10+2], ax
.text:080763FB mov eax, [ebp+arg_C]
.text:080763FE mov word ptr [ebp+var_10], ax
.text:08076402 jz loc_8076654
.text:08076402
.text:08076408 mov eax, [ebp+arg_4]
.text:0807640B mov edx, [eax]
.text:0807640D mov eax, offset follower_proto //调用外观值函数
.text:08076412 lea esi, [esi+0]
.text:08076419 lea edi, [edi+0]
.text:08076419
.text:08076420
.text:08076420 loc_8076420: ; CODE XREF: follower_add+4Cj
.text:08076420 cmp [eax], edx
.text:08076422 jz short loc_807642E
.text:08076422
.text:08076424 add eax, 10h
.text:08076427 inc ebx
.text:08076428 mov ecx, [eax]
.text:0807642A test ecx, ecx
.text:0807642C jnz short loc_8076420
.text:0807642C
.text:0807642E
.text:0807642E loc_807642E: ; CODE XREF: follower_add+42j
.text:0807642E ; follower_add+279j
.text:0807642E mov eax, ebx
.text:08076430 shl eax, 4
.text:08076433 cmp dword ptr follower_proto[eax], edx
.text:08076439 jnz loc_8076650
.text:08076439
.text:0807643F movzx ecx, word ptr [ebp+var_10+2]
.text:08076443 test cx, cx
.text:08076446 jz short loc_8076450
.text:08076446
.text:08076448 mov eax, [ebp+var_10]
.text:0807644B test ax, ax
.text:0807644E jnz short loc_80764B0
.text:0807644E
.text:08076450
.text:08076450 loc_8076450: ; CODE XREF: follower_add+66j
.text:08076450 mov esi, [ebp+arg_0]
.text:08076453 lea eax, [ebp+var_10]
.text:08076456 mov edi, 10h
.text:0807645B mov [esp+38h+var_24], eax
.text:0807645F lea eax, [ebp+var_10+2]
.text:08076462 mov [esp+38h+var_28], eax
.text:08076466 mov [esp+38h+var_2C], edi
.text:0807646A movzx eax, word ptr [esi+188h]
.text:08076471 mov [esp+38h+var_30], eax
.text:08076475 movzx eax, word ptr [esi+184h]
.text:0807647C mov [esp+38h+var_38], esi
.text:0807647F mov [esp+38h+var_34], eax
.text:08076483 call find_empty_sector
.text:08076483
.text:08076488 movzx ecx, word ptr [ebp+var_10+2]
.text:0807648C test cx, cx
.text:0807648F jnz loc_8076643
.text:0807648F
.text:08076495 mov eax, [ebp+var_10]
.text:08076498 xor edx, edx
.text:0807649A test ax, ax
.text:0807649D jz loc_807662F
.text:0807649D
.text:080764A3 mov esi, [ebp+arg_4]
.text:080764A6 mov edx, [esi]
.text:080764A8 nop
.text:080764A9 lea esi, [esi+0]
.text:080764A9
.text:080764B0
.text:080764B0 loc_80764B0: ; CODE XREF: follower_add+6Ej
.text:080764B0 ; follower_add+26Bj
.text:080764B0 movzx eax, ax
.text:080764B3 xor esi, esi
.text:080764B5 mov [esp+38h+var_2C], eax
.text:080764B9 movzx eax, cx
.text:080764BC mov ecx, [ebp+arg_0]
.text:080764BF mov [esp+38h+var_28], esi
.text:080764C3 mov [esp+38h+var_30], eax
.text:080764C7 mov eax, [ecx+174h]
.text:080764CD mov [esp+38h+var_38], edx
.text:080764D0 mov [esp+38h+var_34], eax
.text:080764D4 call clone_npc
.text:080764D4
.text:080764D9 xor edx, edx
.text:080764DB mov edi, eax
.text:080764DD test eax, eax
.text:080764DF jz loc_807662F
.text:080764DF
.text:080764E5 mov [esp+38h+var_38], eax
.text:080764E8 mov esi, [ebp+arg_0]
.text:080764EB mov [esp+38h+var_34], esi
.text:080764EF call group_assign
.text:080764EF
.text:080764F4 xor edx, edx
.text:080764F6 test eax, eax
.text:080764F8 js loc_807662F
.text:080764F8
.text:080764FE mov edx, [esi+0E3Ch]
.text:08076504 lea eax, [eax+eax*2]
.text:08076507 mov esi, ebx
.text:08076509 mov ecx, [ebp+arg_4]
.text:0807650C shl eax, 2
.text:0807650F mov ebx, 51EB851Fh
.text:08076514 shl esi, 4
.text:08076517 add eax, edx
.text:08076519 mov edx, [ecx]
.text:0807651B add eax, 90h
.text:08076520 mov [eax+4], edx
.text:08076523 mov edx, [ecx+4]
.text:08076526 mov [eax+8], edx
.text:08076529 mov edx, [ecx+8]
.text:0807652C mov [eax+0Ch], edx
.text:0807652F mov eax, [ebp+arg_0]
.text:08076532 mov [esp+38h+var_38], edi
.text:08076535 mov [esp+38h+var_34], eax
.text:08076539 call dword ptr [esi+8177B0Ch] ; <suspicious>
.text:0807653F movsx ecx, word ptr [edi+0D12h]
.text:08076546 mov edx, [ebp+arg_4]
.text:08076549 movzx eax, byte ptr [edx+6]
.text:0807654D imul ecx, eax
.text:08076550 mov eax, ecx
.text:08076552 imul ebx
.text:08076554 sar ecx, 1Fh
.text:08076557 sar edx, 5
.text:0807655A sub edx, ecx
.text:0807655C mov ecx, [ebp+arg_4]
.text:0807655F mov [edi+754h], dx
.text:08076566 movsx edx, word ptr [edi+0D14h]
.text:0807656D mov [ebp+var_14], edx
.text:08076570 movzx edx, byte ptr [ecx+7]
.text:08076574 mov ecx, [ebp+var_14]
.text:08076577 imul edx, ecx
.text:0807657A mov [ebp+var_14], edx
.text:0807657D mov eax, edx
.text:0807657F imul ebx
.text:08076581 mov eax, [ebp+var_14]
.text:08076584 lea ebx, [edi+34h]
.text:08076587 sar eax, 1Fh
.text:0807658A sar edx, 5
.text:0807658D sub edx, eax
.text:0807658F mov [edi+756h], dx
.text:08076596 mov eax, ds:locale_index
.text:0807659B mov [esp+38h+var_38], offset s_SS_2 ; "%s 的 %s"
.text:080765A2 mov [esp+38h+var_34], eax
.text:080765A6 call locale_find
.text:080765A6
.text:080765AB mov [esp+38h+var_34], eax
.text:080765AF mov edx, [ebp+arg_0]
.text:080765B2 mov [esp+38h+var_2C], ebx
.text:080765B6 mov [esp+38h+var_38], offset gbuf
.text:080765BD add edx, 34h
.text:080765C0 mov [esp+38h+var_30], edx
.text:080765C4 call sprintf
.text:080765C4
.text:080765C9 mov [esp+38h+var_38], ebx
.text:080765CC mov edx, 10h
.text:080765D1 mov eax, offset gbuf
.text:080765D6 mov [esp+38h+var_30], edx
.text:080765DA mov [esp+38h+var_34], eax
.text:080765DE call strncpy
.text:080765DE
.text:080765E3 movzx eax, word ptr [edi+2Eh]
.text:080765E7 movzx edx, word ptr [esi+8177B08h] ; <suspicious>
.text:080765EE shl eax, 0Eh
.text:080765F1 or eax, edx
.text:080765F3 mov [edi+0D00h], ax
.text:080765FA mov [edi+71Ch], ax
.text:08076601 mov [esp+38h+var_38], edi
.text:08076604 call shape_packet
.text:08076604
.text:08076609 mov [esp+38h+var_38], edi
.text:0807660C call name_packet
.text:0807660C
.text:08076611 mov edx, [ebp+arg_0]
.text:08076614 mov eax, [edx+0E10h]
.text:0807661A test eax, eax
.text:0807661C jz short loc_8076639
.text:0807661C
.text:0807661E
.text:0807661E loc_807661E: ; CODE XREF: follower_add+261j
.text:0807661E mov [esp+38h+var_34], edi
.text:08076622 mov ecx, [ebp+arg_0]
.text:08076625 mov [esp+38h+var_38], ecx
.text:08076628 call follower_sync_speed
.text:08076628
.text:0807662D mov edx, edi
.text:0807662D
.text:0807662F
.text:0807662F loc_807662F: ; CODE XREF: follower_add+BDj
.text:0807662F ; follower_add+FFj
.text:0807662F ; follower_add+118j
.text:0807662F ; follower_add+272j
.text:0807662F add esp, 2Ch
.text:08076632 mov eax, edx
.text:08076634 pop ebx
.text:08076635 pop esi
.text:08076636 pop edi
.text:08076637 pop ebp
.text:08076638 retn
.text:08076638
.text:08076639 ; ---------------------------------------------------------------------------
.text:08076639
.text:08076639 loc_8076639: ; CODE XREF: follower_add+23Cj
.text:08076639 mov [esp+38h+var_38], edx
.text:0807663C call start_follower_event
.text:0807663C
.text:08076641 jmp short loc_807661E
.text:08076641
.text:08076643 ; ---------------------------------------------------------------------------
.text:08076643
.text:08076643 loc_8076643: ; CODE XREF: follower_add+AFj
.text:08076643 mov eax, [ebp+arg_4]
.text:08076646 mov edx, [eax]
.text:08076648 mov eax, [ebp+var_10]
.text:0807664B jmp loc_80764B0
.text:0807664B
.text:08076650 ; ---------------------------------------------------------------------------
.text:08076650
.text:08076650 loc_8076650: ; CODE XREF: follower_add+59j
.text:08076650 xor edx, edx
.text:08076652 jmp short loc_807662F
.text:08076652
.text:08076654 ; ---------------------------------------------------------------------------
.text:08076654
.text:08076654 loc_8076654: ; CODE XREF: follower_add+22j
.text:08076654 mov ecx, [ebp+arg_4]
.text:08076657 mov edx, [ecx]
.text:08076659 jmp loc_807642E
.text:08076659
.text:08076659 follower_add endp