Files
DarkflameServer/dGame/dBehaviors/NpcCombatSkillBehavior.h
David Markowitz 56504d9447 fix: add range checks to npc combat skill behavior (#2003)
* fix: add range checks to npc combat skill behavior

tested that all enemies now cast skills smartly based on range to targets, and do not cast skills if they are out of range.

fixes an issue where the spider queen could attack you outside the normal range

fixes an issue where entering happy flower caused you to need to restart the client

fixes #965

* feedback
2026-06-19 01:27:49 -05:00

25 lines
459 B
C++

#pragma once
#include "Behavior.h"
class NpcCombatSkillBehavior final : public Behavior
{
public:
std::vector<Behavior*> m_behaviors;
float m_npcSkillTime;
float m_maxRange{};
float m_minRange{};
/*
* Inherited
*/
explicit NpcCombatSkillBehavior(const uint32_t behavior_id) : Behavior(behavior_id) {
}
void Calculate(BehaviorContext* context, RakNet::BitStream& bit_stream, BehaviorBranchContext branch) override;
void Load() override;
};