From 6f595b30382e5104e4e4c744431284c9f4eda742 Mon Sep 17 00:00:00 2001
From: megamage <none@none>
Date: Fri, 6 Mar 2009 15:23:25 -0600
Subject: [7387] Check maxcount >= min count for item (not reference) record in
 loot templates DB tables.. Author: VladimirMangos

--HG--
branch : trunk
---
 sql/mangos.sql | 30 ------------------------------
 1 file changed, 30 deletions(-)

(limited to 'sql/mangos.sql')

diff --git a/sql/mangos.sql b/sql/mangos.sql
index ae9773f02ae..a753455301a 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -1472,36 +1472,6 @@ CREATE TABLE `instance_template` (
 
 LOCK TABLES `instance_template` WRITE;
 /*!40000 ALTER TABLE `instance_template` DISABLE KEYS */;
-INSERT INTO `instance_template` VALUES
-(33,0,22,30,10,10,7200,NULL,NULL,NULL,NULL,''),
-(34,0,24,32,10,10,7200,NULL,NULL,NULL,NULL,''),
-(36,0,15,20,10,10,7200,NULL,NULL,NULL,NULL,''),
-(43,0,15,21,10,10,7200,NULL,NULL,NULL,NULL,''),
-(47,0,29,38,10,10,7200,NULL,NULL,NULL,NULL,''),
-(48,0,24,32,10,10,7200,NULL,NULL,NULL,NULL,''),
-(70,0,35,47,10,10,7200,NULL,NULL,NULL,NULL,''),
-(90,0,29,38,10,10,7200,NULL,NULL,NULL,NULL,''),
-(109,0,45,55,10,10,7200,NULL,NULL,NULL,NULL,''),
-(129,0,37,46,10,10,7200,NULL,NULL,NULL,NULL,''),
-(189,0,34,45,10,10,7200,NULL,NULL,NULL,NULL,''),
-(209,0,44,54,10,10,7200,NULL,NULL,NULL,NULL,''),
-(229,0,58,0,10,10,120000,78.5083,-225.044,49.839,5.1,''),
-(230,0,52,0,5,5,7200,NULL,NULL,NULL,NULL,''),
-(249,0,60,0,40,40,432000,NULL,NULL,NULL,NULL,''),
-(289,0,57,0,5,5,7200,NULL,NULL,NULL,NULL,''),
-(309,0,60,0,20,20,259200,NULL,NULL,NULL,NULL,''),
-(329,0,58,60,5,5,7200,NULL,NULL,NULL,NULL,''),
-(349,0,46,55,10,10,7200,NULL,NULL,NULL,NULL,''),
-(389,0,13,18,10,10,7200,NULL,NULL,NULL,NULL,''),
-(409,0,60,0,40,40,604800,NULL,NULL,NULL,NULL,''),
-(429,0,55,60,5,5,7200,NULL,NULL,NULL,NULL,''),
-(469,0,60,0,40,40,604800,NULL,NULL,NULL,NULL,''),
-(509,0,60,0,20,20,259200,NULL,NULL,NULL,NULL,''),
-(531,0,60,0,40,40,604800,NULL,NULL,NULL,NULL,''),
-(533,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''),
-(615,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''),
-(616,0,80,0,10,25,0,NULL,NULL,NULL,NULL,''),
-(624,0,80,0,10,25,0,NULL,NULL,NULL,NULL,'');
 /*!40000 ALTER TABLE `instance_template` ENABLE KEYS */;
 UNLOCK TABLES;
 
-- 
cgit v1.2.3


From 13fc3dcd7e95288cd9482e7440df3b15a3c580cb Mon Sep 17 00:00:00 2001
From: megamage <none@none>
Date: Fri, 6 Mar 2009 15:25:20 -0600
Subject: [7388] Fixed battleground premature warning message. SQL files are
 attached, you must execute them! Author: Triply     Fix for message's color
 will be soon.

--HG--
branch : trunk
---
 sql/mangos.sql                               |  5 +++--
 sql/updates/7388_01_mangos_mangos_string.sql |  3 +++
 src/game/BattleGround.cpp                    | 28 ++++++++++++++++++++++++----
 src/game/BattleGround.h                      |  1 +
 src/game/Language.h                          |  9 +++++++--
 src/shared/revision_nr.h                     |  2 +-
 6 files changed, 39 insertions(+), 9 deletions(-)
 create mode 100644 sql/updates/7388_01_mangos_mangos_string.sql

(limited to 'sql/mangos.sql')

diff --git a/sql/mangos.sql b/sql/mangos.sql
index a753455301a..cd306f1f69c 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -22,7 +22,7 @@
 DROP TABLE IF EXISTS `db_version`;
 CREATE TABLE `db_version` (
   `version` varchar(120) default NULL,
-  `required_7382_01_mangos_creature_template` bit(1) default NULL
+  `required_7388_01_mangos_mangos_string` bit(1) default NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
 
 --
@@ -2812,7 +2812,6 @@ INSERT INTO `mangos_string` VALUES
 (723,'Your group does not have enough players to join this match.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (724,'The Gold Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (725,'The Green Team wins!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
-(726,'There aren\'t enough players in this battleground. It will end soon unless some more players join to balance the fight.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (727,'Your group has an offline member. Please remove him before joining.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (728,'Your group has players from the opposing faction. You can\'t join the battleground as a group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (729,'Your group has players from different battleground brakets. You can\'t join as group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@@ -2833,6 +2832,8 @@ INSERT INTO `mangos_string` VALUES
 (744,'Modifying played count, arena points etc. for loaded arena teams, sending updated stats to online players...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (745,'Modification done.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (746,'Done flushing Arena points.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(750,'Not enough players. This game will close in %u mins.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(751,'Not enough players. This game will close in %u seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (801,'You do not have enough gold',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (802,'You do not have enough free slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
 (803,'Your partner does not have enough free bag slots',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
diff --git a/sql/updates/7388_01_mangos_mangos_string.sql b/sql/updates/7388_01_mangos_mangos_string.sql
new file mode 100644
index 00000000000..07f60a7fe02
--- /dev/null
+++ b/sql/updates/7388_01_mangos_mangos_string.sql
@@ -0,0 +1,3 @@
+DELETE FROM mangos_string WHERE entry = 726;
+INSERT INTO mangos_string VALUES (750,'Not enough players. This game will close in %u mins.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+INSERT INTO mangos_string VALUES (751,'Not enough players. This game will close in %u seconds.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 19b30bd18f2..46c6bbf76aa 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -230,7 +230,6 @@ void BattleGround::Update(uint32 diff)
         {
             m_PrematureCountDown = true;
             m_PrematureCountDownTimer = sBattleGroundMgr.GetPrematureFinishTime();
-            SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
         }
         else if(m_PrematureCountDownTimer < diff)
         {
@@ -242,8 +241,17 @@ void BattleGround::Update(uint32 diff)
         {
             uint32 newtime = m_PrematureCountDownTimer - diff;
             // announce every minute
-            if(m_PrematureCountDownTimer != sBattleGroundMgr.GetPrematureFinishTime() && newtime / 60000 != m_PrematureCountDownTimer / 60000)
-                SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
+            if( newtime > (MINUTE * IN_MILISECONDS) )
+            {
+                if( newtime / (MINUTE * IN_MILISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS) )
+                    PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS)));
+            }
+            else
+            {
+                //announce every 15 seconds
+                if( newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS) )
+                    PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS));
+            }
             m_PrematureCountDownTimer = newtime;
         }
     }
@@ -1047,7 +1055,7 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
 // returns the number how many players can join battleground to MaxPlayersPerTeam
 uint32 BattleGround::GetFreeSlotsForTeam(uint32 Team) const
 {
-    //if BG is starting ... invite anyone
+    //return free slot count to MaxPlayerPerTeam
     if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS)
         return (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0;
 
@@ -1414,6 +1422,18 @@ void BattleGround::SendMessageToAll(int32 entry)
     SendPacketToAll(&data);
 }
 
+//copied from void ChatHandler::PSendSysMessage(int32 entry, ...)
+void BattleGround::PSendMessageToAll(int32 entry, ...)
+{
+    const char *format = GetMangosString(entry);
+    va_list ap;
+    char str [2048];
+    va_start(ap, entry);
+    vsnprintf(str,2048,format, ap );
+    va_end(ap);
+    SendMessageToAll(str);
+}
+
 void BattleGround::EndNow()
 {
     RemoveFromBGFreeSlotQueue();
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index 767b8521cf1..8f8aec564c6 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -402,6 +402,7 @@ class BattleGround
 
         void SendMessageToAll(char const* text);
         void SendMessageToAll(int32 entry);
+        void PSendMessageToAll(int32 entry, ...  );
 
         /* Raid Group */
         Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
diff --git a/src/game/Language.h b/src/game/Language.h
index 327eef25ead..e0e6ce8e8c2 100644
--- a/src/game/Language.h
+++ b/src/game/Language.h
@@ -654,7 +654,7 @@ enum TrinityStrings
     LANG_ARENA_NOT_ENOUGH_PLAYERS       = 723,              // "Your group does not have enough players to join this match."
     LANG_ARENA_GOLD_WINS                = 724,              // "The Gold Team wins!"
     LANG_ARENA_GREEN_WINS               = 725,              // "The Green Team wins!"
-    LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 726,       // The battleground will end soon, because there aren't enough players. Get more ppl or win already!
+//                                      = 726, not used
     LANG_BG_GROUP_OFFLINE_MEMBER        = 727,              // "Your group has an offline member. Please remove him before joining."
     LANG_BG_GROUP_MIXED_FACTION         = 728,              // "Your group has players from the opposing faction. You can't join the battleground as a group."
     LANG_BG_GROUP_MIXED_LEVELS          = 729,              // "Your group has players from different battleground brakets. You can't join as group."
@@ -676,7 +676,12 @@ enum TrinityStrings
     LANG_DIST_ARENA_POINTS_TEAM_START   = 744,
     LANG_DIST_ARENA_POINTS_TEAM_END     = 745,
     LANG_DIST_ARENA_POINTS_END          = 746,
-    // Room for batleground/arena strings 747-799 not used
+//                                      = 747, not used
+//                                      = 748, not used
+//                                      = 749, not used
+    LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING = 750,       // "Not enough players. This game will close in %u mins."
+    LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS = 751,  // "Not enough players. This game will close in %u seconds."
+    // Room for batleground/arena strings 752-799 not used
 
     // Room for BG/ARENA                  750-769 not used
 
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index 160925670ff..ee9321bdae8 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
 #ifndef __REVISION_NR_H__
 #define __REVISION_NR_H__
- #define REVISION_NR "7387"
+ #define REVISION_NR "7389"
 #endif // __REVISION_NR_H__
-- 
cgit v1.2.3

