TrinityCore
Loading...
Searching...
No Matches
TraitMgr Namespace Reference

Classes

struct  PlayerDataAccessor
 
struct  SpentCurrency
 
struct  TraitNodeRankCounts
 

Enumerations

enum class  LearnResult : int32 {
  Ok = 0 , Unknown = 1 , NotEnoughTalentsInPrimaryTree = 2 , NoPrimaryTreeSelected = 3 ,
  CantDoThatRightNow = 4 , AffectingCombat = 5 , CantRemoveTalent = 6 , CantDoThatChallengeModeActive = 7 ,
  RestArea = 8 , UnspentTalentPoints = 9 , InPvpMatch = 10
}
 

Functions

void Load ()
 
int32 GenerateNewTraitConfigId ()
 
TraitConfigType GetConfigTypeForTree (int32 traitTreeId)
 
std::vector< Tree const * > const * GetTreesForConfig (WorldPackets::Traits::TraitConfig const &traitConfig)
 Finds relevant TraitTree identifiers.
 
bool HasEnoughCurrency (WorldPackets::Traits::TraitEntry const &entry, std::map< int32, int32 > const &currencies)
 
void TakeCurrencyCost (WorldPackets::Traits::TraitEntry const &entry, std::map< int32, int32 > &currencies)
 
void FillOwnedCurrenciesMap (WorldPackets::Traits::TraitConfig const &traitConfig, PlayerDataAccessor player, std::map< int32, int32 > &currencies)
 
std::vector< TraitCondEntry const * > GetGateConditionsForNode (Node const *node)
 
void AddSpentCurrenciesForEntry (WorldPackets::Traits::TraitEntry const &entry, std::map< int32, SpentCurrency > &cachedCurrencies, int32 multiplier)
 
void FillSpentCurrenciesMap (std::vector< WorldPackets::Traits::TraitEntry > const &traitEntries, std::map< int32, SpentCurrency > &cachedCurrencies)
 
std::array< int32, 2 > GetClassAndSpecTreeCurrencies (WorldPackets::Traits::TraitConfig const &traitConfig)
 
std::span< TraitCurrencyEntry const *const > GetSubTreeCurrency (int32 traitSubTreeId)
 
TraitNodeRankCounts CountTraitNodeRanks (WorldPackets::Traits::TraitConfig const &traitConfig, int32 traitNodeGroupId, int32 traitNodeId, int32 traitNodeEntryId)
 
bool MeetsTraitCondition (WorldPackets::Traits::TraitConfig const &traitConfig, PlayerDataAccessor player, TraitCondEntry const *condition, Optional< std::map< int32, SpentCurrency > > &cachedCurrencies)
 
bool NodeMeetsTraitConditions (WorldPackets::Traits::TraitConfig const &traitConfig, Node const *node, uint32 traitNodeEntryId, PlayerDataAccessor player, Optional< std::map< int32, SpentCurrency > > &spentCurrencies)
 
std::vector< UF::TraitEntryGetGrantedTraitEntriesForConfig (WorldPackets::Traits::TraitConfig const &traitConfig, PlayerDataAccessor player)
 
bool IsValidEntry (WorldPackets::Traits::TraitEntry const &traitEntry)
 
LearnResult ValidateConfig (WorldPackets::Traits::TraitConfig &traitConfig, PlayerDataAccessor player, bool requireSpendingAllCurrencies, bool removeInvalidEntries)
 
bool CanApplyTraitNode (UF::TraitConfig const &traitConfig, UF::TraitEntry const &traitEntry)
 
std::vector< TraitDefinitionEffectPointsEntry const * > const * GetTraitDefinitionEffectPointModifiers (int32 traitDefinitionId)
 
void InitializeStarterBuildTraitConfig (WorldPackets::Traits::TraitConfig &traitConfig, PlayerDataAccessor player)
 

Variables

constexpr uint32 COMMIT_COMBAT_TRAIT_CONFIG_CHANGES_SPELL_ID = 384255u
 
constexpr uint32 MAX_COMBAT_TRAIT_CONFIGS = 10u
 

Enumeration Type Documentation

◆ LearnResult

enum class TraitMgr::LearnResult : int32
strong
Enumerator
Ok 
Unknown 
NotEnoughTalentsInPrimaryTree 
NoPrimaryTreeSelected 
CantDoThatRightNow 
AffectingCombat 
CantRemoveTalent 
CantDoThatChallengeModeActive 
RestArea 
UnspentTalentPoints 
InPvpMatch 

Definition at line 48 of file TraitMgr.h.

Function Documentation

◆ AddSpentCurrenciesForEntry()

void TraitMgr::AddSpentCurrenciesForEntry ( WorldPackets::Traits::TraitEntry const &  entry,
std::map< int32, SpentCurrency > &  cachedCurrencies,
int32  multiplier 
)

Definition at line 502 of file TraitMgr.cpp.

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

◆ CanApplyTraitNode()

bool TraitMgr::CanApplyTraitNode ( UF::TraitConfig const &  traitConfig,
UF::TraitEntry const &  traitEntry 
)

Definition at line 1017 of file TraitMgr.cpp.

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

◆ CountTraitNodeRanks()

TraitNodeRankCounts TraitMgr::CountTraitNodeRanks ( WorldPackets::Traits::TraitConfig const &  traitConfig,
int32  traitNodeGroupId,
int32  traitNodeId,
int32  traitNodeEntryId 
)

Definition at line 579 of file TraitMgr.cpp.

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

◆ FillOwnedCurrenciesMap()

void TraitMgr::FillOwnedCurrenciesMap ( WorldPackets::Traits::TraitConfig const &  traitConfig,
PlayerDataAccessor  player,
std::map< int32, int32 > &  currencies 
)

Definition at line 409 of file TraitMgr.cpp.

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

◆ FillSpentCurrenciesMap()

void TraitMgr::FillSpentCurrenciesMap ( std::vector< WorldPackets::Traits::TraitEntry > const &  traitEntries,
std::map< int32, SpentCurrency > &  cachedCurrencies 
)

Definition at line 542 of file TraitMgr.cpp.

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

◆ GenerateNewTraitConfigId()

int32 TraitMgr::GenerateNewTraitConfigId ( )

Generates new TraitConfig identifier. Because this only needs to be unique for each character we let it overflow

Definition at line 316 of file TraitMgr.cpp.

+ Here is the caller graph for this function:

◆ GetClassAndSpecTreeCurrencies()

std::array< int32, 2 > TraitMgr::GetClassAndSpecTreeCurrencies ( WorldPackets::Traits::TraitConfig const &  traitConfig)

Definition at line 548 of file TraitMgr.cpp.

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

◆ GetConfigTypeForTree()

TraitConfigType TraitMgr::GetConfigTypeForTree ( int32  traitTreeId)

Definition at line 324 of file TraitMgr.cpp.

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

◆ GetGateConditionsForNode()

std::vector< TraitCondEntry const * > TraitMgr::GetGateConditionsForNode ( Node const *  node)

Definition at line 475 of file TraitMgr.cpp.

+ Here is the caller graph for this function:

◆ GetGrantedTraitEntriesForConfig()

std::vector< UF::TraitEntry > TraitMgr::GetGrantedTraitEntriesForConfig ( WorldPackets::Traits::TraitConfig const &  traitConfig,
PlayerDataAccessor  player 
)

Definition at line 766 of file TraitMgr.cpp.

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

◆ GetSubTreeCurrency()

std::span< TraitCurrencyEntry const *const > TraitMgr::GetSubTreeCurrency ( int32  traitSubTreeId)

Definition at line 563 of file TraitMgr.cpp.

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

◆ GetTraitDefinitionEffectPointModifiers()

std::vector< TraitDefinitionEffectPointsEntry const * > const * TraitMgr::GetTraitDefinitionEffectPointModifiers ( int32  traitDefinitionId)

Definition at line 1033 of file TraitMgr.cpp.

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

◆ GetTreesForConfig()

std::vector< Tree const * > const * TraitMgr::GetTreesForConfig ( WorldPackets::Traits::TraitConfig const &  traitConfig)

Finds relevant TraitTree identifiers.

Parameters
traitConfigconfig data
Returns
Trait tree data

Definition at line 338 of file TraitMgr.cpp.

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

◆ HasEnoughCurrency()

bool TraitMgr::HasEnoughCurrency ( WorldPackets::Traits::TraitEntry const &  entry,
std::map< int32, int32 > const &  currencies 
)

Definition at line 357 of file TraitMgr.cpp.

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

◆ InitializeStarterBuildTraitConfig()

void TraitMgr::InitializeStarterBuildTraitConfig ( WorldPackets::Traits::TraitConfig traitConfig,
PlayerDataAccessor  player 
)

Definition at line 1038 of file TraitMgr.cpp.

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

◆ IsValidEntry()

bool TraitMgr::IsValidEntry ( WorldPackets::Traits::TraitEntry const &  traitEntry)

Definition at line 822 of file TraitMgr.cpp.

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

◆ Load()

void TraitMgr::Load ( )

Definition at line 91 of file TraitMgr.cpp.

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

◆ MeetsTraitCondition()

bool TraitMgr::MeetsTraitCondition ( WorldPackets::Traits::TraitConfig const &  traitConfig,
PlayerDataAccessor  player,
TraitCondEntry const *  condition,
Optional< std::map< int32, SpentCurrency > > &  cachedCurrencies 
)

Definition at line 602 of file TraitMgr.cpp.

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

◆ NodeMeetsTraitConditions()

bool TraitMgr::NodeMeetsTraitConditions ( WorldPackets::Traits::TraitConfig const &  traitConfig,
Node const *  node,
uint32  traitNodeEntryId,
PlayerDataAccessor  player,
Optional< std::map< int32, SpentCurrency > > &  spentCurrencies 
)

Definition at line 681 of file TraitMgr.cpp.

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

◆ TakeCurrencyCost()

void TraitMgr::TakeCurrencyCost ( WorldPackets::Traits::TraitEntry const &  entry,
std::map< int32, int32 > &  currencies 
)

Definition at line 389 of file TraitMgr.cpp.

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

◆ ValidateConfig()

LearnResult TraitMgr::ValidateConfig ( WorldPackets::Traits::TraitConfig traitConfig,
PlayerDataAccessor  player,
bool  requireSpendingAllCurrencies,
bool  removeInvalidEntries 
)

Definition at line 838 of file TraitMgr.cpp.

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

Variable Documentation

◆ COMMIT_COMBAT_TRAIT_CONFIG_CHANGES_SPELL_ID

constexpr uint32 TraitMgr::COMMIT_COMBAT_TRAIT_CONFIG_CHANGES_SPELL_ID = 384255u
constexpr

Definition at line 45 of file TraitMgr.h.

◆ MAX_COMBAT_TRAIT_CONFIGS

constexpr uint32 TraitMgr::MAX_COMBAT_TRAIT_CONFIGS = 10u
constexpr

Definition at line 46 of file TraitMgr.h.