mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-19 21:24:21 +00:00
* 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
25 lines
459 B
C++
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;
|
|
};
|