Use .respawn only for selected creature (if any)

If no creature is selected, old behavior is used (respawn everything).

Thanks Seline for the diff.

Signed-off-by: freghar <compmancz@gmail.com>
(cherry picked from commit 6bbdffac9acb9c02a74be632b35a90f0bda3ccb0)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
Some changes in creature targeting and work in case alive target. Help data updated.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Seline 2008-10-28 01:42:26 +01:00 committed by VladimirMangos
parent e98a123027
commit 4db0c00181
4 changed files with 23 additions and 1 deletions

View file

@ -5315,6 +5315,22 @@ bool ChatHandler::HandleBanListIPCommand(const char* args)
bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
{
Unit* target = getSelectedUnit();
if(target)
{
if(target->GetTypeId()!=TYPEID_UNIT)
{
SendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage(true);
return false;
}
if(target->isDead())
((Creature*)target)->Respawn();
return true;
}
Player* pl = m_session->GetPlayer();
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));