TrinityCore
TraitMgr Namespace Reference

Classes

struct  PlayerDataAccessor
 

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. More...
 
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)
 
void FillSpentCurrenciesMap (WorldPackets::Traits::TraitEntry const &entry, std::map< int32, int32 > &cachedCurrencies)
 
void FillSpentCurrenciesMap (WorldPackets::Traits::TraitConfig const &traitConfig, std::map< int32, int32 > &cachedCurrencies)
 
bool MeetsTraitCondition (WorldPackets::Traits::TraitConfig const &traitConfig, PlayerDataAccessor player, TraitCondEntry const *condition, Optional< std::map< int32, int32 > > &cachedCurrencies)
 
std::vector< UF::TraitEntryGetGrantedTraitEntriesForConfig (WorldPackets::Traits::TraitConfig const &traitConfig, PlayerDataAccessor player)
 
bool IsValidEntry (WorldPackets::Traits::TraitEntry const &traitEntry)
 
LearnResult ValidateConfig (WorldPackets::Traits::TraitConfig const &traitConfig, PlayerDataAccessor player, bool requireSpendingAllCurrencies)
 
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 46 of file TraitMgr.h.

Function Documentation

◆ FillOwnedCurrenciesMap()

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

Definition at line 362 of file TraitMgr.cpp.

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

◆ FillSpentCurrenciesMap() [1/2]

void TraitMgr::FillSpentCurrenciesMap ( WorldPackets::Traits::TraitConfig const &  traitConfig,
std::map< int32, int32 > &  cachedCurrencies 
)

Definition at line 442 of file TraitMgr.cpp.

+ Here is the call graph for this function:

◆ FillSpentCurrenciesMap() [2/2]

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

Definition at line 422 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 269 of file TraitMgr.cpp.

+ Here is the caller graph for this function:

◆ GetConfigTypeForTree()

TraitConfigType TraitMgr::GetConfigTypeForTree ( int32  traitTreeId)

Definition at line 277 of file TraitMgr.cpp.

+ Here is the call graph for this function:
+ 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 492 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 688 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 291 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 310 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 693 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 543 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 80 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, int32 > > &  cachedCurrencies 
)

Definition at line 448 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 342 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 const &  traitConfig,
PlayerDataAccessor  player,
bool  requireSpendingAllCurrencies 
)

Definition at line 559 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 43 of file TraitMgr.h.

◆ MAX_COMBAT_TRAIT_CONFIGS

constexpr uint32 TraitMgr::MAX_COMBAT_TRAIT_CONFIGS = 10u
constexpr

Definition at line 44 of file TraitMgr.h.