TrinityCore
BattlegroundRL.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "BattlegroundRL.h"
19#include "Log.h"
20#include "Player.h"
21
22BattlegroundRL::BattlegroundRL(BattlegroundTemplate const* battlegroundTemplate) : Arena(battlegroundTemplate)
23{
25}
26
28{
30 return;
31
32 _events.Update(diff);
33
34 while (uint32 eventId = _events.ExecuteEvent())
35 {
36 switch (eventId)
37 {
40 DelObject(i);
41 break;
42 default:
43 break;
44 }
45 }
46}
47
49{
52}
53
55{
57 DoorOpen(i);
59
61 SpawnBGObject(i, 60);
62}
63
65{
66 // gates
67 if (!AddObject(BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_TYPE_DOOR_1, 1293.561f, 1601.938f, 31.60557f, -1.457349f, 0, 0, -0.6658813f, 0.7460576f, RESPAWN_IMMEDIATELY)
68 || !AddObject(BG_RL_OBJECT_DOOR_2, BG_RL_OBJECT_TYPE_DOOR_2, 1278.648f, 1730.557f, 31.60557f, 1.684245f, 0, 0, 0.7460582f, 0.6658807f, RESPAWN_IMMEDIATELY)
69 // buffs
70 || !AddObject(BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_1, 1328.719971f, 1632.719971f, 36.730400f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
71 || !AddObject(BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_TYPE_BUFF_2, 1243.300049f, 1699.170044f, 34.872601f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
72 {
73 TC_LOG_ERROR("sql.sql", "BatteGroundRL: Failed to spawn some object!");
74 return false;
75 }
76
77 return true;
78}
constexpr Seconds BG_RL_REMOVE_DOORS_TIMER
@ BG_RL_OBJECT_TYPE_DOOR_2
@ BG_RL_OBJECT_TYPE_DOOR_1
@ BG_RL_OBJECT_TYPE_BUFF_2
@ BG_RL_OBJECT_TYPE_BUFF_1
@ BG_RL_OBJECT_BUFF_2
@ BG_RL_OBJECT_BUFF_1
@ BG_RL_OBJECT_MAX
@ BG_RL_OBJECT_DOOR_2
@ BG_RL_OBJECT_DOOR_1
@ BG_RL_EVENT_REMOVE_DOORS
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:137
@ STATUS_IN_PROGRESS
Definition: Battleground.h:167
uint32_t uint32
Definition: Define.h:142
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
Definition: Arena.h:57
EventMap _events
bool SetupBattleground() override
BattlegroundRL(BattlegroundTemplate const *battlegroundTemplate)
void StartingEventCloseDoors() override
void PostUpdateImpl(uint32 diff) override
Post-update hook.
void StartingEventOpenDoors() override
void DoorOpen(uint32 type)
void SpawnBGObject(uint32 type, uint32 respawntime)
virtual bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
GuidVector BgObjects
Definition: Battleground.h:443
bool DelObject(uint32 type)
BattlegroundStatus GetStatus() const
Definition: Battleground.h:284
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36