refactor(Script/Command): learn spell (#24319)

Co-authored-by: Treeston <14020072+Treeston@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Kitzunu
2026-03-21 13:28:24 +01:00
committed by GitHub
parent b90c917b49
commit e6054ec7ea
6 changed files with 71 additions and 43 deletions

View File

@@ -130,7 +130,7 @@ namespace Trainer
return nullptr;
}
bool Trainer::CanTeachSpell(Player const* player, Spell const* trainerSpell)
bool Trainer::CanTeachSpell(Player const* player, Spell const* trainerSpell) const
{
SpellState state = GetSpellState(player, trainerSpell);
if (state != SpellState::Available)

View File

@@ -70,7 +70,7 @@ namespace Trainer
[[nodiscard]] Spell const* GetSpell(uint32 spellId) const;
[[nodiscard]] std::vector<Spell> const& GetSpells() const { return _spells; }
void SendSpells(Creature* npc, Player* player, LocaleConstant locale) const;
bool CanTeachSpell(Player const* player, Spell const* trainerSpell);
bool CanTeachSpell(Player const* player, Spell const* trainerSpell) const;
void TeachSpell(Creature* npc, Player* player, uint32 spellId);
[[nodiscard]] Type GetTrainerType() const { return _type; }