Planeshift
|
This class is periodically called by the engine to ensure that monsters (and other NPCs) are respawned appropriately. More...
#include <spawnmanager.h>
Public Member Functions | |
LootRandomizer * | GetLootRandomizer () |
Returns the loot randomizer. | |
void | KillNPC (gemActor *npc, gemActor *killer) |
Sets the NPC as dead, plays the death animation and triggers the loot generator. | |
void | LoadHuntLocations (psSectorInfo *sectorinfo=0) |
Load hunt location. | |
void | LoadSpawnRanges (SpawnRule *rule) |
Load all ranges for a rule. | |
void | PreloadDatabase () |
Load all rules into memory for future use. | |
void | PreloadLootRules () |
Load all loot categories into the manager for use in spawn rules. | |
void | RemoveNPC (gemObject *obj) |
Kills the specified NPC, updates the database that he is "dead" and queues him for respawn according to the spawn rules. | |
void | RepopulateItems (psSectorInfo *sectorinfo=0) |
Adds all items to the world. | |
void | RepopulateLive (psSectorInfo *sectorinfo=0) |
Called at server startup to create all creatures currently marked as "living" in the database. | |
void | Respawn (PID playerID, SpawnRule *spawnRule) |
Respawn a NPC given by playerID and find the position from the spawnRule. | |
void | Respawn (psCharacter *chardata, InstanceID instance, csVector3 &where, float rot, const char *sector) |
Respawn a NPC in the given position. | |
void | SpawnHuntLocations (Result &result, psSectorInfo *sectorinfo) |
Used by LoadHuntLocations() to spawn the hunt locations in game. | |
SpawnManager (psDatabase *db, CacheManager *cachemanager, EntityManager *entitymanager, GEMSupervisor *gemsupervisor) | |
virtual | ~SpawnManager () |
Protected Member Functions | |
void | HandleDeathEvent (MsgEntry *me, Client *notused) |
void | HandleLootItem (MsgEntry *me, Client *client) |
Protected Attributes | |
CacheManager * | cacheManager |
psDatabase * | database |
EntityManager * | entityManager |
GEMSupervisor * | gem |
csHash< LootEntrySet * > | looting |
LootRandomizer * | lootRandomizer |
csHash< SpawnRule * > | rules |
This class is periodically called by the engine to ensure that monsters (and other NPCs) are respawned appropriately.
Definition at line 283 of file spawnmanager.h.
SpawnManager::SpawnManager | ( | psDatabase * | db, |
CacheManager * | cachemanager, | ||
EntityManager * | entitymanager, | ||
GEMSupervisor * | gemsupervisor | ||
) |
virtual SpawnManager::~SpawnManager | ( | ) | [virtual] |
LootRandomizer* SpawnManager::GetLootRandomizer | ( | ) | [inline] |
Returns the loot randomizer.
Definition at line 307 of file spawnmanager.h.
Sets the NPC as dead, plays the death animation and triggers the loot generator.
Also queues the removal of the corpse.
void SpawnManager::LoadHuntLocations | ( | psSectorInfo * | sectorinfo = 0 | ) |
Load hunt location.
sectorinfo | The sector to load in. NULL means all sectors. |
void SpawnManager::LoadSpawnRanges | ( | SpawnRule * | rule | ) |
Load all ranges for a rule.
void SpawnManager::PreloadDatabase | ( | ) |
Load all rules into memory for future use.
void SpawnManager::PreloadLootRules | ( | ) |
Load all loot categories into the manager for use in spawn rules.
void SpawnManager::RemoveNPC | ( | gemObject * | obj | ) |
Kills the specified NPC, updates the database that he is "dead" and queues him for respawn according to the spawn rules.
void SpawnManager::RepopulateItems | ( | psSectorInfo * | sectorinfo = 0 | ) |
Adds all items to the world.
Called at the server startup to add all the items to the game.
sectorinfo | The sector to respawn the items into. If NULL it will respawn all items in all sectors. |
void SpawnManager::RepopulateLive | ( | psSectorInfo * | sectorinfo = 0 | ) |
Called at server startup to create all creatures currently marked as "living" in the database.
This will restore the server to its last known NPC population if it crashes.
sectorinfo | The sector we want to repopulate. If NULL then respawn all sectors. |
void SpawnManager::Respawn | ( | PID | playerID, |
SpawnRule * | spawnRule | ||
) |
Respawn a NPC given by playerID and find the position from the spawnRule.
void SpawnManager::Respawn | ( | psCharacter * | chardata, |
InstanceID | instance, | ||
csVector3 & | where, | ||
float | rot, | ||
const char * | sector | ||
) |
Respawn a NPC in the given position.
void SpawnManager::SpawnHuntLocations | ( | Result & | result, |
psSectorInfo * | sectorinfo | ||
) |
Used by LoadHuntLocations() to spawn the hunt locations in game.
result | the result set to use for the spawm |
sectorinfo | The sector to load in. NULL means all sectors. |
CacheManager* SpawnManager::cacheManager [protected] |
Definition at line 290 of file spawnmanager.h.
psDatabase* SpawnManager::database [protected] |
Definition at line 286 of file spawnmanager.h.
EntityManager* SpawnManager::entityManager [protected] |
Definition at line 291 of file spawnmanager.h.
GEMSupervisor* SpawnManager::gem [protected] |
Definition at line 292 of file spawnmanager.h.
csHash<LootEntrySet*> SpawnManager::looting [protected] |
Definition at line 288 of file spawnmanager.h.
LootRandomizer* SpawnManager::lootRandomizer [protected] |
Definition at line 289 of file spawnmanager.h.
csHash<SpawnRule*> SpawnManager::rules [protected] |
Definition at line 287 of file spawnmanager.h.