diff --git a/src/server/scripts/Commands/PlayerCommand.cpp b/src/server/scripts/Commands/PlayerCommand.cpp
index ab8c52dc4..3cf4aa2c4 100644
--- a/src/server/scripts/Commands/PlayerCommand.cpp
+++ b/src/server/scripts/Commands/PlayerCommand.cpp
@@ -16,12 +16,9 @@
*/
#include "PlayerCommand.h"
-#include "Chat.h"
#include "Language.h"
-#include "Player.h"
-#include "ScriptMgr.h"
-bool PlayerCommand::Learn(ChatHandler* handler, Player* targetPlayer, uint32 spell, char const* all)
+bool Acore::PlayerCommand::HandleLearnSpellCommand(ChatHandler* handler, Player* targetPlayer, uint32 spell, char const* all)
{
if (!spell)
return false;
@@ -77,7 +74,7 @@ bool PlayerCommand::Learn(ChatHandler* handler, Player* targetPlayer, uint32 spe
return true;
}
-bool PlayerCommand::UnLearn(ChatHandler* handler, Player* target, uint32 spellId, char const* allStr)
+bool Acore::PlayerCommand::HandleUnlearnSpellCommand(ChatHandler* handler, Player* target, uint32 spellId, char const* allStr)
{
if (!spellId)
return false;
diff --git a/src/server/scripts/Commands/PlayerCommand.h b/src/server/scripts/Commands/PlayerCommand.h
index 1b33758bc..7b361a426 100644
--- a/src/server/scripts/Commands/PlayerCommand.h
+++ b/src/server/scripts/Commands/PlayerCommand.h
@@ -15,19 +15,19 @@
* with this program. If not, see .
*/
-#ifndef _PLAYER_COMMAND_H_
-#define _PLAYER_COMMAND_H_
+#ifndef _PLAYER_COMMAND_H
+#define _PLAYER_COMMAND_H
+#include "Chat.h"
+#include "Player.h"
-#include "Define.h"
-
-class ChatHandler;
-class Player;
-
-class PlayerCommand
+namespace Acore
{
-public:
- static bool Learn(ChatHandler* handler, Player* targetPlayer, uint32 spell, char const* all);
- static bool UnLearn(ChatHandler* handler, Player* targetPlayer, uint32 spell, char const* all);
+ // Used in player/character commands
+ namespace PlayerCommand
+ {
+ bool HandleLearnSpellCommand(ChatHandler* handler, Player* targetPlayer, uint32 spell, char const* all);
+ bool HandleUnlearnSpellCommand(ChatHandler* handler, Player* targetPlayer, uint32 spell, char const* all);
+ };
};
-#endif
+#endif // _PLAYER_COMMAND_H
\ No newline at end of file
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index a76c88221..ff770b455 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -22,13 +22,11 @@ Comment: All learn related commands
Category: commandscripts
EndScriptData */
-#include "Chat.h"
+#include "ScriptMgr.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Pet.h"
-#include "Player.h"
#include "PlayerCommand.h"
-#include "ScriptMgr.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
@@ -38,7 +36,7 @@ EndScriptData */
using namespace Acore::ChatCommands;
-class learn_commandscript : public CommandScript, public PlayerCommand
+class learn_commandscript : public CommandScript
{
public:
learn_commandscript() : CommandScript("learn_commandscript") { }
@@ -94,7 +92,7 @@ public:
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spell = handler->extractSpellIdFromLink((char*)args);
char const* all = strtok(nullptr, " ");
- return Learn(handler, targetPlayer, spell, all);
+ return Acore::PlayerCommand::HandleLearnSpellCommand(handler, targetPlayer, spell, all);
}
static bool HandleLearnAllGMCommand(ChatHandler* handler, char const* /*args*/)
@@ -461,7 +459,7 @@ public:
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
uint32 spellId = handler->extractSpellIdFromLink((char*)args);
char const* allStr = strtok(nullptr, " ");
- return UnLearn(handler, target, spellId, allStr);
+ return Acore::PlayerCommand::HandleUnlearnSpellCommand(handler, target, spellId, allStr);
}
};
diff --git a/src/server/scripts/Commands/cs_player.cpp b/src/server/scripts/Commands/cs_player.cpp
index 46c82a927..a6c6ad614 100644
--- a/src/server/scripts/Commands/cs_player.cpp
+++ b/src/server/scripts/Commands/cs_player.cpp
@@ -15,11 +15,9 @@
* with this program. If not, see .
*/
-#include "Chat.h"
-#include "Language.h"
-#include "Player.h"
-#include "PlayerCommand.h"
#include "ScriptMgr.h"
+#include "Language.h"
+#include "PlayerCommand.h"
#if AC_COMPILER == AC_COMPILER_GNU
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -27,7 +25,7 @@
using namespace Acore::ChatCommands;
-class player_commandscript : public CommandScript, public PlayerCommand
+class player_commandscript : public CommandScript
{
public:
player_commandscript() : CommandScript("player_commandscript") { }
@@ -68,7 +66,7 @@ public:
return false;
}
- return Learn(handler, targetPlayer, spell, all);
+ return Acore::PlayerCommand::HandleLearnSpellCommand(handler, targetPlayer, spell, all);
}
static bool HandlePlayerUnLearnCommand(ChatHandler* handler, char const* args)
@@ -93,7 +91,7 @@ public:
return false;
}
- return UnLearn(handler, targetPlayer, spell, all);
+ return Acore::PlayerCommand::HandleUnlearnSpellCommand(handler, targetPlayer, spell, all);
}
private: