20 #ifndef __NPCMANAGER_H_ 21 #define __NPCMANAGER_H_ 25 #include <csutil/ref.h> 41 #define OWNER_ALL 0xFFFFFFFF 53 class PetOwnerSession;
94 void QueueAssessPerception(EID entityEID, EID targetEID,
const csString &physicalAssessmentPerception,
95 const csString &physicalAssessmentDifferencePerception,
96 const csString &magicalAssessmentPerception,
97 const csString &magicalAssessmentDifferencePerception,
98 const csString &overallAssessmentPerception,
99 const csString &overallAssessmentDifferencePerception);
196 void NewNPCNotify(PID player_id, PID master_id, PID owner_id);
void WaypointAddAlias(const Waypoint *wp, const WaypointAlias *alias)
Notify superclients that a alias has been added to a waypoint.
bool CanPetHearYou(int clientnum, Client *owner, gemNPC *pet, const char *type)
Check if a pet is within range to react to commands.
void QueueAssessPerception(EID entityEID, EID targetEID, const csString &physicalAssessmentPerception, const csString &physicalAssessmentDifferencePerception, const csString &magicalAssessmentPerception, const csString &magicalAssessmentDifferencePerception, const csString &overallAssessmentPerception, const csString &overallAssessmentDifferencePerception)
Let the superclient know the result of an assessment.
void QueueEnemyPerception(psNPCCommandsMessage::PerceptionType type, gemActor *npc, gemActor *player, float relative_faction)
Let the superclient know that one enemy is close.
void WaypointRename(const Waypoint *waypoint)
Notify superclients that a waypoint has been renamed.
void QueueFailedToAttackPerception(gemNPC *attacker, gemObject *target)
Let the superclient know that an attempt to attack failed.
MathScript * petTrainingLockoutTime
void PathSetFlag(const psPath *path, const csString &flag, bool enable)
Notify superclients that a flag has been changed for a path.
void PetHasBeenKilled(gemNPC *pet)
Notification that an pet has been killed. Upon notification of a killed pet this function will start ...
void HandlePetSkill(MsgEntry *me, Client *client)
Handle network message with pet skills.
Manages CEL entities on the server.
void QueueInventoryPerception(gemActor *owner, psItem *itemdata, bool inserted)
Let the superclient know that one of its npcs has a change in inventory.
PSSKILL GetPetSkill()
Returns the skill used to handle pet operations.
PetOwnerSession * CreatePetOwnerSession(gemActor *, psCharacter *)
Add Session for pets.
Class to hold information regarding aliases for waypoints.
csArray< PublishDestination > superclients
List of active superclients.
void CheckWorkLocation(gemNPC *npc, Location *location)
Check work location.
void CheckSendPerceptionQueue(size_t expectedAddSize)
Check if the perception queue is going to overflow with the next perception.
void DismissPet(gemNPC *pet, Client *owner)
Dismiss active (summoned) pet.
MathScript * petDismissLockoutTime
void PetInfo(Client *client, psCharacter *pet)
Provide response for the /info commands for GMs for pets.
EntityManager * entityManager
void WaypointAliasRotation(const Waypoint *wp, const WaypointAlias *alias)
Notify superclients that a alias has been added to a waypoint.
void QueueDamagePerception(gemActor *attacker, gemNPC *target, float dmg)
Let the superclient know that a player has taken HP from one of its npcs.
void DebugNPC(gemNPC *npc, Client *client, uint8_t debugLevel)
Requests the npcclient to change the debug level of this npc.
void WaypointAdjusted(Waypoint *wp)
Notify superclients that a waypoint where adjusted.
A MathScript is a mini-program to run.
void QueueTransferPerception(gemActor *owner, psItem *itemdata, csString target)
Let the superclient know that a transfer has happend.
NPCManager(ClientConnectionSet *pCCS, psDatabase *db, EventManager *evtmgr, GEMSupervisor *gemsupervisor, CacheManager *cachemanager, EntityManager *entitymanager)
void LocationTypeAdd(LocationType *locationType)
Notify superclients that a location type has been added.
This class rappresents an option tree which comes from the server_options table.
void HandlePetCommand(MsgEntry *me, Client *client)
Handle network message with pet directives.
void WorkDoneNotify(EID npcEID, csString reward, csString nick)
Inform the npc about the reward granted after a work done.
void QueueOwnerCmdPerception(gemActor *owner, gemNPC *pet, psPETCommandMessage::PetCommand_t command)
Let the superclient know that one of its npcs has been commanded to stay.
MathScript * GetPetDismissLockoutTime()
The structure of 1 queue entry (pointer to a message)
void SendAllCommands(bool createNewTick)
Send all queued commands and perceptions to active superclients and reset the queues.
bool WillPetReact(int clientnum, Client *owner, gemNPC *pet, const char *type, int level)
Check if your pet will reacto to your command based on skills.
psNPCCommandsMessage * outbound
void QueueNPCCmdPerception(gemActor *owner, const csString &cmd)
Let the superclient know that a response has commanded a npc.
void DebugTribe(gemNPC *npc, Client *client, uint8_t debugLevel)
Requests the npcclient to change the debug level of this npc.
MathScript * GetMaxPetTime()
void WaypointRemoveAlias(const Waypoint *wp, const csString &alias)
Notify superclients that a alias has been removed from a waypoint.
MathScript * GetPetTrainingLockoutTime()
void WaypointRadius(const Waypoint *waypoint)
Notify superclients that a waypoint has changed radius.
void PathRename(const psPath *path)
Notify superclients that a path has been renamed.
A waypoint is a specified circle on the map with a name, location, and a list of waypoints it is conn...
void AddEntity(gemObject *obj)
Communicate a entity added to connected superclients.
csArray< PublishDestination > & GetSuperClients()
Get the vector of active superclients, used in Multicast().
void ControlNPC(gemNPC *npc)
Tell a superclient to control an existing npc.
MathScript * GetPetDeathLockoutTime()
This stores a vector of positions listing a set of points defining a common type of location...
EventManager * eventmanager
void HandleSimpleRenderMesh(MsgEntry *me, Client *client)
Handle debug meshes from superclient.
Any semi-autonomous object, either a player or an NPC.
void SendPetSkillList(Client *client, bool forceOpen=true, PSSKILL focus=PSSKILL_NONE)
void PathPointAdjusted(psPathPoint *point)
Notify superclients that a pathpoint where adjusted.
iDataConnection * db
Global connection to the Database. Set from the psDatabase class.
void QueueSpokenToPerception(gemNPC *npc, bool spokenTo)
Send a spoken to perception to the super client for the npc.
void QueueTeleportPerception(gemNPC *npc, csVector3 &pos, float yrot, iSector *sector, InstanceID instance)
Let the superclient know that the npc was teleported.
void AddPoint(const psPath *path, const psPathPoint *point)
Notify superclients that a point has been added to a path.
bool Initialize()
Initialize the npc manager.
void PrepareMessage()
Create an empty command list message, waiting for items to be queued in it.
void UpdateWorldPositions()
Build a message with all changed world positions for superclients to get.
void QueueSpellPerception(gemActor *caster, gemObject *target, const char *spell_cat, uint32_t spell_category, float severity)
Let the superclient know that a spell has been cast.
int getValueAsInt()
Get the value of this specific option in int format.
void QueueAttackPerception(gemActor *attacker, gemNPC *target)
Let the superclient know that a player has attacked one of its npcs.
MathScript * petReactScript
Math script setup for pet should react check.
void ChangeNPCBrain(gemNPC *npc, Client *client, const char *brainName)
Requests the npcclient to change the brain of this npc (the type) to another one. ...
void RemovePetOwnerSession(PetOwnerSession *session)
Remove Session for pets.
MathScript * petDepletedLockoutTime
void NewNPCNotify(PID player_id, PID master_id, PID owner_id)
Send a newly spawned npc to a superclient to manage it.
MathScript * GetPetDepletedLockoutTime()
void WaypointSetFlag(const Waypoint *wp, const csString &flag, bool enable)
Notify superclients that a flag has been changed for waypoint.
MathScript * petRangeScript
Math script setup for pet range check.
void DeletedNPCNotify(PID player_id)
Send a deleted npc to a superclient to un-manage it.
void QueueDeathPerception(gemObject *who)
Let the superclient know that one of its npcs has died.
This class collects data of a netclient.
csHash< PetOwnerSession *, PID > OwnerPetList
void SendMapList(Client *client)
Send the list of maps for the superclient to load on startup.
void SendNPCList(Client *client)
Send a list of managed NPCs to a newly connecting superclient.
ClientConnectionSet * clients
void SendRaces(Client *client)
Send the list of races for the superclient to load on startup.
void Disconnect(Client *client)
Remove a disconnecting superclient from the active list.
void RemovePoint(const psPath *path, int pointId)
Notify superclients that a point has been removed from a path.
void SendAllNPCStats(Client *client)
Send stats for all managed NPCs to a newly connecting superclient.
void HandleConsoleCommand(MsgEntry *me, Client *client)
Handle network message with console commands from npcclient.
void RemoveEntity(MsgEntry *me)
Communicate a entity going away to connected superclients.
void QueueChangeOwnerPerception(gemNPC *npc, EID owner)
Send a change owner perception.
void WaypointCreate(const Waypoint *waypoint)
Notify superclients that a waypoint has been created.
void QueueFlagPerception(gemActor *owner)
Let the superclient know that one of the actors flags has changed.
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...
void HandleNPCReady(MsgEntry *me, Client *client)
void UpdatePetTime()
Updates time in game for a pet.
This class holds the refs to the core factories, etc in CEL.
void QueueStatDR(gemActor *actor, unsigned int statsDirtyFlags)
GEMSupervisor * gemSupervisor
void QueuePerceptPerception(gemNPC *npc, csString perception, csString type)
Send a perception to the super client for the npc.
void LocationAdjusted(Location *location)
Notify superclients that a location where adjusted.
This class is a list of several CLient objects, it's designed for finding clients very fast based on ...
void LocationInserted(Location *location)
Notify superclients that a location where inserted into a region.
void HandleCommandList(MsgEntry *me, Client *client)
Handle a network msg with a list of npc directives.
void HandleDeathEvent(MsgEntry *me, Client *client)
Catch an internal server event for death so a perception can be sent about it.
A Location is a named place on the map, located dynamically by NPCs as scripted.
void QueueInfoRequestPerception(gemNPC *npc, Client *client, const char *infoRequestSubCmd)
Let the superclient know that info is requested for a npc.
void HandleDamageEvent(MsgEntry *me, Client *client)
Catch an internal server event for damage so a perception can be sent about it.
void LocationTypeRemove(const csString &locationTypeName)
Notify superclients that a location type has been deleted.
void HandleAuthentRequest(MsgEntry *me, Client *client)
Handle a login message from a superclient.
void LocationCreated(Location *location)
Notify superclients that a location where created.
CacheManager * cacheManager
MathScript * petDeathLockoutTime
This class handles all queueing and invoking of timed events, such as combat, spells, NPC dialog responses, range weapons, or NPC respawning.
Represents a point on a path between two waypoints.
void PathCreate(const psPath *path)
Notify superclients that a path has been created.
void QueueSpawnedPerception(gemNPC *spawned, gemNPC *spawner, const csString &tribeMemberType)
Let the superclient know the npc was spawned successfully.
void QueueTalkPerception(gemActor *speaker, gemNPC *target)
Let the superclient know that a player has said something to one of its npcs.
void LocationRadius(Location *location)
Notify superclients that a location radius where chaned.
The message sent from server to superclient after successful login.
This class embodies item instances in the game.
Provides a manager to facilitate subscriptions.