aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNevan <none@none>2009-08-01 12:06:06 +0200
committerNevan <none@none>2009-08-01 12:06:06 +0200
commit03604a25670b9dbbe91537d1af21f2b5a06bbe07 (patch)
treedd96aa88737102ec0888dfd6700aa71c35490944
parent452eb463988cd6f4c39ed9682606995d95826702 (diff)
*Fix Spell 1852 (This is a GM tool for silencing players.)
--HG-- branch : trunk
-rw-r--r--sql/FULL/world_trinity_string_full.sql1
-rw-r--r--sql/updates/4704_world_trinity_string.sql1
-rw-r--r--src/game/ChatHandler.cpp18
-rw-r--r--src/game/Language.h2
-rw-r--r--src/game/SpellMgr.cpp1
5 files changed, 23 insertions, 0 deletions
diff --git a/sql/FULL/world_trinity_string_full.sql b/sql/FULL/world_trinity_string_full.sql
index c8a7a6883a6..aef32a5950c 100644
--- a/sql/FULL/world_trinity_string_full.sql
+++ b/sql/FULL/world_trinity_string_full.sql
@@ -735,6 +735,7 @@ INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `conte
(6613, '|cfff00000[GM Announcement]: %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6614, 'Notification to GM''s - ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(6616, 'Silence is ON for %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(7523, 'WORLD: Denying connections.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(7524, 'WORLD: Accepting connections.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10001, 'The Horde has taken The Overlook!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
diff --git a/sql/updates/4704_world_trinity_string.sql b/sql/updates/4704_world_trinity_string.sql
new file mode 100644
index 00000000000..5b0939c0e99
--- /dev/null
+++ b/sql/updates/4704_world_trinity_string.sql
@@ -0,0 +1 @@
+INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES ('6616','Silence is ON for %s');
diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp
index ae9da2d9fe5..0b38c3aaa0a 100644
--- a/src/game/ChatHandler.cpp
+++ b/src/game/ChatHandler.cpp
@@ -155,6 +155,18 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
GetPlayer()->UpdateSpeakTime();
}
+ if (GetPlayer()->HasAura(1852) && type != CHAT_MSG_WHISPER)
+ {
+ std::string msg="";
+ recv_data >> msg;
+
+ if (ChatHandler(this).ParseCommands(msg.c_str()) == 0)
+ {
+ SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName());
+ return;
+ }
+ }
+
switch(type)
{
case CHAT_MSG_SAY:
@@ -231,6 +243,12 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
}
}
+ if (GetPlayer()->HasAura(1852) && !player->isGameMaster())
+ {
+ SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName());
+ return;
+ }
+
GetPlayer()->Whisper(msg, lang,player->GetGUID());
} break;
diff --git a/src/game/Language.h b/src/game/Language.h
index 215c160b5bc..20fae7a7166 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -870,6 +870,8 @@ enum TrinityStrings
LANG_GM_NOTIFY = 6614,
LANG_GM_ANNOUNCE_COLOR = 6615,
+ LANG_GM_SILENCE = 6616, // "Silence is ON for %s" - Spell 1852
+
LANG_WORLD_CLOSED = 7523,
LANG_WORLD_OPENED = 7524,
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index a4a7b03ba6e..4ffd1263149 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -710,6 +710,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
switch(spellId)
{
+ case 1852: // Silenced (GM)
case 46392: // Focused Assault
case 46393: // Brutal Assault
case 28441: // not positive dummy spell