mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10244] Implement .stable gm command for open pet stable anywhere.
Maybe command not so useful for stable case because spell can be learned, but it example how can be packet allowed depndent from player possibility when some functionality base at many packets recieved from client. Same way possible can be used for auction anywhere, maybe some other cases. Also it will very usefull for 2.x/1.x branches where no another way... ;)
This commit is contained in:
parent
62e0e020a0
commit
40ec688b2c
10 changed files with 24 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_10237_01_mangos_spell_bonus_data` bit(1) default NULL
|
`required_10244_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';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -766,6 +766,7 @@ INSERT INTO `command` VALUES
|
||||||
('server shutdown cancel',3,'Syntax: .server shutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
|
('server shutdown cancel',3,'Syntax: .server shutdown cancel\r\n\r\nCancel the restart/shutdown timer if any.'),
|
||||||
('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'),
|
('setskill',3,'Syntax: .setskill #skill #level [#max]\r\n\r\nSet a skill of id #skill with a current skill value of #level and a maximum value of #max (or equal current maximum if not provide) for the selected character. If no character is selected, you learn the skill.'),
|
||||||
('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'),
|
('showarea',3,'Syntax: .showarea #areaid\r\n\r\nReveal the area of #areaid to the selected character. If no character is selected, reveal this area to you.'),
|
||||||
|
('stable',3,'Syntax: .stable\r\n\r\nShow your pet stable.'),
|
||||||
('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'),
|
('start',0,'Syntax: .start\r\n\r\nTeleport you to the starting area of your character.'),
|
||||||
('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'),
|
('taxicheat',1,'Syntax: .taxicheat on/off\r\n\r\nTemporary grant access or remove to all taxi routes for the selected character. If no character is selected, hide or reveal all routes to you.\r\n\r\nVisited taxi nodes sill accessible after removing access.'),
|
||||||
('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'),
|
('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.'),
|
||||||
|
|
|
||||||
5
sql/updates/10244_01_mangos_command.sql
Normal file
5
sql/updates/10244_01_mangos_command.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_10237_01_mangos_spell_bonus_data required_10244_01_mangos_command bit;
|
||||||
|
|
||||||
|
DELETE FROM command WHERE name = 'stable';
|
||||||
|
INSERT INTO command (name, security, help) VALUES
|
||||||
|
('stable',3,'Syntax: .stable\r\n\r\nShow your pet stable.');
|
||||||
|
|
@ -119,6 +119,7 @@ pkgdata_DATA = \
|
||||||
10219_01_mangos_spell_proc_event.sql \
|
10219_01_mangos_spell_proc_event.sql \
|
||||||
10223_01_mangos_spell_proc_event.sql \
|
10223_01_mangos_spell_proc_event.sql \
|
||||||
10237_01_mangos_spell_bonus_data.sql \
|
10237_01_mangos_spell_bonus_data.sql \
|
||||||
|
10244_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -218,4 +219,5 @@ EXTRA_DIST = \
|
||||||
10219_01_mangos_spell_proc_event.sql \
|
10219_01_mangos_spell_proc_event.sql \
|
||||||
10223_01_mangos_spell_proc_event.sql \
|
10223_01_mangos_spell_proc_event.sql \
|
||||||
10237_01_mangos_spell_bonus_data.sql \
|
10237_01_mangos_spell_bonus_data.sql \
|
||||||
|
10244_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -701,6 +701,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
|
{ "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
|
||||||
{ "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
{ "flusharenapoints",SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
|
||||||
{ "repairitems", SEC_GAMEMASTER, true, &ChatHandler::HandleRepairitemsCommand, "", NULL },
|
{ "repairitems", SEC_GAMEMASTER, true, &ChatHandler::HandleRepairitemsCommand, "", NULL },
|
||||||
|
{ "stable", SEC_ADMINISTRATOR, false, &ChatHandler::HandleStableCommand, "", NULL },
|
||||||
{ "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCommand, "", NULL },
|
{ "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCommand, "", NULL },
|
||||||
{ "quit", SEC_CONSOLE, true, &ChatHandler::HandleQuitCommand, "", NULL },
|
{ "quit", SEC_CONSOLE, true, &ChatHandler::HandleQuitCommand, "", NULL },
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -525,6 +525,7 @@ class ChatHandler
|
||||||
bool HandleCombatStopCommand(const char *args);
|
bool HandleCombatStopCommand(const char *args);
|
||||||
bool HandleFlushArenaPointsCommand(const char *args);
|
bool HandleFlushArenaPointsCommand(const char *args);
|
||||||
bool HandleRepairitemsCommand(const char* args);
|
bool HandleRepairitemsCommand(const char* args);
|
||||||
|
bool HandleStableCommand(const char* args);
|
||||||
bool HandleWaterwalkCommand(const char* args);
|
bool HandleWaterwalkCommand(const char* args);
|
||||||
bool HandleQuitCommand(const char* args);
|
bool HandleQuitCommand(const char* args);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4144,6 +4144,13 @@ bool ChatHandler::HandleBankCommand(const char* /*args*/)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleStableCommand(const char* /*args*/)
|
||||||
|
{
|
||||||
|
m_session->SendStablePet(m_session->GetPlayer()->GetGUID());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleChangeWeather(const char* args)
|
bool ChatHandler::HandleChangeWeather(const char* args)
|
||||||
{
|
{
|
||||||
if(!*args)
|
if(!*args)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
#include "Guild.h"
|
#include "Guild.h"
|
||||||
|
#include "Chat.h"
|
||||||
|
|
||||||
enum StableResultCode
|
enum StableResultCode
|
||||||
{
|
{
|
||||||
|
|
@ -545,7 +546,8 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid)
|
||||||
// spell case or GM
|
// spell case or GM
|
||||||
if (guid == GetPlayer()->GetObjectGuid())
|
if (guid == GetPlayer()->GetObjectGuid())
|
||||||
{
|
{
|
||||||
if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
|
// command case will return only if player have real access to command
|
||||||
|
if (!GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE) && !ChatHandler(GetPlayer()).FindCommand("stable"))
|
||||||
{
|
{
|
||||||
DEBUG_LOG("%s attempt open stable in cheating way.", guid.GetString().c_str());
|
DEBUG_LOG("%s attempt open stable in cheating way.", guid.GetString().c_str());
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ class MANGOS_DLL_SPEC WorldSession
|
||||||
|
|
||||||
//pet
|
//pet
|
||||||
void SendPetNameQuery(uint64 guid, uint32 petnumber);
|
void SendPetNameQuery(uint64 guid, uint32 petnumber);
|
||||||
void SendStablePet(ObjectGuid guid );
|
void SendStablePet(ObjectGuid guid);
|
||||||
void SendStableResult(uint8 res);
|
void SendStableResult(uint8 res);
|
||||||
bool CheckStableMaster(ObjectGuid guid);
|
bool CheckStableMaster(ObjectGuid guid);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10243"
|
#define REVISION_NR "10244"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_10160_02_characters_pet_aura"
|
#define REVISION_DB_CHARACTERS "required_10160_02_characters_pet_aura"
|
||||||
#define REVISION_DB_MANGOS "required_10237_01_mangos_spell_bonus_data"
|
#define REVISION_DB_MANGOS "required_10244_01_mangos_command"
|
||||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue