feat(Core/Battleground): Added new config variables to battleground b… (#6432)

- Closes #5098.
This commit is contained in:
UltraNix
2021-07-07 23:13:58 +02:00
committed by GitHub
parent 06d23c1006
commit 3dec029bc8
6 changed files with 68 additions and 17 deletions

View File

@@ -1818,7 +1818,9 @@ void Battleground::HandleTriggerBuff(GameObject* gameObject)
uint32 index = 0;
for (; index < BgObjects.size() && BgObjects[index] != gameObject->GetGUID(); ++index);
if (BgObjects[index] != gameObject->GetGUID())
{
return;
}
if (m_BuffChange)
{
@@ -1835,7 +1837,26 @@ void Battleground::HandleTriggerBuff(GameObject* gameObject)
}
}
SpawnBGObject(index, BUFF_RESPAWN_TIME);
uint32 respawnTime = SPEED_BUFF_RESPAWN_TIME;
if (Map* map = FindBgMap())
{
if (GameObject* obj = map->GetGameObject(BgObjects[index]))
{
switch (obj->GetEntry())
{
case BG_OBJECTID_REGENBUFF_ENTRY:
respawnTime = RESTORATION_BUFF_RESPAWN_TIME;
break;
case BG_OBJECTID_BERSERKERBUFF_ENTRY:
respawnTime = BERSERKING_BUFF_RESPAWN_TIME;
break;
default:
break;
}
}
}
SpawnBGObject(index, respawnTime);
}
void Battleground::HandleKillPlayer(Player* victim, Player* killer)