21:14 Rswow.ru - Worl... 3 Обычные сервера WoW от StaF
02:08 Бесплатный игро... 3 Обычные сервера WoW от morra
02:44 ^^Limit-WoW^^ ^... 3 Обычные сервера WoW от adidas9699
22:14 Xz-WoW.Ru [FUN]... 3 Обычные сервера WoW от Milko
Rareportal.com
Хочешь разместить тут рекламу бесплатно?

[ Главная страница ] [ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум » MANGOS » Патчи в ядро Mangos » Патч на арену даларана
Патч на арену даларана
STALKER Дата: Среда, 29.02.2012, 00:35 | Сообщение # 1 Offline





Гл. Администратор

Сообщений: 326

Репутация: 300 +

Статус: Offline
арена даларана
1.patch


Code
diff --git a/src/game/BattleGroundDS.cpp b/src/game/BattleGroundDS.cpp    
index e6a298d..4f2fcd3 100644    
--- a/src/game/BattleGroundDS.cpp    
+++ b/src/game/BattleGroundDS.cpp    
@@ -16,14 +16,16 @@    
       * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    
       */    
           
+#include "Object.h"    
      #include "Player.h"    
      #include "BattleGround.h"    
      #include "BattleGroundDS.h"    
+#include "ObjectMgr.h"    
+#include "WorldPacket.h"    
      #include "Language.h"    
           
      BattleGroundDS::BattleGroundDS()    
      {    
-    
          m_StartDelayTimes[BG_STARTING_EVENT_FIRST]  = BG_START_DELAY_1M;    
          m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;    
          m_StartDelayTimes[BG_STARTING_EVENT_THIRD]  = BG_START_DELAY_15S;    
@@ -43,6 +45,24 @@ BattleGroundDS::~BattleGroundDS()    
      void BattleGroundDS::Update(uint32 diff)    
      {    
          BattleGround::Update(diff);    
+    if (GetStatus() == STATUS_IN_PROGRESS)    
+    {    
+        // knockback    
+        if(m_uiKnockback < diff)    
+        {    
+            for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)    
+            {    
+                Player * plr = sObjectMgr.GetPlayer(itr->first);    
+                if (plr && plr->IsWithinLOS(1214,765,14) && plr->GetDistance2d(1214, 765) <= 50)    
+                    plr->KnockBackPlayerWithAngle(6.40f,55,7);    
+                if (plr && plr->IsWithinLOS(1369,817,14) && plr->GetDistance2d(1369, 817) <= 50)    
+                    plr->KnockBackPlayerWithAngle(3.03f,55,7);    
+            }    
+            m_uiKnockback = 1000;    
+        }    
+        else    
+            m_uiKnockback -= diff;    
+    }    
      }    
           
      void BattleGroundDS::StartingEventCloseDoors()    
@@ -51,6 +71,7 @@ void BattleGroundDS::StartingEventCloseDoors()    
           
      void BattleGroundDS::StartingEventOpenDoors()    
      {    
+    OpenDoorEvent(BG_EVENT_DOOR);    
      }    
           
      void BattleGroundDS::AddPlayer(Player *plr)    
@@ -60,19 +81,76 @@ void BattleGroundDS::AddPlayer(Player *plr)    
          BattleGroundDSScore* sc = new BattleGroundDSScore;    
           
          m_PlayerScores[plr->GetGUID()] = sc;    
+    
+    UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
+    UpdateWorldState(0xe10, GetAlivePlayersCountByTeam(HORDE));    
+}    
+    
+void BattleGroundDS::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)    
+{    
+    if (GetStatus() == STATUS_WAIT_LEAVE)    
+        return;    
+    
+    UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
+    UpdateWorldState(0xe10, GetAlivePlayersCountByTeam(HORDE));    
+    
+    CheckArenaWinConditions();    
      }    
           
-void BattleGroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)    
+void BattleGroundDS::HandleKillPlayer(Player *player, Player *killer)    
      {    
+    if (GetStatus() != STATUS_IN_PROGRESS)    
+        return;    
+    
+    if (!killer)    
+    {    
+        sLog.outError("BattleGroundDS: Killer player not found");    
+        return;    
+    }    
+    
+    BattleGround::HandleKillPlayer(player,killer);    
+    
+    UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
+    UpdateWorldState(0xe10, GetAlivePlayersCountByTeam(HORDE));    
+    
+    CheckArenaWinConditions();    
+}    
+    
+bool BattleGroundDS::HandlePlayerUnderMap(Player *player)    
+{    
+    player->TeleportTo(GetMapId(),1299.046f,784.825f,9.338f,player->GetOrientation(),false);    
+    return true;    
+}    
+    
+void BattleGroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)    
+{    
+    if (GetStatus() != STATUS_IN_PROGRESS)    
+        return;    
+    
+    switch(Trigger)    
+    {    
+        case 5347:    
+        case 5348:    
+            break;    
+        default:    
+            sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);    
+            Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);    
+            break;    
+    }    
      }    
           
-void BattleGroundDS::HandleKillPlayer(Player* player, Player* killer)    
+void BattleGroundDS::FillInitialWorldStates(WorldPacket &data, uint32& count)    
      {    
-    BattleGround::HandleKillPlayer(player, killer);    
+    FillInitialWorldState(data, count, 0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
+    FillInitialWorldState(data, count, 0xe10, GetAlivePlayersCountByTeam(HORDE));    
+    FillInitialWorldState(data, count, 0xe1a, 1);    
      }    
           
-void BattleGroundDS::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)    
+void BattleGroundDS::Reset()    
      {    
+    //call parent's class reset    
+    BattleGround::Reset();    
+    m_uiKnockback = 5000;    
      }    
           
      bool BattleGroundDS::SetupBattleGround()    
diff --git a/src/game/BattleGroundDS.h b/src/game/BattleGroundDS.h    
index 0034226..2d21b58 100644    
--- a/src/game/BattleGroundDS.h    
+++ b/src/game/BattleGroundDS.h    
@@ -45,6 +45,11 @@ class BattleGroundDS : public BattleGround    
              void RemovePlayer(Player *plr, uint64 guid);    
              void HandleAreaTrigger(Player *Source, uint32 Trigger);    
              bool SetupBattleGround();    
+        virtual void Reset();    
+        virtual void FillInitialWorldStates(WorldPacket &d, uint32& count);    
              void HandleKillPlayer(Player* player, Player *killer);    
+        bool HandlePlayerUnderMap(Player * plr);    
+    private:    
+        uint32 m_uiKnockback;    
      };    
      #endif    
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp    
index e4715ea..1015832 100644    
--- a/src/game/BattleGroundMgr.cpp    
+++ b/src/game/BattleGroundMgr.cpp    
@@ -1485,8 +1485,8 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI    
          //for arenas there is random map used    
          if (bg_template->isArena())    
          {    
-        BattleGroundTypeId arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL/*, BATTLEGROUND_DS, BATTLEGROUND_RV*/};    
-        uint32 arena_num = urand(0,2/*4*/);    
+        BattleGroundTypeId arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL, BATTLEGROUND_DS/*, BATTLEGROUND_RV*/};    
+        uint32 arena_num = urand(0,3/*4*/);    
              bgTypeId = arenas[arena_num];    
              bg_template = GetBattleGroundTemplate(bgTypeId);    
              if (!bg_template)    
@@ -1897,7 +1897,8 @@ bool BattleGroundMgr::IsArenaType(BattleGroundTypeId bgTypeId)    
          return ( bgTypeId == BATTLEGROUND_AA ||    
              bgTypeId == BATTLEGROUND_BE ||    
              bgTypeId == BATTLEGROUND_NA ||    
-        bgTypeId == BATTLEGROUND_RL );    
+        bgTypeId == BATTLEGROUND_RL ||    
+        bgTypeId == BATTLEGROUND_DS);    
      }    
           
      BattleGroundQueueTypeId BattleGroundMgr::BGQueueTypeId(BattleGroundTypeId bgTypeId, uint8 arenaType)    
diff --git a/src/game/Player.cpp b/src/game/Player.cpp    
index 0372f37..d31f19e 100644    
--- a/src/game/Player.cpp    
+++ b/src/game/Player.cpp    
@@ -8381,6 +8381,16 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)    
                      FillInitialWorldState(data,count,0xbba,0x0);// 9 show    
                  }    
                  break;    
+        case 4378:                    // Dalaran Severs    
+            if (bg && bg->GetTypeID(true) == BATTLEGROUND_DS)    
+                bg->FillInitialWorldStates(data, count);    
+            else    
+            {    
+                FillInitialWorldState(data,count,0xe11,0x0);// 7 gold    
+                FillInitialWorldState(data,count,0xe10,0x0);// 8 green    
+                FillInitialWorldState(data,count,0xe1a,0x0);// 9 show    
+            }    
+            break;    
              case 3703:                    // Shattrath City    
                  break;    
              default:    
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp    
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp    
index 37abee6..3694295 100644    
--- a/src/game/Unit.cpp    
+++ b/src/game/Unit.cpp    
@@ -14222,6 +14222,27 @@ void Unit::KnockBackFrom(Unit* target, float horizontalSpeed, float verticalSpee    
          }    
      }    
           
+void Unit::KnockBackPlayerWithAngle(float angle, float horizontalSpeed, float verticalSpeed)    
+{    
+    float vsin = sin(angle);    
+    float vcos = cos(angle);    
+    
+    // Effect propertly implemented only for players    
+    if(GetTypeId()==TYPEID_PLAYER)    
+    {    
+        WorldPacket data(SMSG_MOVE_KNOCK_BACK, 8+4+4+4+4+4);    
+        data << GetPackGUID();    
+        data << uint32(0);                    // Sequence    
+        data << float(vcos);                    // x direction    
+        data << float(vsin);                    // y direction    
+        data << float(horizontalSpeed);                     // Horizontal speed    
+        data << float(-verticalSpeed);                      // Z Movement speed (vertical)    
+        ((Player*)this)->GetSession()->SendPacket(&data);    
+    }    
+    else    
+        sLog.outError("KnockBackPlayer: Target of KnockBackPlayer must be player!");    
+}    
+    
      float Unit::GetCombatRatingReduction(CombatRating cr) const    
      {    
          if (GetTypeId() == TYPEID_PLAYER)    
diff --git a/src/game/Unit.h b/src/game/Unit.h    
index 4aaf7c3..2094a98 100644    
--- a/src/game/Unit.h    
+++ b/src/game/Unit.h    
@@ -1775,6 +1775,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject    
              bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); }    
           
              void KnockBackFrom(Unit* target, float horizontalSpeed, float verticalSpeed);    
+        void KnockBackPlayerWithAngle(float angle, float horizontalSpeed, float verticalSpeed);    
           
              void _RemoveAllAuraMods();    
              void _ApplyAllAuraMods();


в базу.sql

Code
delete from `gameobject` where `map` = 617;    
insert into `gameobject` values    
-- buffs    
('200060','184663','617','1','1','1291.7','813.424','7.11472','4.64562','0','0','0.730314','-0.683111','-120','100','1'),    
('200061',  '184664','617','1','1','1291.7','768.911','7.11472','1.55194','0','0','0.700409','0.713742','-120','100','1'),    
-- doors    
('200062','192642','617','1','1','1350.95','817.2','21.4096','3.15','0','0','0.99627','0.0862864','86400','100','1'),    
('200063','192  643','617','1','1','1232.65','764.913','21.4729','6.3','0','0','0.0310211','-0.999519','86400','100','1');    
           
delete from `gameobject_battleground` where `guid` in (200060,200061,200062,200063);    
insert into `gameobject_battleground` values    
-- buffs    
('200060','252','0'),    
('200061','252','0'),    
-- doors    
('200062','254','0'),    
('200063','254','0');    
           
delete from `battleground_events` where `map` = 617;    
insert into `battleground_events` values    
('617','252','0','buffs'),    
('617','254','0','doors');    
           
-- doors    
update `gameobject_template` set `faction` = 114, `flags` = 32, `size` = 1.5 where `entry` in (192642,192643);
 
Форум » MANGOS » Патчи в ядро Mangos » Патч на арену даларана
  • Страница 1 из 1
  • 1
Поиск: