mirror of
https://github.com/azerothcore/mod-learn-spells.git
synced 2026-01-13 00:58:37 +00:00
fix codestyle and add enabled hook list for performance improvement
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
void AddSC_LearnAllSpells();
|
||||
|
||||
void Addmod_learn_spellsScripts() {
|
||||
void Addmod_learn_spellsScripts()
|
||||
{
|
||||
AddSC_LearnAllSpells();
|
||||
}
|
||||
|
||||
@@ -9,14 +9,16 @@
|
||||
class LearnSpellsOnLevelUp : public PlayerScript
|
||||
{
|
||||
public:
|
||||
LearnSpellsOnLevelUp() : PlayerScript("LearnSpellsOnLevelUp") { }
|
||||
LearnSpellsOnLevelUp() : PlayerScript("LearnSpellsOnLevelUp", {
|
||||
PLAYERHOOK_ON_FIRST_LOGIN,
|
||||
PLAYERHOOK_ON_LEVEL_CHANGED
|
||||
}) { }
|
||||
|
||||
void OnPlayerFirstLogin(Player* player) override
|
||||
{
|
||||
if (sConfigMgr->GetOption<bool>("LearnSpells.OnFirstLogin", 0))
|
||||
{
|
||||
LearnSpellsForNewLevel(player, 1);
|
||||
}
|
||||
|
||||
if (player->getClass() == CLASS_SHAMAN)
|
||||
{
|
||||
player->AddItem(5175, 1); // Earth Totem
|
||||
@@ -480,13 +482,11 @@ private:
|
||||
for (auto const& spell : additionalSpellsToTeach)
|
||||
{
|
||||
if (!(player->HasSpell(spell.spellId)) && (spell.faction == TeamId::TEAM_NEUTRAL || spell.faction == player->GetTeamId()))
|
||||
{
|
||||
player->learnSpell(spell.spellId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetSpellFamily(const Player* p)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user