comparison NPC.cpp @ 292:5586bb4e8395

build fix
author Gloval
date Tue, 19 Feb 2013 00:37:12 +0400
parents 0ea5fbd16edb
children 27670273a6ff
comparison
equal deleted inserted replaced
291:0ea5fbd16edb 292:5586bb4e8395
523 // 47730C: using guessed type int __stdcall const_1(int); 523 // 47730C: using guessed type int __stdcall const_1(int);
524 524
525 //----- (0047732C) -------------------------------------------------------- 525 //----- (0047732C) --------------------------------------------------------
526 void NPCStats::InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId) 526 void NPCStats::InitializeAdditionalNPCs(NPCData *pNPCDataBuff, int npc_uid, int uLocation2D, int uMapId)
527 { 527 {
528 528 int rep_gen;
529 int uNPCSex; // esi@1 529 int uNPCSex; // esi@1
530 int uGeneratedPortret; // ecx@23 530 int uGeneratedPortret; // ecx@23
531 int test_prof_summ; // ecx@37 531 int test_prof_summ; // ecx@37
532 int gen_profession; // eax@37 532 int gen_profession; // eax@37
533 int max_prof_cap; // edx@37 533 int max_prof_cap; // edx@37
547 static const unsigned __int8 NPCRaceGenTable[86] ={ 547 static const unsigned __int8 NPCRaceGenTable[86] ={
548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 1, 548 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 1,
549 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 549 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
550 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 550 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
551 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 551 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
552 , 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0}; 552 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0};
553 553
554 554
555 unsigned __int8 seed = (unsigned __int8)((double)(npc_uid - 1) * 0.33333334); 555 unsigned __int8 seed = (unsigned __int8)((double)(npc_uid - 1) * 0.33333334);
556 uNPCSex = NPCSexGenTable[seed]; 556 uNPCSex = NPCSexGenTable[seed];
557 uRace = NPCRaceGenTable[seed]; 557 uRace = NPCRaceGenTable[seed];
630 630
631 pNPCDataBuff->uPortraitID = uGeneratedPortret; 631 pNPCDataBuff->uPortraitID = uGeneratedPortret;
632 pNPCDataBuff->uFlags = 0; 632 pNPCDataBuff->uFlags = 0;
633 pNPCDataBuff->fame = 0; 633 pNPCDataBuff->fame = 0;
634 //generate reputation 634 //generate reputation
635 v13 = rand() % 100 + 1; 635 rep_gen = rand() % 100 + 1;
636 636
637 if ( v13 >= 60 ) 637 if ( rep_gen >= 60 )
638 { 638 {
639 if ( v13 >= 90 ) 639 if ( rep_gen >= 90 )
640 { 640 {
641 if ( v13 >= 95 ) 641 if ( rep_gen >= 95 )
642 { 642 {
643 if ( v13 >= 98 ) 643 if ( rep_gen >= 98 )
644 pNPCDataBuff->rep = -600; 644 pNPCDataBuff->rep = -600;
645 else 645 else
646 pNPCDataBuff->rep = 400; 646 pNPCDataBuff->rep = 400;
647 } 647 }
648 else 648 else