66 {
"all", learnAllCommandTable },
67 {
"my", learnMyCommandTable }
72 {
"learn", learnCommandTable },
96 if (!allRanks && targetPlayer->
HasSpell(spell->
Id))
110 while ((spellId =
sSpellMgr->GetNextSpellInChain(spellId)))
141 for (
auto const& [
id, quest] :
sObjectMgr->GetQuestTemplates())
143 if (quest->GetRequiredClasses() && player->
SatisfyQuestClass(quest.get(),
false))
156 std::vector<Trainer::Trainer const*>
const& trainers =
sObjectMgr->GetClassTrainers(player->
GetClass());
164 if (!trainer->IsTrainerValidForPlayer(player))
168 if (!trainer->CanTeachSpell(player, &trainerSpell))
171 if (trainerSpell.IsCastable())
172 player->
CastSpell(player, trainerSpell.SpellId,
true);
174 player->
LearnSpell(trainerSpell.SpellId,
false);
200 if ((classMask & talentTabInfo->
ClassMask) == 0)
313 if (
uint32 langSpellId = langDesc.spell_id)
336 player = PlayerIdentifier::FromTargetOrSelf(handler);
337 if (!player || !player->IsConnected())
340 Player* target = player->GetConnectedPlayer();
352 player = PlayerIdentifier::FromTargetOrSelf(handler);
353 if (!player || !player->IsConnected())
356 Player* target = player->GetConnectedPlayer();
386 if (namePart.empty())
393 char const* name =
nullptr;
418 targetSkillInfo = skillInfo;
423 if (!(name && targetSkillInfo))
439 if (!skillLineAbilities)
445 if (skillLine->SupercededBySpell)
449 if (skillLine->RaceMask != 0)
453 if (skillLine->ClassMask && (skillLine->ClassMask & classmask) == 0)
477 spellId =
sSpellMgr->GetFirstSpellInChain(spellId);
DBCStorage< TalentTabEntry > sTalentTabStore(TalentTabEntryfmt)
std::vector< SkillLineAbilityEntry const * > const * GetSkillLineAbilitiesBySkill(uint32 skillLine)
uint32 GetTalentSpellCost(uint32 spellId)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
@ LANG_COMMAND_LEARN_ALL_RECIPES
@ LANG_COMMAND_LEARN_ALL_DEBUG_HELP
@ LANG_COMMAND_LEARN_ALL_PETTALENT_HELP
@ LANG_COMMAND_LEARN_ALL_CRAFT
@ LANG_LEARNING_GM_SKILLS
@ LANG_COMMAND_LEARN_ALL_LANGUAGES_HELP
@ LANG_COMMAND_LEARN_MY_TRAINER_HELP
@ LANG_COMMAND_LEARN_CLASS_TALENTS
@ LANG_COMMAND_LEARN_ALL_BLIZZARD_HELP
@ LANG_COMMAND_LEARN_CLASS_SPELLS
@ LANG_COMMAND_LEARN_ALL_LANG
@ LANG_COMMAND_LEARN_ALL_CRAFTS_HELP
@ LANG_COMMAND_LEARN_ALL_DEFAULT_HELP
@ LANG_COMMAND_LEARN_ALL_RECIPES_HELP
@ LANG_COMMAND_UNLEARN_HELP
@ LANG_COMMAND_LEARN_PET_TALENTS
@ LANG_COMMAND_LEARN_ALL_TALENTS_HELP
@ LANG_COMMAND_SPELL_BROKEN
@ LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST
@ LANG_COMMAND_LEARN_MY_QUESTS_HELP
@ LANG_TARGET_KNOWN_SPELL
@ LANG_COMMAND_LEARN_HELP
LanguageDesc lang_description[LANGUAGES_COUNT]
std::optional< T > Optional
Optional helper class to wrap optional values within.
Role Based Access Control related classes definition.
@ SKILL_CATEGORY_SECONDARY
@ SKILL_CATEGORY_PROFESSION
void wstrToLower(std::wstring &str)
bool Utf8FitTo(std::string_view str, std::wstring_view search)
Player * getSelectedPlayerOrSelf()
Player * getSelectedPlayer()
WorldSession * GetSession()
virtual std::string GetNameLink() const
void PSendSysMessage(const char *fmt, Args &&... args)
void SetSentErrorMessage(bool val)
Player * GetPlayer() const
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
CreatureTemplate const * GetCreatureTemplate() const
void learnSpellHighRank(uint32 spellid)
void SetFreeTalentPoints(uint8 points)
void LearnSpell(uint32 spell_id, bool dependent, uint32 fromSkill=0)
void SendTalentsInfoData(bool pet)
void LearnQuestRewardedSpells()
void SetSkill(uint32 id, uint16 step, uint16 newVal, uint16 maxVal)
uint16 GetPureMaxSkillValue(uint32 skill) const
bool SatisfyQuestClass(Quest const *qInfo, bool msg) const
void RemoveSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true)
uint16 GetSkillStep(uint32 skill) const
void SetFreeTalentPoints(uint32 points)
uint8 GetActiveSpec() const
bool HasSpell(uint32 spell) const override
bool AddTalent(uint32 spellId, uint8 spec, bool learning)
void LearnDefaultSkills()
SpellInfo const * GetFirstRankSpell() const
bool IsAbilityOfSkillType(uint32 skillType) const
static bool IsSpellValid(SpellInfo const *spellInfo, Player *player=nullptr, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
uint32 GetClassMask() const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Player * GetPlayer() const
static bool HandleLearnMySpellsCommand(ChatHandler *handler)
static bool HandleLearnDebugSpellsCommand(ChatHandler *handler)
static bool HandleUnLearnCommand(ChatHandler *handler, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
static bool HandleLearnAllRecipesCommand(ChatHandler *handler, WTail namePart)
static bool HandleLearnAllTalentsCommand(ChatHandler *handler)
static bool HandleLearnMyQuestsCommand(ChatHandler *handler)
static bool HandleLearnAllCraftsCommand(ChatHandler *handler, Optional< PlayerIdentifier > player)
static bool HandleLearnAllGMCommand(ChatHandler *handler)
ChatCommandTable GetCommands() const override
static bool HandleLearnAllPetTalentsCommand(ChatHandler *handler)
static bool HandleLearnAllDefaultCommand(ChatHandler *handler, Optional< PlayerIdentifier > player)
static bool HandleLearnAllLangCommand(ChatHandler *handler)
static bool HandleLearnCommand(ChatHandler *handler, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
static void HandleLearnSkillRecipesHelper(Player *player, uint32 skillId)
void AddSC_learn_commandscript()
std::vector< ChatCommandBuilder > ChatCommandTable
@ RBAC_PERM_COMMAND_UNLEARN
@ RBAC_PERM_COMMAND_LEARN_ALL_LANG
@ RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS
@ RBAC_PERM_COMMAND_LEARN_ALL_RECIPES
@ RBAC_PERM_COMMAND_LEARN_ALL_TALENTS
@ RBAC_PERM_COMMAND_LEARN
@ RBAC_PERM_COMMAND_LEARN_ALL_MY_SPELLS
@ RBAC_PERM_COMMAND_LEARN_ALL_GM
@ RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT
@ RBAC_PERM_COMMAND_LEARN_MY_PETTALENTS
char const * DisplayName[16]
std::array< uint32, MAX_TALENT_RANK > SpellRank