From 0dd628717d7619551e302995c65b81c2d98daa42 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Tue, 25 Jul 2023 13:42:40 -0400 Subject: [PATCH] Move buffs from Mob to CombatNPC --- src/Entities.hpp | 2 ++ src/Groups.hpp | 5 +++++ src/MobAI.hpp | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Entities.hpp b/src/Entities.hpp index d84f756..9dffe5d 100644 --- a/src/Entities.hpp +++ b/src/Entities.hpp @@ -104,6 +104,8 @@ struct CombatNPC : public BaseNPC, public ICombatant { std::map stateHandlers; std::map transitionHandlers; + std::unordered_map buffs = {}; + CombatNPC(int x, int y, int z, int angle, uint64_t iID, int t, int id, int maxHP) : BaseNPC(angle, iID, t, id), maxHealth(maxHP) { spawnX = x; diff --git a/src/Groups.hpp b/src/Groups.hpp index b8a1782..4fe40f5 100644 --- a/src/Groups.hpp +++ b/src/Groups.hpp @@ -3,6 +3,7 @@ #include "EntityRef.hpp" #include +#include struct Group { std::vector members; @@ -14,6 +15,10 @@ struct Group { }); return filtered; } + EntityRef getLeader() { + assert(members.size() > 0); + return members[0]; + } Group(EntityRef leader); }; diff --git a/src/MobAI.hpp b/src/MobAI.hpp index 09eeefb..3e74d3f 100644 --- a/src/MobAI.hpp +++ b/src/MobAI.hpp @@ -41,7 +41,6 @@ struct Mob : public CombatNPC { time_t lastDrainTime = 0; int skillStyle = -1; // -1 for nothing, 0-2 for corruption, -2 for eruption int hitX = 0, hitY = 0, hitZ = 0; // for use in ability targeting - std::unordered_map buffs = {}; // group int groupLeader = 0;