Core/Creature: merged creature extra flag for offhand attacks

This commit is contained in:
Ovalord committed 2017-12-09 20:37:54 +01:00
1 parent f943ac6d06
commit 6ecb9746b1
4 files changed
+15 -9

No files matched your search

+3 -2
View File
@@ -5560,9 +5560,10 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
}
// delay offhand weapon attack to next attack time
// delay offhand weapon attack by 50% of the base attack time
if (haveOffhandWeapon() && GetTypeId() != TYPEID_PLAYER)
resetAttackTimer(OFF_ATTACK);
setAttackTimer(OFF_ATTACK, std::max(getAttackTimer(OFF_ATTACK), getAttackTimer(BASE_ATTACK) + uint32(CalculatePct(GetFloatValue(UNIT_FIELD_BASEATTACKTIME), 50))));
if (meleeAttack)
SendMeleeAttackStart(victim);