mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7290] Command .npc setdeathstate on/off.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
25a57cca18
commit
74fdc7bee7
8 changed files with 45 additions and 2 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
DROP TABLE IF EXISTS `db_version`;
|
DROP TABLE IF EXISTS `db_version`;
|
||||||
CREATE TABLE `db_version` (
|
CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`required_7252_02_mangos_mangos_string` bit(1) default NULL
|
`required_7290_01_mangos_command` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -401,6 +401,7 @@ INSERT INTO `command` VALUES
|
||||||
('npc name',2,'Syntax: .npc name $name\r\n\r\nChange the name of the selected creature or character to $name.\r\n\r\nCommand disabled.'),
|
('npc name',2,'Syntax: .npc name $name\r\n\r\nChange the name of the selected creature or character to $name.\r\n\r\nCommand disabled.'),
|
||||||
('npc phase',3,'Syntax: .npc phase #phasemask\r\n\r\nSelected unit or pet phasemask changed to #phasemask with related world vision update for players. In creature case state saved to DB and persistent. In pet case change active until in game phase changed for owner, owner re-login, or GM-mode enable/disable..'),
|
('npc phase',3,'Syntax: .npc phase #phasemask\r\n\r\nSelected unit or pet phasemask changed to #phasemask with related world vision update for players. In creature case state saved to DB and persistent. In pet case change active until in game phase changed for owner, owner re-login, or GM-mode enable/disable..'),
|
||||||
('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'),
|
('npc playemote',3,'Syntax: .npc playemote #emoteid\r\n\r\nMake the selected creature emote with an emote of id #emoteid.'),
|
||||||
|
('npc setdeathstate',2,'Syntax: .npc setdeathstate on/off\r\n\r\nSet default death state (dead/alive) for npc at spawn.'),
|
||||||
('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'),
|
('npc setmodel',2,'Syntax: .npc setmodel #displayid\r\n\r\nChange the model id of the selected creature to #displayid.'),
|
||||||
('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'),
|
('npc setmovetype',2,'Syntax: .npc setmovetype [#creature_guid] stay/random/way [NODEL]\r\n\r\nSet for creature pointed by #creature_guid (or selected if #creature_guid not provided) movement type and move it to respawn position (if creature alive). Any existing waypoints for creature will be removed from the database if you do not use NODEL. If the creature is dead then movement type will applied at creature respawn.\r\nMake sure you use NODEL, if you want to keep the waypoints.'),
|
||||||
('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'),
|
('npc spawndist',2,'Syntax: .npc spawndist #dist\r\n\r\nAdjust spawndistance of selected creature to dist.'),
|
||||||
|
|
|
||||||
5
sql/updates/7290_01_mangos_command.sql
Normal file
5
sql/updates/7290_01_mangos_command.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_7252_02_mangos_mangos_string required_7290_01_mangos_command bit;
|
||||||
|
|
||||||
|
DELETE FROM `command` WHERE `name` = 'npc setdeathstate';
|
||||||
|
INSERT INTO `command` VALUES
|
||||||
|
('npc setdeathstate',2,'Syntax: .npc setdeathstate on/off\r\n\r\nSet default death state (dead/alive) for npc at spawn.');
|
||||||
|
|
@ -176,6 +176,7 @@ pkgdata_DATA = \
|
||||||
7252_02_mangos_mangos_string.sql \
|
7252_02_mangos_mangos_string.sql \
|
||||||
7255_01_characters_characters.sql \
|
7255_01_characters_characters.sql \
|
||||||
7267_01_characters_auctionhouse.sql \
|
7267_01_characters_auctionhouse.sql \
|
||||||
|
7290_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -332,4 +333,5 @@ EXTRA_DIST = \
|
||||||
7252_02_mangos_mangos_string.sql \
|
7252_02_mangos_mangos_string.sql \
|
||||||
7255_01_characters_characters.sql \
|
7255_01_characters_characters.sql \
|
||||||
7267_01_characters_auctionhouse.sql \
|
7267_01_characters_auctionhouse.sql \
|
||||||
|
7290_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -439,6 +439,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL },
|
{ "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL },
|
||||||
{ "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
|
{ "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
|
||||||
{ "tame", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcTameCommand, "", NULL },
|
{ "tame", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcTameCommand, "", NULL },
|
||||||
|
{ "setdeathstate", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetDeathStateCommand, "", NULL },
|
||||||
|
|
||||||
//{ TODO: fix or remove this commands
|
//{ TODO: fix or remove this commands
|
||||||
{ "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL },
|
{ "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL },
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ class ChatHandler
|
||||||
bool HandleNpcUnFollowCommand(const char* args);
|
bool HandleNpcUnFollowCommand(const char* args);
|
||||||
bool HandleNpcWhisperCommand(const char* args);
|
bool HandleNpcWhisperCommand(const char* args);
|
||||||
bool HandleNpcYellCommand(const char* args);
|
bool HandleNpcYellCommand(const char* args);
|
||||||
|
bool HandleNpcSetDeathStateCommand(const char* args);
|
||||||
|
|
||||||
bool HandleReloadAllCommand(const char* args);
|
bool HandleReloadAllCommand(const char* args);
|
||||||
bool HandleReloadAllAreaCommand(const char* args);
|
bool HandleReloadAllAreaCommand(const char* args);
|
||||||
|
|
|
||||||
|
|
@ -608,6 +608,8 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
||||||
|
|
||||||
uint32 GetGlobalCooldown() const { return m_GlobalCooldown; }
|
uint32 GetGlobalCooldown() const { return m_GlobalCooldown; }
|
||||||
|
|
||||||
|
void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
||||||
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
|
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
|
||||||
|
|
|
||||||
|
|
@ -4301,3 +4301,34 @@ bool ChatHandler::HandleGOPhaseCommand(const char* args)
|
||||||
obj->SaveToDB();
|
obj->SaveToDB();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleNpcSetDeathStateCommand(const char* args)
|
||||||
|
{
|
||||||
|
if (!*args)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Creature* pCreature = getSelectedCreature();
|
||||||
|
if(!pCreature || pCreature->isPet())
|
||||||
|
{
|
||||||
|
SendSysMessage(LANG_SELECT_CREATURE);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strncmp(args, "on", 3) == 0)
|
||||||
|
pCreature->SetDeadByDefault(true);
|
||||||
|
else if (strncmp(args, "off", 4) == 0)
|
||||||
|
pCreature->SetDeadByDefault(false);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendSysMessage(LANG_USE_BOL);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pCreature->SaveToDB();
|
||||||
|
pCreature->Respawn();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7289"
|
#define REVISION_NR "7290"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue