Planeshift
|
This class is used to store respawn rules for NPCs. More...
#include <spawnmanager.h>
Public Member Functions | |
void | AddRange (SpawnRange *range) |
Add a spawn range to current rule. | |
PID | CheckSubstitution (PID originalplayer) |
Determine if substitute player should be spawned. Returns either original or substitute. | |
bool | DetermineSpawnLoc (psCharacter *ch, csVector3 &pos, float &angle, csString §orname, InstanceID &instance) |
Pick a spot for the entity to respawn. | |
int | GetDeadRemainTime () |
int | GetID () |
LootEntrySet * | GetLootRules () |
Get the Loot Rule set to generate loot. | |
int | GetMinSpawnSpacingDistance () |
int | GetRespawnDelay () |
Get random value between min and max spawn time, in ticks/msecs. | |
void | Initialize (int idval, int minspawn, int maxspawn, float substodds, int substplayer, float x, float y, float z, float angle, const char *sector, LootEntrySet *loot_id, int dead_time, float minSpacing, InstanceID instance) |
Setup variables. | |
void | SetID (int idval) |
SpawnRule () | |
Ctor clears all to zero. | |
~SpawnRule () | |
Protected Attributes | |
int | dead_remain_time |
InstanceID | fixedinstance |
float | fixedspawnrot |
csString | fixedspawnsector |
float | fixedspawnx |
If ranges are populated, these are ignored. | |
float | fixedspawny |
float | fixedspawnz |
int | id |
Unique Id used for ident and tree sorting. | |
LootEntrySet * | loot |
Rules for generating loot when this npc is killed. | |
int | maxspawntime |
Maximum respawn delay in ticks. | |
float | minSpawnSpacingDistance |
What should the free space be around before spawn position is accepted. | |
int | minspawntime |
Minimum respawn delay in ticks (msec) | |
csRandomGen * | randomgen |
csHash< SpawnRange * > | ranges |
Spawn ranges for the current rule. | |
PID | substituteplayer |
Player id to respawn if substitution spawn odds are met. | |
float | substitutespawnodds |
Odds of substitute spawn triggering instead of respawn of same entity. |
This class is used to store respawn rules for NPCs.
They are loaded from the database at startup and used only in RAM thereafter.
Definition at line 118 of file spawnmanager.h.
SpawnRule::SpawnRule | ( | ) |
Ctor clears all to zero.
SpawnRule::~SpawnRule | ( | ) |
void SpawnRule::AddRange | ( | SpawnRange * | range | ) |
Add a spawn range to current rule.
PID SpawnRule::CheckSubstitution | ( | PID | originalplayer | ) |
Determine if substitute player should be spawned. Returns either original or substitute.
bool SpawnRule::DetermineSpawnLoc | ( | psCharacter * | ch, |
csVector3 & | pos, | ||
float & | angle, | ||
csString & | sectorname, | ||
InstanceID & | instance | ||
) |
Pick a spot for the entity to respawn.
int SpawnRule::GetDeadRemainTime | ( | ) | [inline] |
Definition at line 206 of file spawnmanager.h.
int SpawnRule::GetID | ( | ) | [inline] |
Definition at line 175 of file spawnmanager.h.
LootEntrySet* SpawnRule::GetLootRules | ( | ) | [inline] |
Get the Loot Rule set to generate loot.
Definition at line 201 of file spawnmanager.h.
int SpawnRule::GetMinSpawnSpacingDistance | ( | ) | [inline] |
Definition at line 211 of file spawnmanager.h.
int SpawnRule::GetRespawnDelay | ( | ) |
Get random value between min and max spawn time, in ticks/msecs.
void SpawnRule::Initialize | ( | int | idval, |
int | minspawn, | ||
int | maxspawn, | ||
float | substodds, | ||
int | substplayer, | ||
float | x, | ||
float | y, | ||
float | z, | ||
float | angle, | ||
const char * | sector, | ||
LootEntrySet * | loot_id, | ||
int | dead_time, | ||
float | minSpacing, | ||
InstanceID | instance | ||
) |
Setup variables.
void SpawnRule::SetID | ( | int | idval | ) | [inline] |
Definition at line 179 of file spawnmanager.h.
int SpawnRule::dead_remain_time [protected] |
Definition at line 154 of file spawnmanager.h.
InstanceID SpawnRule::fixedinstance [protected] |
Definition at line 145 of file spawnmanager.h.
float SpawnRule::fixedspawnrot [protected] |
Definition at line 143 of file spawnmanager.h.
csString SpawnRule::fixedspawnsector [protected] |
Definition at line 144 of file spawnmanager.h.
float SpawnRule::fixedspawnx [protected] |
If ranges are populated, these are ignored.
Definition at line 140 of file spawnmanager.h.
float SpawnRule::fixedspawny [protected] |
Definition at line 141 of file spawnmanager.h.
float SpawnRule::fixedspawnz [protected] |
Definition at line 142 of file spawnmanager.h.
int SpawnRule::id [protected] |
Unique Id used for ident and tree sorting.
Definition at line 125 of file spawnmanager.h.
LootEntrySet* SpawnRule::loot [protected] |
Rules for generating loot when this npc is killed.
Definition at line 152 of file spawnmanager.h.
int SpawnRule::maxspawntime [protected] |
Maximum respawn delay in ticks.
Definition at line 131 of file spawnmanager.h.
float SpawnRule::minSpawnSpacingDistance [protected] |
What should the free space be around before spawn position is accepted.
Definition at line 146 of file spawnmanager.h.
int SpawnRule::minspawntime [protected] |
Minimum respawn delay in ticks (msec)
Definition at line 128 of file spawnmanager.h.
csRandomGen* SpawnRule::randomgen [protected] |
Definition at line 122 of file spawnmanager.h.
csHash<SpawnRange*> SpawnRule::ranges [protected] |
Spawn ranges for the current rule.
Definition at line 149 of file spawnmanager.h.
PID SpawnRule::substituteplayer [protected] |
Player id to respawn if substitution spawn odds are met.
Definition at line 137 of file spawnmanager.h.
float SpawnRule::substitutespawnodds [protected] |
Odds of substitute spawn triggering instead of respawn of same entity.
Definition at line 134 of file spawnmanager.h.