Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
Npc.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include "Entity.hpp"
6 
10 class Npc : public Entity
11 {
12 
13 public:
14  Npc(GameWorld* pGameWorld, std::string name, int baseDamage, int baseAccuracy, SpawnCoordinateBounds spawnCoordinateBounds, std::vector<std::string> chatResponses, unsigned int id = 0, Coordinates location = Coordinates());
15 
16  ~Npc() = default;
17 
23  void update();
24 
30  void respawn();
31 
37  std::string getChatResponse();
38 
40 
41 private:
42  std::vector<std::string> chatResponsesM;
43 };
Base pure virtual Entity class. Different types of enities inherit this.
Definition: Entity.hpp:17
GameWorld class. It contains all the player, npc, object and item instances.
Definition: GameWorld.hpp:16
Base NPC class. It represents a peaceful NPC that does not attack the player under any circumstances.
Definition: Npc.hpp:11
void update()
Updates the NPC.
Definition: Npc.cpp:28
void addRandomItemToInventory()
Definition: Npc.cpp:65
std::vector< std::string > chatResponsesM
Definition: Npc.hpp:42
~Npc()=default
Npc(GameWorld *pGameWorld, std::string name, int baseDamage, int baseAccuracy, SpawnCoordinateBounds spawnCoordinateBounds, std::vector< std::string > chatResponses, unsigned int id=0, Coordinates location=Coordinates())
Definition: Npc.cpp:7
std::string getChatResponse()
Get a random chat response.
Definition: Npc.cpp:55
void respawn()
Respawn the NPC.
Definition: Npc.cpp:45
Struct for coordinates.
Definition: Coordinates.hpp:7
Contains the spawn coordinate bounds for a character.
Definition: CharacterReader.hpp:10