1 | /* |
---|
2 | * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or modify |
---|
5 | * it under the terms of the GNU General Public License as published by |
---|
6 | * the Free Software Foundation; either version 2 of the License, or |
---|
7 | * (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | * GNU General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public License |
---|
15 | * along with this program; if not, write to the Free Software |
---|
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef OUTDOOR_PVP_MGR_H_ |
---|
20 | #define OUTDOOR_PVP_MGR_H_ |
---|
21 | |
---|
22 | #include "OutdoorPvP.h" |
---|
23 | #include "Policies/Singleton.h" |
---|
24 | |
---|
25 | class Player; |
---|
26 | class GameObject; |
---|
27 | class Creature; |
---|
28 | struct GossipOption; |
---|
29 | |
---|
30 | // class to handle player enter / leave / areatrigger / GO use events |
---|
31 | class OutdoorPvPMgr |
---|
32 | { |
---|
33 | public: |
---|
34 | // ctor |
---|
35 | OutdoorPvPMgr(); |
---|
36 | // dtor |
---|
37 | ~OutdoorPvPMgr(); |
---|
38 | |
---|
39 | // create outdoor pvp events |
---|
40 | void InitOutdoorPvP(); |
---|
41 | // called when a player enters an outdoor pvp area |
---|
42 | void HandlePlayerEnterZone(Player * plr, uint32 areaflag); |
---|
43 | // called when player leaves an outdoor pvp area |
---|
44 | void HandlePlayerLeaveZone(Player * plr, uint32 areaflag); |
---|
45 | // return assigned outdoor pvp |
---|
46 | OutdoorPvP * GetOutdoorPvPToZoneId(uint32 zoneid); |
---|
47 | // handle custom (non-exist in dbc) spell if registered |
---|
48 | bool HandleCustomSpell(Player * plr, uint32 spellId, GameObject* go); |
---|
49 | // handle custom go if registered |
---|
50 | bool HandleOpenGo(Player * plr, uint64 guid); |
---|
51 | |
---|
52 | void AddZone(uint32 zoneid, OutdoorPvP * handle); |
---|
53 | |
---|
54 | void Update(uint32 diff); |
---|
55 | |
---|
56 | bool HandleCaptureCreaturePlayerMoveInLos(Player * plr, Creature * c); |
---|
57 | |
---|
58 | void HandleGossipOption(Player * player, uint64 guid, uint32 gossipid); |
---|
59 | |
---|
60 | bool CanTalkTo(Player * player, Creature * creature, GossipOption & gso); |
---|
61 | |
---|
62 | void HandleDropFlag(Player * plr, uint32 spellId); |
---|
63 | |
---|
64 | typedef std::set<OutdoorPvP*> OutdoorPvPSet; |
---|
65 | typedef std::map<uint32 /* zoneid */, OutdoorPvP*> OutdoorPvPMap; |
---|
66 | private: |
---|
67 | // contains all initiated outdoor pvp events |
---|
68 | // used when initing / cleaning up |
---|
69 | OutdoorPvPSet m_OutdoorPvPSet; |
---|
70 | // maps the zone ids to an outdoor pvp event |
---|
71 | // used in player event handling |
---|
72 | OutdoorPvPMap m_OutdoorPvPMap; |
---|
73 | }; |
---|
74 | |
---|
75 | #define sOutdoorPvPMgr Trinity::Singleton<OutdoorPvPMgr>::Instance() |
---|
76 | |
---|
77 | #endif /*OUTDOOR_PVP_MGR_H_*/ |
---|