mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11825] Implement creature offhand attack. based on patch from maxxx2021
also drop some archaic Unit's code
This commit is contained in:
parent
4bd3976e30
commit
70a6a1ce76
9 changed files with 104 additions and 102 deletions
|
|
@ -120,20 +120,5 @@ CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32
|
|||
|
||||
bool CreatureAI::DoMeleeAttackIfReady()
|
||||
{
|
||||
// Check target
|
||||
if (!m_creature->getVictim())
|
||||
return false;
|
||||
|
||||
// Make sure our attack is ready before checking distance
|
||||
if (!m_creature->isAttackReady())
|
||||
return false;
|
||||
|
||||
// If we are within range melee the target
|
||||
if (!m_creature->CanReachWithMeleeAttack(m_creature->getVictim()))
|
||||
return false;
|
||||
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
|
||||
return true;
|
||||
return m_creature->UpdateMeleeAttackingState();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue