OpenFusion/src/NPC.hpp

32 lines
883 B
C++
Raw Normal View History

#pragma once
2020-08-20 21:43:48 +00:00
#include "CNStructs.hpp"
#include "ChunkManager.hpp"
2020-08-20 21:43:48 +00:00
class BaseNPC {
public:
sNPCAppearanceData appearanceData;
2020-09-23 03:41:43 +00:00
NPCClass npcClass;
std::pair<int, int> chunkPos;
std::vector<Chunk*> currentChunks;
2020-08-20 21:43:48 +00:00
BaseNPC() {};
BaseNPC(int x, int y, int z, int type, int id) {
2020-08-20 21:43:48 +00:00
appearanceData.iX = x;
appearanceData.iY = y;
appearanceData.iZ = z;
appearanceData.iNPCType = type;
appearanceData.iHP = 400;
appearanceData.iAngle = 0;
appearanceData.iConditionBitFlag = 0;
appearanceData.iBarkerType = 0;
appearanceData.iNPC_ID = id;
chunkPos = ChunkManager::grabChunk(x, y);
currentChunks = ChunkManager::grabChunks(chunkPos);
2020-08-20 21:43:48 +00:00
};
BaseNPC(int x, int y, int z, int type, int id, NPCClass classType) : BaseNPC(x, y, z, type, id) {
2020-09-23 03:41:43 +00:00
npcClass = classType;
}
};