19 #ifndef __SPAWNMANAGER_H__ 20 #define __SPAWNMANAGER_H__ 28 #include <csgeom/vector3.h> 29 #include <csutil/hash.h> 72 csVector3 PickWithRadius(csVector3 pos,
float radius);
81 const char* type_code,
82 float rx1,
float ry1,
float rz1,
83 float rx2,
float ry2,
float rz2,
85 const char* sectorname);
168 float x,
float y,
float z,
float angle,
185 int GetRespawnDelay();
188 PID CheckSubstitution(PID originalplayer);
195 bool DetermineSpawnLoc(
psCharacter* ch, csVector3 &pos,
float &angle, csString §orname,
InstanceID &instance);
208 return dead_remain_time;
213 return minSpawnSpacingDistance;
250 void CreateMultipleLoot(
psCharacter* chr,
size_t numModifiers = 0);
272 void CreateLoot(
psCharacter* character,
size_t numModifiers = 0);
277 class PendingLootPrompt;
309 return lootRandomizer;
315 void PreloadDatabase();
320 void PreloadLootRules();
326 LoadWaypointsAsSpawnRanges(iDocumentNode* topNode);
364 void Respawn(PID playerID,
SpawnRule* spawnRule);
369 void Respawn(
psCharacter* chardata,
InstanceID instance, csVector3 &where,
float rot,
const char* sector);
416 virtual void Trigger();
437 virtual void Trigger();
This class stores an array of LootModifiers and randomizes loot stats.
int npcspawnruleid
A = Area (rect), L = Line Segment, C = Circle.
PID substituteplayer
Player id to respawn if substitution spawn odds are met.
Manages CEL entities on the server.
LootRandomizer * GetLootRandomizer()
Returns the loot randomizer.
float GetArea()
Get range's XZ area.
float minSpawnSpacingDistance
What should the free space be around before spawn position is accepted.
int id
Unique Id used for ident and tree sorting.
The structure of 1 queue entry (pointer to a message)
psScheduledItem * schedule
csString fixedspawnsector
This class holds one loot possibility for a killed npc.
SpawnManager * spawnmanager
csString spawnsector
Spawn sector name.
csHash< LootEntrySet * > looting
csArray< LootEntry * > entries
int max_item
The maximum amount of these items.
Any semi-autonomous object, either a player or an NPC.
void Initialize(int idval, int spawnruleid, const char *type_code, float rx1, float ry1, float rz1, float rx2, float ry2, float rz2, float radius, const char *sectorname)
Setup variables and compute area.
LootRandomizer * lootRandomizer
iDataConnection * db
Global connection to the Database. Set from the psDatabase class.
int min_item
The minimal amount of these items.
float substitutespawnodds
Odds of substitute spawn triggering instead of respawn of same entity.
LootEntrySet * GetLootRules()
Get the Loot Rule set to generate loot.
EntityManager * entityManager
This class stores an array of LootEntry and calculates required loot on a newly dead mob...
const csString & GetSector()
Get spawn sector name.
When an NPC or mob is killed in the spawn manager, its respawn event is immediately created and added...
When an NPC or mob is killed in the spawn manager, its respawn event is immediately created and added...
int id
Unique ID used for ident.
This is a wrapper class for result sets which makes syntax for getting at the data easier and also us...
LootRandomizer * lootRandomizer
void handleGroupLootItem(psItem *item, gemActor *obj, Client *client, CacheManager *cacheManager, GEMSupervisor *gem, uint8_t lootAction=0)
Handles looting of an item, whether there is a group or not.
This class collects data of a netclient.
SpawnRange()
Ctor clears all to zero.
int minspawntime
Minimum respawn delay in ticks (msec)
CacheManager * cacheManager
csHash< SpawnRule * > rules
float fixedspawnx
If ranges are populated, these are ignored.
SpawnManager * spawnmanager
PID playerID
The PID of the entity to respawn.
This huge class stores all the properties of any object a player can have in the game.
const csVector3 PickPos()
Randomly pick a position within the range.
This class manages the caching of data that is unchanging during server operation.
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision det...
This class holds the refs to the core factories, etc in CEL.
int maxspawntime
Maximum respawn delay in ticks.
LootEntrySet * loot
Rules for generating loot when this npc is killed.
SpawnRule * spawnRule
The rule to use for determine where.
Contains information about sectors from the server perspective.
This class is used to store respawn rules for NPCs.
All scheduled events must inherit from this class.
LootEntrySet(int idx, LootRandomizer *lr)
int GetMinSpawnSpacingDistance()
This class is used to store respawn ranges for NPCs.
This class is periodically called by the engine to ensure that monsters (and other NPCs) are respawne...
float randomizeProbability
The probability that if this item was picked it will be randomized.
csHash< SpawnRange * > ranges
Spawn ranges for the current rule.
This class embodies item instances in the game.
Provides a manager to facilitate subscriptions.