aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_trinity_string_full.sql1
-rw-r--r--sql/updates/5776_world_command.sql7
-rw-r--r--src/game/Chat.cpp1
-rw-r--r--src/game/Chat.h1
-rw-r--r--src/game/Language.h3
-rw-r--r--src/game/Level0.cpp19
6 files changed, 31 insertions, 1 deletions
diff --git a/sql/FULL/world_trinity_string_full.sql b/sql/FULL/world_trinity_string_full.sql
index 909af8ee507..f93440316bf 100644
--- a/sql/FULL/world_trinity_string_full.sql
+++ b/sql/FULL/world_trinity_string_full.sql
@@ -62,6 +62,7 @@ INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `conte
(58, 'Using script library: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(59, 'Using creature EventAI: %s', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(60, 'Online players: %u (max: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(61, 'Up to %u expansion allowed now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(100, 'Global notify: ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(101, 'Map: %u (%s) Zone: %u (%s) Area: %u (%s) Phase: %u\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: %f\nGroundZ: %f FloorZ: %f Have height data (Map: %u VMap: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(102, '%s is already being teleported.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
diff --git a/sql/updates/5776_world_command.sql b/sql/updates/5776_world_command.sql
new file mode 100644
index 00000000000..516dad98d3a
--- /dev/null
+++ b/sql/updates/5776_world_command.sql
@@ -0,0 +1,7 @@
+
+DELETE FROM `command` WHERE `name` = 'account addon';
+INSERT INTO `command` (`name`, `security`, `help`) VALUES ('account addon', 3, 'Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.');
+
+DELETE FROM `trinity_string` WHERE `entry`=61;
+INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES
+(61, 'Up to %u expansion allowed now.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 0318dedb8b7..32233aae5a9 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -74,6 +74,7 @@ ChatCommand * ChatHandler::getCommandTable()
static ChatCommand accountCommandTable[] =
{
+ { "addon", SEC_PLAYER, false, &ChatHandler::HandleAccountAddonCommand, "", NULL },
{ "create", SEC_CONSOLE, true, &ChatHandler::HandleAccountCreateCommand, "", NULL },
{ "delete", SEC_CONSOLE, true, &ChatHandler::HandleAccountDeleteCommand, "", NULL },
{ "onlinelist", SEC_CONSOLE, true, &ChatHandler::HandleAccountOnlineListCommand, "", NULL },
diff --git a/src/game/Chat.h b/src/game/Chat.h
index 252c198300b..1518cb6d45e 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -101,6 +101,7 @@ class TRINITY_DLL_SPEC ChatHandler
bool ShowHelpForSubCommands(ChatCommand *table, char const* cmd, char const* subcmd);
bool HandleAccountCommand(const char* args);
+ bool HandleAccountAddonCommand(const char* args);
bool HandleAccountCreateCommand(const char* args);
bool HandleAccountDeleteCommand(const char* args);
bool HandleAccountLockCommand(const char* args);
diff --git a/src/game/Language.h b/src/game/Language.h
index 048ba69bb43..e38d58f109e 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -86,7 +86,8 @@ enum TrinityStrings
LANG_USING_SCRIPT_LIB = 58,
LANG_USING_EVENT_AI = 59,
LANG_CONNECTED_PLAYERS = 60,
- // Room for more level 0 61-99 not used
+ LANG_ACCOUNT_ADDON = 61,
+ // Room for more level 0 62-99 not used
// level 1 chat
LANG_GLOBAL_NOTIFY = 100,
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index 1efd3f2ce7a..95e35475cc1 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -234,6 +234,25 @@ bool ChatHandler::HandleAccountPasswordCommand(const char* args)
return true;
}
+bool ChatHandler::HandleAccountAddonCommand(const char* args)
+{
+ if(!*args)
+ return false;
+
+ char *szExp = strtok((char*)args," ");
+
+ uint32 account_id = m_session->GetAccountId();
+
+ int lev=atoi(szExp); //get int anyway (0 if error)
+ if(lev < 0)
+ return false;
+
+ // No SQL injection
+ loginDatabase.PExecute("UPDATE account SET expansion = '%d' WHERE id = '%u'",lev,account_id);
+ PSendSysMessage(LANG_ACCOUNT_ADDON,lev);
+ return true;
+}
+
bool ChatHandler::HandleAccountLockCommand(const char* args)
{
if (!*args)