comparison Actor.cpp @ 1875:1d9e4b50bc7c

Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
author Grumpy7
date Thu, 17 Oct 2013 08:55:28 +0200
parents a6276dda8804
children 2070d01ccfae
comparison
equal deleted inserted replaced
1874:a6276dda8804 1875:1d9e4b50bc7c
1345 switch ( a2 ) 1345 switch ( a2 )
1346 { 1346 {
1347 case 1: 1347 case 1:
1348 if ( a3 ) 1348 if ( a3 )
1349 { 1349 {
1350 pOtherOverlayList->_4418B6(904, v4, 0, (sub_43AE12(a3) * 65536.0), 0); 1350 pOtherOverlayList->_4418B6(904, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
1351 } 1351 }
1352 return; 1352 return;
1353 case 2: 1353 case 2:
1354 if ( a3 ) 1354 if ( a3 )
1355 { 1355 {
1356 pOtherOverlayList->_4418B6(905, v4, 0, (sub_43AE12(a3) * 65536.0), 0); 1356 pOtherOverlayList->_4418B6(905, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
1357 } 1357 }
1358 return; 1358 return;
1359 case 3: 1359 case 3:
1360 if ( a3 ) 1360 if ( a3 )
1361 { 1361 {
1362 pOtherOverlayList->_4418B6(906, v4, 0, (sub_43AE12(a3) * 65536.0), 0); 1362 pOtherOverlayList->_4418B6(906, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
1363 } 1363 }
1364 return; 1364 return;
1365 case 4: 1365 case 4:
1366 if ( a3 ) 1366 if ( a3 )
1367 { 1367 {
1368 pOtherOverlayList->_4418B6(907, v4, 0, (sub_43AE12(a3) * 65536.0), 0); 1368 pOtherOverlayList->_4418B6(907, v4, 0, (int)(sub_43AE12(a3) * 65536.0), 0);
1369 } 1369 }
1370 return; 1370 return;
1371 case 5: 1371 case 5:
1372 pOtherOverlayList->_4418B6(901, v4, 0, PID(OBJECT_Actor,uActorID), 0); 1372 pOtherOverlayList->_4418B6(901, v4, 0, PID(OBJECT_Actor,uActorID), 0);
1373 return; 1373 return;
1391 } 1391 }
1392 return; 1392 return;
1393 } 1393 }
1394 1394
1395 //----- (0043B3E0) -------------------------------------------------------- 1395 //----- (0043B3E0) --------------------------------------------------------
1396 int Actor::_43B3E0_CalcDamage(Actor *a1, signed int a2) 1396 int Actor::_43B3E0_CalcDamage(Actor *a1, signed int dmgSource)
1397 { 1397 {
1398 signed int v2; // ebp@1 1398 signed int v2; // ebp@1
1399 int v3; // eax@9 1399 int v3; // eax@9
1400 signed int v4; // edi@9 1400 signed int v4; // edi@9
1401 int v5; // esi@9 1401 int v5; // esi@9
1402 int v6; // ebx@11
1403 unsigned __int16 v8; // si@21 1402 unsigned __int16 v8; // si@21
1404 int v9; // edi@21 1403 int v9; // edi@21
1405 signed int v10; // eax@23 1404 signed int v10; // eax@23
1406 int v11; // [sp+10h] [bp-4h]@1 1405 int v11; // [sp+10h] [bp-4h]@1
1407 1406
1408 v2 = 0; 1407 v2 = 0;
1409 v11 = 0; 1408 v11 = 0;
1410 if ( a2 ) 1409
1411 { 1410 switch( dmgSource )
1412 if ( a2 == 1 ) 1411 {
1413 { 1412 case 0:
1413 if ( a1->pActorBuffs[14].uExpireTime > 0 )
1414 v2 = a1->pActorBuffs[14].uPower;
1415 if ( a1->pActorBuffs[18].uExpireTime > 0 && a1->pActorBuffs[18].uPower > v2 )
1416 v2 = a1->pActorBuffs[18].uPower;
1417 if ( a1->pActorBuffs[21].uExpireTime > 0 )
1418 v2 += a1->pActorBuffs[21].uPower;
1419 v3 = a1->pMonsterInfo.uAttack1DamageDiceRolls;
1420 v4 = a1->pMonsterInfo.uAttack1DamageDiceSides;
1421 v5 = a1->pMonsterInfo.uAttack1DamageBonus;
1422 break;
1423 case 1:
1414 v3 = a1->pMonsterInfo.uAttack2DamageDiceRolls; 1424 v3 = a1->pMonsterInfo.uAttack2DamageDiceRolls;
1415 v4 = a1->pMonsterInfo.uAttack2DamageDiceSides; 1425 v4 = a1->pMonsterInfo.uAttack2DamageDiceSides;
1416 v5 = a1->pMonsterInfo.uAttack2DamageBonus; 1426 v5 = a1->pMonsterInfo.uAttack2DamageBonus;
1417 } 1427 break;
1418 else 1428 case 2:
1419 { 1429 v8 = a1->pMonsterInfo.uSpellSkillAndMastery1;
1420 if ( a2 <= 1 ) 1430 v9 = a1->pMonsterInfo.uSpell1ID;
1421 return 0; 1431 v10 = SkillToMastery(v8);
1422 if ( a2 <= 3 ) 1432 return _43AFE3_calc_spell_damage(v9, v8 & 0x3F, v10, 0);
1423 { 1433 break;
1424 if ( a2 == 2 ) 1434 case 3:
1425 { 1435 v8 = a1->pMonsterInfo.uSpellSkillAndMastery2;
1426 v8 = a1->pMonsterInfo.uSpellSkillAndMastery1; 1436 v9 = a1->pMonsterInfo.uSpell2ID;
1427 v9 = a1->pMonsterInfo.uSpell1ID; 1437 v10 = SkillToMastery(v8);
1428 } 1438 return _43AFE3_calc_spell_damage(v9, v8 & 0x3F, v10, 0);
1429 else 1439 break;
1430 { 1440 case 4:
1431 v8 = a1->pMonsterInfo.uSpellSkillAndMastery2;
1432 v9 = a1->pMonsterInfo.uSpell2ID;
1433 }
1434 v10 = SkillToMastery(v8);
1435 return _43AFE3_calc_spell_damage(v9, v8 & 0x3F, v10, 0);
1436 }
1437 if ( a2 != 4 )
1438 return 0;
1439 v3 = a1->pMonsterInfo.uSpecialAbilityDamageDiceRolls; 1441 v3 = a1->pMonsterInfo.uSpecialAbilityDamageDiceRolls;
1440 v4 = a1->pMonsterInfo.uSpecialAbilityDamageDiceSides; 1442 v4 = a1->pMonsterInfo.uSpecialAbilityDamageDiceSides;
1441 v5 = a1->pMonsterInfo.uSpecialAbilityDamageDiceBonus; 1443 v5 = a1->pMonsterInfo.uSpecialAbilityDamageDiceBonus;
1442 } 1444 default:
1443 } 1445 return 0;
1444 else 1446 }
1445 { 1447 for ( int i = 0; i < v3; i++)
1446 if ( (signed __int64)a1->pActorBuffs[14].uExpireTime > 0 ) 1448 {
1447 v2 = a1->pActorBuffs[14].uPower; 1449 v11 += rand() % v4 + 1;
1448 if ( (signed __int64)a1->pActorBuffs[18].uExpireTime > 0 && a1->pActorBuffs[18].uPower > v2 )
1449 v2 = a1->pActorBuffs[18].uPower;
1450 if ( (signed __int64)a1->pActorBuffs[21].uExpireTime > 0 )
1451 v2 += a1->pActorBuffs[21].uPower;
1452 v3 = a1->pMonsterInfo.uAttack1DamageDiceRolls;
1453 v4 = a1->pMonsterInfo.uAttack1DamageDiceSides;
1454 v5 = a1->pMonsterInfo.uAttack1DamageBonus;
1455 }
1456 if ( v3 > 0 )
1457 {
1458 v6 = v3;
1459 do
1460 {
1461 --v6;
1462 v11 += rand() % v4 + 1;
1463 }
1464 while ( v6 );
1465 } 1450 }
1466 return v11 + v5 + v2; 1451 return v11 + v5 + v2;
1467 } 1452 }
1468 1453
1469 //----- (00438B9B) -------------------------------------------------------- 1454 //----- (00438B9B) --------------------------------------------------------