Вернуться   D3Scene.Ru Софт портал игр | Хаки | Проги | Статьи > World Of Warcraft > Флейм и Обсуждение WoW > WoW Серверная
Присоединяйся к нам

WoW Серверная Хочешь поднять свой сервер? Mangos, ArcEmu, TrinityCore и другие эмуляторы.



Ответ
 
Опции темы Опции просмотра
Старый 05.05.2011, 11:06   #1
Старожил

 
Аватар для Regaska
 
Регистрация: 15.02.2009
Адрес: Гражданка - мёд!
Сообщений: 784
Репутация: 292
Отправить сообщение для Regaska с помощью ICQ Отправить сообщение для Regaska с помощью Skype™
Автор По умолчанию

[Mangos][mod] Патч на арену доблести


Арена доблести

1.patch
Код:
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp    
 index 1015832..08e60e6 100644    
 --- a/src/game/BattleGroundMgr.cpp    
 +++ b/src/game/BattleGroundMgr.cpp    
 @@ -1476,8 +1476,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};    
 -        uint32 arena_num = urand(0,2);    
 +        BattleGroundTypeId arenas[] = {BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL, BATTLEGROUND_RV};    
 +        uint32 arena_num = urand(0,3);    
              bgTypeId = arenas[arena_num];    
              bg_template = GetBattleGroundTemplate(bgTypeId);    
              if (!bg_template)    
 @@ -1860,7 +1860,8 @@ bool BattleGroundMgr::IsArenaType(BattleGroundTypeId bgTypeId)    
          return ( bgTypeId == BATTLEGROUND_AA ||    
              bgTypeId == BATTLEGROUND_BE ||    
              bgTypeId == BATTLEGROUND_NA ||    
 -        bgTypeId == BATTLEGROUND_RL );    
 +        bgTypeId == BATTLEGROUND_RL ||    
 +        bgTypeId == BATTLEGROUND_RV );    
      }    
           
      BattleGroundQueueTypeId BattleGroundMgr::BGQueueTypeId(BattleGroundTypeId bgTypeId, uint8 arenaType)    
 diff --git a/src/game/BattleGroundRV.cpp b/src/game/BattleGroundRV.cpp    
 index e54e4db..4cbe4a5 100644    
 --- a/src/game/BattleGroundRV.cpp    
 +++ b/src/game/BattleGroundRV.cpp    
 @@ -19,11 +19,13 @@    
      #include "Player.h"    
      #include "BattleGround.h"    
      #include "BattleGroundRV.h"    
 +#include "ObjectMgr.h"    
 +#include "WorldPacket.h"    
 +#include "GameObject.h"    
      #include "Language.h"    
           
      BattleGroundRV::BattleGroundRV()    
      {    
 -    
          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 @@ BattleGroundRV::~BattleGroundRV()    
      void BattleGroundRV::Update(uint32 diff)    
      {    
          BattleGround::Update(diff);    
 +    if (GetStatus() == STATUS_IN_PROGRESS)    
 +    {    
 +        // teleport buggers    
 +        if(m_uiTeleport < diff)    
 +        {    
 +            for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)    
 +            {    
 +                Player * plr = sObjectMgr.GetPlayer(itr->first);    
 +                if (plr && plr->GetPositionZ() < 27)    
 +                    plr->TeleportTo(618, plr->GetPositionX(),  plr->GetPositionY(), 29, plr->GetOrientation(), false);    
 +                if (plr && plr->GetPositionZ() < 27)    
 +                    plr->TeleportTo(618, plr->GetPositionX(),  plr->GetPositionY(), 29, plr->GetOrientation(), false);    
 +            }    
 +            m_uiTeleport = 1000;    
 +        }    
 +        else    
 +            m_uiTeleport -= diff;    
 +    }    
      }    
           
      void BattleGroundRV::StartingEventCloseDoors()    
 @@ -51,6 +71,7 @@ void BattleGroundRV::StartingEventCloseDoors()    
           
      void BattleGroundRV::StartingEventOpenDoors()    
      {    
 +    OpenDoorEvent(BG_EVENT_DOOR);    
      }    
           
      void BattleGroundRV::AddPlayer(Player *plr)    
 @@ -60,19 +81,78 @@ void BattleGroundRV::AddPlayer(Player *plr)    
          BattleGroundRVScore* sc = new BattleGroundRVScore;    
           
          m_PlayerScores[plr->GetGUID()] = sc;    
 +    
 +    UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
 +    UpdateWorldState(0xe10, GetAlivePlayersCountByTeam(HORDE));    
      }    
           
      void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)    
      {    
 +    if (GetStatus() == STATUS_WAIT_LEAVE)    
 +        return;    
 +    
 +    UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
 +    UpdateWorldState(0xe10, GetAlivePlayersCountByTeam(HORDE));    
 +    
 +    CheckArenaWinConditions();    
      }    
           
      void BattleGroundRV::HandleKillPlayer(Player* player, Player* killer)    
      {    
 +    if (GetStatus() != STATUS_IN_PROGRESS)    
 +        return;    
 +    
 +    if (!killer)    
 +    {    
 +        sLog.outError("BattleGroundRV: Killer player not found");    
 +        return;    
 +    }    
 +    
          BattleGround::HandleKillPlayer(player, killer);    
 +    
 +    UpdateWorldState(0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
 +    UpdateWorldState(0xe10, GetAlivePlayersCountByTeam(HORDE));    
 +    
 +    CheckArenaWinConditions();    
 +}    
 +    
 +bool BattleGroundRV::HandlePlayerUnderMap(Player *player)    
 +{    
 +    player->TeleportTo(GetMapId(), 763.5f, -284, 28.276f, player->GetOrientation(), false);    
 +    return true;    
 +}    
 +    
 +void BattleGroundRV::HandleAreaTrigger(Player * Source, uint32 Trigger)    
 +{    
 +    if (GetStatus() != STATUS_IN_PROGRESS)    
 +        return;    
 +    
 +    switch(Trigger)    
 +    {    
 +        case 5224:    
 +        case 5226:    
 +        case 5473:    
 +        case 5474:    
 +            break;    
 +        default:    
 +            sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);    
  +            Source->GetSession()->SendAreaTriggerMessage("Warning:  Unhandled AreaTrigger in Battleground: %u", Trigger);    
 +            break;    
 +    }    
 +}    
 +    
 +void BattleGroundRV::FillInitialWorldStates(WorldPacket &data, uint32& count)    
 +{    
 +    FillInitialWorldState(data, count, 0xe11, GetAlivePlayersCountByTeam(ALLIANCE));    
 +    FillInitialWorldState(data, count, 0xe10, GetAlivePlayersCountByTeam(HORDE));    
 +    FillInitialWorldState(data, count, 0xe1a, 1);    
      }    
           
 -void BattleGroundRV::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)    
 +void BattleGroundRV::Reset()    
      {    
 +    //call parent's class reset    
 +    BattleGround::Reset();    
 +    m_uiTeleport = 22000;    
      }    
           
      bool BattleGroundRV::SetupBattleGround()    
 diff --git a/src/game/BattleGroundRV.h b/src/game/BattleGroundRV.h    
 index d53dd23..d8bc665 100644    
 --- a/src/game/BattleGroundRV.h    
 +++ b/src/game/BattleGroundRV.h    
 @@ -45,6 +45,11 @@ class BattleGroundRV : 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_uiTeleport;    
      };    
      #endif    
 diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp    
 index 7748a59..880f80d 100644    
 --- a/src/game/GameObject.cpp    
 +++ b/src/game/GameObject.cpp    
 @@ -154,6 +154,13 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa    
              ((InstanceMap*)map)->GetInstanceData()->OnObjectCreate(this);    
          }    
           
 +    if (goinfo->type == GAMEOBJECT_TYPE_TRANSPORT)    
 +    {    
 +        SetUInt32Value(GAMEOBJECT_LEVEL, goinfo->transport.pause);    
 +        if (goinfo->transport.startOpen)    
 +            SetGoState(GO_STATE_ACTIVE);    
 +    }    
 +    
          return true;    
      }    
           
 @@ -672,6 +679,15 @@ bool GameObject::IsTransport() const    
          return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT;    
      }    
           
 +// is Dynamic transport = non-stop Transport    
 +bool GameObject::IsDynTransport() const    
 +{    
 +    // If something is marked as a transport, don't transmit an out of range packet for it.    
 +    GameObjectInfo const * gInfo = GetGOInfo();    
 +    if(!gInfo) return false;    
 +    return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT ||  (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT &&  !gInfo->transport.pause);    
 +}    
 +    
      Unit* GameObject::GetOwner() const    
      {    
          return ObjectAccessor::GetUnit(*this, GetOwnerGUID());    
 diff --git a/src/game/GameObject.h b/src/game/GameObject.h    
 index 0e48cb7..9969a6e 100644    
 --- a/src/game/GameObject.h    
 +++ b/src/game/GameObject.h    
 @@ -590,6 +590,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject    
              GameObjectInfo const* GetGOInfo() const;    
           
              bool IsTransport() const;    
 +        bool IsDynTransport() const;    
           
              uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }    
           
 diff --git a/src/game/Object.cpp b/src/game/Object.cpp    
 index c0a36c4..cd40765 100644    
 --- a/src/game/Object.cpp    
 +++ b/src/game/Object.cpp    
 @@ -541,7 +541,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *    
          bool IsPerCasterAuraState = false;    
          if (updatetype == UPDATETYPE_CREATE_OBJECT || updatetype == UPDATETYPE_CREATE_OBJECT2)    
          {    
 -        if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport())    
 +        if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsDynTransport())    
              {    
                  if ( ((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster())    
                      IsActivateToQuest = true;    
 @@ -559,7 +559,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *    
          }    
          else                    // case UPDATETYPE_VALUES    
          {    
 -        if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport())    
 +        if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsDynTransport())    
              {    
                  if ( ((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster())    
                  {    
 diff --git a/src/game/Player.cpp b/src/game/Player.cpp    
 index 0e5f522..89c5515 100644    
 --- a/src/game/Player.cpp    
 +++ b/src/game/Player.cpp    
 @@ -8395,6 +8395,16 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)    
                      FillInitialWorldState(data,count,0xe1a,0x0);// 9 show    
                  }    
                  break;    
 +        case 4406:                    // Ring of Valor    
 +            if (bg && bg->GetTypeID(true) == BATTLEGROUND_RV)    
 +                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:
в базу.sql


Код:
delete from `gameobject` where `map` = 618;    
 insert into `gameobject` values    
 -- buffs    
 ('200070','184663','618','1','1','735.551819','-284.794678','28.276682','0.034906','0','0','0','0','-120','100','1'),    
 ('200071', '184  664','618','1','1','791.224487','-284.794464','28.276682','2.600535','0','0','0','0','-120','100','1'),    
 -- elevators    
 ('200072','194582','618','1','1','763.536377','-294.535767','0.505383','3.141593','0','0','0','0','120','100','1'),    
 ('200073 ','1  94586','618','1','1','763.506348','-273.873352','0.505383','0','0','0','0','0','120','100','1'),    
 -- fire    
 ('200074','192704','618','1','1','743.543457','-283.799469','28.286655','0','0','0','0','0','120','100','1'),    
 ('200075','192705', '618  ','1','1','782.971802','-283.799469','28.286655','0','0','0','0','0','120','100','1'),    
 ('200076','192388','618','1','1','743.711060 ','-284.  099609','27.542587','3.141593','0','0','0','0','120','100','1'),    
 ('200077','192387','618','1','1','783.221252','-284.133362','2 7.535686','0  ','0','0','0','0','120','100','1'),    
 -- gears    
 ('200078','192393','618','1','1','763.664551','-261.872986','26.686588','0','0','0','0','0','120','100','1'),    
 ('200079','192394' ,'61  8','1','1','763.578979','-306.146149','26.665222','3.141593','0','0','0','0','120','100','1'),    
 -- pillars    
 ('200080','194583','618','1','1','763.632385','-306.162384','25.909504','3.141593','0','0','0','0','120','100','1'),    
 ('200081' ,'19  4584','618','1','1','723.644287','-284.493256','24.648525','3.141593','0','0','0','0','120','100','1'),    
 ('200082','194585','618','1 ','1','7  63.611145','-261.856750','25.909504','0','0','0','0','0','120','100','1'),    
 ('200083','194587','618','1','1','802.211609','-284. 493256','24.  648525','0','0','0','0','0','120','100','1'),    
 /*    
 -- pillars collision (not work - should make you break LoS)    
 ('200084','194580','618','1','1','763.632385','-306.162384','30.639660','3.141593','0','0','0','0','120','100','1'),    
 ('200085','1 9457  9','618','1','1','723.644287','-284.493256','32.382710','0','0','0','0','0','120','100','1'),    
 ('200086','194581','618','1','1','763 .611145'  ,'-261.856750','30.639660','0','0','0','0','0','120','100','1'),    
 ('200087','194578','618','1','1','802.211609','-284.493256','3 2.382710','3  .141593','0','0','0','0','120','100','1');    
 */    
 -- pulley    
 ('200088','192389','618','1','1','700.722290','-283.990662','39.517582','3.141593','0','0','0','0','120','100','1'),    
 ('200089', '192  390','618','1','1','826.303833','-283.996429','39.517582','0','0','0','0','0','120','100','1');    
           
 delete from `gameobject_battleground` where `guid` in (200070,200071,200072,200073);    
 insert into `gameobject_battleground` values    
 -- buffs    
 ('200070','252','0'),    
 ('200071','252','0'),    
 -- elevators    
 ('200072','254','0'),    
 ('200073','254','0');    
           
 delete from `battleground_events` where `map` = 618;    
 insert into `battleground_events` values    
 ('618','252','0','buffs'),   
 ('618','254','0','doors');  

 update `gameobject_template` set `faction` = 114, `flags` = 32 where  `entry` in (192704,192705,192388,192387,192393,192394,192389,192390);
  Ответить с цитированием Наверх
Ответ


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 
Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


Powered by vBulletin
Copyright © 2017 vBulletin Solutions, Inc.
Перевод: zCarot | Дизайн: G-A | Верстка: OldEr
Текущее время: 19:31. Часовой пояс GMT +4.