![]() |
TrinityCore
|
#include <Trainer.h>
Public Member Functions | |
| Trainer (uint32 id, Type type, std::string_view greeting, std::vector< Spell > spells) | |
| void | SendSpells (Creature const *npc, Player *player, LocaleConstant locale) const |
| void | TeachSpell (Creature const *npc, Player *player, uint32 spellId) const |
Private Member Functions | |
| Spell const * | GetSpell (uint32 spellId) const |
| bool | CanTeachSpell (Player const *player, Spell const *trainerSpell) const |
| SpellState | GetSpellState (Player const *player, Spell const *trainerSpell) const |
| void | SendTeachFailure (Creature const *npc, Player const *player, uint32 spellId, FailReason reason) const |
| std::string const & | GetGreeting (LocaleConstant locale) const |
| void | AddGreetingLocale (LocaleConstant locale, std::string_view greeting) |
Private Attributes | |
| friend | ObjectMgr |
| uint32 | _id |
| Type | _type |
| std::vector< Spell > | _spells |
| std::array< std::string, TOTAL_LOCALES > | _greeting |
| Trainer::Trainer::Trainer | ( | uint32 | id, |
| Type | type, | ||
| std::string_view | greeting, | ||
| std::vector< Spell > | spells | ||
| ) |
Definition at line 36 of file Trainer.cpp.
References DEFAULT_LOCALE.
|
private |
Definition at line 229 of file Trainer.cpp.
|
private |
Definition at line 149 of file Trainer.cpp.
References Trainer::Available, DIFFICULTY_NONE, SpellInfo::GetEffects(), Player::GetFreePrimaryProfessionPoints(), SpellInfo::IsPrimaryProfessionFirstRank(), SPELL_EFFECT_LEARN_SPELL, Trainer::Spell::SpellId, and sSpellMgr.
|
private |
Definition at line 221 of file Trainer.cpp.
References DEFAULT_LOCALE.
Definition at line 136 of file Trainer.cpp.
|
private |
Definition at line 172 of file Trainer.cpp.
References Trainer::Available, DIFFICULTY_NONE, Player::GetBaseSkillValue(), Unit::GetLevel(), Player::HasSpell(), Player::IsSpellFitByClassAndRace(), Trainer::Known, Trainer::Spell::ReqAbility, Trainer::Spell::ReqLevel, Trainer::Spell::ReqSkillLine, Trainer::Spell::ReqSkillRank, SPELL_EFFECT_LEARN_SPELL, Trainer::Spell::SpellId, sSpellMgr, and Trainer::Unavailable.
| void Trainer::Trainer::SendSpells | ( | Creature const * | npc, |
| Player * | player, | ||
| LocaleConstant | locale | ||
| ) | const |
Definition at line 41 of file Trainer.cpp.
References AsUnderlyingType(), BaseEntity::GetGUID(), WorldObject::GetName(), Player::GetReputationPriceDiscount(), WorldPackets::NPC::TrainerList::Greeting, Player::IsSpellFitByClassAndRace(), WorldPackets::NPC::TrainerListSpell::MoneyCost, WorldPackets::NPC::TrainerListSpell::ReqAbility, WorldPackets::NPC::TrainerListSpell::ReqLevel, WorldPackets::NPC::TrainerListSpell::ReqSkillLine, WorldPackets::NPC::TrainerListSpell::ReqSkillRank, sConditionMgr, Player::SendDirectMessage(), WorldPackets::NPC::TrainerListSpell::SpellID, WorldPackets::NPC::TrainerList::Spells, TC_LOG_DEBUG, ObjectGuid::ToString(), WorldPackets::NPC::TrainerList::TrainerGUID, WorldPackets::NPC::TrainerList::TrainerID, WorldPackets::NPC::TrainerList::TrainerType, WorldPackets::NPC::TrainerListSpell::Usable, and WorldPackets::NPC::TrainerList::Write().
Referenced by WorldSession::SendTrainerList().
|
private |
Definition at line 212 of file Trainer.cpp.
References AsUnderlyingType(), BaseEntity::GetGUID(), Player::SendDirectMessage(), WorldPackets::NPC::TrainerBuyFailed::SpellID, WorldPackets::NPC::TrainerBuyFailed::TrainerFailedReason, WorldPackets::NPC::TrainerBuyFailed::TrainerGUID, and WorldPackets::NPC::TrainerBuyFailed::Write().
Definition at line 76 of file Trainer.cpp.
References BattlePets::BattlePetMgr::AddPet(), WorldObject::CastSpell(), WorldSession::GetBattlePetMgr(), BattlePets::BattlePetMgr::GetBattlePetSpeciesBySpell(), BattlePets::BattlePetMgr::GetDefaultPetQuality(), BaseEntity::GetGUID(), Player::GetReputationPriceDiscount(), Player::GetSession(), Player::HasEnoughMoney(), BattlePets::BattlePetMgr::HasMaxPetCount(), BattlePetSpeciesEntry::ID, Trainer::Spell::IsCastable(), Player::LearnSpell(), Player::ModifyMoney(), Trainer::Spell::MoneyCost, Trainer::NotEnoughMoney, BattlePets::BattlePetMgr::RollPetBreed(), BattlePets::BattlePetMgr::SelectPetDisplay(), Unit::SendPlaySpellVisualKit(), Trainer::Spell::SpellId, and Trainer::Unavailable.
Referenced by WorldSession::HandleTrainerBuySpellOpcode().
|
private |