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

Public Member Functions

 reset_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 HandleResetAchievementsCommand (ChatHandler *handler, char const *args)
 
static bool HandleResetHonorCommand (ChatHandler *handler, char const *args)
 
static bool HandleResetStatsOrLevelHelper (Player *player)
 
static bool HandleResetLevelCommand (ChatHandler *handler, char const *args)
 
static bool HandleResetSpellsCommand (ChatHandler *handler, char const *args)
 
static bool HandleResetStatsCommand (ChatHandler *handler, char const *args)
 
static bool HandleResetTalentsCommand (ChatHandler *handler, char const *args)
 
static bool HandleResetAllCommand (ChatHandler *handler, char const *args)
 

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

◆ reset_commandscript()

reset_commandscript::reset_commandscript ( )
inline
42: CommandScript("reset_commandscript") { }
Definition: ScriptMgr.h:850

Member Function Documentation

◆ GetCommands()

ChatCommandTable reset_commandscript::GetCommands ( ) const
inlineoverridevirtual

Implements CommandScript.

45 {
46 static ChatCommandTable resetCommandTable =
47 {
48 { "achievements", SEC_CONSOLE, true, &HandleResetAchievementsCommand, "" },
49 { "honor", SEC_ADMINISTRATOR, true, &HandleResetHonorCommand, "" },
50 { "level", SEC_ADMINISTRATOR, true, &HandleResetLevelCommand, "" },
51 { "spells", SEC_ADMINISTRATOR, true, &HandleResetSpellsCommand, "" },
52 { "stats", SEC_ADMINISTRATOR, true, &HandleResetStatsCommand, "" },
53 { "talents", SEC_ADMINISTRATOR, true, &HandleResetTalentsCommand, "" },
54 { "all", SEC_CONSOLE, true, &HandleResetAllCommand, "" }
55 };
56 static ChatCommandTable commandTable =
57 {
58 { "reset", SEC_ADMINISTRATOR, true, nullptr, "", resetCommandTable }
59 };
60 return commandTable;
61 }
@ SEC_ADMINISTRATOR
Definition: Common.h:69
@ SEC_CONSOLE
Definition: Common.h:70
std::vector< ChatCommandBuilder > ChatCommandTable
Definition: ChatCommand.h:50
static bool HandleResetHonorCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:78
static bool HandleResetAllCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:269
static bool HandleResetTalentsCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:209
static bool HandleResetStatsCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:191
static bool HandleResetLevelCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:126
static bool HandleResetAchievementsCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:63
static bool HandleResetSpellsCommand(ChatHandler *handler, char const *args)
Definition: cs_reset.cpp:162

References HandleResetAchievementsCommand(), HandleResetAllCommand(), HandleResetHonorCommand(), HandleResetLevelCommand(), HandleResetSpellsCommand(), HandleResetStatsCommand(), HandleResetTalentsCommand(), SEC_ADMINISTRATOR, and SEC_CONSOLE.

◆ HandleResetAchievementsCommand()

static bool reset_commandscript::HandleResetAchievementsCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
64 {
65 Player* target;
66 ObjectGuid targetGuid;
67 if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid))
68 return false;
69
70 if (target)
71 target->ResetAchievements();
72 else
74
75 return true;
76 }
static void DeleteFromDB(ObjectGuid::LowType lowguid)
Definition: AchievementMgr.cpp:540
bool extractPlayerTarget(char *args, Player **player, ObjectGuid *player_guid=nullptr, std::string *player_name=nullptr)
Definition: Chat.cpp:678
Definition: ObjectGuid.h:120
LowType GetCounter() const
Definition: ObjectGuid.h:147
Definition: Player.h:1046
void ResetAchievements()
Definition: Player.cpp:13788

References AchievementMgr::DeleteFromDB(), ChatHandler::extractPlayerTarget(), ObjectGuid::GetCounter(), and Player::ResetAchievements().

Referenced by GetCommands().

◆ HandleResetAllCommand()

static bool reset_commandscript::HandleResetAllCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
270 {
271 if (!*args)
272 return false;
273
274 std::string caseName = args;
275
276 AtLoginFlags atLogin;
277
278 // Command specially created as single command to prevent using short case names
279 if (caseName == "spells")
280 {
281 atLogin = AT_LOGIN_RESET_SPELLS;
282 sWorld->SendWorldText(LANG_RESETALL_SPELLS);
283 if (!handler->GetSession())
285 }
286 else if (caseName == "talents")
287 {
289 sWorld->SendWorldText(LANG_RESETALL_TALENTS);
290 if (!handler->GetSession())
292 }
293 else
294 {
296 handler->SetSentErrorMessage(true);
297 return false;
298 }
299
301 stmt->SetData(0, uint16(atLogin));
302 CharacterDatabase.Execute(stmt);
303
304 std::shared_lock<std::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
306 for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
307 itr->second->SetAtLoginFlag(atLogin);
308
309 return true;
310 }
std::uint16_t uint16
Definition: Define.h:109
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
@ CHAR_UPD_ALL_AT_LOGIN_FLAGS
Definition: CharacterDatabase.h:276
AtLoginFlags
Definition: Player.h:599
@ AT_LOGIN_RESET_TALENTS
Definition: Player.h:603
@ AT_LOGIN_RESET_SPELLS
Definition: Player.h:602
@ AT_LOGIN_RESET_PET_TALENTS
Definition: Player.h:605
@ LANG_RESETALL_TALENTS
Definition: Language.h:259
@ LANG_RESETALL_UNKNOWN_CASE
Definition: Language.h:257
@ LANG_RESETALL_SPELLS
Definition: Language.h:258
#define sWorld
Definition: World.h:451
HashMapHolder< Player >::MapType const & GetPlayers()
Definition: ObjectAccessor.cpp:80
Definition: PreparedStatement.h:158
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:78
WorldSession * GetSession()
Definition: Chat.h:122
void SetSentErrorMessage(bool val)
Definition: Chat.h:118
void PSendSysMessage(char const *fmt, Args &&... args)
Definition: Chat.h:60
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:103
Definition: ObjectAccessor.h:45
std::unordered_map< ObjectGuid, T * > MapType
Definition: ObjectAccessor.h:51

References AT_LOGIN_RESET_PET_TALENTS, AT_LOGIN_RESET_SPELLS, AT_LOGIN_RESET_TALENTS, CHAR_UPD_ALL_AT_LOGIN_FLAGS, CharacterDatabase, ObjectAccessor::GetPlayers(), ChatHandler::GetSession(), LANG_RESETALL_SPELLS, LANG_RESETALL_TALENTS, LANG_RESETALL_UNKNOWN_CASE, ChatHandler::PSendSysMessage(), ChatHandler::SendSysMessage(), PreparedStatementBase::SetData(), ChatHandler::SetSentErrorMessage(), and sWorld.

Referenced by GetCommands().

◆ HandleResetHonorCommand()

static bool reset_commandscript::HandleResetHonorCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
79 {
80 Player* target;
81 if (!handler->extractPlayerTarget((char*)args, &target))
82 return false;
83
84 target->SetHonorPoints(0);
90
91 return true;
92 }
@ PLAYER_FIELD_TODAY_CONTRIBUTION
Definition: UpdateFields.h:375
@ PLAYER_FIELD_KILLS
Definition: UpdateFields.h:374
@ PLAYER_FIELD_YESTERDAY_CONTRIBUTION
Definition: UpdateFields.h:376
@ PLAYER_FIELD_LIFETIME_HONORABLE_KILLS
Definition: UpdateFields.h:377
@ ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL
Definition: DBCEnums.h:225
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: PlayerUpdates.cpp:2128
void SetHonorPoints(uint32 value)
Definition: Player.cpp:6140

References ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL, ChatHandler::extractPlayerTarget(), PLAYER_FIELD_KILLS, PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, PLAYER_FIELD_TODAY_CONTRIBUTION, PLAYER_FIELD_YESTERDAY_CONTRIBUTION, Player::SetHonorPoints(), Object::SetUInt32Value(), and Player::UpdateAchievementCriteria().

Referenced by GetCommands().

◆ HandleResetLevelCommand()

static bool reset_commandscript::HandleResetLevelCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
127 {
128 Player* target;
129 if (!handler->extractPlayerTarget((char*)args, &target))
130 return false;
131
133 return false;
134
135 uint8 oldLevel = target->GetLevel();
136
137 // set starting level
138 uint32 startLevel = target->getClass() != CLASS_DEATH_KNIGHT
139 ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
141
142 target->_ApplyAllLevelScaleItemMods(false);
143 target->SetLevel(startLevel);
144 target->InitRunes();
145 target->InitStatsForLevel(true);
146 target->InitTaxiNodesForLevel();
147 target->InitGlyphsForLevel();
148 target->InitTalentForLevel();
149 target->SetUInt32Value(PLAYER_XP, 0);
150
151 target->_ApplyAllLevelScaleItemMods(true);
152
153 // reset level for pet
154 if (Pet* pet = target->GetPet())
155 pet->SynchronizeLevelWithOwner();
156
157 sScriptMgr->OnPlayerLevelChanged(target, oldLevel);
158
159 return true;
160 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ PLAYER_XP
Definition: UpdateFields.h:339
#define sScriptMgr
Definition: ScriptMgr.h:2702
@ CONFIG_START_HEROIC_PLAYER_LEVEL
Definition: IWorld.h:237
@ CONFIG_START_PLAYER_LEVEL
Definition: IWorld.h:236
@ CLASS_DEATH_KNIGHT
Definition: SharedDefines.h:118
Definition: Pet.h:40
void _ApplyAllLevelScaleItemMods(bool apply)
Definition: Player.cpp:7495
void InitTalentForLevel()
Definition: Player.cpp:2520
void InitGlyphsForLevel()
Definition: Player.cpp:13179
Pet * GetPet() const
Definition: Player.cpp:8784
void InitTaxiNodesForLevel()
Definition: Player.h:1124
void InitStatsForLevel(bool reapplyMods=false)
Definition: Player.cpp:2535
void InitRunes()
Definition: Player.cpp:13347
uint8 getClass() const
Definition: Unit.h:1426
void SetLevel(uint8 lvl, bool showLevelChange=true)
Definition: Unit.cpp:15352
uint8 GetLevel() const
Definition: Unit.h:1420
static bool HandleResetStatsOrLevelHelper(Player *player)
Definition: cs_reset.cpp:94

References Player::_ApplyAllLevelScaleItemMods(), CLASS_DEATH_KNIGHT, CONFIG_START_HEROIC_PLAYER_LEVEL, CONFIG_START_PLAYER_LEVEL, ChatHandler::extractPlayerTarget(), Unit::getClass(), Unit::GetLevel(), Player::GetPet(), HandleResetStatsOrLevelHelper(), Player::InitGlyphsForLevel(), Player::InitRunes(), Player::InitStatsForLevel(), Player::InitTalentForLevel(), Player::InitTaxiNodesForLevel(), PLAYER_XP, Unit::SetLevel(), Object::SetUInt32Value(), sScriptMgr, and sWorld.

Referenced by GetCommands().

◆ HandleResetSpellsCommand()

static bool reset_commandscript::HandleResetSpellsCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
163 {
164 Player* target;
165 ObjectGuid targetGuid;
166 std::string targetName;
167 if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
168 return false;
169
170 if (target)
171 {
172 target->resetSpells(/* bool myClassOnly */);
173
175 if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
176 handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(target).c_str());
177 }
178 else
179 {
182 stmt->SetData(1, targetGuid.GetCounter());
183 CharacterDatabase.Execute(stmt);
184
185 handler->PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, targetName.c_str());
186 }
187
188 return true;
189 }
@ CHAR_UPD_ADD_AT_LOGIN_FLAG
Definition: CharacterDatabase.h:274
@ LANG_RESET_SPELLS_ONLINE
Definition: Language.h:250
@ LANG_RESET_SPELLS_OFFLINE
Definition: Language.h:251
@ LANG_RESET_SPELLS
Definition: Language.h:254
Definition: Chat.h:38
virtual std::string GetNameLink() const
Definition: Chat.h:84
WorldSession * GetSession() const
Definition: Player.h:1948
void resetSpells()
Definition: Player.cpp:11714
Player * GetPlayer() const
Definition: WorldSession.h:361

References AT_LOGIN_RESET_SPELLS, CHAR_UPD_ADD_AT_LOGIN_FLAG, CharacterDatabase, ChatHandler::extractPlayerTarget(), ObjectGuid::GetCounter(), ChatHandler::GetNameLink(), WorldSession::GetPlayer(), ChatHandler::GetSession(), Player::GetSession(), LANG_RESET_SPELLS, LANG_RESET_SPELLS_OFFLINE, LANG_RESET_SPELLS_ONLINE, ChatHandler::PSendSysMessage(), Player::resetSpells(), ChatHandler::SendSysMessage(), and PreparedStatementBase::SetData().

Referenced by GetCommands().

◆ HandleResetStatsCommand()

static bool reset_commandscript::HandleResetStatsCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
192 {
193 Player* target;
194 if (!handler->extractPlayerTarget((char*)args, &target))
195 return false;
196
198 return false;
199
200 target->InitRunes();
201 target->InitStatsForLevel(true);
202 target->InitTaxiNodesForLevel();
203 target->InitGlyphsForLevel();
204 target->InitTalentForLevel();
205
206 return true;
207 }

References ChatHandler::extractPlayerTarget(), HandleResetStatsOrLevelHelper(), Player::InitGlyphsForLevel(), Player::InitRunes(), Player::InitStatsForLevel(), Player::InitTalentForLevel(), and Player::InitTaxiNodesForLevel().

Referenced by GetCommands().

◆ HandleResetStatsOrLevelHelper()

static bool reset_commandscript::HandleResetStatsOrLevelHelper ( Player player)
inlinestatic
95 {
96 ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass());
97 if (!classEntry)
98 {
99 LOG_ERROR("dbc", "Class {} not found in DBC (Wrong DBC files?)", player->getClass());
100 return false;
101 }
102
103 uint8 powerType = classEntry->powerType;
104
105 // reset m_form if no aura
108
109 player->SetFactionForRace(player->getRace());
110
111 player->SetUInt32Value(UNIT_FIELD_BYTES_0, ((player->getRace()) | (player->getClass() << 8) | (player->getGender() << 16) | (powerType << 24)));
112
113 // reset only if player not in some form;
114 if (player->GetShapeshiftForm() == FORM_NONE)
115 player->InitDisplayIds();
116
118
120
121 //-1 is default value
123 return true;
124 }
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
@ UNIT_FIELD_BYTES_0
Definition: UpdateFields.h:95
@ PLAYER_FIELD_WATCHED_FACTION_INDEX
Definition: UpdateFields.h:379
@ UNIT_FIELD_BYTES_2
Definition: UpdateFields.h:161
@ FORM_NONE
Definition: Unit.h:90
@ UNIT_BYTE2_FLAG_PVP
Definition: Unit.h:136
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition: Unit.h:451
@ SPELL_AURA_MOD_SHAPESHIFT
Definition: SpellAuraDefines.h:99
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition: Object.cpp:750
void InitDisplayIds()
Definition: Player.cpp:10514
void SetFactionForRace(uint8 race)
Definition: Player.cpp:5750
uint8 getGender() const
Definition: Unit.h:1428
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:2071
void ReplaceAllUnitFlags(UnitFlags flags)
Definition: Unit.h:1483
uint8 getRace(bool original=false) const
Definition: Unit.cpp:21185
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:5617
void SetShapeshiftForm(ShapeshiftForm form)
Definition: Unit.h:2072
Definition: DBCStructure.h:653
uint32 powerType
Definition: DBCStructure.h:656

References FORM_NONE, Unit::getClass(), Unit::getGender(), Unit::getRace(), Unit::GetShapeshiftForm(), Unit::HasAuraType(), Player::InitDisplayIds(), LOG_ERROR, PLAYER_FIELD_WATCHED_FACTION_INDEX, ChrClassesEntry::powerType, Unit::ReplaceAllUnitFlags(), sChrClassesStore, Object::SetByteValue(), Player::SetFactionForRace(), Unit::SetShapeshiftForm(), Object::SetUInt32Value(), SPELL_AURA_MOD_SHAPESHIFT, UNIT_BYTE2_FLAG_PVP, UNIT_FIELD_BYTES_0, UNIT_FIELD_BYTES_2, and UNIT_FLAG_PLAYER_CONTROLLED.

Referenced by HandleResetLevelCommand(), and HandleResetStatsCommand().

◆ HandleResetTalentsCommand()

static bool reset_commandscript::HandleResetTalentsCommand ( ChatHandler handler,
char const *  args 
)
inlinestatic
210 {
211 Player* target;
212 ObjectGuid targetGuid;
213 std::string targetName;
214 if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
215 {
216 // Try reset talents as Hunter Pet
217 Creature* creature = handler->getSelectedCreature();
218 if (!*args && creature && creature->IsPet())
219 {
220 Unit* owner = creature->GetOwner();
221 if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer()))
222 {
223 creature->ToPet()->resetTalents();
224 owner->ToPlayer()->SendTalentsInfoData(true);
225
227 if (!handler->GetSession() || handler->GetSession()->GetPlayer() != owner->ToPlayer())
228 handler->PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, handler->GetNameLink(owner->ToPlayer()).c_str());
229 }
230 return true;
231 }
232
234 handler->SetSentErrorMessage(true);
235 return false;
236 }
237
238 if (target)
239 {
240 target->resetTalents(true);
241 target->SendTalentsInfoData(false);
243 if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target)
244 handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(target).c_str());
245
246 Pet* pet = target->GetPet();
248 if (pet)
249 target->SendTalentsInfoData(true);
250 return true;
251 }
252 else if (targetGuid)
253 {
256 stmt->SetData(1, targetGuid.GetCounter());
257 CharacterDatabase.Execute(stmt);
258
259 std::string nameLink = handler->playerLink(targetName);
260 handler->PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str());
261 return true;
262 }
263
265 handler->SetSentErrorMessage(true);
266 return false;
267 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ LANG_RESET_TALENTS_OFFLINE
Definition: Language.h:253
@ LANG_RESET_TALENTS_ONLINE
Definition: Language.h:252
@ LANG_RESET_TALENTS
Definition: Language.h:255
@ LANG_RESET_PET_TALENTS_ONLINE
Definition: Language.h:889
@ LANG_NO_CHAR_SELECTED
Definition: Language.h:148
@ LANG_RESET_PET_TALENTS
Definition: Language.h:888
std::string playerLink(std::string const &name) const
Definition: Chat.h:111
Creature * getSelectedCreature() const
Definition: Chat.cpp:337
Definition: Creature.h:46
Player * ToPlayer()
Definition: Object.h:195
TypeID GetTypeId() const
Definition: Object.h:121
bool IsPermanentPetFor(Player *owner) const
Definition: Pet.cpp:2238
static void resetTalentsForAllPetsOf(Player *owner, Pet *online_pet=nullptr)
Definition: Pet.cpp:2100
bool resetTalents()
Definition: Pet.cpp:2022
void SendTalentsInfoData(bool pet)
Definition: Player.cpp:14305
bool resetTalents(bool noResetCost=false)
Definition: Player.cpp:3643
Definition: Unit.h:1290
Unit * GetOwner() const
Definition: Unit.cpp:10560
Pet * ToPet()
Definition: Unit.h:2398
bool IsPet() const
Definition: Unit.h:1413

References AT_LOGIN_RESET_PET_TALENTS, AT_LOGIN_RESET_TALENTS, CHAR_UPD_ADD_AT_LOGIN_FLAG, CharacterDatabase, ChatHandler::extractPlayerTarget(), ObjectGuid::GetCounter(), ChatHandler::GetNameLink(), Unit::GetOwner(), Player::GetPet(), WorldSession::GetPlayer(), ChatHandler::getSelectedCreature(), ChatHandler::GetSession(), Player::GetSession(), Object::GetTypeId(), Pet::IsPermanentPetFor(), Unit::IsPet(), LANG_NO_CHAR_SELECTED, LANG_RESET_PET_TALENTS, LANG_RESET_PET_TALENTS_ONLINE, LANG_RESET_TALENTS, LANG_RESET_TALENTS_OFFLINE, LANG_RESET_TALENTS_ONLINE, ChatHandler::playerLink(), ChatHandler::PSendSysMessage(), Pet::resetTalents(), Player::resetTalents(), Pet::resetTalentsForAllPetsOf(), ChatHandler::SendSysMessage(), Player::SendTalentsInfoData(), PreparedStatementBase::SetData(), ChatHandler::SetSentErrorMessage(), Unit::ToPet(), Object::ToPlayer(), and TYPEID_PLAYER.

Referenced by GetCommands().