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

Public Member Functions

 cheat_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
 

Static Public Member Functions

static bool HandleGodModeCheatCommand (ChatHandler *handler, Optional< bool > enableArg)
 
static bool HandleCasttimeCheatCommand (ChatHandler *handler, Optional< bool > enableArg)
 
static bool HandleCoolDownCheatCommand (ChatHandler *handler, Optional< bool > enableArg)
 
static bool HandlePowerCheatCommand (ChatHandler *handler, Optional< bool > enableArg)
 
static bool HandleCheatStatusCommand (ChatHandler *handler)
 
static bool HandleWaterWalkCheatCommand (ChatHandler *handler, Optional< bool > enableArg)
 
static bool HandleTaxiCheatCommand (ChatHandler *handler, Optional< bool > enableArg)
 
static bool HandleExploreCheatCommand (ChatHandler *handler, bool reveal)
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ cheat_commandscript()

cheat_commandscript::cheat_commandscript ( )
inline
29: CommandScript("cheat_commandscript") { }
Definition: ScriptMgr.h:849

Member Function Documentation

◆ GetCommands()

ChatCommandTable cheat_commandscript::GetCommands ( ) const
inlineoverridevirtual

Implements CommandScript.

32 {
33 static ChatCommandTable cheatCommandTable =
34 {
35 { "god", HandleGodModeCheatCommand, SEC_GAMEMASTER, Console::No },
36 { "casttime", HandleCasttimeCheatCommand, SEC_GAMEMASTER, Console::No },
37 { "cooldown", HandleCoolDownCheatCommand, SEC_GAMEMASTER, Console::No },
38 { "power", HandlePowerCheatCommand, SEC_GAMEMASTER, Console::No },
39 { "waterwalk", HandleWaterWalkCheatCommand, SEC_GAMEMASTER, Console::No },
40 { "status", HandleCheatStatusCommand, SEC_GAMEMASTER, Console::No },
41 { "taxi", HandleTaxiCheatCommand, SEC_GAMEMASTER, Console::No },
42 { "explore", HandleExploreCheatCommand, SEC_GAMEMASTER, Console::No }
43 };
44
45 static ChatCommandTable commandTable =
46 {
47 { "cheat", cheatCommandTable }
48 };
49 return commandTable;
50 }
@ SEC_GAMEMASTER
Definition: Common.h:68
std::vector< ChatCommandBuilder > ChatCommandTable
Definition: ChatCommand.h:50
static bool HandleCasttimeCheatCommand(ChatHandler *handler, Optional< bool > enableArg)
Definition: cs_cheat.cpp:72
static bool HandleExploreCheatCommand(ChatHandler *handler, bool reveal)
Definition: cs_cheat.cpp:203
static bool HandleWaterWalkCheatCommand(ChatHandler *handler, Optional< bool > enableArg)
Definition: cs_cheat.cpp:150
static bool HandleCoolDownCheatCommand(ChatHandler *handler, Optional< bool > enableArg)
Definition: cs_cheat.cpp:92
static bool HandleTaxiCheatCommand(ChatHandler *handler, Optional< bool > enableArg)
Definition: cs_cheat.cpp:172
static bool HandleGodModeCheatCommand(ChatHandler *handler, Optional< bool > enableArg)
Definition: cs_cheat.cpp:52
static bool HandleCheatStatusCommand(ChatHandler *handler)
Definition: cs_cheat.cpp:132
static bool HandlePowerCheatCommand(ChatHandler *handler, Optional< bool > enableArg)
Definition: cs_cheat.cpp:112

References HandleCasttimeCheatCommand(), HandleCheatStatusCommand(), HandleCoolDownCheatCommand(), HandleExploreCheatCommand(), HandleGodModeCheatCommand(), HandlePowerCheatCommand(), HandleTaxiCheatCommand(), HandleWaterWalkCheatCommand(), and SEC_GAMEMASTER.

◆ HandleCasttimeCheatCommand()

static bool cheat_commandscript::HandleCasttimeCheatCommand ( ChatHandler handler,
Optional< bool >  enableArg 
)
inlinestatic
73 {
74 bool enable = !handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_CASTTIME);
75 if (enableArg)
76 enable = *enableArg;
77
78 if (enable)
79 {
81 handler->SendSysMessage("CastTime Cheat is ON. Your spells won't have a casttime.");
82 }
83 else
84 {
86 handler->SendSysMessage("CastTime Cheat is OFF. Your spells will have a casttime.");
87 }
88
89 return true;
90 }
@ CHEAT_CASTTIME
Definition: Player.h:992
WorldSession * GetSession()
Definition: Chat.h:122
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:103
bool GetCommandStatus(uint32 command) const
Definition: Player.h:1154
void SetCommandStatusOn(uint32 command)
Definition: Player.h:1155
void SetCommandStatusOff(uint32 command)
Definition: Player.h:1156
Player * GetPlayer() const
Definition: WorldSession.h:360

References CHEAT_CASTTIME, Player::GetCommandStatus(), WorldSession::GetPlayer(), ChatHandler::GetSession(), ChatHandler::SendSysMessage(), Player::SetCommandStatusOff(), and Player::SetCommandStatusOn().

Referenced by GetCommands().

◆ HandleCheatStatusCommand()

static bool cheat_commandscript::HandleCheatStatusCommand ( ChatHandler handler)
inlinestatic
133 {
134 Player* player = handler->GetSession()->GetPlayer();
135
136 char const* enabled = "ON";
137 char const* disabled = "OFF";
138
140 handler->PSendSysMessage(LANG_COMMAND_CHEAT_GOD, player->GetCommandStatus(CHEAT_GOD) ? enabled : disabled);
141 handler->PSendSysMessage(LANG_COMMAND_CHEAT_CD, player->GetCommandStatus(CHEAT_COOLDOWN) ? enabled : disabled);
142 handler->PSendSysMessage(LANG_COMMAND_CHEAT_CT, player->GetCommandStatus(CHEAT_CASTTIME) ? enabled : disabled);
143 handler->PSendSysMessage(LANG_COMMAND_CHEAT_POWER, player->GetCommandStatus(CHEAT_POWER) ? enabled : disabled);
144 handler->PSendSysMessage(LANG_COMMAND_CHEAT_WW, player->GetCommandStatus(CHEAT_WATERWALK) ? enabled : disabled);
145 handler->PSendSysMessage(LANG_COMMAND_CHEAT_TAXINODES, player->isTaxiCheater() ? enabled : disabled);
146
147 return true;
148 }
@ CHEAT_COOLDOWN
Definition: Player.h:993
@ CHEAT_POWER
Definition: Player.h:994
@ CHEAT_GOD
Definition: Player.h:991
@ CHEAT_WATERWALK
Definition: Player.h:995
@ LANG_COMMAND_CHEAT_CT
Definition: Language.h:400
@ LANG_COMMAND_CHEAT_WW
Definition: Language.h:403
@ LANG_COMMAND_CHEAT_POWER
Definition: Language.h:402
@ LANG_COMMAND_CHEAT_GOD
Definition: Language.h:399
@ LANG_COMMAND_CHEAT_CD
Definition: Language.h:401
@ LANG_COMMAND_CHEAT_STATUS
Definition: Language.h:398
@ LANG_COMMAND_CHEAT_TAXINODES
Definition: Language.h:405
void PSendSysMessage(char const *fmt, Args &&... args)
Definition: Chat.h:60
Definition: Player.h:1046
bool isTaxiCheater() const
Definition: Player.h:1140

References CHEAT_CASTTIME, CHEAT_COOLDOWN, CHEAT_GOD, CHEAT_POWER, CHEAT_WATERWALK, Player::GetCommandStatus(), WorldSession::GetPlayer(), ChatHandler::GetSession(), Player::isTaxiCheater(), LANG_COMMAND_CHEAT_CD, LANG_COMMAND_CHEAT_CT, LANG_COMMAND_CHEAT_GOD, LANG_COMMAND_CHEAT_POWER, LANG_COMMAND_CHEAT_STATUS, LANG_COMMAND_CHEAT_TAXINODES, LANG_COMMAND_CHEAT_WW, ChatHandler::PSendSysMessage(), and ChatHandler::SendSysMessage().

Referenced by GetCommands().

◆ HandleCoolDownCheatCommand()

static bool cheat_commandscript::HandleCoolDownCheatCommand ( ChatHandler handler,
Optional< bool >  enableArg 
)
inlinestatic
93 {
94 bool enable = !handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_COOLDOWN);
95 if (enableArg)
96 enable = *enableArg;
97
98 if (enable)
99 {
101 handler->SendSysMessage("Cooldown Cheat is ON. You are not on the global cooldown.");
102 }
103 else
104 {
106 handler->SendSysMessage("Cooldown Cheat is OFF. You are on the global cooldown.");
107 }
108
109 return true;
110 }

References CHEAT_COOLDOWN, Player::GetCommandStatus(), WorldSession::GetPlayer(), ChatHandler::GetSession(), ChatHandler::SendSysMessage(), Player::SetCommandStatusOff(), and Player::SetCommandStatusOn().

Referenced by GetCommands().

◆ HandleExploreCheatCommand()

static bool cheat_commandscript::HandleExploreCheatCommand ( ChatHandler handler,
bool  reveal 
)
inlinestatic
204 {
205 Player* chr = handler->getSelectedPlayer();
206 if (!chr)
207 {
209 handler->SetSentErrorMessage(true);
210 return false;
211 }
212
213 if (reveal)
214 {
215 handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr).c_str());
216 if (handler->needReportToTarget(chr))
218 }
219 else
220 {
221 handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr).c_str());
222 if (handler->needReportToTarget(chr))
224 }
225
226 for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
227 {
228 if (reveal)
229 handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
230 else
232 }
233
234 return true;
235 }
std::uint8_t uint8
Definition: Define.h:110
@ PLAYER_EXPLORED_ZONES_1
Definition: UpdateFields.h:357
#define PLAYER_EXPLORED_ZONES_SIZE
Definition: Player.h:73
@ LANG_YOU_SET_EXPLORE_NOTHING
Definition: Language.h:587
@ LANG_YOURS_EXPLORE_SET_ALL
Definition: Language.h:588
@ LANG_NO_CHAR_SELECTED
Definition: Language.h:148
@ LANG_YOU_SET_EXPLORE_ALL
Definition: Language.h:586
@ LANG_YOURS_EXPLORE_SET_NOTHING
Definition: Language.h:589
Definition: Chat.h:38
virtual std::string GetNameLink() const
Definition: Chat.h:84
void SetSentErrorMessage(bool val)
Definition: Chat.h:118
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:776
Player * getSelectedPlayer() const
Definition: Chat.cpp:301
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:845
WorldSession * GetSession() const
Definition: Player.h:1947

References ChatHandler::GetNameLink(), WorldSession::GetPlayer(), ChatHandler::getSelectedPlayer(), ChatHandler::GetSession(), Player::GetSession(), LANG_NO_CHAR_SELECTED, LANG_YOU_SET_EXPLORE_ALL, LANG_YOU_SET_EXPLORE_NOTHING, LANG_YOURS_EXPLORE_SET_ALL, LANG_YOURS_EXPLORE_SET_NOTHING, ChatHandler::needReportToTarget(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE, ChatHandler::PSendSysMessage(), ChatHandler::SendSysMessage(), Object::SetFlag(), and ChatHandler::SetSentErrorMessage().

Referenced by GetCommands().

◆ HandleGodModeCheatCommand()

static bool cheat_commandscript::HandleGodModeCheatCommand ( ChatHandler handler,
Optional< bool >  enableArg 
)
inlinestatic
53 {
54 bool enable = !handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_GOD);
55 if (enableArg)
56 enable = *enableArg;
57
58 if (enable)
59 {
61 handler->SendSysMessage("Godmode is ON. You won't take damage.");
62 }
63 else
64 {
66 handler->SendSysMessage("Godmode is OFF. You can take damage.");
67 }
68
69 return true;
70 }

References CHEAT_GOD, Player::GetCommandStatus(), WorldSession::GetPlayer(), ChatHandler::GetSession(), ChatHandler::SendSysMessage(), Player::SetCommandStatusOff(), and Player::SetCommandStatusOn().

Referenced by GetCommands().

◆ HandlePowerCheatCommand()

static bool cheat_commandscript::HandlePowerCheatCommand ( ChatHandler handler,
Optional< bool >  enableArg 
)
inlinestatic
113 {
114 bool enable = !handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_POWER);
115 if (enableArg)
116 enable = *enableArg;
117
118 if (enable)
119 {
121 handler->SendSysMessage("Power Cheat is ON. You don't need mana/rage/energy to use spells.");
122 }
123 else
124 {
126 handler->SendSysMessage("Power Cheat is OFF. You need mana/rage/energy to use spells.");
127 }
128
129 return true;
130 }

References CHEAT_POWER, Player::GetCommandStatus(), WorldSession::GetPlayer(), ChatHandler::GetSession(), ChatHandler::SendSysMessage(), Player::SetCommandStatusOff(), and Player::SetCommandStatusOn().

Referenced by GetCommands().

◆ HandleTaxiCheatCommand()

static bool cheat_commandscript::HandleTaxiCheatCommand ( ChatHandler handler,
Optional< bool >  enableArg 
)
inlinestatic
173 {
174 Player* chr = handler->getSelectedPlayer();
175
176 if (!chr)
177 chr = handler->GetSession()->GetPlayer();
178 else if (handler->HasLowerSecurity(chr, ObjectGuid::Empty)) // check online security
179 return false;
180
181 bool enable = !chr->isTaxiCheater();
182 if (enableArg)
183 enable = *enableArg;
184
185 if (enable)
186 {
187 chr->SetTaxiCheater(true);
188 handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
189 if (handler->needReportToTarget(chr))
191 }
192 else
193 {
194 chr->SetTaxiCheater(false);
195 handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
196 if (handler->needReportToTarget(chr))
198 }
199
200 return true;
201 }
@ LANG_YOURS_TAXIS_REMOVED
Definition: Language.h:170
@ LANG_YOURS_TAXIS_ADDED
Definition: Language.h:169
@ LANG_YOU_REMOVE_TAXIS
Definition: Language.h:168
@ LANG_YOU_GIVE_TAXIS
Definition: Language.h:167
bool HasLowerSecurity(Player *target, ObjectGuid guid=ObjectGuid::Empty, bool strong=false)
Definition: Chat.cpp:53
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
void SetTaxiCheater(bool on)
Definition: Player.h:1141

References ObjectGuid::Empty, ChatHandler::GetNameLink(), WorldSession::GetPlayer(), ChatHandler::getSelectedPlayer(), ChatHandler::GetSession(), Player::GetSession(), ChatHandler::HasLowerSecurity(), Player::isTaxiCheater(), LANG_YOU_GIVE_TAXIS, LANG_YOU_REMOVE_TAXIS, LANG_YOURS_TAXIS_ADDED, LANG_YOURS_TAXIS_REMOVED, ChatHandler::needReportToTarget(), ChatHandler::PSendSysMessage(), and Player::SetTaxiCheater().

Referenced by GetCommands().

◆ HandleWaterWalkCheatCommand()

static bool cheat_commandscript::HandleWaterWalkCheatCommand ( ChatHandler handler,
Optional< bool >  enableArg 
)
inlinestatic
151 {
152 bool enable = !handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK);
153 if (enableArg)
154 enable = *enableArg;
155
156 if (enable)
157 {
159 handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON
160 handler->SendSysMessage("Waterwalking is ON. You can walk on water.");
161 }
162 else
163 {
165 handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF
166 handler->SendSysMessage("Waterwalking is OFF. You can't walk on water.");
167 }
168
169 return true;
170 }
@ MOVE_WATER_WALK
Definition: Player.h:459
@ MOVE_LAND_WALK
Definition: Player.h:460
void SetMovement(PlayerMovementType pType)
Definition: Player.cpp:4280

References CHEAT_WATERWALK, Player::GetCommandStatus(), WorldSession::GetPlayer(), ChatHandler::GetSession(), MOVE_LAND_WALK, MOVE_WATER_WALK, ChatHandler::SendSysMessage(), Player::SetCommandStatusOff(), Player::SetCommandStatusOn(), and Player::SetMovement().

Referenced by GetCommands().