mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
[9603] Implement use of UNIT_FLAG_PASSIVE for creature.
Add function to check creatures own ability to initiate an attack in MoveInLineOfSight. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
a27ff3e79d
commit
bfecdc3ded
6 changed files with 21 additions and 5 deletions
|
|
@ -1634,6 +1634,20 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Creature::CanInitiateAttack()
|
||||
{
|
||||
if (hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED))
|
||||
return false;
|
||||
|
||||
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
|
||||
return false;
|
||||
|
||||
if (isPassiveToHostile())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Creature::SaveRespawnTime()
|
||||
{
|
||||
if(isPet() || !m_DBTableGuid)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue