# HG changeset patch # User Grumpy7 # Date 1382772961 25200 # Node ID f708aaeb635b7d25d0b54110eb13edf72bb2ec56 # Parent 3ef25d06b9b0b718ebbb64e71a0cdda616caf8b2 stru319::_4273BB cleaned up diff -r 3ef25d06b9b0 -r f708aaeb635b mm7_6.cpp --- a/mm7_6.cpp Sat Oct 26 00:18:52 2013 -0700 +++ b/mm7_6.cpp Sat Oct 26 00:36:01 2013 -0700 @@ -106,39 +106,33 @@ } //----- (004273BB) -------------------------------------------------------- -bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) +bool stru319::_4273BB(Actor *attacker, Actor *defender, int a3, int a4) { - Actor *v5; // ecx@1 signed int v6; // ebx@1 signed int v7; // esi@1 - unsigned __int8 v8; // zf@1 - unsigned __int8 v9; // sf@1 - int v10; // ebx@10 + int armorSum; // ebx@10 signed int a2a; // [sp+18h] [bp+Ch]@1 - v5 = a2; - v6 = a2->pMonsterInfo.uAC; + v6 = defender->pMonsterInfo.uAC; v7 = 0; - v8 = HIDWORD(a2->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime) == 0; - v9 = SHIDWORD(a2->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime) < 0; a2a = 0; - if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime) > 0) ) + if ( defender->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 ) v6 /= 2; - if ( (signed __int64)v5->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) - v7 = v5->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; - if ( (signed __int64)v5->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && v5->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v7 ) - v7 = v5->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower; - v10 = v7 + v6; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) - a2a = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower > a2a ) - a2a = pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower; - if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 ) + if ( defender->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) + v7 = defender->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; + if ( defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v7 ) + v7 = defender->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower; + armorSum = v7 + v6; + if ( attacker->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) + a2a = attacker->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; + if ( attacker->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && attacker->pActorBuffs[ACTOR_BUFF_BLESS].uPower > a2a ) + a2a = attacker->pActorBuffs[ACTOR_BUFF_BLESS].uPower; + if ( attacker->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 ) { - a2a += pActor->pActorBuffs[ACTOR_BUFF_FATE].uPower; - pActor->pActorBuffs[ACTOR_BUFF_FATE].Reset(); + a2a += attacker->pActorBuffs[ACTOR_BUFF_FATE].uPower; + attacker->pActorBuffs[ACTOR_BUFF_FATE].Reset(); } - return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; + return rand() % (armorSum + 2 * attacker->pMonsterInfo.uLevel + 10) + a2a + 1 > armorSum + 5; } //----- (004274AD) --------------------------------------------------------