Core/Creatures: ported all existing static flag implementations from master branch
This commit is contained in:
1 parent
393b4d0dc6
commit
ff575bcef0
7 files changed
+110
-30
No files matched your search
@@ -5299,9 +5299,15 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
return false;
|
||||
|
||||
Creature* creature = ToCreature();
|
||||
// creatures cannot attack while evading
|
||||
if (creature && creature->IsInEvadeMode())
|
||||
return false;
|
||||
if (creature)
|
||||
{
|
||||
// creatures cannot attack while evading
|
||||
if (creature->IsInEvadeMode())
|
||||
return false;
|
||||
|
||||
if (!creature->CanMelee())
|
||||
meleeAttack = false;
|
||||
}
|
||||
|
||||
if (HasAuraType(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES))
|
||||
return false;
|
||||
@@ -11842,8 +11848,8 @@ bool Unit::IsInPartyWith(Unit const* unit) const
|
||||
|
||||
if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER)
|
||||
return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer());
|
||||
else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) ||
|
||||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
|
||||
else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->HasStaticFlag(CREATURE_STATIC_FLAG_4_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS)) ||
|
||||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->HasStaticFlag(CREATURE_STATIC_FLAG_4_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS)))
|
||||
return true;
|
||||
|
||||
return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction();
|
||||
@@ -11861,8 +11867,8 @@ bool Unit::IsInRaidWith(Unit const* unit) const
|
||||
|
||||
if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER)
|
||||
return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer());
|
||||
else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) ||
|
||||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
|
||||
else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->HasStaticFlag(CREATURE_STATIC_FLAG_4_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS)) ||
|
||||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->HasStaticFlag(CREATURE_STATIC_FLAG_4_TREAT_AS_RAID_UNIT_FOR_HELPFUL_SPELLS)))
|
||||
return true;
|
||||
|
||||
return u1->GetTypeId() == TYPEID_UNIT && u2->GetTypeId() == TYPEID_UNIT && u1->GetFaction() == u2->GetFaction();
|
||||
|
||||
Reference in new issue
Block a user