![]() |
TrinityCore
|
#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 |
| bool | IsReputationAllowedForTeam (TeamId team, uint32 factionId) 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 | SetReputation (FactionEntry const *factionEntry, int32 standing) |
| bool | ModifyReputation (FactionEntry const *factionEntry, int32 standing, bool spillOverOnly=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. | |
| 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 = 42999 |
| 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) |
| void | SetVisible (FactionState *faction) |
| void | SetAtWar (FactionState *faction, bool atWar) const |
| void | SetInactive (FactionState *faction, bool inactive) const |
| void | SendVisible (FactionState const *faction) const |
| void | UpdateRankCounters (ReputationRank old_rank, ReputationRank new_rank) |
| int32 | GetFactionDataIndexForRaceAndClass (FactionEntry const *factionEntry) const |
Definition at line 63 of file ReputationMgr.h.
|
inlineexplicit |
Definition at line 66 of file ReputationMgr.h.
|
inline |
Definition at line 68 of file ReputationMgr.h.
| void ReputationMgr::ApplyForceReaction | ( | uint32 | faction_id, |
| ReputationRank | rank, | ||
| bool | apply | ||
| ) |
Definition at line 190 of file ReputationMgr.cpp.
References _forcedReactions.
Referenced by AuraEffect::HandleForceReaction().
| ReputationRank ReputationMgr::GetBaseRank | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 168 of file ReputationMgr.cpp.
References GetBaseReputation(), and ReputationToRank().
Referenced by Initialize().
| int32 ReputationMgr::GetBaseReputation | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 131 of file ReputationMgr.cpp.
References GetFactionDataIndexForRaceAndClass(), and FactionEntry::ReputationBase.
Referenced by GetBaseRank(), GetReputation(), LoadFromDB(), and SetOneFactionReputation().
|
private |
Definition at line 198 of file ReputationMgr.cpp.
References GetFactionDataIndexForRaceAndClass(), None, and FactionEntry::ReputationFlags.
Referenced by Initialize().
|
inline |
Definition at line 82 of file ReputationMgr.h.
|
private |
Definition at line 644 of file ReputationMgr.cpp.
References _player, Unit::GetClassMask(), Unit::GetRaceMask(), FactionEntry::ReputationClassMask, and FactionEntry::ReputationRaceMask.
Referenced by GetBaseReputation(), and GetDefaultStateFlags().
| ReputationRank const * ReputationMgr::GetForcedRankIfAny | ( | FactionTemplateEntry const * | factionTemplateEntry | ) | const |
Definition at line 180 of file ReputationMgr.cpp.
References FactionTemplateEntry::Faction, and GetForcedRankIfAny().
Referenced by GetForcedRankIfAny(), WorldObject::GetReactionTo(), and WorldObject::IsValidAttackTarget().
| ReputationRank const * ReputationMgr::GetForcedRankIfAny | ( | uint32 | factionId | ) | const |
Definition at line 185 of file ReputationMgr.cpp.
References _forcedReactions, and Trinity::Containers::MapGetValuePtr().
|
inline |
Definition at line 80 of file ReputationMgr.h.
| int32 ReputationMgr::GetMaxReputation | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 145 of file ReputationMgr.cpp.
References Reputation_Cap.
Referenced by SetOneFactionReputation().
| int32 ReputationMgr::GetMinReputation | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 140 of file ReputationMgr.cpp.
References Reputation_Bottom.
Referenced by SetOneFactionReputation().
| ReputationRank ReputationMgr::GetRank | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 162 of file ReputationMgr.cpp.
References GetReputation(), and ReputationToRank().
Referenced by Player::GetReputationRank(), GetReputationRankName(), LoadFromDB(), Player::RewardReputation(), SetAtWar(), and SetReputation().
| int32 ReputationMgr::GetReputation | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 150 of file ReputationMgr.cpp.
References GetBaseReputation(), and GetState().
Definition at line 118 of file ReputationMgr.cpp.
References _player, WorldObject::GetName(), GetReputation(), sFactionStore, and TC_LOG_ERROR.
Referenced by GetRank(), GetReputation(), Player::GetReputation(), character_commandscript::HandleCharacterReputationCommand(), spell_gen_oracle_wolvar_reputation::HandleDummy(), lookup_commandscript::HandleLookupFactionCommand(), modify_commandscript::HandleModifyRepCommand(), quest_commandscript::HandleQuestComplete(), and AchievementMgr::UpdateAchievementCriteria().
| std::string ReputationMgr::GetReputationRankName | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 174 of file ReputationMgr.cpp.
References _player, GetRank(), Player::GetSession(), WorldSession::GetSessionDbcLocale(), ReputationRankStrIndex, and sObjectMgr.
Referenced by character_commandscript::HandleCharacterReputationCommand(), and lookup_commandscript::HandleLookupFactionCommand().
|
inline |
Definition at line 81 of file ReputationMgr.h.
| FactionState const * ReputationMgr::GetState | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 75 of file ReputationMgr.cpp.
References FactionEntry::CanHaveReputation(), GetState(), and FactionEntry::ReputationIndex.
Referenced by GetReputation(), GetState(), lookup_commandscript::HandleLookupFactionCommand(), modify_commandscript::HandleModifyRepCommand(), IsAtWar(), and WorldObject::IsValidAttackTarget().
|
inline |
Definition at line 88 of file ReputationMgr.h.
|
inline |
Definition at line 84 of file ReputationMgr.h.
Referenced by character_commandscript::HandleCharacterReputationCommand().
|
inline |
Definition at line 79 of file ReputationMgr.h.
|
private |
Definition at line 282 of file ReputationMgr.cpp.
References _exaltedFactionCount, _factions, _honoredFactionCount, _reveredFactionCount, _sendFactionIncreased, _visibleFactionCount, FactionEntry::CanHaveReputation(), FactionState::Flags, GetBaseRank(), GetDefaultStateFlags(), EnumFlag< T >::HasFlag(), FactionState::ID, FactionEntry::ID, FactionState::needSave, FactionState::needSend, REP_HOSTILE, FactionEntry::ReputationIndex, FactionState::ReputationListID, sFactionStore, FactionState::Standing, UpdateRankCounters(), and Visible.
Referenced by LoadFromDB().
| bool ReputationMgr::IsAtWar | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 93 of file ReputationMgr.cpp.
References AtWar, and GetState().
| bool ReputationMgr::IsAtWar | ( | uint32 | faction_id | ) | const |
Definition at line 80 of file ReputationMgr.cpp.
References _player, WorldObject::GetName(), IsAtWar(), sFactionStore, and TC_LOG_ERROR.
Referenced by WorldObject::GetReactionTo(), and IsAtWar().
Definition at line 103 of file ReputationMgr.cpp.
References TEAM_ALLIANCE, and TEAM_HORDE.
| void ReputationMgr::LoadFromDB | ( | PreparedQueryResult | result | ) |
Definition at line 544 of file ReputationMgr.cpp.
References _factions, AtWar, FactionEntry::CanHaveReputation(), FactionState::Flags, GetBaseReputation(), Field::GetInt32(), GetRank(), Field::GetUInt16(), EnumFlag< T >::HasFlag(), Inactive, Initialize(), FactionState::needSave, FactionState::needSend, REP_HOSTILE, FactionEntry::ReputationIndex, ReputationToRank(), SetAtWar(), SetInactive(), SetVisible(), sFactionStore, FactionState::Standing, UpdateRankCounters(), and Visible.
Referenced by Player::LoadFromDB().
|
inline |
Definition at line 116 of file ReputationMgr.h.
Referenced by Spell::EffectReputation(), OutdoorPvPSI::HandleAreaTrigger(), Player::RewardReputation(), Player::RewardReputation(), and Battleground::RewardReputationToTeam().
|
static |
Definition at line 61 of file ReputationMgr.cpp.
References ReputationRankThresholds.
Referenced by GetBaseRank(), GetRank(), LoadFromDB(), and SetOneFactionReputation().
| void ReputationMgr::SaveToDB | ( | CharacterDatabaseTransaction | trans | ) |
Definition at line 604 of file ReputationMgr.cpp.
References _factions, _player, CHAR_DEL_CHAR_REPUTATION_BY_FACTION, CHAR_INS_CHAR_REPUTATION_BY_FACTION, CharacterDatabase, ObjectGuid::GetCounter(), Object::GetGUID(), PreparedStatementBase::setInt32(), PreparedStatementBase::setUInt16(), and PreparedStatementBase::setUInt32().
Referenced by Player::SaveToDB().
| void ReputationMgr::SendForceReactions | ( | ) |
Definition at line 207 of file ReputationMgr.cpp.
References _forcedReactions, _player, WorldPacket::Initialize(), Player::SendDirectMessage(), and SMSG_SET_FORCED_REACTIONS.
Referenced by AuraEffect::HandleForceReaction(), and Player::SendInitialPacketsBeforeAddToMap().
| void ReputationMgr::SendInitialReputations | ( | ) |
Definition at line 256 of file ReputationMgr.cpp.
References _factions, _player, WorldPackets::Reputation::InitializeFactions::Factions, WorldPackets::Reputation::FactionData::Flags, Player::SendDirectMessage(), WorldPackets::Reputation::FactionData::Standing, and WorldPackets::Reputation::InitializeFactions::Write().
Referenced by Player::SendInitialPacketsBeforeAddToMap().
| void ReputationMgr::SendState | ( | FactionState const * | faction | ) |
Definition at line 220 of file ReputationMgr.cpp.
References _factions, _player, _sendFactionIncreased, ByteBuffer::put(), FactionState::ReputationListID, Player::SendDirectMessage(), SMSG_SET_FACTION_STANDING, FactionState::Standing, and ByteBuffer::wpos().
Referenced by modify_commandscript::HandleModifyRepCommand(), WorldSession::HandlePlayerLogin(), WorldSession::HandleSetFactionCheat(), and SetReputation().
|
private |
Definition at line 271 of file ReputationMgr.cpp.
References _player, Player::GetSession(), WorldSession::PlayerLoading(), FactionState::ReputationListID, Player::SendDirectMessage(), and SMSG_SET_FACTION_VISIBLE.
Referenced by SetVisible().
|
private |
Definition at line 497 of file ReputationMgr.cpp.
References AtWar, FactionState::Flags, GetRank(), EnumFlag< T >::HasFlag(), FactionState::ID, FactionState::needSave, FactionState::needSend, Peaceful, REP_HATED, and sFactionStore.
| void ReputationMgr::SetAtWar | ( | RepListID | repListID, |
| bool | on | ||
| ) |
Definition at line 484 of file ReputationMgr.cpp.
References _factions, Header, Hidden, and SetAtWar().
Referenced by WorldSession::HandleSetFactionAtWar(), LoadFromDB(), SetAtWar(), and SetOneFactionReputation().
|
private |
Definition at line 525 of file ReputationMgr.cpp.
References FactionState::Flags, EnumFlag< T >::HasFlag(), Header, Hidden, Inactive, FactionState::needSave, FactionState::needSend, and Visible.
| void ReputationMgr::SetInactive | ( | RepListID | repListID, |
| bool | on | ||
| ) |
Definition at line 516 of file ReputationMgr.cpp.
References _factions, and SetInactive().
Referenced by WorldSession::HandleSetFactionInactiveOpcode(), LoadFromDB(), and SetInactive().
| bool ReputationMgr::SetOneFactionReputation | ( | FactionEntry const * | factionEntry, |
| int32 | standing, | ||
| bool | incremental | ||
| ) |
Public for chat command needs.
Definition at line 389 of file ReputationMgr.cpp.
References _factions, _player, _sendFactionIncreased, ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, GetBaseReputation(), GetMaxReputation(), GetMinReputation(), FactionEntry::ID, RATE_REPUTATION_GAIN, REP_HOSTILE, Player::ReputationChanged(), FactionEntry::ReputationIndex, ReputationToRank(), SetAtWar(), SetVisible(), sWorld, Player::UpdateAchievementCriteria(), and UpdateRankCounters().
Referenced by modify_commandscript::HandleModifyRepCommand(), WorldSession::HandlePlayerLogin(), and SetReputation().
|
inline |
Definition at line 112 of file ReputationMgr.h.
Referenced by spell_gen_oracle_wolvar_reputation::HandleDummy(), quest_commandscript::HandleQuestComplete(), and Player::SetReputation().
|
private |
Definition at line 315 of file ReputationMgr.cpp.
References _factions, _player, GetFactionTeamList(), GetRank(), Player::GetReputationRank(), HeaderShowsBar, FactionEntry::ID, MAX_SPILLOVER_FACTIONS, FactionEntry::ParentFactionID, FactionEntry::ParentFactionMod, FactionEntry::ReputationIndex, SendState(), SetOneFactionReputation(), sFactionStore, sObjectMgr, and sScriptMgr.
| void ReputationMgr::SetVisible | ( | FactionEntry const * | factionEntry | ) |
Definition at line 450 of file ReputationMgr.cpp.
References _factions, FactionEntry::CanHaveReputation(), FactionEntry::ReputationIndex, and SetVisible().
|
private |
Definition at line 462 of file ReputationMgr.cpp.
References _visibleFactionCount, FactionState::Flags, EnumFlag< T >::HasFlag(), Header, HeaderShowsBar, Hidden, FactionState::needSave, FactionState::needSend, SendVisible(), and Visible.
| void ReputationMgr::SetVisible | ( | FactionTemplateEntry const * | factionTemplateEntry | ) |
Definition at line 439 of file ReputationMgr.cpp.
References _player, FactionTemplateEntry::Faction, Unit::GetRaceMask(), Reputation_Bottom, SetVisible(), and sFactionStore.
Referenced by Player::AddQuest(), WorldSession::HandleGossipHelloOpcode(), LoadFromDB(), SetOneFactionReputation(), SetVisible(), and SetVisible().
|
private |
Definition at line 627 of file ReputationMgr.cpp.
References _exaltedFactionCount, _honoredFactionCount, _reveredFactionCount, REP_EXALTED, REP_HONORED, and REP_REVERED.
Referenced by Initialize(), LoadFromDB(), and SetOneFactionReputation().
|
private |
Definition at line 154 of file ReputationMgr.h.
Referenced by Initialize(), and UpdateRankCounters().
|
private |
Definition at line 149 of file ReputationMgr.h.
Referenced by Initialize(), LoadFromDB(), SaveToDB(), SendInitialReputations(), SendState(), SetAtWar(), SetInactive(), SetOneFactionReputation(), SetReputation(), and SetVisible().
|
private |
Definition at line 150 of file ReputationMgr.h.
Referenced by ApplyForceReaction(), GetForcedRankIfAny(), and SendForceReactions().
|
private |
Definition at line 152 of file ReputationMgr.h.
Referenced by Initialize(), and UpdateRankCounters().
|
private |
Definition at line 148 of file ReputationMgr.h.
Referenced by GetFactionDataIndexForRaceAndClass(), GetReputation(), GetReputationRankName(), IsAtWar(), SaveToDB(), SendForceReactions(), SendInitialReputations(), SendState(), SendVisible(), SetOneFactionReputation(), SetReputation(), and SetVisible().
|
private |
Definition at line 153 of file ReputationMgr.h.
Referenced by Initialize(), and UpdateRankCounters().
|
private |
Definition at line 155 of file ReputationMgr.h.
Referenced by Initialize(), SendState(), and SetOneFactionReputation().
|
private |
Definition at line 151 of file ReputationMgr.h.
Referenced by Initialize(), and SetVisible().
|
static |
Definition at line 75 of file ReputationMgr.h.
Referenced by GetMinReputation(), and SetVisible().
|
static |
Definition at line 74 of file ReputationMgr.h.
Referenced by GetMaxReputation(), and ObjectMgr::LoadQuests().
|
static |
Definition at line 37 of file ReputationMgr.h.
Referenced by modify_commandscript::HandleModifyRepCommand(), and ReputationToRank().