mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Changed the wandertype IDs to an enum so we know what we're looking at. Added new pathgrid type 8 (GridRandomCenterPoint). (SQL required) This new type causes a NPC to alternate between a random waypoint in grid_entries and a random waypoint marked with the new centerpoint column set to true. If no waypoints are marked as a centerpoint, this wandertype will not work. There is no numbering requirement or limit for centerpoints. You can have as many as you need. New spawngroup field: wp_spawns (SQL required). Added a new spawngroup field, which is a boolean that if true changes the behavior of spawngroups this way: If the spawnpoint in the spawngroup has a grid, the NPC will spawn at a random waypoint location taken from its grid instead of the spawnpoint location. New randompath behavior: The randompath grid type will now use the closest waypoint as its current waypoint on spawning. This allows multiple spawn locations to use the same grid without having the undesirable behavior of walking to the first waypoint through walls and ignoring waypoint nodes. NPC::GetClosestWaypoint() was renamed to NPC::GetClosestWaypoints() as it was filling a list of multiple waypoints. a new method NPC::GetClosestWaypoint() returns a single waypoint in the form of an integer.
89 lines
2.4 KiB
C++
89 lines
2.4 KiB
C++
/* EQEMu: Everquest Server Emulator
|
|
Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
are required to give you total support for your newly bought product;
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
#ifndef SPAWNGROUP_H
|
|
#define SPAWNGROUP_H
|
|
|
|
#include "../common/types.h"
|
|
|
|
#include <map>
|
|
#include <list>
|
|
|
|
class SpawnEntry {
|
|
public:
|
|
SpawnEntry(uint32 in_NPCType, int in_chance, uint16 in_filter, uint8 in_npc_spawn_limit);
|
|
~SpawnEntry() {}
|
|
uint32 NPCType;
|
|
int chance;
|
|
uint16 condition_value_filter;
|
|
|
|
//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 {
|
|
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,
|
|
bool wp_spawns_in
|
|
);
|
|
|
|
~SpawnGroup();
|
|
uint32 GetNPCType(uint16 condition_value_filter=1);
|
|
void AddSpawnEntry(SpawnEntry *newEntry);
|
|
uint32 id;
|
|
bool wp_spawns; // if true, spawn NPCs at a random waypoint location (if spawnpoint has a grid) instead of the spawnpoint's loc
|
|
float roamdist;
|
|
float roambox[4];
|
|
int min_delay;
|
|
int delay;
|
|
int despawn;
|
|
uint32 despawn_timer;
|
|
private:
|
|
char name_[120];
|
|
std::list<SpawnEntry *> list_;
|
|
uint8 group_spawn_limit; //max # of this entry which can be spawned by this group
|
|
};
|
|
|
|
class SpawnGroupList {
|
|
public:
|
|
SpawnGroupList() {}
|
|
~SpawnGroupList();
|
|
|
|
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 *> m_spawn_groups;
|
|
};
|
|
|
|
#endif
|