mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-20 21:54:23 +00:00
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
This commit is contained in:
@@ -350,7 +350,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto result = skillComponent->CalculateBehavior(entry.skillId, entry.behavior->m_behaviorId, LWOOBJID_EMPTY);
|
||||
const auto result = skillComponent->CalculateBehavior(entry.skillId, entry.behavior->m_behaviorId, GetTarget());
|
||||
|
||||
if (result.success) {
|
||||
if (m_MovementAI != nullptr) {
|
||||
@@ -759,8 +759,8 @@ void BaseCombatAIComponent::SetTetherSpeed(float value) {
|
||||
m_TetherSpeed = value;
|
||||
}
|
||||
|
||||
void BaseCombatAIComponent::Stun(const float time) {
|
||||
if (m_StunImmune || m_StunTime > time) {
|
||||
void BaseCombatAIComponent::Stun(const float time, const bool force) {
|
||||
if (!force && (m_StunImmune || m_StunTime > time)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user