mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
@@ -74,21 +74,13 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
if (me->isAttackReady())
|
||||
{
|
||||
if (ShouldSparWith(victim))
|
||||
me->FakeAttackerStateUpdate(victim);
|
||||
else
|
||||
me->AttackerStateUpdate(victim);
|
||||
|
||||
me->AttackerStateUpdate(victim);
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
|
||||
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
|
||||
{
|
||||
if (ShouldSparWith(victim))
|
||||
me->FakeAttackerStateUpdate(victim, OFF_ATTACK);
|
||||
else
|
||||
me->AttackerStateUpdate(victim, OFF_ATTACK);
|
||||
|
||||
me->AttackerStateUpdate(victim, OFF_ATTACK);
|
||||
me->resetAttackTimer(OFF_ATTACK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2037,52 +2037,6 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BASE_ATTACK*/)
|
||||
{
|
||||
if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasUnitFlag(UNIT_FLAG_PACIFIED))
|
||||
return;
|
||||
|
||||
if (!victim->IsAlive())
|
||||
return;
|
||||
|
||||
if ((attType == BASE_ATTACK || attType == OFF_ATTACK) && !IsWithinLOSInMap(victim))
|
||||
return;
|
||||
|
||||
AttackedTarget(victim, true);
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::Attacking);
|
||||
|
||||
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
|
||||
return; // ignore ranged case
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT && !HasUnitFlag(UNIT_FLAG_POSSESSED) && !HasUnitFlag2(UNIT_FLAG2_DISABLE_TURN))
|
||||
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
|
||||
|
||||
CalcDamageInfo damageInfo;
|
||||
damageInfo.Attacker = this;
|
||||
damageInfo.Target = victim;
|
||||
|
||||
damageInfo.DamageSchoolMask = GetMeleeDamageSchoolMask();
|
||||
damageInfo.OriginalDamage = 0;
|
||||
damageInfo.Damage = 0;
|
||||
damageInfo.Absorb = 0;
|
||||
damageInfo.Resist = 0;
|
||||
|
||||
damageInfo.AttackType = attType;
|
||||
damageInfo.CleanDamage = 0;
|
||||
damageInfo.Blocked = 0;
|
||||
|
||||
damageInfo.TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo.HitInfo = HITINFO_AFFECTS_VICTIM | HITINFO_NORMALSWING | HITINFO_FAKE_DAMAGE;
|
||||
if (attType == OFF_ATTACK)
|
||||
damageInfo.HitInfo |= HITINFO_OFFHAND;
|
||||
|
||||
damageInfo.ProcAttacker = PROC_FLAG_NONE;
|
||||
damageInfo.ProcVictim = PROC_FLAG_NONE;
|
||||
damageInfo.HitOutCome = MELEE_HIT_NORMAL;
|
||||
|
||||
SendAttackStateUpdate(&damageInfo);
|
||||
}
|
||||
|
||||
void Unit::HandleProcExtraAttackFor(Unit* victim)
|
||||
{
|
||||
while (m_extraAttacks)
|
||||
|
||||
@@ -1031,7 +1031,6 @@ class TC_GAME_API Unit : public WorldObject
|
||||
|
||||
void HandleEmoteCommand(uint32 anim_id, Player* target = nullptr, Trinity::IteratorPair<int32 const*> spellVisualKitIds = {});
|
||||
void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false);
|
||||
void FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType = BASE_ATTACK);
|
||||
|
||||
void CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK);
|
||||
void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);
|
||||
|
||||
Reference in New Issue
Block a user