Skip to content

Add interface methods for NPC_Respawn, NPC_MoveToPlayer and callback OnNPCRespawn #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/Server/Components/NPCs/npcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ struct INPC : public IExtensible, public IEntity
/// Spawn NPC.
virtual void spawn() = 0;

/// Respawn NPC.
virtual void respawn() = 0;

/// Move NPC to a specified location.
virtual bool move(Vector3 position, NPCMoveType moveType, float moveSpeed = NPC_MOVE_SPEED_AUTO) = 0;

/// Move NPC to a player.
virtual bool moveToPlayer(IPlayer& player, NPCMoveType moveType, float moveSpeed = NPC_MOVE_SPEED_AUTO) = 0;

/// Stop NPC from moving.
virtual void stopMove() = 0;

Expand Down Expand Up @@ -180,6 +186,7 @@ struct NPCEventHandler
virtual void onNPCCreate(INPC& npc) {};
virtual void onNPCDestroy(INPC& npc) {};
virtual void onNPCSpawn(INPC& npc) {};
virtual void onNPCRespawn(INPC& npc) {};
virtual void onNPCWeaponStateChange(INPC& npc, PlayerWeaponState newState, PlayerWeaponState oldState) {};
virtual bool onNPCTakeDamage(INPC& npc, IPlayer& damager, float damage, uint8_t weapon, BodyPart bodyPart) { return true; };
virtual bool onNPCGiveDamage(INPC& npc, IPlayer& damaged, float damage, uint8_t weapon, BodyPart bodyPart) { return true; };
Expand Down