AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
FactionTemplateEntry Struct Reference

#include "DBCStructure.h"

Public Member Functions

bool IsFriendlyTo (FactionTemplateEntry const &entry) const
 
bool IsHostileTo (FactionTemplateEntry const &entry) const
 
bool IsHostileToPlayers () const
 
bool IsHostileToAlliancePlayers () const
 
bool IsHostileToHordePlayers () const
 
bool IsNeutralToAll () const
 
bool IsContestedGuardFaction () const
 
bool FactionRespondsToCallForHelp () const
 

Public Attributes

uint32 ID
 
uint32 faction
 
uint32 factionFlags
 
uint32 ourMask
 
uint32 friendlyMask
 
uint32 hostileMask
 
uint32 enemyFaction [MAX_FACTION_RELATIONS]
 
uint32 friendFaction [MAX_FACTION_RELATIONS]
 

Detailed Description

Member Function Documentation

◆ FactionRespondsToCallForHelp()

bool FactionTemplateEntry::FactionRespondsToCallForHelp ( ) const
inline
@ FACTION_TEMPLATE_FLAG_RESPOND_TO_CALL_FOR_HELP
Definition DBCEnums.h:319
uint32 factionFlags
Definition DBCStructure.h:978

References FACTION_TEMPLATE_FLAG_RESPOND_TO_CALL_FOR_HELP, and factionFlags.

◆ IsContestedGuardFaction()

bool FactionTemplateEntry::IsContestedGuardFaction ( ) const
inline
@ FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS
Definition DBCEnums.h:331

References FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS, and factionFlags.

◆ IsFriendlyTo()

bool FactionTemplateEntry::IsFriendlyTo ( FactionTemplateEntry const &  entry) const
inline
988 {
989 // Xinef: Always friendly to self faction
990 if (faction == entry.faction)
991 return true;
992
993 if (entry.faction)
994 {
995 for (unsigned int i : enemyFaction)
996 if (i == entry.faction)
997 return false;
998 for (unsigned int i : friendFaction)
999 if (i == entry.faction)
1000 return true;
1001 }
1002 return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask);
1003 }
uint32 faction
Definition DBCStructure.h:977
uint32 friendlyMask
Definition DBCStructure.h:980
uint32 ourMask
Definition DBCStructure.h:979
uint32 friendFaction[MAX_FACTION_RELATIONS]
Definition DBCStructure.h:983
uint32 enemyFaction[MAX_FACTION_RELATIONS]
Definition DBCStructure.h:982

References enemyFaction, faction, friendFaction, friendlyMask, and ourMask.

Referenced by Player::CanUseBattlegroundObject(), Spell::EffectGameObjectDamage(), Unit::GetFactionReactionTo(), WorldObject::GetFactionReactionTo(), and Unit::PatchValuesUpdate().

◆ IsHostileTo()

bool FactionTemplateEntry::IsHostileTo ( FactionTemplateEntry const &  entry) const
inline
1005 {
1006 if (entry.faction)
1007 {
1008 for (unsigned int i : enemyFaction)
1009 if (i == entry.faction)
1010 return true;
1011 for (unsigned int i : friendFaction)
1012 if (i == entry.faction)
1013 return false;
1014 }
1015 return (hostileMask & entry.ourMask) != 0;
1016 }
uint32 hostileMask
Definition DBCStructure.h:981

References enemyFaction, faction, friendFaction, hostileMask, and ourMask.

Referenced by GameObject::ActivateToQuest(), Unit::GetFactionReactionTo(), and WorldObject::GetFactionReactionTo().

◆ IsHostileToAlliancePlayers()

bool FactionTemplateEntry::IsHostileToAlliancePlayers ( ) const
inline
1018{ return (hostileMask & FACTION_MASK_ALLIANCE) != 0; }
@ FACTION_MASK_ALLIANCE
Definition DBCEnums.h:338

References FACTION_MASK_ALLIANCE, and hostileMask.

Referenced by GameObject::ActivateToQuest(), and Player::RewardReputation().

◆ IsHostileToHordePlayers()

bool FactionTemplateEntry::IsHostileToHordePlayers ( ) const
inline
1019{ return (hostileMask & FACTION_MASK_HORDE) != 0; }
@ FACTION_MASK_HORDE
Definition DBCEnums.h:339

References FACTION_MASK_HORDE, and hostileMask.

Referenced by GameObject::ActivateToQuest(), and Player::RewardReputation().

◆ IsHostileToPlayers()

bool FactionTemplateEntry::IsHostileToPlayers ( ) const
inline
1017{ return (hostileMask & FACTION_MASK_PLAYER) != 0; }
@ FACTION_MASK_PLAYER
Definition DBCEnums.h:337

References FACTION_MASK_PLAYER, and hostileMask.

Referenced by Unit::IsHostileToPlayers().

◆ IsNeutralToAll()

bool FactionTemplateEntry::IsNeutralToAll ( ) const
inline
1021 {
1022 for (unsigned int i : enemyFaction)
1023 if (i != 0)
1024 return false;
1025 return hostileMask == 0 && friendlyMask == 0;
1026 }

References enemyFaction, friendlyMask, and hostileMask.

Referenced by Unit::IsNeutralToAll().

Member Data Documentation

◆ enemyFaction

uint32 FactionTemplateEntry::enemyFaction[MAX_FACTION_RELATIONS]

◆ faction

◆ factionFlags

◆ friendFaction

uint32 FactionTemplateEntry::friendFaction[MAX_FACTION_RELATIONS]

Referenced by IsFriendlyTo(), and IsHostileTo().

◆ friendlyMask

uint32 FactionTemplateEntry::friendlyMask

Referenced by IsFriendlyTo(), and IsNeutralToAll().

◆ hostileMask

◆ ID

uint32 FactionTemplateEntry::ID

◆ ourMask


The documentation for this struct was generated from the following file: