[2008_10_29_01_mangos_string.sql 2008_10_29_02_mangos_command.sql] Added new command: .waterwalk on/off - disable or enable waterwalk mode

for selected player

Signed-off-by: dythzer <micke223@gmail.com>

Add help text and mangos strings.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
dythzer 2008-10-26 17:58:08 +01:00 committed by VladimirMangos
parent 9534aece0b
commit 67779b76b7
8 changed files with 52 additions and 2 deletions

View file

@ -397,6 +397,7 @@ INSERT INTO `command` VALUES
('unban ip',3,'Syntax is: unban ip $Ip\r\nUnban accounts for IP pattern.'),
('unlearn',3,'Syntax: .unlearn #startspell #endspell\r\n\r\nUnlearn for selected player the range of spells between id #startspell and #endspell. If no #endspell is provided, just unlearn spell of id #startspell.'),
('unmute',1,'Syntax: .unmute $playerName\r\n\r\nRestore chat messaging for any character from account of character $playerName.'),
('waterwalk',3,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player.'),
('wchange',3,'Syntax: .wchange #weathertype #status\r\n\r\nSet current weather to #weathertype with an intensity of #status.\r\n\r\n#weathertype can be 1 for rain, 2 for snow, and 3 for sand. #status can be 0 for disabled, and 1 for enabled.'),
('whispers',1,'Syntax: .whispers on|off\r\nEnable/disable accepting whispers by GM from players. By default use mangosd.conf setting.'),
('wp',2,'Using WP Command:\r\nEach Waypoint Command has it\'s own description!'),
@ -2406,6 +2407,8 @@ INSERT INTO `mangos_string` VALUES
(335,'GM Chat Badge is OFF',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(336,'You repair all %s''s items.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(337,'All your items repaired by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(338,'You set waterwalk mode %s for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(339,'Yor waterwalk mode %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(401,'You change security level of account %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),

View file

@ -0,0 +1,5 @@
DELETE FROM mangos_string WHERE entry IN (338,339);
INSERT INTO mangos_string VALUES
(338,'You set waterwalk mode %s for %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(339,'Your waterwalk mode %s by %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

View file

@ -0,0 +1,4 @@
DELETE FROM command WHERE name IN ('waterwalk');
INSERT INTO command VALUES
('waterwalk',3,'Syntax: .waterwalk on/off\r\n\r\nSet on/off waterwalk state for selected player.');

View file

@ -113,6 +113,8 @@ pkgdata_DATA = \
2008_10_28_02_mangos_mangos_string.sql \
2008_10_28_03_mangos_command.sql \
2008_10_28_04_mangos_command.sql \
2008_10_29_01_mangos_mangos_string.sql \
2008_10_29_02_mangos_command.sql \
README
## Additional files to include when running 'make dist'
@ -207,4 +209,6 @@ EXTRA_DIST = \
2008_10_28_02_mangos_mangos_string.sql \
2008_10_28_03_mangos_command.sql \
2008_10_28_04_mangos_command.sql \
2008_10_29_01_mangos_mangos_string.sql \
2008_10_29_02_mangos_command.sql \
README

View file

@ -528,6 +528,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "chardelete", SEC_CONSOLE, true, &ChatHandler::HandleCombatStopCommand, "", NULL },
{ "sendmessage", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
{ "repairitems", SEC_GAMEMASTER, false, &ChatHandler::HandleRepairitemsCommand, "", NULL },
{ "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};

View file

@ -407,6 +407,7 @@ class ChatHandler
bool HandleCombatStopCommand(const char *args);
bool HandleSendMessageCommand(const char * args);
bool HandleRepairitemsCommand(const char* args);
bool HandleWaterwalkCommand(const char* args);
//! Development Commands
bool HandleSetValue(const char* args);

View file

@ -319,7 +319,9 @@ enum MangosStrings
LANG_GM_CHAT_OFF = 335,
LANG_YOU_REPAIR_ITEMS = 336,
LANG_YOUR_ITEMS_REPAIRED = 337,
// Room for more level 2 338-399 not used
LANG_YOU_SET_WATERWALK = 338,
LANG_YOUR_WATERWALK_SET = 339,
// Room for more level 2 340-399 not used
// level 3 chat
LANG_SCRIPTS_RELOADED = 400,

View file

@ -4057,7 +4057,7 @@ bool ChatHandler::HandleRepairitemsCommand(const char* args)
PSendSysMessage(LANG_NO_CHAR_SELECTED);
SetSentErrorMessage(true);
return false;
}
}
// Repair items
target->DurabilityRepairAll(false, 0, false);
@ -4067,3 +4067,33 @@ bool ChatHandler::HandleRepairitemsCommand(const char* args)
ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetName());
return true;
}
bool ChatHandler::HandleWaterwalkCommand(const char* args)
{
if(!*args)
return false;
Player *player = getSelectedPlayer();
if(!player)
{
PSendSysMessage(LANG_NO_CHAR_SELECTED);
SetSentErrorMessage(true);
return false;
}
if (strncmp(args, "on", 3) == 0)
player->SetMovement(MOVE_WATER_WALK); // ON
else if (strncmp(args, "off", 4) == 0)
player->SetMovement(MOVE_LAND_WALK); // OFF
else
{
SendSysMessage(LANG_USE_BOL);
return false;
}
PSendSysMessage(LANG_YOU_SET_WATERWALK, args, player->GetName());
if(needReportToTarget(player))
ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetName());
return true;
}