![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "Trainer.h"
Public Member Functions | |
| Trainer (uint32 trainerId, Type type, uint32 requirement, std::string greeting, std::vector< Spell > spells) | |
| Spell const * | GetSpell (uint32 spellId) const |
| std::vector< Spell > const & | GetSpells () const |
| void | SendSpells (Creature *npc, Player *player, LocaleConstant locale) const |
| bool | CanTeachSpell (Player const *player, Spell const *trainerSpell) |
| void | TeachSpell (Creature *npc, Player *player, uint32 spellId) |
| Type | GetTrainerType () const |
| uint32 | GetTrainerRequirement () const |
| bool | IsTrainerValidForPlayer (Player const *player) const |
Private Member Functions | |
| SpellState | GetSpellState (Player const *player, Spell const *trainerSpell) const |
| void | SendTeachFailure (Creature const *npc, Player const *player, uint32 spellId, FailReason reason) const |
| void | SendTeachSucceeded (Creature const *npc, Player const *player, uint32 spellId) const |
| std::string const & | GetGreeting (LocaleConstant locale) const |
| void | AddGreetingLocale (LocaleConstant locale, std::string greeting) |
Private Attributes | |
| friend | ObjectMgr |
| uint32 | _trainerId |
| Type | _type |
| uint32 | _requirement |
| std::vector< Spell > | _spells |
| std::array< std::string, TOTAL_LOCALES > | _greeting |
| Trainer::Trainer::Trainer | ( | uint32 | trainerId, |
| Type | type, | ||
| uint32 | requirement, | ||
| std::string | greeting, | ||
| std::vector< Spell > | spells | ||
| ) |
References DEFAULT_LOCALE.
|
private |
References Trainer::Available, SpellInfo::GetEffects(), Player::GetFreePrimaryProfessionPoints(), SpellInfo::IsPrimaryProfessionFirstRank(), SPELL_EFFECT_LEARN_SPELL, Trainer::Spell::SpellId, and sSpellMgr.
|
private |
References DEFAULT_LOCALE.
|
private |
References Trainer::Available, 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.
|
inline |
| bool Trainer::Trainer::IsTrainerValidForPlayer | ( | Player const * | player | ) | const |
References Trainer::Class, Unit::getClass(), Unit::getRace(), Player::HasSpell(), Trainer::Mount, Trainer::Pet, and Trainer::Tradeskill.
Referenced by Creature::CanResetTalents(), Player::PrepareGossipMenu(), and WorldSession::SendTrainerList().
| void Trainer::Trainer::SendSpells | ( | Creature * | npc, |
| Player * | player, | ||
| LocaleConstant | locale | ||
| ) | const |
References AsUnderlyingType(), SpellInfo::GetEffects(), Player::GetReputationPriceDiscount(), WorldPackets::NPC::TrainerList::Greeting, SpellInfo::IsPrimaryProfessionFirstRank(), Player::IsSpellFitByClassAndRace(), WorldPackets::NPC::TrainerListSpell::MoneyCost, WorldPackets::NPC::TrainerListSpell::PointCost, WorldPackets::NPC::TrainerListSpell::ReqAbility, WorldPackets::NPC::TrainerListSpell::ReqLevel, WorldPackets::NPC::TrainerListSpell::ReqSkillLine, WorldPackets::NPC::TrainerListSpell::ReqSkillRank, Player::SendDirectMessage(), SPELL_EFFECT_LEARN_SPELL, WorldPackets::NPC::TrainerListSpell::SpellID, WorldPackets::NPC::TrainerList::Spells, sSpellMgr, WorldPackets::NPC::TrainerList::TrainerGUID, WorldPackets::NPC::TrainerList::TrainerType, WorldPackets::NPC::TrainerListSpell::Usable, and WorldPackets::NPC::TrainerList::Write().
Referenced by WorldSession::SendTrainerList().
|
private |
References AsUnderlyingType(), Player::SendDirectMessage(), WorldPackets::NPC::TrainerBuyFailed::SpellID, WorldPackets::NPC::TrainerBuyFailed::TrainerFailedReason, WorldPackets::NPC::TrainerBuyFailed::TrainerGUID, and WorldPackets::NPC::TrainerBuyFailed::Write().
|
private |
References Player::SendDirectMessage(), WorldPackets::NPC::TrainerBuySucceeded::SpellID, WorldPackets::NPC::TrainerBuySucceeded::TrainerGUID, and WorldPackets::NPC::TrainerBuySucceeded::Write().
References Unit::CastSpell(), Object::GetGUID(), Player::GetReputationPriceDiscount(), Player::HasEnoughMoney(), Trainer::Spell::IsCastable(), Player::learnSpell(), Player::ModifyMoney(), Trainer::Spell::MoneyCost, Trainer::NotEnoughMoney, Trainer::NotEnoughSkill, Trainer::Spell::SpellId, and Trainer::Unavailable.
Referenced by WorldSession::HandleTrainerBuySpellOpcode().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |