aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorkaelima <jeppo_meyer@msn.com>2011-06-28 13:05:15 +0200
committerkaelima <jeppo_meyer@msn.com>2011-06-28 13:05:15 +0200
commit142943d4c148580b686b6afaa989838daba50c95 (patch)
tree06597e8c26e6882720bb86e31f0634d72c3945de /src/server/scripts/Commands
parenta5493c14a90b9c5f2bd8d730bfd59b98c0f13013 (diff)
This reverts commit f580cddc09c9c08d91a7b45a2999a822465e9c23.
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/CMakeLists.txt1
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp180
2 files changed, 0 insertions, 181 deletions
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt
index bf86ada75f9..809e78204f4 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/src/server/scripts/Commands/CMakeLists.txt
@@ -12,7 +12,6 @@ set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
Commands/cs_account.cpp
Commands/cs_achievement.cpp
- Commands/cs_bf.cpp
Commands/cs_gm.cpp
Commands/cs_npc.cpp
Commands/cs_go.cpp
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
deleted file mode 100644
index 76e6665f0b4..00000000000
--- a/src/server/scripts/Commands/cs_bf.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-Name: bf_commandscript
-%Complete: 100
-Comment: All bf related commands
-Category: commandscripts
-EndScriptData */
-
-#include "ScriptMgr.h"
-#include "Chat.h"
-#include "BattlefieldMgr.h"
-
-class bf_commandscript : public CommandScript
-{
-public:
- bf_commandscript() : CommandScript("bf_commandscript") { }
-
- ChatCommand* GetCommands() const
- {
- static ChatCommand battlefieldcommandTable[] =
- {
- { "start", SEC_ADMINISTRATOR, false, &HandleBattlefieldStart, "", NULL },
- { "stop", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnd, "", NULL },
- { "switch", SEC_ADMINISTRATOR, false, &HandleBattlefieldSwitch, "", NULL },
- { "timer", SEC_ADMINISTRATOR, false, &HandleBattlefieldTimer, "", NULL },
- { "enable", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnable, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- static ChatCommand commandTable[] =
- {
- { "bf", SEC_ADMINISTRATOR, false, NULL, "", battlefieldcommandTable },
- { NULL, 0, false, NULL, "", NULL }
- };
- return commandTable;
- }
-
- static bool HandleBattlefieldStart(ChatHandler* handler, const char* args)
- {
- uint32 battleid = 0;
- char* battleid_str = strtok((char*)args, " ");
- if (!battleid_str)
- return false;
-
- battleid = atoi(battleid_str);
-
- Battlefield* bf = sBattlefieldMgr.GetBattlefieldByBattleId(battleid);
-
- if (!bf)
- return false;
-
- bf->StartBattle();
-
- if (battleid == 1)
- handler->SendGlobalGMSysMessage("Wintergrasp (Command start used)");
-
- return true;
- }
-
- static bool HandleBattlefieldEnd(ChatHandler* handler, const char* args)
- {
- uint32 battleid = 0;
- char* battleid_str = strtok((char*)args, " ");
- if (!battleid_str)
- return false;
-
- battleid = atoi(battleid_str);
-
- Battlefield* bf = sBattlefieldMgr.GetBattlefieldByBattleId(battleid);
-
- if (!bf)
- return false;
-
- bf->EndBattle(true);
-
- if (battleid == 1)
- handler->SendGlobalGMSysMessage("Wintergrasp (Command stop used)");
-
- return true;
- }
-
- static bool HandleBattlefieldEnable(ChatHandler* handler, const char* args)
- {
- uint32 battleid = 0;
- char* battleid_str = strtok((char*)args, " ");
- if (!battleid_str)
- return false;
-
- battleid = atoi(battleid_str);
-
- Battlefield* bf = sBattlefieldMgr.GetBattlefieldByBattleId(battleid);
-
- if (!bf)
- return false;
-
- if (bf->GetEnable())
- {
- bf->SetEnable(false);
- if (battleid == 1)
- handler->SendGlobalGMSysMessage("Wintergrasp is disabled");
- }
- else
- {
- bf->SetEnable(true);
- if (battleid == 1)
- handler->SendGlobalGMSysMessage("Wintergrasp is enabled");
- }
-
- return true;
- }
-
- static bool HandleBattlefieldSwitch(ChatHandler* handler, const char* args)
- {
- uint32 battleid = 0;
- char* battleid_str = strtok((char*)args, " ");
- if (!battleid_str)
- return false;
-
- battleid = atoi(battleid_str);
-
- Battlefield* bf = sBattlefieldMgr.GetBattlefieldByBattleId(battleid);
-
- if (!bf)
- return false;
-
- bf->EndBattle(false);
- if (battleid == 1)
- handler->SendGlobalGMSysMessage("Wintergrasp (Command switch used)");
-
- return true;
- }
-
- static bool HandleBattlefieldTimer(ChatHandler* handler, const char* args)
- {
- uint32 battleid = 0;
- uint32 time = 0;
- char* battleid_str = strtok((char*)args, " ");
- if (!battleid_str)
- return false;
- char* time_str = strtok(NULL, " ");
- if (!time_str)
- return false;
-
- battleid = atoi(battleid_str);
-
- time = atoi(time_str);
-
- Battlefield* bf = sBattlefieldMgr.GetBattlefieldByBattleId(battleid);
-
- if (!bf)
- return false;
-
- bf->SetTimer(time * IN_MILLISECONDS);
- bf->SendInitWorldStatesToAll();
- if (battleid == 1)
- handler->SendGlobalGMSysMessage("Wintergrasp (Command timer used)");
-
- return true;
- }
-};
-
-void AddSC_bf_commandscript()
-{
- new bf_commandscript();
-}