Mercurial > mm7
comparison Player.cpp @ 1648:a4390cef284c
DamagePlayerFromMonster starting cleanup
author | Grumpy7 |
---|---|
date | Tue, 17 Sep 2013 07:30:41 +0200 |
parents | 511cd6dd1048 |
children | d25389b91029 |
comparison
equal
deleted
inserted
replaced
1647:511cd6dd1048 | 1648:a4390cef284c |
---|---|
7486 unsigned __int8 v20; // sf@26 | 7486 unsigned __int8 v20; // sf@26 |
7487 unsigned __int16 v21; // ax@29 | 7487 unsigned __int16 v21; // ax@29 |
7488 signed int v22; // edi@36 | 7488 signed int v22; // edi@36 |
7489 int v23; // eax@38 | 7489 int v23; // eax@38 |
7490 signed int v24; // eax@44 | 7490 signed int v24; // eax@44 |
7491 unsigned __int16 v25; // cx@47 | 7491 AIState v25; // cx@47 |
7492 signed int v26; // eax@49 | 7492 signed int v26; // eax@49 |
7493 int v27; // eax@54 | 7493 int v27; // eax@54 |
7494 float v28; // ST18_4@58 | 7494 float v28; // ST18_4@58 |
7495 double v29; // st7@58 | 7495 double v29; // st7@58 |
7496 float v30; // ST08_4@58 | 7496 float v30; // ST08_4@58 |
7560 || (v9 = (char *)v6 + 36 * v8, v9[516] & 2) | 7560 || (v9 = (char *)v6 + 36 * v8, v9[516] & 2) |
7561 || (v10 = pItemsTable->pItems[*((int *)v9 + 124)].uSkillType, v10 < 10) | 7561 || (v10 = pItemsTable->pItems[*((int *)v9 + 124)].uSkillType, v10 < 10) |
7562 || v10 > 11 ) | 7562 || v10 > 11 ) |
7563 { | 7563 { |
7564 v14 = rand() % 4; | 7564 v14 = rand() % 4; |
7565 if ( !v14 ) | 7565 switch (v14) |
7566 { | 7566 { |
7567 v71 = (SoundID)108; | 7567 case 0 : v17 = (SoundID)108; break; |
7568 goto LABEL_24; | 7568 case 1 : v17 = (SoundID)109; break; |
7569 } | 7569 case 2 : v17 = (SoundID)110; break; |
7570 v15 = v14 - 1; | 7570 case 3 : v17 = (SoundID)44; break; |
7571 if ( !v15 ) | |
7572 { | |
7573 v71 = (SoundID)109; | |
7574 goto LABEL_24; | |
7575 } | |
7576 v16 = v15 - 1; | |
7577 if ( !v16 ) | |
7578 { | |
7579 v71 = (SoundID)110; | |
7580 goto LABEL_24; | |
7581 } | |
7582 if ( v16 == 1 ) | |
7583 { | |
7584 v71 = (SoundID)44; | |
7585 goto LABEL_24; | |
7586 } | 7571 } |
7587 } | 7572 } |
7588 else | 7573 else |
7589 { | 7574 { |
7590 v11 = rand() % 4; | 7575 v11 = rand() % 4; |
7591 if ( !v11 ) | 7576 switch (v11) |
7592 { | 7577 { |
7593 v71 = (SoundID)105; | 7578 case 0 : v17 = (SoundID)105; break; |
7594 goto LABEL_24; | 7579 case 1 : v17 = (SoundID)106; break; |
7595 } | 7580 case 2 : v17 = (SoundID)107; break; |
7596 v12 = v11 - 1; | 7581 case 3 : v17 = (SoundID)45; break; |
7597 if ( !v12 ) | 7582 } |
7598 { | 7583 } |
7599 v71 = (SoundID)106; | |
7600 goto LABEL_24; | |
7601 } | |
7602 v13 = v12 - 1; | |
7603 if ( !v13 ) | |
7604 { | |
7605 v71 = (SoundID)107; | |
7606 goto LABEL_24; | |
7607 } | |
7608 if ( v13 == 1 ) | |
7609 { | |
7610 v71 = (SoundID)45; | |
7611 LABEL_24: | |
7612 v17 = v71; | |
7613 goto LABEL_26; | |
7614 } | |
7615 } | |
7616 v17 = (SoundID)a4; | |
7617 LABEL_26: | |
7618 pAudioPlayer->PlaySound(v17, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); | 7584 pAudioPlayer->PlaySound(v17, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); |
7619 v18 = Actor::_43B3E0_CalcDamage(v7, v74); | 7585 v18 = Actor::_43B3E0_CalcDamage(v7, v74); |
7620 v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0; | 7586 v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0; |
7621 v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0; | 7587 v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0; |
7622 v77 = v18; | 7588 v77 = v18; |
7624 { | 7590 { |
7625 v21 = v7->pActorBuffs[3].uPower; | 7591 v21 = v7->pActorBuffs[3].uPower; |
7626 if ( v21 ) | 7592 if ( v21 ) |
7627 v77 /= (signed int)v21; | 7593 v77 /= (signed int)v21; |
7628 } | 7594 } |
7629 if ( v74 ) | 7595 switch (v74) |
7630 { | 7596 { |
7631 if ( v74 == 1 ) | 7597 case 0: v22 = v7->pMonsterInfo.uAttack1Type; |
7632 { | 7598 break; |
7633 v22 = v7->pMonsterInfo.uAttack2Type; | 7599 case 1: v22 = v7->pMonsterInfo.uAttack2Type; |
7634 } | 7600 break; |
7635 else | 7601 case 2: v23 = v7->pMonsterInfo.uSpell1ID; |
7636 { | |
7637 if ( v74 == 2 ) | |
7638 { | |
7639 v23 = v7->pMonsterInfo.uSpell1ID; | |
7640 } | |
7641 else | |
7642 { | |
7643 if ( v74 != 3 ) | |
7644 { | |
7645 if ( v74 == 4 ) | |
7646 v22 = v7->pMonsterInfo.field_3C_some_special_attack; | |
7647 else | |
7648 v22 = 4; | |
7649 goto LABEL_43; | |
7650 } | |
7651 v23 = v7->pMonsterInfo.uSpell2ID; | |
7652 } | |
7653 v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool); | 7602 v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool); |
7654 } | 7603 break; |
7655 } | 7604 case 3: v23 = v7->pMonsterInfo.uSpell2ID; |
7656 else | 7605 v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool); |
7657 { | 7606 break; |
7658 v22 = v7->pMonsterInfo.uAttack1Type; | 7607 case 4: v22 = v7->pMonsterInfo.field_3C_some_special_attack; |
7659 } | 7608 break; |
7660 LABEL_43: | 7609 default: |
7610 case 5: v22 = 4; //yes, the original just assigned the value 4 | |
7611 break; | |
7612 } | |
7661 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | 7613 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) |
7662 { | 7614 { |
7663 v24 = v6->ReceiveDamage(v77, (DAMAGE_TYPE)v22); | 7615 v24 = v6->ReceiveDamage(v77, (DAMAGE_TYPE)v22); |
7664 if ( SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) >= 0 | 7616 if ( SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) >= 0 |
7665 && (SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v6->pPlayerBuffs[10].uExpireTime)) ) | 7617 && (SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v6->pPlayerBuffs[10].uExpireTime)) ) |
7666 { | 7618 { |
7667 v25 = v7->uAIState; | 7619 v25 = v7->uAIState; |
7668 if ( v25 != 5 ) | 7620 if ( v25 != Dying && v25 != Dead) |
7669 { | 7621 { |
7670 if ( v25 != 4 ) | 7622 v26 = stru_50C198.CalcMagicalDamageToActor(v7, v22, v24); |
7623 v7->sCurrentHP -= v26; | |
7624 if ( v26 ) | |
7671 { | 7625 { |
7672 v26 = stru_50C198.CalcMagicalDamageToActor(v7, v22, v24); | 7626 if ( v7->sCurrentHP >= 1 ) |
7673 v7->sCurrentHP -= v26; | |
7674 if ( v26 ) | |
7675 { | 7627 { |
7676 if ( v7->sCurrentHP >= 1 ) | 7628 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); |
7629 Actor::AggroSurroundingPeasants(uActorID, 1); | |
7630 } | |
7631 else | |
7632 { | |
7633 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) | |
7677 { | 7634 { |
7678 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); | 7635 v27 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v7->uActorRadius : v7->uActorRadius; |
7679 Actor::AggroSurroundingPeasants(uActorID, 1); | 7636 if ( pRenderer->pRenderD3D ) |
7680 } | |
7681 else | |
7682 { | |
7683 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) | |
7684 { | 7637 { |
7685 v27 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v7->uActorRadius : v7->uActorRadius; | 7638 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) |
7686 v74 = v27; | |
7687 if ( pRenderer->pRenderD3D ) | |
7688 { | 7639 { |
7689 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) | 7640 pDecalBuilder->AddBloodsplat(v7->vPosition.x, v7->vPosition.y, v7->vPosition.z, 1.0, 0.0, 0.0, v27, 0, 0); |
7690 { | |
7691 v28 = (double)v74; | |
7692 v74 = v7->vPosition.z; | |
7693 v29 = (double)v74; | |
7694 v74 = v7->vPosition.y; | |
7695 v30 = v29; | |
7696 v31 = (double)v74; | |
7697 v74 = v7->vPosition.x; | |
7698 v32 = v31; | |
7699 v33 = (double)v74; | |
7700 pDecalBuilder->AddBloodsplat(v33, v32, v30, 1.0, 0.0, 0.0, v28, 0, 0); | |
7701 } | |
7702 } | 7641 } |
7703 } | 7642 } |
7704 Actor::Die(uActorID); | |
7705 Actor::ApplyFineForKillingPeasant(uActorID); | |
7706 Actor::AggroSurroundingPeasants(uActorID, 1); | |
7707 if ( v7->pMonsterInfo.uExp ) | |
7708 GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp); | |
7709 v34 = SPEECH_51; | |
7710 if ( rand() % 100 < 20 ) | |
7711 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1; | |
7712 v6->PlaySound((PlayerSpeech)v34, 0); | |
7713 } | 7643 } |
7644 Actor::Die(uActorID); | |
7645 Actor::ApplyFineForKillingPeasant(uActorID); | |
7646 Actor::AggroSurroundingPeasants(uActorID, 1); | |
7647 if ( v7->pMonsterInfo.uExp ) | |
7648 GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp); | |
7649 v34 = SPEECH_51; | |
7650 if ( rand() % 100 < 20 ) | |
7651 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1; | |
7652 v6->PlaySound((PlayerSpeech)v34, 0); | |
7714 } | 7653 } |
7715 } | 7654 } |
7716 } | 7655 } |
7717 } | 7656 } |
7718 if ( !(dword_6BE368_debug_settings_2 & 0x10) | 7657 if ( !(dword_6BE368_debug_settings_2 & 0x10) |
7739 } | 7678 } |
7740 } | 7679 } |
7741 viewparams->bRedrawGameUI = 1; | 7680 viewparams->bRedrawGameUI = 1; |
7742 return; | 7681 return; |
7743 } | 7682 } |
7744 v37 = &pSpriteObjects[uActorID]; | 7683 else |
7745 v38 = PID_TYPE(v37->spell_caster_pid); | 7684 { |
7746 v39 = PID_ID(v37->spell_caster_pid); | 7685 v37 = &pSpriteObjects[uActorID]; |
7747 v40 = PID_TYPE(v37->spell_caster_pid); | 7686 v38 = PID_TYPE(v37->spell_caster_pid); |
7748 uActorID = PID_ID(v37->spell_caster_pid); | 7687 v39 = PID_ID(v37->spell_caster_pid); |
7749 v41 = v40 - 2; | 7688 v40 = PID_TYPE(v37->spell_caster_pid); |
7750 if ( !v41 ) | 7689 uActorID = PID_ID(v37->spell_caster_pid); |
7751 goto LABEL_80; | 7690 v41 = v40 - 2; |
7752 v42 = v41 - 1; | 7691 if ( !v41 ) |
7753 if ( !v42 ) | 7692 goto LABEL_80; |
7754 { | 7693 v42 = v41 - 1; |
7755 v44 = &pActors[v39]; | 7694 if ( !v42 ) |
7756 if ( a4 == -1 ) | 7695 { |
7757 a4 = stru_50C198.which_player_would_attack(v44); | 7696 v44 = &pActors[v39]; |
7758 v45 = &pParty->pPlayers[a4]; | 7697 if ( a4 == -1 ) |
7759 v77 = Actor::_43B3E0_CalcDamage(v44, v74); | 7698 a4 = stru_50C198.which_player_would_attack(v44); |
7760 v46 = v37->uType; | 7699 v45 = &pParty->pPlayers[a4]; |
7761 if ( v37->uType == 545 ) | 7700 v77 = Actor::_43B3E0_CalcDamage(v44, v74); |
7762 { | 7701 v46 = v37->uType; |
7763 LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | 7702 if ( v37->uType == 545 ) |
7764 v52 = v51; | 7703 { |
7765 if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) ) | 7704 LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
7766 { | 7705 v52 = v51; |
7767 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName); | 7706 if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) ) |
7768 ShowStatusBarString(pTmpBuf.data(), 2u); | 7707 { |
7769 v45->PlaySound(SPEECH_6, 0); | 7708 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName); |
7709 ShowStatusBarString(pTmpBuf.data(), 2u); | |
7710 v45->PlaySound(SPEECH_6, 0); | |
7711 return; | |
7712 } | |
7713 } | |
7714 else | |
7715 { | |
7716 if ( v46 != 555 | |
7717 && v46 != 510 | |
7718 && v46 != 500 | |
7719 && v46 != 515 | |
7720 && v46 != 505 | |
7721 && v46 != 530 | |
7722 && v46 != 525 | |
7723 && v46 != 520 | |
7724 && v46 != 535 | |
7725 && v46 != 540 ) | |
7726 goto LABEL_115; | |
7727 } | |
7728 if ( !stru_50C198.ActorHitOrMiss(v44, v45) ) | |
7770 return; | 7729 return; |
7771 } | 7730 if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 ) |
7772 } | 7731 v77 >>= 1; |
7773 else | 7732 if ( v45->HasEnchantedItemEquipped(36) ) |
7774 { | 7733 v77 >>= 1; |
7775 if ( v46 != 555 | 7734 if ( v45->HasEnchantedItemEquipped(69) ) |
7776 && v46 != 510 | 7735 v77 >>= 1; |
7777 && v46 != 500 | 7736 if ( v45->HasItemEquipped(EQUIP_ARMOUR) |
7778 && v46 != 515 | 7737 && v45->pInventoryItemList[v45->pEquipment.uArmor-1].uItemID == ITEM_ARTIFACT_GOVERNORS_ARMOR ) |
7779 && v46 != 505 | 7738 v77 >>= 1; |
7780 && v46 != 530 | 7739 if ( v45->HasItemEquipped(EQUIP_MAIN_HAND)) |
7781 && v46 != 525 | 7740 { |
7782 && v46 != 520 | 7741 v48 = v45->pInventoryItemList[v45->pEquipment.uMainHand - 1].uItemID; |
7783 && v46 != 535 | 7742 if ( v48 == ITEM_RELIC_KELEBRIM || v48 == ITEM_ARTIFACT_ELFBANE || (v45->GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v75) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4)) |
7784 && v46 != 540 ) | |
7785 goto LABEL_115; | |
7786 } | |
7787 if ( !stru_50C198.ActorHitOrMiss(v44, v45) ) | |
7788 return; | |
7789 if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 ) | |
7790 v77 >>= 1; | |
7791 if ( v45->HasEnchantedItemEquipped(36) ) | |
7792 v77 >>= 1; | |
7793 if ( v45->HasEnchantedItemEquipped(69) ) | |
7794 v77 >>= 1; | |
7795 if ( v45->HasItemEquipped(EQUIP_ARMOUR) | |
7796 && *(_DWORD *)&v45->pInventoryItemList[v45->pEquipment.uArmor-1] == 504 ) | |
7797 v77 >>= 1; | |
7798 v75 = 0; | |
7799 v47 = (int)&v45->pEquipment; | |
7800 do | |
7801 { | |
7802 if ( v45->HasItemEquipped((ITEM_EQUIP_TYPE)v75) ) | |
7803 { | |
7804 v48 = *(int *)&v45[36 * *(int *)v47 + 496]; | |
7805 if ( v48 == 520 ) | |
7806 v77 >>= 1; | 7743 v77 >>= 1; |
7807 if ( v48 == 531 ) | 7744 } |
7745 if ( v45->HasItemEquipped(EQUIP_OFF_HAND)) | |
7746 { | |
7747 v48 = v45->pInventoryItemList[v45->pEquipment.uShield - 1].uItemID; | |
7748 if ( v48 == ITEM_RELIC_KELEBRIM || v48 == ITEM_ARTIFACT_ELFBANE || (v45->GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v75) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4)) | |
7808 v77 >>= 1; | 7749 v77 >>= 1; |
7809 if ( v45->GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v75) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4 ) | 7750 } |
7810 v77 >>= 1; | 7751 LABEL_115: |
7811 } | 7752 if ( (signed __int64)v44->pActorBuffs[3].uExpireTime > 0 ) |
7812 ++v75; | 7753 { |
7813 v47 += 4; | 7754 v49 = v44->pActorBuffs[3].uPower; |
7814 } | 7755 if ( v49 ) |
7815 while ( (signed int)v75 <= 1 ); | 7756 v77 /= (signed int)v49; |
7816 LABEL_115: | 7757 } |
7817 if ( (signed __int64)v44->pActorBuffs[3].uExpireTime > 0 ) | 7758 if ( !v74 ) |
7818 { | 7759 { |
7819 v49 = v44->pActorBuffs[3].uPower; | 7760 v50 = v44->pMonsterInfo.uAttack1Type; |
7820 if ( v49 ) | 7761 goto LABEL_133; |
7821 v77 /= (signed int)v49; | 7762 } |
7822 } | 7763 if ( v74 == 1 ) |
7823 if ( !v74 ) | 7764 { |
7824 { | 7765 v50 = v44->pMonsterInfo.uAttack2Type; |
7825 v50 = v44->pMonsterInfo.uAttack1Type; | 7766 goto LABEL_133; |
7826 goto LABEL_133; | 7767 } |
7827 } | 7768 if ( v74 == 2 ) |
7828 if ( v74 == 1 ) | 7769 { |
7829 { | 7770 v53 = v44->pMonsterInfo.uSpell1ID; |
7830 v50 = v44->pMonsterInfo.uAttack2Type; | 7771 } |
7831 goto LABEL_133; | 7772 else |
7832 } | 7773 { |
7833 if ( v74 == 2 ) | 7774 if ( v74 != 3 ) |
7834 { | |
7835 v53 = v44->pMonsterInfo.uSpell1ID; | |
7836 } | |
7837 else | |
7838 { | |
7839 if ( v74 != 3 ) | |
7840 { | |
7841 if ( v74 == 4 ) | |
7842 v50 = v44->pMonsterInfo.field_3C_some_special_attack; | |
7843 else | |
7844 v50 = 4; | |
7845 LABEL_133: | |
7846 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | |
7847 { | 7775 { |
7848 v54 = v45->ReceiveDamage(v77, (DAMAGE_TYPE)v50); | 7776 if ( v74 == 4 ) |
7849 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 ) | 7777 v50 = v44->pMonsterInfo.field_3C_some_special_attack; |
7778 else | |
7779 v50 = 4; | |
7780 LABEL_133: | |
7781 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | |
7850 { | 7782 { |
7851 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) ) | 7783 v54 = v45->ReceiveDamage(v77, (DAMAGE_TYPE)v50); |
7784 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 ) | |
7852 { | 7785 { |
7853 v55 = v44->uAIState; | 7786 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) ) |
7854 if ( v55 != 5 ) | |
7855 { | 7787 { |
7856 if ( v55 != 4 ) | 7788 v55 = v44->uAIState; |
7789 if ( v55 != Dying && v55 != Dead) | |
7857 { | 7790 { |
7858 v56 = stru_50C198.CalcMagicalDamageToActor(v44, v50, v54); | 7791 v56 = stru_50C198.CalcMagicalDamageToActor(v44, v50, v54); |
7859 v44->sCurrentHP -= v56; | 7792 v44->sCurrentHP -= v56; |
7860 if ( v56 ) | 7793 if ( v56 ) |
7861 { | 7794 { |
7867 else | 7800 else |
7868 { | 7801 { |
7869 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) | 7802 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) |
7870 { | 7803 { |
7871 v57 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v44->uActorRadius : v44->uActorRadius; | 7804 v57 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v44->uActorRadius : v44->uActorRadius; |
7872 v75 = v57; | |
7873 if ( pRenderer->pRenderD3D ) | 7805 if ( pRenderer->pRenderD3D ) |
7874 { | 7806 { |
7875 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) | 7807 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) |
7876 { | 7808 { |
7877 v58 = (double)(signed int)v75; | 7809 pDecalBuilder->AddBloodsplat(v44->vPosition.x, v44->vPosition.y, v44->vPosition.z, 1.0, 0.0, 0.0, v57, 0, 0); |
7878 v75 = v44->vPosition.z; | |
7879 v59 = (double)(signed int)v75; | |
7880 v75 = v44->vPosition.y; | |
7881 v60 = v59; | |
7882 v61 = (double)(signed int)v75; | |
7883 v75 = v44->vPosition.x; | |
7884 v62 = v61; | |
7885 v63 = (double)(signed int)v75; | |
7886 pDecalBuilder->AddBloodsplat(v63, v62, v60, 1.0, 0.0, 0.0, v58, 0, 0); | |
7887 } | 7810 } |
7888 } | 7811 } |
7889 } | 7812 } |
7890 Actor::Die(uActorID); | 7813 Actor::Die(uActorID); |
7891 Actor::ApplyFineForKillingPeasant(uActorID); | 7814 Actor::ApplyFineForKillingPeasant(uActorID); |
7900 } | 7823 } |
7901 } | 7824 } |
7902 } | 7825 } |
7903 } | 7826 } |
7904 } | 7827 } |
7828 if ( !v74 | |
7829 && !(dword_6BE368_debug_settings_2 & 0x10) | |
7830 && v44->pMonsterInfo.uSpecialAttack | |
7831 && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType ) | |
7832 v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44); | |
7833 if ( !pParty->bTurnBasedModeOn ) | |
7834 { | |
7835 v65 = v45->GetActualEndurance(); | |
7836 v66 = (double)(20 - v45->GetParameterBonus(v65)) | |
7837 * flt_6BE3A4_debug_recmod1 | |
7838 * 2.133333333333333; | |
7839 v45->SetRecoveryTime((signed __int64)v66); | |
7840 } | |
7841 return; | |
7905 } | 7842 } |
7906 if ( !v74 | 7843 v53 = v44->pMonsterInfo.uSpell2ID; |
7907 && !(dword_6BE368_debug_settings_2 & 0x10) | 7844 } |
7908 && v44->pMonsterInfo.uSpecialAttack | 7845 v50 = LOBYTE(pSpellStats->pInfos[v53].uSchool); |
7909 && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType ) | 7846 goto LABEL_133; |
7910 v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44); | 7847 } |
7911 if ( !pParty->bTurnBasedModeOn ) | 7848 if ( v42 != 1 ) |
7912 { | 7849 return; |
7913 v65 = v45->GetActualEndurance(); | 7850 LABEL_80: |
7914 v66 = (double)(20 - v45->GetParameterBonus(v65)) | 7851 if ( a4 != -1 ) |
7915 * flt_6BE3A4_debug_recmod1 | 7852 { |
7916 * 2.133333333333333; | 7853 v43 = &pParty->pPlayers[a4]; |
7917 v45->SetRecoveryTime((signed __int64)v66); | 7854 LABEL_168: |
7918 } | 7855 a4b = v43; |
7919 return; | 7856 if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) |
7920 } | 7857 { |
7921 v53 = v44->pMonsterInfo.uSpell2ID; | 7858 v70 = v43->GetMaxHealth(); |
7922 } | 7859 v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70); |
7923 v50 = LOBYTE(pSpellStats->pInfos[v53].uSchool); | 7860 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); |
7924 goto LABEL_133; | 7861 } |
7925 } | 7862 else |
7926 if ( v42 != 1 ) | 7863 { |
7927 return; | 7864 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); |
7928 LABEL_80: | 7865 v69 = 0; |
7929 if ( a4 != -1 ) | 7866 } |
7930 { | 7867 a4b->ReceiveDamage(v68, (DAMAGE_TYPE)v69); |
7931 v43 = &pParty->pPlayers[a4]; | 7868 if ( v38 == OBJECT_Player && !qword_A750D8 ) |
7932 LABEL_168: | 7869 { |
7933 a4b = v43; | 7870 qword_A750D8 = 256i64; |
7934 if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) | 7871 PlayerSpeechID = SPEECH_44; |
7935 { | 7872 uSpeakingCharacter = uActorID + 1; |
7936 v70 = v43->GetMaxHealth(); | 7873 } |
7937 v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70); | 7874 return; |
7938 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); | 7875 } |
7939 } | 7876 v74 = 0; |
7940 else | 7877 a4a = 1; |
7941 { | 7878 do |
7942 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); | 7879 { |
7943 v69 = 0; | 7880 if ( pPlayers[a4a]->CanAct() ) |
7944 } | 7881 { |
7945 a4b->ReceiveDamage(v68, (DAMAGE_TYPE)v69); | 7882 v67 = v74++; |
7946 if ( v38 == OBJECT_Player && !qword_A750D8 ) | 7883 *(&v72 + v67) = a4a; |
7947 { | 7884 } |
7948 qword_A750D8 = 256i64; | 7885 ++a4a; |
7949 PlayerSpeechID = SPEECH_44; | 7886 } |
7950 uSpeakingCharacter = uActorID + 1; | 7887 while ( a4a <= 4 ); |
7951 } | 7888 if ( v74 ) |
7952 return; | 7889 { |
7953 } | 7890 v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; |
7954 v74 = 0; | 7891 goto LABEL_168; |
7955 a4a = 1; | 7892 } |
7956 do | |
7957 { | |
7958 if ( pPlayers[a4a]->CanAct() ) | |
7959 { | |
7960 v67 = v74++; | |
7961 *(&v72 + v67) = a4a; | |
7962 } | |
7963 ++a4a; | |
7964 } | |
7965 while ( a4a <= 4 ); | |
7966 if ( v74 ) | |
7967 { | |
7968 v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; | |
7969 goto LABEL_168; | |
7970 } | 7893 } |
7971 } | 7894 } |
7972 //----- (00421EA6) -------------------------------------------------------- | 7895 //----- (00421EA6) -------------------------------------------------------- |
7973 void OnInventoryLeftClick() | 7896 void OnInventoryLeftClick() |
7974 { | 7897 { |