AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
player_commandscript Class Reference
Inheritance diagram for player_commandscript:
CommandScript ScriptObject

Public Member Functions

 player_commandscript ()
 
ChatCommandTable GetCommands () const override
 
virtual std::vector< Acore::ChatCommands::ChatCommandBuilderGetCommands () const =0
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Static Public Member Functions

static bool HandlePlayerLearnCommand (ChatHandler *handler, Optional< PlayerIdentifier > player, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
 
static bool HandlePlayerUnLearnCommand (ChatHandler *handler, Optional< PlayerIdentifier > player, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
 

Additional Inherited Members

- Protected Member Functions inherited from CommandScript
 CommandScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ player_commandscript()

player_commandscript::player_commandscript ( )
inline
26: CommandScript("player_commandscript") { }
Definition: CommandScript.h:25

Member Function Documentation

◆ GetCommands()

ChatCommandTable player_commandscript::GetCommands ( ) const
inlineoverridevirtual

Implements CommandScript.

29 {
30 static ChatCommandTable playerCommandTable =
31 {
32 { "learn", HandlePlayerLearnCommand, SEC_GAMEMASTER, Console::Yes },
33 { "unlearn", HandlePlayerUnLearnCommand, SEC_GAMEMASTER, Console::Yes }
34 };
35
36 static ChatCommandTable commandTable =
37 {
38 { "player", playerCommandTable }
39 };
40 return commandTable;
41 }
@ SEC_GAMEMASTER
Definition: Common.h:59
std::vector< ChatCommandBuilder > ChatCommandTable
Definition: ChatCommand.h:46
static bool HandlePlayerUnLearnCommand(ChatHandler *handler, Optional< PlayerIdentifier > player, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
Definition: cs_player.cpp:54
static bool HandlePlayerLearnCommand(ChatHandler *handler, Optional< PlayerIdentifier > player, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
Definition: cs_player.cpp:43

References HandlePlayerLearnCommand(), HandlePlayerUnLearnCommand(), and SEC_GAMEMASTER.

◆ HandlePlayerLearnCommand()

static bool player_commandscript::HandlePlayerLearnCommand ( ChatHandler handler,
Optional< PlayerIdentifier player,
SpellInfo const *  spell,
Optional< EXACT_SEQUENCE("all")>  allRanks 
)
inlinestatic
44 {
45 if (!player)
46 player = PlayerIdentifier::FromTargetOrSelf(handler);
47 if (!player || !player->IsConnected())
48 return false;
49
50 Player* targetPlayer = player->GetConnectedPlayer();
51 return Acore::PlayerCommand::HandleLearnSpellCommand(handler, targetPlayer, spell, allRanks);
52 }
bool HandleLearnSpellCommand(ChatHandler *handler, Player *targetPlayer, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
Definition: PlayerCommand.cpp:24
static Optional< PlayerIdentifier > FromTargetOrSelf(ChatHandler *handler)
Definition: ChatCommandTags.h:184
Definition: Player.h:1081

References Acore::ChatCommands::PlayerIdentifier::FromTargetOrSelf(), and Acore::PlayerCommand::HandleLearnSpellCommand().

Referenced by GetCommands().

◆ HandlePlayerUnLearnCommand()

static bool player_commandscript::HandlePlayerUnLearnCommand ( ChatHandler handler,
Optional< PlayerIdentifier player,
SpellInfo const *  spell,
Optional< EXACT_SEQUENCE("all")>  allRanks 
)
inlinestatic
55 {
56 if (!player)
57 player = PlayerIdentifier::FromTargetOrSelf(handler);
58 if (!player || !player->IsConnected())
59 return false;
60
61 Player* targetPlayer = player->GetConnectedPlayer();
62 return Acore::PlayerCommand::HandleUnlearnSpellCommand(handler, targetPlayer, spell, allRanks);
63 }
bool HandleUnlearnSpellCommand(ChatHandler *handler, Player *targetPlayer, SpellInfo const *spell, Optional< EXACT_SEQUENCE("all")> allRanks)
Definition: PlayerCommand.cpp:66

References Acore::ChatCommands::PlayerIdentifier::FromTargetOrSelf(), and Acore::PlayerCommand::HandleUnlearnSpellCommand().

Referenced by GetCommands().