TrinityCore
ReputationMgr Class Reference

#include <ReputationMgr.h>

Public Member Functions

 ReputationMgr (Player *owner)
 
 ~ReputationMgr ()
 
void SaveToDB (CharacterDatabaseTransaction trans)
 
void LoadFromDB (PreparedQueryResult result)
 
uint8 GetVisibleFactionCount () const
 
uint8 GetHonoredFactionCount () const
 
uint8 GetReveredFactionCount () const
 
uint8 GetExaltedFactionCount () const
 
FactionStateList const & GetStateList () const
 
FactionState const * GetState (FactionEntry const *factionEntry) const
 
FactionState const * GetState (RepListID id) const
 
bool IsAtWar (uint32 faction_id) const
 
bool IsAtWar (FactionEntry const *factionEntry) const
 
int32 GetReputation (uint32 faction_id) const
 
int32 GetReputation (FactionEntry const *factionEntry) const
 
int32 GetBaseReputation (FactionEntry const *factionEntry) const
 
int32 GetMinReputation (FactionEntry const *factionEntry) const
 
int32 GetMaxReputation (FactionEntry const *factionEntry) const
 
ReputationRank GetRank (FactionEntry const *factionEntry) const
 
ReputationRank GetBaseRank (FactionEntry const *factionEntry) const
 
std::string GetReputationRankName (FactionEntry const *factionEntry) const
 
ReputationRank const * GetForcedRankIfAny (FactionTemplateEntry const *factionTemplateEntry) const
 
ReputationRank const * GetForcedRankIfAny (uint32 factionId) const
 
bool IsParagonReputation (FactionEntry const *factionEntry) const
 
int32 GetParagonLevel (uint32 paragonFactionId) const
 
int32 GetParagonLevel (FactionEntry const *paragonFactionEntry) const
 
bool HasMaximumRenownReputation (FactionEntry const *factionEntry) const
 
bool IsRenownReputation (FactionEntry const *factionEntry) const
 
int32 GetRenownLevel (FactionEntry const *renownFactionEntry) const
 
int32 GetRenownLevelThreshold (FactionEntry const *renownFactionEntry) const
 
int32 GetRenownMaxLevel (FactionEntry const *renownFactionEntry) const
 
bool SetReputation (FactionEntry const *factionEntry, int32 standing)
 
bool ModifyReputation (FactionEntry const *factionEntry, int32 standing, bool spillOverOnly=false, bool noSpillover=false)
 
void SetVisible (FactionTemplateEntry const *factionTemplateEntry)
 
void SetVisible (FactionEntry const *factionEntry)
 
void SetAtWar (RepListID repListID, bool on)
 
void SetInactive (RepListID repListID, bool on)
 
void ApplyForceReaction (uint32 faction_id, ReputationRank rank, bool apply)
 
bool SetOneFactionReputation (FactionEntry const *factionEntry, int32 standing, bool incremental)
 Public for chat command needs. More...
 
void SendInitialReputations ()
 
void SendForceReactions ()
 
void SendState (FactionState const *faction)
 

Static Public Member Functions

static ReputationRank ReputationToRank (FactionEntry const *factionEntry, int32 standing)
 

Static Public Attributes

static std::set< int32 > const ReputationRankThresholds
 
static const int32 Reputation_Cap = 42000
 
static const int32 Reputation_Bottom = -42000
 

Private Member Functions

void Initialize ()
 
ReputationFlags GetDefaultStateFlags (FactionEntry const *factionEntry) const
 
bool SetReputation (FactionEntry const *factionEntry, int32 standing, bool incremental, bool spillOverOnly, bool noSpillover)
 
void SetVisible (FactionState *faction)
 
void SetAtWar (FactionState *faction, bool atWar) const
 
void SetInactive (FactionState *faction, bool inactive) const
 
void SendVisible (FactionState const *faction, bool visible=true) const
 
void UpdateRankCounters (ReputationRank old_rank, ReputationRank new_rank)
 
int32 GetFactionDataIndexForRaceAndClass (FactionEntry const *factionEntry) const
 
bool CanGainParagonReputationForFaction (FactionEntry const *factionEntry) const
 

Private Attributes

Player_player
 
FactionStateList _factions
 
ForcedReactions _forcedReactions
 
uint8 _visibleFactionCount:8
 
uint8 _honoredFactionCount:8
 
uint8 _reveredFactionCount:8
 
uint8 _exaltedFactionCount:8
 
bool _sendFactionIncreased
 Play visual effect on next SMSG_SET_FACTION_STANDING sent. More...
 

Detailed Description

Definition at line 68 of file ReputationMgr.h.

Constructor & Destructor Documentation

◆ ReputationMgr()

ReputationMgr::ReputationMgr ( Player owner)
inlineexplicit

Definition at line 71 of file ReputationMgr.h.

◆ ~ReputationMgr()

ReputationMgr::~ReputationMgr ( )
inline

Definition at line 73 of file ReputationMgr.h.

Member Function Documentation

◆ ApplyForceReaction()

void ReputationMgr::ApplyForceReaction ( uint32  faction_id,
ReputationRank  rank,
bool  apply 
)

Definition at line 299 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanGainParagonReputationForFaction()

bool ReputationMgr::CanGainParagonReputationForFaction ( FactionEntry const *  factionEntry) const
private

Definition at line 850 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBaseRank()

ReputationRank ReputationMgr::GetBaseRank ( FactionEntry const *  factionEntry) const

Definition at line 201 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBaseReputation()

int32 ReputationMgr::GetBaseReputation ( FactionEntry const *  factionEntry) const

Definition at line 127 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDefaultStateFlags()

ReputationFlags ReputationMgr::GetDefaultStateFlags ( FactionEntry const *  factionEntry) const
private

Definition at line 307 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetExaltedFactionCount()

uint8 ReputationMgr::GetExaltedFactionCount ( ) const
inline

Definition at line 87 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ GetFactionDataIndexForRaceAndClass()

int32 ReputationMgr::GetFactionDataIndexForRaceAndClass ( FactionEntry const *  factionEntry) const
private

Definition at line 832 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetForcedRankIfAny() [1/2]

ReputationRank const * ReputationMgr::GetForcedRankIfAny ( FactionTemplateEntry const *  factionTemplateEntry) const

Definition at line 223 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetForcedRankIfAny() [2/2]

ReputationRank const * ReputationMgr::GetForcedRankIfAny ( uint32  factionId) const
inline

Definition at line 114 of file ReputationMgr.h.

◆ GetHonoredFactionCount()

uint8 ReputationMgr::GetHonoredFactionCount ( ) const
inline

Definition at line 85 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ GetMaxReputation()

int32 ReputationMgr::GetMaxReputation ( FactionEntry const *  factionEntry) const

Definition at line 144 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMinReputation()

int32 ReputationMgr::GetMinReputation ( FactionEntry const *  factionEntry) const

Definition at line 136 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ GetParagonLevel() [1/2]

int32 ReputationMgr::GetParagonLevel ( FactionEntry const *  paragonFactionEntry) const

Definition at line 241 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ GetParagonLevel() [2/2]

int32 ReputationMgr::GetParagonLevel ( uint32  paragonFactionId) const

Definition at line 236 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRank()

ReputationRank ReputationMgr::GetRank ( FactionEntry const *  factionEntry) const

Definition at line 195 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRenownLevel()

int32 ReputationMgr::GetRenownLevel ( FactionEntry const *  renownFactionEntry) const

Definition at line 265 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRenownLevelThreshold()

int32 ReputationMgr::GetRenownLevelThreshold ( FactionEntry const *  renownFactionEntry) const

Definition at line 276 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRenownMaxLevel()

int32 ReputationMgr::GetRenownMaxLevel ( FactionEntry const *  renownFactionEntry) const

Definition at line 288 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetReputation() [1/2]

int32 ReputationMgr::GetReputation ( FactionEntry const *  factionEntry) const

Definition at line 183 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ GetReputation() [2/2]

int32 ReputationMgr::GetReputation ( uint32  faction_id) const

Definition at line 114 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetReputationRankName()

std::string ReputationMgr::GetReputationRankName ( FactionEntry const *  factionEntry) const

Definition at line 207 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetReveredFactionCount()

uint8 ReputationMgr::GetReveredFactionCount ( ) const
inline

Definition at line 86 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ GetState() [1/2]

FactionState const * ReputationMgr::GetState ( FactionEntry const *  factionEntry) const

Definition at line 86 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetState() [2/2]

FactionState const * ReputationMgr::GetState ( RepListID  id) const
inline

Definition at line 93 of file ReputationMgr.h.

◆ GetStateList()

FactionStateList const & ReputationMgr::GetStateList ( ) const
inline

Definition at line 89 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ GetVisibleFactionCount()

uint8 ReputationMgr::GetVisibleFactionCount ( ) const
inline

Definition at line 84 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ HasMaximumRenownReputation()

bool ReputationMgr::HasMaximumRenownReputation ( FactionEntry const *  factionEntry) const

Definition at line 252 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Initialize()

void ReputationMgr::Initialize ( )
private

Definition at line 395 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsAtWar() [1/2]

bool ReputationMgr::IsAtWar ( FactionEntry const *  factionEntry) const

Definition at line 104 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ IsAtWar() [2/2]

bool ReputationMgr::IsAtWar ( uint32  faction_id) const

Definition at line 91 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsParagonReputation()

bool ReputationMgr::IsParagonReputation ( FactionEntry const *  factionEntry) const

Definition at line 228 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ IsRenownReputation()

bool ReputationMgr::IsRenownReputation ( FactionEntry const *  factionEntry) const

Definition at line 260 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

◆ LoadFromDB()

void ReputationMgr::LoadFromDB ( PreparedQueryResult  result)

Definition at line 729 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ ModifyReputation()

bool ReputationMgr::ModifyReputation ( FactionEntry const *  factionEntry,
int32  standing,
bool  spillOverOnly = false,
bool  noSpillover = false 
)
inline

Definition at line 135 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ ReputationToRank()

ReputationRank ReputationMgr::ReputationToRank ( FactionEntry const *  factionEntry,
int32  standing 
)
static

Definition at line 75 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveToDB()

void ReputationMgr::SaveToDB ( CharacterDatabaseTransaction  trans)

Definition at line 792 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SendForceReactions()

void ReputationMgr::SendForceReactions ( )

Definition at line 324 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendInitialReputations()

void ReputationMgr::SendInitialReputations ( )
Todo:
faction bonus

Definition at line 369 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SendState()

void ReputationMgr::SendState ( FactionState const *  faction)

Definition at line 340 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendVisible()

void ReputationMgr::SendVisible ( FactionState const *  faction,
bool  visible = true 
) const
private

Definition at line 384 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAtWar() [1/2]

void ReputationMgr::SetAtWar ( FactionState faction,
bool  atWar 
) const
private

Definition at line 682 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetAtWar() [2/2]

void ReputationMgr::SetAtWar ( RepListID  repListID,
bool  on 
)

Definition at line 669 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetInactive() [1/2]

void ReputationMgr::SetInactive ( FactionState faction,
bool  inactive 
) const
private

Definition at line 710 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetInactive() [2/2]

void ReputationMgr::SetInactive ( RepListID  repListID,
bool  on 
)

Definition at line 701 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetOneFactionReputation()

bool ReputationMgr::SetOneFactionReputation ( FactionEntry const *  factionEntry,
int32  standing,
bool  incremental 
)

Public for chat command needs.

Definition at line 515 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetReputation() [1/2]

bool ReputationMgr::SetReputation ( FactionEntry const *  factionEntry,
int32  standing 
)
inline

Definition at line 131 of file ReputationMgr.h.

+ Here is the caller graph for this function:

◆ SetReputation() [2/2]

bool ReputationMgr::SetReputation ( FactionEntry const *  factionEntry,
int32  standing,
bool  incremental,
bool  spillOverOnly,
bool  noSpillover 
)
private

Definition at line 428 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetVisible() [1/3]

void ReputationMgr::SetVisible ( FactionEntry const *  factionEntry)

Definition at line 632 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetVisible() [2/3]

void ReputationMgr::SetVisible ( FactionState faction)
private

Definition at line 644 of file ReputationMgr.cpp.

+ Here is the call graph for this function:

◆ SetVisible() [3/3]

void ReputationMgr::SetVisible ( FactionTemplateEntry const *  factionTemplateEntry)

Definition at line 621 of file ReputationMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateRankCounters()

void ReputationMgr::UpdateRankCounters ( ReputationRank  old_rank,
ReputationRank  new_rank 
)
private

Definition at line 815 of file ReputationMgr.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _exaltedFactionCount

uint8 ReputationMgr::_exaltedFactionCount
private

Definition at line 174 of file ReputationMgr.h.

◆ _factions

FactionStateList ReputationMgr::_factions
private

Definition at line 169 of file ReputationMgr.h.

◆ _forcedReactions

ForcedReactions ReputationMgr::_forcedReactions
private

Definition at line 170 of file ReputationMgr.h.

◆ _honoredFactionCount

uint8 ReputationMgr::_honoredFactionCount
private

Definition at line 172 of file ReputationMgr.h.

◆ _player

Player* ReputationMgr::_player
private

Definition at line 168 of file ReputationMgr.h.

◆ _reveredFactionCount

uint8 ReputationMgr::_reveredFactionCount
private

Definition at line 173 of file ReputationMgr.h.

◆ _sendFactionIncreased

bool ReputationMgr::_sendFactionIncreased
private

Play visual effect on next SMSG_SET_FACTION_STANDING sent.

Definition at line 175 of file ReputationMgr.h.

◆ _visibleFactionCount

uint8 ReputationMgr::_visibleFactionCount
private

Definition at line 171 of file ReputationMgr.h.

◆ Reputation_Bottom

const int32 ReputationMgr::Reputation_Bottom = -42000
static

Definition at line 80 of file ReputationMgr.h.

◆ Reputation_Cap

const int32 ReputationMgr::Reputation_Cap = 42000
static

Definition at line 79 of file ReputationMgr.h.

◆ ReputationRankThresholds

std::set< int32 > const ReputationMgr::ReputationRankThresholds
static
Initial value:
=
{
-42000,
-6000,
-3000,
0,
3000,
9000,
21000,
42000
}

Definition at line 78 of file ReputationMgr.h.


The documentation for this class was generated from the following files: