mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11032] Implement CREATURE_FLAG_EXTRA_AGGRO_ZONE.
This let control zone wide aggro in DB data instead need special script code. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
3bb16cacdb
commit
54cb8f1a63
5 changed files with 21 additions and 6 deletions
|
|
@ -1985,7 +1985,7 @@ void Creature::SetInCombatWithZone()
|
|||
if (pPlayer->isGameMaster())
|
||||
continue;
|
||||
|
||||
if (pPlayer->isAlive())
|
||||
if (pPlayer->isAlive() && !IsFriendlyTo(pPlayer))
|
||||
{
|
||||
pPlayer->SetInCombatWith(this);
|
||||
AddThreat(pPlayer);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ enum CreatureFlagsExtra
|
|||
CREATURE_FLAG_EXTRA_NO_XP_AT_KILL = 0x00000040, // creature kill not provide XP
|
||||
CREATURE_FLAG_EXTRA_INVISIBLE = 0x00000080, // creature is always invisible for player (mostly trigger creatures)
|
||||
CREATURE_FLAG_EXTRA_NOT_TAUNTABLE = 0x00000100, // creature is immune to taunt auras and effect attack me
|
||||
CREATURE_FLAG_EXTRA_AGGRO_ZONE = 0x00000200, // creature sets itself in combat with zone on aggro
|
||||
};
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
|
||||
|
|
|
|||
|
|
@ -1350,7 +1350,15 @@ void ObjectMgr::LoadCreatures()
|
|||
if(cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
{
|
||||
if(!mapEntry || !mapEntry->IsDungeon())
|
||||
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.",guid,data.id);
|
||||
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND (%u) but creature are not in instance.",
|
||||
guid, data.id, CREATURE_FLAG_EXTRA_INSTANCE_BIND);
|
||||
}
|
||||
|
||||
if(cInfo->flags_extra & CREATURE_FLAG_EXTRA_AGGRO_ZONE)
|
||||
{
|
||||
if(!mapEntry || !mapEntry->IsDungeon())
|
||||
sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_AGGRO_ZONE (%u) but creature are not in instance.",
|
||||
guid, data.id, CREATURE_FLAG_EXTRA_AGGRO_ZONE);
|
||||
}
|
||||
|
||||
if(data.curmana < cInfo->minmana)
|
||||
|
|
|
|||
|
|
@ -7711,11 +7711,17 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
|||
if (getStandState() == UNIT_STAND_STATE_CUSTOM)
|
||||
SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if (((Creature*)this)->AI())
|
||||
((Creature*)this)->AI()->EnterCombat(enemy);
|
||||
Creature* pCreature = (Creature*)this;
|
||||
|
||||
if (pCreature->AI())
|
||||
pCreature->AI()->EnterCombat(enemy);
|
||||
|
||||
// Some bosses are set into combat with zone
|
||||
if (GetMap()->IsDungeon() && (pCreature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_AGGRO_ZONE))
|
||||
pCreature->SetInCombatWithZone();
|
||||
|
||||
if (InstanceData* mapInstance = GetInstanceData())
|
||||
mapInstance->OnCreatureEnterCombat((Creature*)this);
|
||||
mapInstance->OnCreatureEnterCombat(pCreature);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11031"
|
||||
#define REVISION_NR "11032"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue