TrinityCore
Loading...
Searching...
No Matches
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#include "WorldPacket.h"
22#include "WorldStatePackets.h"
23
28
30{
32 return;
33
34 _events.Update(diff);
35
36 while (uint32 eventId = _events.ExecuteEvent())
37 {
38 switch (eventId)
39 {
42 DelObject(i);
43 break;
44 default:
45 break;
46 }
47 }
48}
49
55
65
67{
69 return;
70
71 switch (trigger)
72 {
73 case 4536: // buff trigger?
74 case 4537: // buff trigger?
75 break;
76 default:
77 Battleground::HandleAreaTrigger(player, trigger);
78 break;
79 }
80}
81
83{
84 packet.Worldstates.emplace_back(2577, 1); // BATTLEGROUND_NAGRAND_ARENA_SHOW
85
87}
88
90{
91 // gates
92 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)
93 || !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)
94 || !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)
95 || !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)
96 // buffs
97 || !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)
98 || !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))
99 {
100 TC_LOG_ERROR("sql.sql", "BatteGroundNA: Failed to spawn some object!");
101 return false;
102 }
103
104 return true;
105}
@ 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
@ STATUS_IN_PROGRESS
uint32_t uint32
Definition Define.h:133
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition Arena.cpp:92
void PostUpdateImpl(uint32 diff) override
Post-update hook.
void StartingEventCloseDoors() override
void StartingEventOpenDoors() override
void HandleAreaTrigger(Player *Source, uint32 Trigger) override
bool SetupBattleground() override
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) 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
bool DelObject(uint32 type)
BattlegroundStatus GetStatus() const
virtual void HandleAreaTrigger(Player *, uint32)
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
std::vector< WorldStateInfo > Worldstates