[Request] Wintegrasp Custom Timers Before Start

Hi guys I tried to make a custom code that send to every player a message like “There are 30 minutes before wintergrasp start/ 15 minutes before… etc” but it is not working and idk why. Can anyone give a look on my code and tell me what i must fix?

http://www.trinitycore.org/f/pastebin/1gjhvwm4eedzt/

Thanks to everyone /emoticons/default_smile.png

is there some reason you can’t use the existing event system?

Hmm I wanted to make this because , as i know there are some many ppl that are looking for this… if you could help it would be great… /emoticons/default_smile.png

So could you help me?.. It is just for me i have trinitycore in computer and try to make some custom things for fun for me… and learn more c++

Yeah, right, because there is so much use for something to tell yourself when you are getting ready to start an event that requires more than one person… Pull the other one.

If you think that I am having a private server or something … you are wrong it is just for me how i said…

36ebb64d7a01d3f76776abd54ebbcdd0bf4ce1be
 sql/Wintergrasp/01_24_2014_00_trinity_string.sql     |  6 ++++++
 .../Wintergrasp/01_24_2014_01_gameobject_template.sql        |  2 ++
 src/server/game/Battlefield/Zones/BattlefieldWG.cpp          | 12 ++++++++++++
 src/server/game/Miscellaneous/Language.h                     |  7 +++++++
 4 files changed, 27 insertions(+)

diff --git a/sql/Wintergrasp/01_24_2014_00_trinity_string.sql b/sql/Wintergrasp/01_24_2014_00_trinity_string.sql
new file mode 100644
index 0000000..d3822cf
--- /dev/null
+++ b/sql/Wintergrasp/01_24_2014_00_trinity_string.sql
@@ -0,0 +1,6 @@
+REPLACE INTO `trinity_string` VALUES 
+('10990', '|cffff0000[Wintergrasp]:|cFF00ccffThe battle will begin in 5 minutes.|r', '', '', '', '', '', '', '', ''),
+('10991', '|cffff0000[Wintergrasp]:|cFF00ccffThe battle will begin in 2 minutes.|r', '', '', '', '', '', '', '', ''),
+('10992', '|cffff0000[Wintergrasp]:|cFF00ccffThe battle will begin in one minute.|r', '', '', '', '', '', '', '', ''),
+('10988', '|cffff0000[Wintergrasp]:|cFF00ccffThe battle will begin in 30 minutes.|r', '', '', '', '', '', '', '', ''),
+('10989', '|cffff0000[Wintergrasp]:|cFF00ccffThe battle will begin in 10 minutes. |r', '', '', '', '', '', '', '', '');
 No newline at end of file
diff --git a/sql/Wintergrasp/01_24_2014_01_gameobject_template.sql b/sql/Wintergrasp/01_24_2014_01_gameobject_template.sql
new file mode 100644
index 0000000..407e888
--- /dev/null
+++ b/eclipse_sql/Wintergrasp/01_24_2014_01_gameobject_template.sql
@@ -0,0 +1,2 @@
+UPDATE `gameobject_template` SET `faction` = 0, `flags` = 6553632 WHERE `entry` IN (190356,190357,190358);
+UPDATE `gameobject_template` SET `faction` = 0, `flags` = 32 WHERE `entry` IN (190221,190373,190377,190378);
 No newline at end of file
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
index fb898ed..49ba0c6 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -29,6 +29,7 @@
 #include "TemporarySummon.h"
 #include "Vehicle.h"
 #include "WorldSession.h"
+#include "Language.h"
 
 BattlefieldWG::~BattlefieldWG()
 {
@@ -205,6 +206,17 @@ bool BattlefieldWG::Update(uint32 diff)
     else
         m_saveTimer -= diff;
 
+    if ((m_Timer > 1800000) && (m_Timer < 1801000) && (m_isActive == false))
+        sWorld->SendWorldText(LANG_BF_WG_WORLD_ANNOUNCE_30);
+    else if ((m_Timer > 600000) && (m_Timer < 601000) && (m_isActive == false))
+        sWorld->SendWorldText(LANG_BF_WG_WORLD_ANNOUNCE_10);
+    else if ((m_Timer > 300000) && (m_Timer < 301000) && (m_isActive == false))
+        sWorld->SendWorldText(LANG_BF_WG_WORLD_ANNOUNCE_5);
+    else if ((m_Timer > 120000) && (m_Timer < 121000) && (m_isActive == false))
+        sWorld->SendWorldText(LANG_BF_WG_WORLD_ANNOUNCE_2);
+    else if ((m_Timer > 60000) && (m_Timer < 61000) && (m_isActive == false))
+        sWorld->SendWorldText(LANG_BF_WG_WORLD_ANNOUNCE_1);
+
     return m_return;
 }
 
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 3102e2c..3177d10 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -1227,6 +1227,13 @@ enum TrinityStrings
     LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD       = 11006,
     LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD   = 11007,
 
+    // Wintergrast
+    LANG_BF_WG_WORLD_ANNOUNCE_30 = 10988,
+    LANG_BF_WG_WORLD_ANNOUNCE_10 = 10989,
+    LANG_BF_WG_WORLD_ANNOUNCE_5  = 10990,
+    LANG_BF_WG_WORLD_ANNOUNCE_2  = 10991,
+    LANG_BF_WG_WORLD_ANNOUNCE_1  = 10992,
+
     // NOT RESERVED IDS                   12000-1999999999
     // `db_script_string` table index     2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
     // For other tables maybe             2000010000-2147483647 (max index)