diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2023-07-30 19:49:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-30 19:49:12 +0200 |
commit | f5461a1161a5a9dfabe7a142ad84f8c900776c92 (patch) | |
tree | 4f327bbb5752acd5c8f75d5552ddd0489d76c0dc /src/server/game/Battlegrounds/Battleground.cpp | |
parent | 845f61e0a969891b14e1f182fadd29af347a1a3f (diff) |
Battlegrounds/Buffs: Rework using areatriggers (#29171)
* Rework GameObject trap handling for buffs (removed radius hack)
* Add script for Old AreaTriggers
* Add script for new AreaTriggers
* Spawn AreaTriggers in Arathi Basin
Diffstat (limited to 'src/server/game/Battlegrounds/Battleground.cpp')
-rw-r--r-- | src/server/game/Battlegrounds/Battleground.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 473e1124412..06d0b381b4d 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -75,7 +75,6 @@ Battleground::Battleground(BattlegroundTemplate const* battlegroundTemplate) : _ m_Events = 0; m_StartDelayTime = 0; m_IsRated = false; - m_BuffChange = false; m_IsRandom = false; m_InBGFreeSlotQueue = false; m_SetDeleteThis = false; @@ -1647,51 +1646,6 @@ void Battleground::EndNow() SetRemainingTime(0); } -// IMPORTANT NOTICE: -// buffs aren't spawned/despawned when players captures anything -// buffs are in their positions when battleground starts -void Battleground::HandleTriggerBuff(ObjectGuid go_guid) -{ - if (!FindBgMap()) - { - TC_LOG_ERROR("bg.battleground", "Battleground::HandleTriggerBuff called with null bg map, {}", go_guid.ToString()); - return; - } - - GameObject* obj = GetBgMap()->GetGameObject(go_guid); - if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned()) - return; - - // Change buff type, when buff is used: - int32 index = BgObjects.size() - 1; - while (index >= 0 && BgObjects[index] != go_guid) - index--; - if (index < 0) - { - TC_LOG_ERROR("bg.battleground", "Battleground::HandleTriggerBuff: cannot find buff gameobject ({}, entry: {}, type: {}) in internal data for BG (map: {}, instance id: {})!", - go_guid.ToString(), obj->GetEntry(), obj->GetGoType(), GetMapId(), m_InstanceID); - return; - } - - // Randomly select new buff - uint8 buff = urand(0, 2); - uint32 entry = obj->GetEntry(); - if (m_BuffChange && entry != Buff_Entries[buff]) - { - // Despawn current buff - SpawnBGObject(index, RESPAWN_ONE_DAY); - // Set index for new one - for (uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex) - if (entry == Buff_Entries[currBuffTypeIndex]) - { - index -= currBuffTypeIndex; - index += buff; - } - } - - SpawnBGObject(index, BUFF_RESPAWN_TIME); -} - void Battleground::HandleKillPlayer(Player* victim, Player* killer) { // Keep in mind that for arena this will have to be changed a bit |