mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-04 22:40:05 +00:00
dongresource
279cb78d5f
* NPCs now keep track of their chunk information like PlayerView does for players * NPCManager::sendToViewable() parallels PlayerManager::sendToViewable() * Nano damage and debuffs now count as attacking a mob * Mobs will de-aggro if something else killed their target
32 lines
883 B
C++
32 lines
883 B
C++
#pragma once
|
|
|
|
#include "CNStructs.hpp"
|
|
#include "ChunkManager.hpp"
|
|
|
|
class BaseNPC {
|
|
public:
|
|
sNPCAppearanceData appearanceData;
|
|
NPCClass npcClass;
|
|
std::pair<int, int> chunkPos;
|
|
std::vector<Chunk*> currentChunks;
|
|
|
|
BaseNPC() {};
|
|
BaseNPC(int x, int y, int z, int type, int id) {
|
|
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);
|
|
};
|
|
BaseNPC(int x, int y, int z, int type, int id, NPCClass classType) : BaseNPC(x, y, z, type, id) {
|
|
npcClass = classType;
|
|
}
|
|
};
|