mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-05 07:16:37 +00:00
Simplified the use of roamboxes and improved the AI for roambox pathing
This commit is contained in:
+34
-21
@@ -23,50 +23,63 @@
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
class SpawnEntry
|
||||
{
|
||||
class SpawnEntry {
|
||||
public:
|
||||
SpawnEntry(uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit );
|
||||
~SpawnEntry() { }
|
||||
SpawnEntry(uint32 in_NPCType, int in_chance, uint8 in_npc_spawn_limit);
|
||||
~SpawnEntry() {}
|
||||
uint32 NPCType;
|
||||
int chance;
|
||||
int chance;
|
||||
|
||||
//this is a cached value from npc_types, for speed
|
||||
uint8 npc_spawn_limit; //max # of this entry which can be spawned in this zone
|
||||
};
|
||||
|
||||
class SpawnGroup
|
||||
{
|
||||
class SpawnGroup {
|
||||
public:
|
||||
SpawnGroup(uint32 in_id, char* name, int in_group_spawn_limit, float dist, float maxx, float minx, float maxy, float miny, int delay_in, int despawn_in, uint32 despawn_timer_in, int min_delay_in );
|
||||
SpawnGroup(
|
||||
uint32 in_id,
|
||||
char *name,
|
||||
int in_group_spawn_limit,
|
||||
float dist,
|
||||
float maxx,
|
||||
float minx,
|
||||
float maxy,
|
||||
float miny,
|
||||
int delay_in,
|
||||
int despawn_in,
|
||||
uint32 despawn_timer_in,
|
||||
int min_delay_in
|
||||
);
|
||||
|
||||
~SpawnGroup();
|
||||
uint32 GetNPCType();
|
||||
void AddSpawnEntry( SpawnEntry* newEntry );
|
||||
void AddSpawnEntry(SpawnEntry *newEntry);
|
||||
uint32 id;
|
||||
float roamdist;
|
||||
float roambox[4];
|
||||
int min_delay;
|
||||
int delay;
|
||||
int despawn;
|
||||
float roamdist;
|
||||
float roambox[4];
|
||||
int min_delay;
|
||||
int delay;
|
||||
int despawn;
|
||||
uint32 despawn_timer;
|
||||
private:
|
||||
char name_[120];
|
||||
std::list<SpawnEntry*> list_;
|
||||
std::list<SpawnEntry *> list_;
|
||||
uint8 group_spawn_limit; //max # of this entry which can be spawned by this group
|
||||
};
|
||||
|
||||
class SpawnGroupList
|
||||
{
|
||||
class SpawnGroupList {
|
||||
public:
|
||||
SpawnGroupList() { }
|
||||
SpawnGroupList() {}
|
||||
~SpawnGroupList();
|
||||
|
||||
void AddSpawnGroup(SpawnGroup* newGroup);
|
||||
SpawnGroup* GetSpawnGroup(uint32 id);
|
||||
void AddSpawnGroup(SpawnGroup *new_group);
|
||||
SpawnGroup *GetSpawnGroup(uint32 id);
|
||||
bool RemoveSpawnGroup(uint32 in_id);
|
||||
void ClearSpawnGroups();
|
||||
void ReloadSpawnGroups();
|
||||
private:
|
||||
//LinkedList<SpawnGroup*> list_;
|
||||
std::map<uint32, SpawnGroup*> groups;
|
||||
std::map<uint32, SpawnGroup *> m_spawn_groups;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user