OregonCore  revision fb2a440-git
Your Favourite TBC server
OutdoorPvPMgr.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore 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 #ifndef OUTDOOR_PVP_MGR_H_
19 #define OUTDOOR_PVP_MGR_H_
20 
21 #define OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL 1000
22 
23 #include "OutdoorPvP.h"
24 #include "Policies/Singleton.h"
25 
26 class Player;
27 class GameObject;
28 class Creature;
29 class ZoneScript;
30 struct GossipMenuItems;
31 
32 // class to handle player enter / leave / areatrigger / GO use events
34 {
35  public:
36  // ctor
37  OutdoorPvPMgr();
38  // dtor
40 
41  // create outdoor pvp events
42  void InitOutdoorPvP();
43  // called when a player enters an outdoor pvp area
44  void HandlePlayerEnterZone(Player* plr, uint32 areaflag);
45  // called when player leaves an outdoor pvp area
46  void HandlePlayerLeaveZone(Player* plr, uint32 areaflag);
47  // return assigned outdoor pvp
49  // handle custom (non-exist in dbc) spell if registered
50  bool HandleCustomSpell(Player* plr, uint32 spellId, GameObject* go);
51  // handle custom go if registered
52  bool HandleOpenGo(Player* plr, uint64 guid);
53 
55 
56  void AddZone(uint32 zoneid, OutdoorPvP* handle);
57 
58  void Update(uint32 diff);
59 
60  void HandleGossipOption(Player* player, uint64 guid, uint32 gossipid);
61 
62  bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems gso);
63 
64  void HandleDropFlag(Player* plr, uint32 spellId);
65 
66  typedef std::vector<OutdoorPvP*> OutdoorPvPSet;
67  typedef std::map<uint32 /* zoneid */, OutdoorPvP*> OutdoorPvPMap;
68  private:
69  // contains all initiated outdoor pvp events
70  // used when initing / cleaning up
71  OutdoorPvPSet m_OutdoorPvPSet;
72  // maps the zone ids to an outdoor pvp event
73  // used in player event handling
74  OutdoorPvPMap m_OutdoorPvPMap;
75  // update interval
76  uint32 m_UpdateTimer;
77 };
78 
79 #define sOutdoorPvPMgr Oregon::Singleton<OutdoorPvPMgr>::Instance()
80 
81 #endif /*OUTDOOR_PVP_MGR_H_*/
82 
bool CanTalkTo(Player *player, Creature *creature, GossipMenuItems gso)
void Update(uint32 diff)
void HandleGossipOption(Player *player, uint64 guid, uint32 gossipid)
uint32 m_UpdateTimer
Definition: OutdoorPvPMgr.h:76
OutdoorPvPSet m_OutdoorPvPSet
Definition: OutdoorPvPMgr.h:71
bool HandleOpenGo(Player *plr, uint64 guid)
std::map< uint32, OutdoorPvP * > OutdoorPvPMap
Definition: OutdoorPvPMgr.h:67
void HandlePlayerLeaveZone(Player *plr, uint32 areaflag)
OutdoorPvP * GetOutdoorPvPToZoneId(uint32 zoneid)
bool HandleCustomSpell(Player *plr, uint32 spellId, GameObject *go)
ZoneScript * GetZoneScript(uint32 zoneId)
void AddZone(uint32 zoneid, OutdoorPvP *handle)
OutdoorPvPMap m_OutdoorPvPMap
Definition: OutdoorPvPMgr.h:74
void InitOutdoorPvP()
ACE_UINT64 uint64
Definition: Define.h:70
void HandlePlayerEnterZone(Player *plr, uint32 areaflag)
void HandleDropFlag(Player *plr, uint32 spellId)
ACE_UINT32 uint32
Definition: Define.h:71
Definition: Player.h:922
std::vector< OutdoorPvP * > OutdoorPvPSet
Definition: OutdoorPvPMgr.h:66