diff --git a/sql/mangos.sql b/sql/mangos.sql index be9dc8be9..8e3e149a3 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -365,7 +365,7 @@ INSERT INTO `command` VALUES ('reset spells',3,'Syntax:\r\n.reset spells [Playername]\r\n Removes all non-original spells from spellbook.\r\n. Playername can be name of offline character.'), ('reset stats',3,'Syntax:\r\n.reset stats [Playername]\r\n Resets(recalculate) all stats of the targeted player to their original VALUESat current level.'), ('reset talents',3,'Syntax:\r\n.reset talents [Playername]\r\n Removes all talents of the targeted player. Playername can be name of offline character.'), -('respawn',3,'Syntax: .respawn\r\n\r\nRespawn all nearest creatures and GO without waiting respawn time expiration.'), +('respawn',3,'Syntax: .respawn\r\n\r\nRespawn selected creature or respawn all nearest creatures (if none selected) and GO without waiting respawn time expiration.'), ('revive',3,'Syntax: .revive\r\n\r\nRevive the selected player. If no player is selected, it will revive you.'), ('save',0,'Syntax: .save\r\n\r\nSaves your character.'), ('saveall',1,'Syntax: .saveall\r\n\r\nSave all characters in game.'), diff --git a/sql/updates/2008_10_28_04_mangos_command.sql b/sql/updates/2008_10_28_04_mangos_command.sql new file mode 100644 index 000000000..c1758fc58 --- /dev/null +++ b/sql/updates/2008_10_28_04_mangos_command.sql @@ -0,0 +1,4 @@ +DELETE FROM command WHERE name IN ('respawn'); + +INSERT INTO command VALUES +('respawn',3,'Syntax: .respawn\r\n\r\nRespawn selected creature or respawn all nearest creatures (if none selected) and GO without waiting respawn time expiration.'); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 1703688e8..1829616e2 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -112,6 +112,7 @@ pkgdata_DATA = \ 2008_10_28_01_mangos_mangos_string.sql \ 2008_10_28_02_mangos_mangos_string.sql \ 2008_10_28_03_mangos_command.sql \ + 2008_10_28_04_mangos_command.sql \ README ## Additional files to include when running 'make dist' @@ -205,4 +206,5 @@ EXTRA_DIST = \ 2008_10_28_01_mangos_mangos_string.sql \ 2008_10_28_02_mangos_mangos_string.sql \ 2008_10_28_03_mangos_command.sql \ + 2008_10_28_04_mangos_command.sql \ README diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index cdd22d478..2129c41b1 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -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()));