mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[7693] Allow use .revive command in console, support revive offline players.
This commit is contained in:
parent
35970244e5
commit
1b09aab42b
3 changed files with 21 additions and 10 deletions
|
|
@ -570,7 +570,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
|||
{ "commands", SEC_PLAYER, true, &ChatHandler::HandleCommandsCommand, "", NULL },
|
||||
{ "demorph", SEC_GAMEMASTER, false, &ChatHandler::HandleDeMorphCommand, "", NULL },
|
||||
{ "die", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDieCommand, "", NULL },
|
||||
{ "revive", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReviveCommand, "", NULL },
|
||||
{ "revive", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReviveCommand, "", NULL },
|
||||
{ "dismount", SEC_PLAYER, false, &ChatHandler::HandleDismountCommand, "", NULL },
|
||||
{ "gps", SEC_MODERATOR, false, &ChatHandler::HandleGPSCommand, "", NULL },
|
||||
{ "guid", SEC_GAMEMASTER, false, &ChatHandler::HandleGUIDCommand, "", NULL },
|
||||
|
|
|
|||
|
|
@ -3439,33 +3439,44 @@ bool ChatHandler::HandleModifyArenaCommand(const char * args)
|
|||
|
||||
bool ChatHandler::HandleReviveCommand(const char* args)
|
||||
{
|
||||
Player* SelectedPlayer = NULL;
|
||||
Player* player = NULL;
|
||||
uint32 player_guid = 0;
|
||||
|
||||
if (*args)
|
||||
{
|
||||
std::string name = extractPlayerNameFromLink((char*)args);
|
||||
if(name.empty())
|
||||
if (name.empty())
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
SelectedPlayer = objmgr.GetPlayer(name.c_str());
|
||||
player = objmgr.GetPlayer(name.c_str());
|
||||
if (!player)
|
||||
player_guid = objmgr.GetPlayerGUIDByName(name);
|
||||
}
|
||||
else
|
||||
SelectedPlayer = getSelectedPlayer();
|
||||
player = getSelectedPlayer();
|
||||
|
||||
if(!SelectedPlayer)
|
||||
if (player)
|
||||
{
|
||||
player->ResurrectPlayer(0.5f);
|
||||
player->SpawnCorpseBones();
|
||||
player->SaveToDB();
|
||||
}
|
||||
else if (player_guid)
|
||||
{
|
||||
// will resurrected at login without corpse
|
||||
ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
SelectedPlayer->ResurrectPlayer(0.5f);
|
||||
SelectedPlayer->SpawnCorpseBones();
|
||||
SelectedPlayer->SaveToDB();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7692"
|
||||
#define REVISION_NR "7693"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue