TrinityCore
BattlegroundBE.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 "BattlegroundBE.h"
19#include "Log.h"
20#include "Player.h"
21
22BattlegroundBE::BattlegroundBE(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
55}
56
58{
60 DoorOpen(i);
62
64 SpawnBGObject(i, 60);
65}
66
68{
69 // gates
70 if (!AddObject(BG_BE_OBJECT_DOOR_1, BG_BE_OBJECT_TYPE_DOOR_1, 6287.277f, 282.1877f, 3.810925f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, RESPAWN_IMMEDIATELY)
71 || !AddObject(BG_BE_OBJECT_DOOR_2, BG_BE_OBJECT_TYPE_DOOR_2, 6189.546f, 241.7099f, 3.101481f, 0.8813917f, 0, 0, 0.4265689f, 0.9044551f, RESPAWN_IMMEDIATELY)
72 || !AddObject(BG_BE_OBJECT_DOOR_3, BG_BE_OBJECT_TYPE_DOOR_3, 6299.116f, 296.5494f, 3.308032f, 0.8813917f, 0, 0, 0.4265689f, 0.9044551f, RESPAWN_IMMEDIATELY)
73 || !AddObject(BG_BE_OBJECT_DOOR_4, BG_BE_OBJECT_TYPE_DOOR_4, 6177.708f, 227.3481f, 3.604374f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, RESPAWN_IMMEDIATELY)
74 // buffs
75 || !AddObject(BG_BE_OBJECT_BUFF_1, BG_BE_OBJECT_TYPE_BUFF_1, 6249.042f, 275.3239f, 11.22033f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
76 || !AddObject(BG_BE_OBJECT_BUFF_2, BG_BE_OBJECT_TYPE_BUFF_2, 6228.26f, 249.566f, 11.21812f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
77 {
78 TC_LOG_ERROR("sql.sql", "BatteGroundBE: Failed to spawn some object!");
79 return false;
80 }
81
82 return true;
83}
@ BG_BE_OBJECT_TYPE_DOOR_3
@ BG_BE_OBJECT_TYPE_DOOR_2
@ BG_BE_OBJECT_TYPE_DOOR_1
@ BG_BE_OBJECT_TYPE_BUFF_1
@ BG_BE_OBJECT_TYPE_DOOR_4
@ BG_BE_OBJECT_TYPE_BUFF_2
@ BG_BE_EVENT_REMOVE_DOORS
@ BG_BE_OBJECT_DOOR_1
@ BG_BE_OBJECT_DOOR_2
@ BG_BE_OBJECT_MAX
@ BG_BE_OBJECT_DOOR_3
@ BG_BE_OBJECT_BUFF_1
@ BG_BE_OBJECT_BUFF_2
@ BG_BE_OBJECT_DOOR_4
constexpr Seconds BG_BE_REMOVE_DOORS_TIMER
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:137
@ RESPAWN_ONE_DAY
Definition: Battleground.h:136
@ 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
void StartingEventOpenDoors() override
EventMap _events
BattlegroundBE(BattlegroundTemplate const *battlegroundTemplate)
void StartingEventCloseDoors() override
bool SetupBattleground() override
void PostUpdateImpl(uint32 diff) override
Post-update hook.
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