Permalink
Browse files

[p1] New Announce System (by me)

  • Loading branch information...
kicho committed Jul 13, 2010
1 parent e43c1d9 commit 6575478b3e02c1ec898c64b480341641a5643552
Showing with 59 additions and 5 deletions.
  1. +7 −0 sql/CUSTOM/1_mangos_announce_system.sql
  2. +2 −1 src/game/Chat.cpp
  3. +1 −0 src/game/Chat.h
  4. +7 −1 src/game/Language.h
  5. +39 −2 src/game/Level1.cpp
  6. +3 −1 src/shared/Common.h
@@ -0,0 +1,7 @@
INSERT INTO `mangos_string` VALUES
(65,'|c1f40af20 <Mod>|cffff0000[%s]|c1f40af20 announce:|cffffff00 %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(66,'|c1f40af20 <GM>|cffff0000[%s]|c1f40af20 announce:|cffffff00 %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(67,'|c1f40af20 <Admin>|cffff0000[%s]|c1f40af20 announce:|cffffff00 %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(68,'|c1f40af20 <Dev>|cffff0000[%s]|c1f40af20 announce:|cffffff00 %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(69,'|cffffcc00 <Owner>|cffff0000[%s]|c1f40af20 announce:|cffffff00 %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(70,'|cffffff00 <SERVER> announcement:|cffffff00 %s|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
View
@@ -646,7 +646,8 @@ ChatCommand * ChatHandler::getCommandTable()
{ "aura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAuraCommand, "", NULL },
{ "unaura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnAuraCommand, "", NULL },
{ "announce", SEC_MODERATOR, true, &ChatHandler::HandleAnnounceCommand, "", NULL },
{ "announce", SEC_MODERATOR, false, &ChatHandler::HandleAnnounceCommand, "", NULL },
{ "system", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSystemCommand, "", NULL },
{ "notify", SEC_MODERATOR, true, &ChatHandler::HandleNotifyCommand, "", NULL },
{ "goname", SEC_MODERATOR, false, &ChatHandler::HandleGonameCommand, "", NULL },
{ "namego", SEC_MODERATOR, false, &ChatHandler::HandleNamegoCommand, "", NULL },
View
@@ -466,6 +466,7 @@ class ChatHandler
bool HandleGroupgoCommand(const char* args);
bool HandleRecallCommand(const char* args);
bool HandleAnnounceCommand(const char* args);
bool HandleSystemCommand(const char* args);
bool HandleNotifyCommand(const char* args);
bool HandleGPSCommand(const char* args);
bool HandleTaxiCheatCommand(const char* args);
View
@@ -88,7 +88,13 @@ enum MangosStrings
LANG_RA_PASS = 62,
LANG_GM_ACCEPTS_WHISPER = 63,
LANG_GM_NO_WHISPER = 64,
// Room for more level 0 65-99 not used
LANG_SYSTEMMESSAGE_MODERATOR = 65,
LANG_SYSTEMMESSAGE_GAMEMASTER = 66,
LANG_SYSTEMMESSAGE_ADMINISTRATOR = 67,
LANG_SYSTEMMESSAGE_DEVELOPER = 68,
LANG_SYSTEMMESSAGE_OWNER = 69,
LANG_SYSTEMMESSAGE_CONSOLE = 70,
// Room for more level 0 70-99 not used
// level 1 chat
LANG_GLOBAL_NOTIFY = 100,
View
@@ -123,8 +123,8 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
}
//----------------------------------------------------------
// global announce
bool ChatHandler::HandleAnnounceCommand(const char* args)
// Administrator System Message .system
bool ChatHandler::HandleSystemCommand(const char* args)
{
if(!*args)
return false;
@@ -133,6 +133,43 @@ bool ChatHandler::HandleAnnounceCommand(const char* args)
return true;
}
// Moderator .announce Command with colored name and GM rank
bool ChatHandler::HandleAnnounceCommand(const char* args)
{
int32 strid = 0;
if(!*args)
return false;
switch(m_session->GetSecurity())
{
case SEC_MODERATOR:
strid = LANG_SYSTEMMESSAGE_MODERATOR;
break;
case SEC_GAMEMASTER:
strid = LANG_SYSTEMMESSAGE_GAMEMASTER;
break;
case SEC_ADMINISTRATOR:
strid = LANG_SYSTEMMESSAGE_ADMINISTRATOR;
break;
case SEC_DEVELOPER:
strid = LANG_SYSTEMMESSAGE_DEVELOPER;
break;
case SEC_OWNER:
strid = LANG_SYSTEMMESSAGE_OWNER;
break;
case SEC_CONSOLE:
strid = LANG_SYSTEMMESSAGE_CONSOLE;
break;
default:
return false;
}
sWorld.SendWorldText(strid, m_session->GetPlayerName(), args);
return true;
}
//notification player at the screen
bool ChatHandler::HandleNotifyCommand(const char* args)
{
View
@@ -177,7 +177,9 @@ enum AccountTypes
SEC_MODERATOR = 1,
SEC_GAMEMASTER = 2,
SEC_ADMINISTRATOR = 3,
SEC_CONSOLE = 4 // must be always last in list, accounts must have less security level always also
SEC_DEVELOPER = 4,
SEC_OWNER = 5,
SEC_CONSOLE = 6 // must be always last in list, accounts must have less security level always also
};
// Used in mangosd/realmd

0 comments on commit 6575478

Please sign in to comment.