|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <ReputationMgr.h>
Static Public Member Functions | |
| static ReputationRank | ReputationToRank (int32 standing) |
Static Public Attributes | |
| static const int32 | PointsInRank [MAX_REPUTATION_RANK] = { 36000, 3000, 3000, 3000, 6000, 12000, 21000, 1000 } |
| static const int32 | Reputation_Bottom = -42000 |
| static const int32 | Reputation_Cap = 42999 |
Private Member Functions | |
| uint32 | GetDefaultStateFlags (FactionEntry const *factionEntry) const |
| float | GetLFGBonus (FactionEntry const *factionEntry) |
| void | Initialize () |
| void | SendVisible (FactionState const *faction) const |
| void | SetAtWar (FactionState *faction, bool atWar) const |
| void | SetInactive (FactionState *faction, bool inactive) const |
| bool | SetReputation (FactionEntry const *factionEntry, int32 standing, bool incremental) |
| void | SetVisible (FactionState *faction) |
| void | UpdateRankCounters (ReputationRank old_rank, ReputationRank new_rank) |
Private Attributes | |
| uint8 | _exaltedFactionCount: 8 |
| FactionStateList | _factions |
| ForcedReactions | _forcedReactions |
| uint8 | _honoredFactionCount: 8 |
| Player * | _player |
| uint8 | _reveredFactionCount: 8 |
| bool | _sendFactionIncreased |
| uint8 | _visibleFactionCount: 8 |
Definition at line 52 of file ReputationMgr.h.
|
inlineexplicit |
Definition at line 55 of file ReputationMgr.h.
References _exaltedFactionCount, _honoredFactionCount, _player, _reveredFactionCount, _sendFactionIncreased, and _visibleFactionCount.
|
inline |
Definition at line 57 of file ReputationMgr.h.
| void ReputationMgr::ApplyForceReaction | ( | uint32 | faction_id, |
| ReputationRank | rank, | ||
| bool | apply ) |
Definition at line 113 of file ReputationMgr.cpp.
References _forcedReactions.
Referenced by AuraEffect::HandleForceReaction().
| ReputationRank ReputationMgr::GetBaseRank | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 107 of file ReputationMgr.cpp.
References GetBaseReputation(), and ReputationToRank().
Referenced by Initialize().
| int32 ReputationMgr::GetBaseReputation | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 67 of file ReputationMgr.cpp.
References _player, FactionEntry::BaseRepClassMask, FactionEntry::BaseRepRaceMask, and FactionEntry::BaseRepValue.
Referenced by GetBaseRank(), GetReputation(), spell_gen_oracle_wolvar_reputation::spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy(), LoadFromDB(), and SetOneFactionReputation().
|
private |
Definition at line 121 of file ReputationMgr.cpp.
References _player, FactionEntry::BaseRepClassMask, FactionEntry::BaseRepRaceMask, and FactionEntry::ReputationFlags.
Referenced by Initialize().
|
inline |
Definition at line 71 of file ReputationMgr.h.
References _exaltedFactionCount.
Referenced by AchievementMgr< T >::UpdateAchievementCriteria().
|
inline |
Definition at line 100 of file ReputationMgr.h.
References _forcedReactions, and FactionTemplateEntry::faction.
Referenced by Unit::_IsValidAttackTarget(), and Unit::GetReactionTo().
|
inline |
Definition at line 69 of file ReputationMgr.h.
References _honoredFactionCount.
Referenced by AchievementMgr< T >::UpdateAchievementCriteria().
|
private |
Definition at line 624 of file ReputationMgr.cpp.
References _player, FactionEntry::ID, PLAYER_FIELD_LFG_BONUS_FACTION_ID, RATE_REPUTATION_LFG_BONUS, and sWorld.
Referenced by SetOneFactionReputation().
| ReputationRank ReputationMgr::GetRank | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 101 of file ReputationMgr.cpp.
References GetReputation(), and ReputationToRank().
Referenced by Player::GetReputationRank(), GetReputationRankStrIndex(), character_commandscript::HandleCharacterReputationCommand(), LoadFromDB(), Player::RewardReputation(), and SetReputation().
| int32 ReputationMgr::GetReputation | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 89 of file ReputationMgr.cpp.
References GetBaseReputation(), and GetState().
Definition at line 54 of file ReputationMgr.cpp.
References _player, GetReputation(), SF_LOG_ERROR, and sFactionStore.
Referenced by GetRank(), LuaPlayer::GetReputation(), Player::GetReputation(), GetReputation(), character_commandscript::HandleCharacterReputationCommand(), lookup_commandscript::HandleLookupFactionCommand(), modify_commandscript::HandleModifyRepCommand(), quest_commandscript::HandleQuestComplete(), and AchievementMgr< T >::UpdateAchievementCriteria().
|
inline |
Definition at line 95 of file ReputationMgr.h.
References GetRank(), and ReputationRankStrIndex.
Referenced by lookup_commandscript::HandleLookupFactionCommand().
|
inline |
Definition at line 70 of file ReputationMgr.h.
References _reveredFactionCount.
Referenced by AchievementMgr< T >::UpdateAchievementCriteria().
|
inline |
Definition at line 75 of file ReputationMgr.h.
References FactionEntry::CanHaveReputation(), GetState(), and FactionEntry::reputationListID.
Referenced by Unit::_IsValidAttackTarget(), GetReputation(), GetState(), lookup_commandscript::HandleLookupFactionCommand(), modify_commandscript::HandleModifyRepCommand(), and IsAtWar().
|
inline |
Definition at line 80 of file ReputationMgr.h.
References _factions.
|
inline |
Definition at line 73 of file ReputationMgr.h.
References _factions.
Referenced by character_commandscript::HandleCharacterReputationCommand().
|
inline |
Definition at line 68 of file ReputationMgr.h.
References _visibleFactionCount.
Referenced by AchievementMgr< T >::UpdateAchievementCriteria().
|
private |
Definition at line 255 of file ReputationMgr.cpp.
References _exaltedFactionCount, _factions, _honoredFactionCount, _reveredFactionCount, _sendFactionIncreased, _visibleFactionCount, FACTION_FLAG_VISIBLE, FactionState::Flags, GetBaseRank(), GetDefaultStateFlags(), FactionEntry::ID, FactionState::ID, FactionState::needSave, FactionState::needSend, REP_HOSTILE, FactionState::ReputationListID, FactionEntry::reputationListID, sFactionStore, FactionState::Standing, and UpdateRankCounters().
Referenced by LoadFromDB().
| bool ReputationMgr::IsAtWar | ( | FactionEntry const * | factionEntry | ) | const |
Definition at line 44 of file ReputationMgr.cpp.
References FACTION_FLAG_AT_WAR, and GetState().
| bool ReputationMgr::IsAtWar | ( | uint32 | faction_id | ) | const |
Definition at line 31 of file ReputationMgr.cpp.
References _player, IsAtWar(), SF_LOG_ERROR, and sFactionStore.
Referenced by Unit::GetReactionTo(), and IsAtWar().
| void ReputationMgr::LoadFromDB | ( | PreparedQueryResult | result | ) |
Definition at line 525 of file ReputationMgr.cpp.
References _factions, FACTION_FLAG_AT_WAR, FACTION_FLAG_INACTIVE, FACTION_FLAG_VISIBLE, FactionState::Flags, GetBaseReputation(), Field::GetInt32(), GetRank(), Field::GetUInt16(), Initialize(), FactionState::needSave, FactionState::needSend, REP_HOSTILE, FactionEntry::reputationListID, ReputationToRank(), SetAtWar(), SetInactive(), SetVisible(), sFactionStore, FactionState::Standing, and UpdateRankCounters().
|
inline |
Definition at line 111 of file ReputationMgr.h.
References SetReputation().
Referenced by Spell::EffectReputation(), OutdoorPvPSI::HandleAreaTrigger(), Player::RewardReputation(), and Player::RewardReputation().
|
static |
Definition at line 19 of file ReputationMgr.cpp.
References MAX_REPUTATION_RANK, MIN_REPUTATION_RANK, PointsInRank, and Reputation_Cap.
Referenced by GetBaseRank(), GetRank(), LoadFromDB(), and SetOneFactionReputation().
| void ReputationMgr::SaveToDB | ( | SQLTransaction & | trans | ) |
Definition at line 584 of file ReputationMgr.cpp.
References _factions, _player, CHAR_DEL_CHAR_REPUTATION_BY_FACTION, CHAR_INS_CHAR_REPUTATION_BY_FACTION, CharacterDatabase, PreparedStatement::setInt32(), PreparedStatement::setUInt16(), and PreparedStatement::setUInt32().
| void ReputationMgr::SendForceReactions | ( | ) |
Definition at line 141 of file ReputationMgr.cpp.
References _forcedReactions, _player, ByteBuffer::FlushBits(), SMSG_SET_FORCED_REACTIONS, and ByteBuffer::WriteBits().
Referenced by AuraEffect::HandleForceReaction(), and Player::SendInitialPacketsBeforeAddToMap().
| void ReputationMgr::SendInitialReputations | ( | ) |
Definition at line 194 of file ReputationMgr.cpp.
References _factions, _player, ByteBuffer::append(), ByteBuffer::FlushBits(), SMSG_INITIALIZE_FACTIONS, and ByteBuffer::WriteBit().
| void ReputationMgr::SendState | ( | FactionState const * | faction | ) |
Definition at line 156 of file ReputationMgr.cpp.
References _factions, _player, _sendFactionIncreased, ByteBuffer::bitwpos(), ByteBuffer::FlushBits(), ByteBuffer::PutBits(), FactionState::ReputationListID, SMSG_SET_FACTION_STANDING, FactionState::Standing, ByteBuffer::WriteBit(), and ByteBuffer::WriteBits().
Referenced by modify_commandscript::HandleModifyRepCommand(), SendStates(), and SetReputation().
| void ReputationMgr::SendStates | ( | ) |
Definition at line 238 of file ReputationMgr.cpp.
References _factions, and SendState().
Referenced by WorldSession::HandleSetFactionCheat().
|
private |
Definition at line 244 of file ReputationMgr.cpp.
References _player, FactionState::ReputationListID, and SMSG_SET_FACTION_VISIBLE.
Referenced by SetVisible().
| void ReputationMgr::SetAtWar | ( | FactionIndex | FactionIndexID | ) |
Definition at line 450 of file ReputationMgr.cpp.
References _factions, FACTION_FLAG_HIDDEN, FACTION_FLAG_INVISIBLE_FORCED, and SetAtWar().
Referenced by WorldSession::HandleSetFactionAtWar(), LoadFromDB(), SetAtWar(), SetNotAtWar(), and SetOneFactionReputation().
|
private |
Definition at line 476 of file ReputationMgr.cpp.
References FACTION_FLAG_AT_WAR, FACTION_FLAG_PEACE_FORCED, FactionState::Flags, FactionState::needSave, and FactionState::needSend.
|
private |
Definition at line 506 of file ReputationMgr.cpp.
References FACTION_FLAG_HIDDEN, FACTION_FLAG_INACTIVE, FACTION_FLAG_INVISIBLE_FORCED, FACTION_FLAG_VISIBLE, FactionState::Flags, FactionState::needSave, and FactionState::needSend.
| void ReputationMgr::SetInactive | ( | RepListID | repListID, |
| bool | on ) |
Definition at line 497 of file ReputationMgr.cpp.
References _factions, and SetInactive().
Referenced by LoadFromDB(), and SetInactive().
| void ReputationMgr::SetNotAtWar | ( | FactionIndex | FactionIndexID | ) |
Definition at line 463 of file ReputationMgr.cpp.
References _factions, FACTION_FLAG_HIDDEN, FACTION_FLAG_INVISIBLE_FORCED, and SetAtWar().
Referenced by WorldSession::HandleSetFactionNotAtWar().
| bool ReputationMgr::SetOneFactionReputation | ( | FactionEntry const * | factionEntry, |
| int32 | standing, | ||
| bool | incremental ) |
Public for chat command needs.
Definition at line 359 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(), GetLFGBonus(), FactionEntry::ID, RATE_REPUTATION_GAIN, REP_HOSTILE, Reputation_Bottom, Reputation_Cap, FactionEntry::reputationListID, ReputationToRank(), SetAtWar(), SetVisible(), sWorld, and UpdateRankCounters().
Referenced by modify_commandscript::HandleModifyRepCommand(), and SetReputation().
|
inline |
Definition at line 107 of file ReputationMgr.h.
References SetReputation().
Referenced by Player::Create(), spell_gen_oracle_wolvar_reputation::spell_gen_oracle_wolvar_reputation_SpellScript::HandleDummy(), quest_commandscript::HandleQuestComplete(), ModifyReputation(), LuaPlayer::SetReputation(), Player::SetReputation(), and SetReputation().
|
private |
Definition at line 288 of file ReputationMgr.cpp.
References _factions, _player, FACTION_FLAG_SPECIAL, GetFactionTeamList(), GetRank(), FactionEntry::ID, MAX_SPILLOVER_FACTIONS, FactionEntry::reputationListID, SendState(), SetOneFactionReputation(), sFactionStore, sObjectMgr, FactionEntry::spilloverRateOut, sScriptMgr, and FactionEntry::team.
| void ReputationMgr::SetVisible | ( | FactionEntry const * | factionEntry | ) |
Definition at line 418 of file ReputationMgr.cpp.
References _factions, FactionEntry::reputationListID, and SetVisible().
|
private |
Definition at line 430 of file ReputationMgr.cpp.
References _visibleFactionCount, FACTION_FLAG_HIDDEN, FACTION_FLAG_INVISIBLE_FORCED, FACTION_FLAG_SPECIAL, FACTION_FLAG_VISIBLE, FactionState::Flags, FactionState::needSave, FactionState::needSend, and SendVisible().
| void ReputationMgr::SetVisible | ( | FactionTemplateEntry const * | factionTemplateEntry | ) |
Definition at line 407 of file ReputationMgr.cpp.
References _player, FactionTemplateEntry::faction, Reputation_Bottom, SetVisible(), and sFactionStore.
Referenced by Player::AddQuest(), LoadFromDB(), SetOneFactionReputation(), SetVisible(), and SetVisible().
|
private |
Definition at line 607 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 150 of file ReputationMgr.h.
Referenced by GetExaltedFactionCount(), Initialize(), ReputationMgr(), and UpdateRankCounters().
|
private |
Definition at line 145 of file ReputationMgr.h.
Referenced by GetState(), GetStateList(), Initialize(), LoadFromDB(), SaveToDB(), SendInitialReputations(), SendState(), SendStates(), SetAtWar(), SetInactive(), SetNotAtWar(), SetOneFactionReputation(), SetReputation(), and SetVisible().
|
private |
Definition at line 146 of file ReputationMgr.h.
Referenced by ApplyForceReaction(), GetForcedRankIfAny(), and SendForceReactions().
|
private |
Definition at line 148 of file ReputationMgr.h.
Referenced by GetHonoredFactionCount(), Initialize(), ReputationMgr(), and UpdateRankCounters().
|
private |
Definition at line 144 of file ReputationMgr.h.
Referenced by GetBaseReputation(), GetDefaultStateFlags(), GetLFGBonus(), GetReputation(), IsAtWar(), ReputationMgr(), SaveToDB(), SendForceReactions(), SendInitialReputations(), SendState(), SendVisible(), SetOneFactionReputation(), SetReputation(), and SetVisible().
|
private |
Definition at line 149 of file ReputationMgr.h.
Referenced by GetReveredFactionCount(), Initialize(), ReputationMgr(), and UpdateRankCounters().
|
private |
Definition at line 151 of file ReputationMgr.h.
Referenced by Initialize(), ReputationMgr(), SendState(), and SetOneFactionReputation().
|
private |
Definition at line 147 of file ReputationMgr.h.
Referenced by GetVisibleFactionCount(), Initialize(), ReputationMgr(), and SetVisible().
|
static |
Definition at line 17 of file ReputationMgr.h.
Referenced by modify_commandscript::HandleModifyRepCommand(), and ReputationToRank().
|
static |
Definition at line 64 of file ReputationMgr.h.
Referenced by SetOneFactionReputation(), and SetVisible().
|
static |
Definition at line 63 of file ReputationMgr.h.
Referenced by ObjectMgr::LoadQuests(), ReputationToRank(), and SetOneFactionReputation().