mirror of
https://github.com/azerothcore/mod-learn-spells.git
synced 2026-01-13 00:58:37 +00:00
update script also fix indentations
This commit is contained in:
@@ -11,3 +11,8 @@ LearnSpells.Enable = 1
|
||||
# Announce the module when the player logs in?
|
||||
|
||||
LearnSpells.Announce = 1
|
||||
|
||||
# Max level Limit the player will learn spells
|
||||
# Default: = 80
|
||||
|
||||
MaxLevel = 80
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "ScriptPCH.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Config.h"
|
||||
#include "Configuration\Config.h"
|
||||
#include "Player.h"
|
||||
|
||||
uint32 MaxLevel;
|
||||
|
||||
class LearnSpellsOnLevelUp : public PlayerScript
|
||||
{
|
||||
@@ -59,11 +62,14 @@ class LearnSpellsOnLevelUp : public PlayerScript
|
||||
void OnLevelChanged(Player* player, uint8 oldLevel)
|
||||
{
|
||||
if (sConfigMgr->GetBoolDefault("LearnSpells.Enable", true))
|
||||
{
|
||||
if (player->getLevel() < MaxLevel)
|
||||
{
|
||||
if (oldLevel < player->getLevel())
|
||||
LearnSpellsForNewLevel(player, oldLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsIgnoredSpell(uint32 spellID)
|
||||
{
|
||||
@@ -174,6 +180,8 @@ public:
|
||||
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||
|
||||
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||
|
||||
MaxLevel = sConfigMgr->GetIntDefault("MaxLevel", 80);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user