comparison mm7_5.cpp @ 322:ce39b96acf5c

Killing friendly peasants subs
author Nomad
date Wed, 20 Feb 2013 04:36:14 +0200
parents 15decc249a94
children 8e23edf57e27
comparison
equal deleted inserted replaced
321:15decc249a94 322:ce39b96acf5c
5490 return; 5490 return;
5491 } 5491 }
5492 if ( pMonster->sCurrentHP > 0 ) 5492 if ( pMonster->sCurrentHP > 0 )
5493 { 5493 {
5494 Actor::_4030AD(uActorID_Monster_, a1, 0); 5494 Actor::_4030AD(uActorID_Monster_, a1, 0);
5495 Actor::_43AC45(uActorID_Monster_, 1); 5495 Actor::AggroSurroundingPeasants(uActorID_Monster_, 1);
5496 if ( bShowDamage ) 5496 if ( bShowDamage )
5497 { 5497 {
5498 v50 = uDamageAmount; 5498 v50 = uDamageAmount;
5499 pMonsterName = (char *)pMonster; 5499 pMonsterName = (char *)pMonster;
5500 pPlayerName = player->pName; 5500 pPlayerName = player->pName;
5535 pDecalBuilder->AddBloodsplat(v39, v38, v37, 1.0, 0.0, 0.0, *(float *)&pPlayerName, 0, 0); 5535 pDecalBuilder->AddBloodsplat(v39, v38, v37, 1.0, 0.0, 0.0, *(float *)&pPlayerName, 0, 0);
5536 } 5536 }
5537 } 5537 }
5538 } 5538 }
5539 Actor::Die(uActorID_Monster_); 5539 Actor::Die(uActorID_Monster_);
5540 Actor::_438CF3(uActorID_Monster_); 5540 Actor::ApplyFineForKillingPeasant(uActorID_Monster_);
5541 Actor::_43AC45(uActorID_Monster_, 1); 5541 Actor::AggroSurroundingPeasants(uActorID_Monster_, 1);
5542 if ( pMonster->pMonsterInfo.uExp ) 5542 if ( pMonster->pMonsterInfo.uExp )
5543 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp); 5543 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp);
5544 v40 = SPEECH_51; 5544 v40 = SPEECH_51;
5545 if ( rand() % 100 < 20 ) 5545 if ( rand() % 100 < 20 )
5546 v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1; 5546 v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1;
5825 v7->sCurrentHP -= v26; 5825 v7->sCurrentHP -= v26;
5826 if ( v26 ) 5826 if ( v26 )
5827 { 5827 {
5828 if ( v7->sCurrentHP >= 1 ) 5828 if ( v7->sCurrentHP >= 1 )
5829 { 5829 {
5830 Actor::_4030AD(uActorID, 8 * a4 | 4, 0); 5830 Actor::_4030AD(uActorID, 8 * a4 | OBJECT_Player, 0);
5831 Actor::_43AC45(uActorID, 1); 5831 Actor::AggroSurroundingPeasants(uActorID, 1);
5832 } 5832 }
5833 else 5833 else
5834 { 5834 {
5835 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) 5835 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 )
5836 { 5836 {
5852 pDecalBuilder->AddBloodsplat(v33, v32, v30, 1.0, 0.0, 0.0, v28, 0, 0); 5852 pDecalBuilder->AddBloodsplat(v33, v32, v30, 1.0, 0.0, 0.0, v28, 0, 0);
5853 } 5853 }
5854 } 5854 }
5855 } 5855 }
5856 Actor::Die(uActorID); 5856 Actor::Die(uActorID);
5857 Actor::_438CF3(uActorID); 5857 Actor::ApplyFineForKillingPeasant(uActorID);
5858 Actor::_43AC45(uActorID, 1); 5858 Actor::AggroSurroundingPeasants(uActorID, 1);
5859 if ( v7->pMonsterInfo.uExp ) 5859 if ( v7->pMonsterInfo.uExp )
5860 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp); 5860 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp);
5861 v34 = SPEECH_51; 5861 v34 = SPEECH_51;
5862 if ( rand() % 100 < 20 ) 5862 if ( rand() % 100 < 20 )
5863 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1; 5863 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1;
6011 v44->sCurrentHP -= v56; 6011 v44->sCurrentHP -= v56;
6012 if ( v56 ) 6012 if ( v56 )
6013 { 6013 {
6014 if ( v44->sCurrentHP >= 1 ) 6014 if ( v44->sCurrentHP >= 1 )
6015 { 6015 {
6016 Actor::_4030AD(uActorID, 8 * a4 | 4, 0); 6016 Actor::_4030AD(uActorID, 8 * a4 | OBJECT_Player, 0);
6017 Actor::_43AC45(uActorID, 1); 6017 Actor::AggroSurroundingPeasants(uActorID, 1);
6018 } 6018 }
6019 else 6019 else
6020 { 6020 {
6021 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) 6021 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 )
6022 { 6022 {
6038 pDecalBuilder->AddBloodsplat(v63, v62, v60, 1.0, 0.0, 0.0, v58, 0, 0); 6038 pDecalBuilder->AddBloodsplat(v63, v62, v60, 1.0, 0.0, 0.0, v58, 0, 0);
6039 } 6039 }
6040 } 6040 }
6041 } 6041 }
6042 Actor::Die(uActorID); 6042 Actor::Die(uActorID);
6043 Actor::_438CF3(uActorID); 6043 Actor::ApplyFineForKillingPeasant(uActorID);
6044 Actor::_43AC45(uActorID, 1); 6044 Actor::AggroSurroundingPeasants(uActorID, 1);
6045 if ( v44->pMonsterInfo.uExp ) 6045 if ( v44->pMonsterInfo.uExp )
6046 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v44->pMonsterInfo.uID].uExp); 6046 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[v44->pMonsterInfo.uID].uExp);
6047 v64 = SPEECH_51; 6047 v64 = SPEECH_51;
6048 if ( rand() % 100 < 20 ) 6048 if ( rand() % 100 < 20 )
6049 v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1; 6049 v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1;
6346 } 6346 }
6347 } 6347 }
6348 } 6348 }
6349 6349
6350 //----- (0043B1B0) -------------------------------------------------------- 6350 //----- (0043B1B0) --------------------------------------------------------
6351 __int16 __fastcall sub_43B1B0(signed int a1, unsigned int a2, Vec3_int_ *pVelocity, signed int a4) 6351 void sub_43B1B0(signed int a1, unsigned int a2, Vec3_int_ *pVelocity, signed int a4)
6352 { 6352 {
6353 int v4; // ebx@1 6353 int v4; // ebx@1
6354 LayingItem *v5; // eax@2 6354 LayingItem *v5; // eax@2
6355 bool v6; // eax@3 6355 bool v6; // eax@3
6356 Actor *v7; // esi@4 6356 Actor *v7; // esi@4
6430 { 6430 {
6431 if ( v7->sCurrentHP > 0 ) 6431 if ( v7->sCurrentHP > 0 )
6432 Actor::_4030AD(uActorID, v17, 0); 6432 Actor::_4030AD(uActorID, v17, 0);
6433 else 6433 else
6434 Actor::Die(uActorID); 6434 Actor::Die(uActorID);
6435 Actor::_43AC45(uActorID, 0); 6435 Actor::AggroSurroundingPeasants(uActorID, 0);
6436 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP; 6436 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP;
6437 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 ) 6437 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 )
6438 v18 = 10; 6438 v18 = 10;
6439 if ( !MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) 6439 if ( !MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) )
6440 { 6440 {
6443 pVelocity->z = (unsigned __int64)(v18 * (signed __int64)pVelocity->z) >> 16; 6443 pVelocity->z = (unsigned __int64)(v18 * (signed __int64)pVelocity->z) >> 16;
6444 v7->vVelocity.x = 50 * LOWORD(pVelocity->x); 6444 v7->vVelocity.x = 50 * LOWORD(pVelocity->x);
6445 v7->vVelocity.y = 50 * LOWORD(pVelocity->y); 6445 v7->vVelocity.y = 50 * LOWORD(pVelocity->y);
6446 v7->vVelocity.z = 50 * LOWORD(pVelocity->z); 6446 v7->vVelocity.z = 50 * LOWORD(pVelocity->z);
6447 } 6447 }
6448 LOWORD(v6) = Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14); 6448 Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14);
6449 } 6449 }
6450 else 6450 else
6451 { 6451 {
6452 LOWORD(v6) = Actor::_4030AD(uActorID, v17, 0); 6452 Actor::_4030AD(uActorID, v17, 0);
6453 } 6453 }
6454 return v6; 6454 return;
6455 } 6455 }
6456 v13 = v7->pMonsterInfo.uSpell2ID; 6456 v13 = v7->pMonsterInfo.uSpell2ID;
6457 } 6457 }
6458 v12 = LOBYTE(pSpellStats->pInfos[v13].uSchool); 6458 v12 = LOBYTE(pSpellStats->pInfos[v13].uSchool);
6459 goto LABEL_30; 6459 goto LABEL_30;
6461 v12 = v8->pMonsterInfo.uAttack1Type; 6461 v12 = v8->pMonsterInfo.uAttack1Type;
6462 goto LABEL_30; 6462 goto LABEL_30;
6463 } 6463 }
6464 } 6464 }
6465 } 6465 }
6466 return v6;
6467 } 6466 }
6468 6467
6469 //----- (0043BCA7) -------------------------------------------------------- 6468 //----- (0043BCA7) --------------------------------------------------------
6470 int __cdecl CharacterUI_LoadPaperdollTextures() 6469 int __cdecl CharacterUI_LoadPaperdollTextures()
6471 { 6470 {
10235 while ( v5 < this->uActorQueueSize ); 10234 while ( v5 < this->uActorQueueSize );
10236 } 10235 }
10237 } 10236 }
10238 10237
10239 //----- (004065B0) -------------------------------------------------------- 10238 //----- (004065B0) --------------------------------------------------------
10240 __int16 stru262_TurnBased::_4065B0() 10239 void stru262_TurnBased::_4065B0()
10241 { 10240 {
10242 stru262_TurnBased *v1; // esi@1 10241 stru262_TurnBased *v1; // esi@1
10243 signed int v2; // eax@1 10242 signed int v2; // eax@1
10244 int v3; // ebx@6 10243 int v3; // ebx@6
10245 int v4; // edi@7 10244 int v4; // edi@7
10275 } 10274 }
10276 v5 = 0; 10275 v5 = 0;
10277 if ( v1->uActorQueueSize > 0 ) 10276 if ( v1->uActorQueueSize > 0 )
10278 { 10277 {
10279 do 10278 do
10280 LOWORD(v2) = v1->_406648(v5++); 10279 v1->_406648(v5++);
10281 while ( (signed int)v5 < v1->uActorQueueSize ); 10280 while ( (signed int)v5 < v1->uActorQueueSize );
10282 } 10281 }
10283 return v2;
10284 } 10282 }
10285 10283
10286 //----- (00406648) -------------------------------------------------------- 10284 //----- (00406648) --------------------------------------------------------
10287 __int16 stru262_TurnBased::_406648(unsigned int a2) 10285 void stru262_TurnBased::_406648(unsigned int a2)
10288 { 10286 {
10289 TurnBased_QueueElem *v1; // ecx@1 10287 TurnBased_QueueElem *v1; // ecx@1
10290 int v3; // eax@1 10288 int v3; // eax@1
10291 unsigned int v4; // ebx@2 10289 unsigned int v4; // ebx@2
10292 Actor *v5; // esi@2 10290 Actor *v5; // esi@2
10373 v15 = v4; 10371 v15 = v4;
10374 v23 = &a4; 10372 v23 = &a4;
10375 v16 = a2a; 10373 v16 = a2a;
10376 if ( !(v14 % 2) ) 10374 if ( !(v14 % 2) )
10377 { 10375 {
10378 LOWORD(v3) = Actor::_402F87(v4, a2a, &a4); 10376 Actor::_402F87(v4, a2a, &a4);
10379 return v3; 10377 return;
10380 } 10378 }
10381 v21 = 64; 10379 v21 = 64;
10382 LABEL_26: 10380 LABEL_26:
10383 LOWORD(v3) = Actor::_403EB6(v15, v16, v21, v23); 10381 Actor::_403EB6(v15, v16, v21, v23);
10384 return v3; 10382 return;
10385 } 10383 }
10386 LABEL_21: 10384 LABEL_21:
10387 v5->uCurrentActionTime = 0; 10385 v5->uCurrentActionTime = 0;
10388 v5->uCurrentActionLength = 0; 10386 v5->uCurrentActionLength = 0;
10389 v5->uAIState = Dead; 10387 v5->uAIState = Dead;
10390 return pActors[v4].UpdateAnimation(); 10388 pActors[v4].UpdateAnimation();
10389 return;
10391 } 10390 }
10392 v24 = v5->pMonsterInfo.uSpellSkillAndMastery2; 10391 v24 = v5->pMonsterInfo.uSpellSkillAndMastery2;
10393 v22 = 3; 10392 v22 = 3;
10394 v17 = v5->pMonsterInfo.uSpell2ID; 10393 v17 = v5->pMonsterInfo.uSpell2ID;
10395 } 10394 }
10420 } 10419 }
10421 } 10420 }
10422 } 10421 }
10423 } 10422 }
10424 } 10423 }
10425 return v3;
10426 } 10424 }
10427 // 50FE08: using guessed type stru298 stru_50FE08; 10425 // 50FE08: using guessed type stru298 stru_50FE08;
10428 10426
10429 //----- (0040680F) -------------------------------------------------------- 10427 //----- (0040680F) --------------------------------------------------------
10430 __int16 stru262_TurnBased::_40680F(int a2) 10428 __int16 stru262_TurnBased::_40680F(int a2)
12390 12388
12391 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 12389 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
12392 12390
12393 if (!v8 || v7) 12391 if (!v8 || v7)
12394 if (!v6 || v5) 12392 if (!v6 || v5)
12395 if (actor->_438B9B()) 12393 if (actor->IsPeasant())
12396 BYTE2(actor->uAttributes) &= 0xF7u; 12394 BYTE2(actor->uAttributes) &= 0xF7u;
12397 12395
12398 BYTE2(actor->uAttributes) &= 0x7Fu; 12396 BYTE2(actor->uAttributes) &= 0x7Fu;
12399 if (BYTE2(actor->uAttributes) & 0x40) 12397 if (BYTE2(actor->uAttributes) & 0x40)
12400 Actor::_4031C1_update_job(i, pParty->uCurrentHour, 1); 12398 Actor::_4031C1_update_job(i, pParty->uCurrentHour, 1);