EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpawnMgr.h
Go to the documentation of this file.
1 
12 #ifndef _EVE_NPC_SPAWNMGR_H__
13 #define _EVE_NPC_SPAWNMGR_H__
14 
15 #include <unordered_map>
16 #include "../../../eve-common/EVE_Spawn.h"
18 
19 class NPC;
20 class PyServiceMgr;
21 class SystemManager;
22 class SystemBubble;
23 class DungeonMgr;
24 
25 class SpawnMgr
26 {
27 public:
29  ~SpawnMgr() { /* nothing do to yet */ }
30 
31  bool Init();
32 
33  void Process();
34  void SetDungMgr(DungeonMgr* pDmgr) { m_dungMgr = pDmgr; }
35  // not working... warp a spawned npc group from one location to another (change bubbles)
36  void WarpOutSpawn(NPC* pNPC, SystemBubble* pBubble);
37  // update SpawnMgr on npcs new location (change bubbles)
38  void MoveSpawn(NPC* pNPC, SystemBubble* pBubble);
39 
40  std::string GetSpawnClassName(int8 sClass);
41  std::string GetSpawnGroupName(int8 sGroup);
42 
43  bool DoSpawnForBubble(SystemBubble* pBubble);
44  void DoSpawnForAnomaly(SystemBubble* pBubble, uint8 spawnClass);
45  void DoSpawnForMission(SystemBubble* pBubble, uint32 regionID);
46  void DoSpawnForIncursion(SystemBubble* pBubble, uint32 regionID);
47 
48  // primative test for chained spawns
49  bool IsChaining(uint16 bubbleID);
50  // this will be used for all spawn types
51  void SpawnKilled(SystemBubble* pBubble, uint32 itemID); // this DOES NOT remove entity from system or bubble. user must do this BEFORE calling.
52 
53  void StartRatTimer();
55  void StartRatGroupTimer();
57 
58  bool IsRatSpawnEnabled() { return m_ratEnabled; }
59  bool IsInitialized() { return m_initalized; }
60  bool IsRatTimerStarted() { return m_ratTimer.Enabled(); }
61 
62 
63 protected:
64  bool FindSpawnForBubble(uint16 bubbleID);
65  bool PrepSpawn(SystemBubble* pBubble, uint8 sClass = Spawn::Class::None, uint8 level = 0);
66  void MakeSpawn(SystemBubble* pBubble, uint32 factionID, uint8 sClass, uint8 level, bool anomaly=false);
67  void ReSpawn(SystemBubble* pBubble, SpawnEntry& spawnEntry);
68  void RemoveSpawn(uint16 bubbleID, uint32 itemID);
69 
70  uint8 GetSpawnGroup(uint8 sClass);
71 
72  uint16 GetRandTypeID(uint8 sClass);
73 
74  typedef std::vector<NPC*> RatSpawningVec;
75  typedef std::vector<SystemBubble*> RatBubbleVec;
76  typedef std::vector<SpawnGroup> RatSpawnGroupVec;
77  typedef std::vector<RatSpawnClass> RatSpawnClassVec;
78  typedef std::vector<RatFactionGroups> RatFactionGroupsVec;
79  typedef std::map<uint8, uint16> RatFactionGroupsMap; //map to enable 'find' shipClass is key
80  typedef std::multimap<uint16, SpawnEntry> SpawnEntryDef; //bubbleID is key
81  //typedef std::vector<uint32, SystemSpawnGroup> SystemSpawnGroupVec; //systemID is key *unused at this time*
82 
83 private:
84  SystemManager* m_system; //we do not own this
85  PyServiceMgr& m_services; //we do not own this
86  DungeonMgr* m_dungMgr; //we do not own this
87 
93 
94  bool m_ratEnabled; //allow belt rat spawning?
95  bool m_initalized; //allow spawning?
96 
97  uint16 m_groupTimerSetTime; //ms - this is for hard-coding the respawn timer time.
98 
99  uint32 m_spawnID; //in case i need to track a specific spawn group.
100 
101  RatBubbleVec m_bubbles;
102  SpawnEntryDef m_spawns;
103  RatSpawningVec m_ratSpawns;
104  RatSpawnGroupVec m_toSpawn;
105  RatSpawnClassVec m_ratSpawnClass; // not used
106  //SystemSpawnGroupVec m_spawnGroups;
107  RatFactionGroupsMap m_factionGroups;
108 };
109 
110 
111 #endif // _EVE_NPC_SPAWNMGR_H__
~SpawnMgr()
Definition: SpawnMgr.h:29
unsigned __int8 uint8
Definition: eve-compat.h:46
DungeonMgr * m_dungMgr
Definition: SpawnMgr.h:86
Timer m_deadspaceTimer
Definition: SpawnMgr.h:92
void StartRatGroupTimer()
Definition: SpawnMgr.cpp:215
bool m_ratEnabled
Definition: SpawnMgr.h:94
std::map< uint8, uint16 > RatFactionGroupsMap
Definition: SpawnMgr.h:79
void Disable()
Definition: timer.h:39
bool IsRatTimerStarted()
Definition: SpawnMgr.h:60
bool IsInitialized()
Definition: SpawnMgr.h:59
RatBubbleVec m_bubbles
Definition: SpawnMgr.h:101
bool IsChaining(uint16 bubbleID)
Definition: SpawnMgr.cpp:827
uint32 m_spawnID
Definition: SpawnMgr.h:99
std::vector< RatSpawnClass > RatSpawnClassVec
Definition: SpawnMgr.h:77
SpawnMgr(SystemManager *mgr, PyServiceMgr &svc)
Definition: SpawnMgr.cpp:40
bool Init()
Definition: SpawnMgr.cpp:62
void SpawnKilled(SystemBubble *pBubble, uint32 itemID)
Definition: SpawnMgr.cpp:229
void DoSpawnForIncursion(SystemBubble *pBubble, uint32 regionID)
Definition: SpawnMgr.cpp:317
signed __int8 int8
Definition: eve-compat.h:45
std::vector< NPC * > RatSpawningVec
Definition: SpawnMgr.h:74
Timer m_ratGroupTimer
Definition: SpawnMgr.h:89
void MakeSpawn(SystemBubble *pBubble, uint32 factionID, uint8 sClass, uint8 level, bool anomaly=false)
Definition: SpawnMgr.cpp:655
bool IsRatSpawnEnabled()
Definition: SpawnMgr.h:58
void MoveSpawn(NPC *pNPC, SystemBubble *pBubble)
Definition: SpawnMgr.cpp:141
bool PrepSpawn(SystemBubble *pBubble, uint8 sClass=Spawn::Class::None, uint8 level=0)
Definition: SpawnMgr.cpp:376
SystemManager * m_system
Definition: SpawnMgr.h:84
bool Enabled() const
Definition: timer.h:41
std::vector< SystemBubble * > RatBubbleVec
Definition: SpawnMgr.h:75
void WarpOutSpawn(NPC *pNPC, SystemBubble *pBubble)
Definition: SpawnMgr.cpp:169
Timer m_ratTimer
Definition: SpawnMgr.h:88
void SetDungMgr(DungeonMgr *pDmgr)
Definition: SpawnMgr.h:34
Definition: NPC.h:41
bool FindSpawnForBubble(uint16 bubbleID)
Definition: SpawnMgr.cpp:811
void ReSpawn(SystemBubble *pBubble, SpawnEntry &spawnEntry)
Definition: SpawnMgr.cpp:763
RatSpawnClassVec m_ratSpawnClass
Definition: SpawnMgr.h:105
void RemoveSpawn(uint16 bubbleID, uint32 itemID)
Definition: SpawnMgr.cpp:841
void Process()
Definition: SpawnMgr.cpp:85
unsigned __int32 uint32
Definition: eve-compat.h:50
void DoSpawnForMission(SystemBubble *pBubble, uint32 regionID)
Definition: SpawnMgr.cpp:327
void DoSpawnForAnomaly(SystemBubble *pBubble, uint8 spawnClass)
Definition: SpawnMgr.cpp:309
RatFactionGroupsMap m_factionGroups
Definition: SpawnMgr.h:107
uint16 m_groupTimerSetTime
Definition: SpawnMgr.h:97
std::vector< SpawnGroup > RatSpawnGroupVec
Definition: SpawnMgr.h:76
std::string GetSpawnGroupName(int8 sGroup)
Definition: SpawnMgr.cpp:934
SpawnEntryDef m_spawns
Definition: SpawnMgr.h:102
Timer m_missionTimer
Definition: SpawnMgr.h:90
void StopRatGroupTimer()
Definition: SpawnMgr.h:56
std::multimap< uint16, SpawnEntry > SpawnEntryDef
Definition: SpawnMgr.h:80
std::string GetSpawnClassName(int8 sClass)
Definition: SpawnMgr.cpp:952
bool m_initalized
Definition: SpawnMgr.h:95
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()() itemID(attributeID)-Retrieves attribute value." ) COMMAND( setattr
void StopRatTimer()
Definition: SpawnMgr.h:54
std::vector< RatFactionGroups > RatFactionGroupsVec
Definition: SpawnMgr.h:78
void StartRatTimer()
Definition: SpawnMgr.cpp:201
uint8 GetSpawnGroup(uint8 sClass)
Definition: SpawnMgr.cpp:858
uint16 GetRandTypeID(uint8 sClass)
Definition: SpawnMgr.cpp:818
Definition: timer.h:30
PyServiceMgr & m_services
Definition: SpawnMgr.h:85
unsigned __int16 uint16
Definition: eve-compat.h:48
bool DoSpawnForBubble(SystemBubble *pBubble)
Definition: SpawnMgr.cpp:344
RatSpawnGroupVec m_toSpawn
Definition: SpawnMgr.h:104
RatSpawningVec m_ratSpawns
Definition: SpawnMgr.h:103
Timer m_incursionTimer
Definition: SpawnMgr.h:91