mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[6987] Implemented aura dependent creature target prioritization more correctly
This commit is contained in:
parent
2b7004a0ab
commit
9a411858d0
4 changed files with 13 additions and 2 deletions
|
|
@ -278,7 +278,7 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
|
|||
|
||||
// some units are prefered in comparison to others
|
||||
if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) ||
|
||||
target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING)
|
||||
target->hasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_DAMAGE)
|
||||
) )
|
||||
{
|
||||
// current victim is a second choice target, so don't compare threat with it below
|
||||
|
|
|
|||
|
|
@ -10279,6 +10279,16 @@ Unit* Unit::SelectNearbyTarget() const
|
|||
return *tcIter;
|
||||
}
|
||||
|
||||
bool Unit::hasNegativeAuraWithInterruptFlag(uint32 flag)
|
||||
{
|
||||
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ++iter)
|
||||
{
|
||||
if (!iter->second->IsPositive() && iter->second->GetSpellProto()->AuraInterruptFlags & flag)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Unit::ApplyAttackTimePercentMod( WeaponAttackType att,float val, bool apply )
|
||||
{
|
||||
if(val > 0)
|
||||
|
|
|
|||
|
|
@ -824,6 +824,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
void CombatStop(bool cast = false);
|
||||
void CombatStopWithPets(bool cast = false);
|
||||
Unit* SelectNearbyTarget() const;
|
||||
bool hasNegativeAuraWithInterruptFlag(uint32 flag);
|
||||
|
||||
void addUnitState(uint32 f) { m_state |= f; }
|
||||
bool hasUnitState(const uint32 f) const { return (m_state & f); }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6986"
|
||||
#define REVISION_NR "6987"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue