mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
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:
parent
e98a123027
commit
4db0c00181
4 changed files with 23 additions and 1 deletions
|
|
@ -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.'),
|
||||
|
|
|
|||
4
sql/updates/2008_10_28_04_mangos_command.sql
Normal file
4
sql/updates/2008_10_28_04_mangos_command.sql
Normal file
|
|
@ -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.');
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue