TrinityCore
BattlegroundNA.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 "BattlegroundNA.h"
19#include "Log.h"
20#include "Player.h"
21
22BattlegroundNA::BattlegroundNA(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_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854f, 2966.833f, 12.6462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
68 || !AddObject(BG_NA_OBJECT_DOOR_2, BG_NA_OBJECT_TYPE_DOOR_2, 4081.179f, 2874.97f, 12.39171f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
69 || !AddObject(BG_NA_OBJECT_DOOR_3, BG_NA_OBJECT_TYPE_DOOR_3, 4023.709f, 2981.777f, 10.70117f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
70 || !AddObject(BG_NA_OBJECT_DOOR_4, BG_NA_OBJECT_TYPE_DOOR_4, 4090.064f, 2858.438f, 10.23631f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
71 // buffs
72 || !AddObject(BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_TYPE_BUFF_1, 4009.189941f, 2895.250000f, 13.052700f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
73 || !AddObject(BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_TYPE_BUFF_2, 4103.330078f, 2946.350098f, 13.051300f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
74 {
75 TC_LOG_ERROR("sql.sql", "BatteGroundNA: Failed to spawn some object!");
76 return false;
77 }
78
79 return true;
80}
@ BG_NA_OBJECT_DOOR_1
@ BG_NA_OBJECT_DOOR_4
@ BG_NA_OBJECT_MAX
@ BG_NA_OBJECT_BUFF_2
@ BG_NA_OBJECT_DOOR_2
@ BG_NA_OBJECT_BUFF_1
@ BG_NA_OBJECT_DOOR_3
@ BG_NA_EVENT_REMOVE_DOORS
@ BG_NA_OBJECT_TYPE_DOOR_1
@ BG_NA_OBJECT_TYPE_DOOR_2
@ BG_NA_OBJECT_TYPE_BUFF_2
@ BG_NA_OBJECT_TYPE_BUFF_1
@ BG_NA_OBJECT_TYPE_DOOR_3
@ BG_NA_OBJECT_TYPE_DOOR_4
constexpr Seconds BG_NA_REMOVE_DOORS_TIMER
@ 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
void PostUpdateImpl(uint32 diff) override
Post-update hook.
void StartingEventCloseDoors() override
void StartingEventOpenDoors() override
EventMap _events
BattlegroundNA(BattlegroundTemplate const *battlegroundTemplate)
bool SetupBattleground() 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