TrinityCore
Loading...
Searching...
No Matches
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#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 4696: // buff trigger?
74 case 4697: // buff trigger?
75 break;
76 default:
77 Battleground::HandleAreaTrigger(player, trigger);
78 break;
79 }
80}
81
83{
84 packet.Worldstates.emplace_back(3002, 1); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW
85
87}
88
90{
91 // gates
92 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)
93 || !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)
94 // buffs
95 || !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)
96 || !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))
97 {
98 TC_LOG_ERROR("sql.sql", "BatteGroundRL: Failed to spawn some object!");
99 return false;
100 }
101
102 return true;
103}
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
@ 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
bool SetupBattleground() override
void HandleAreaTrigger(Player *Source, uint32 Trigger) override
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
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
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