When an enemy NPC has their speed attribute reduced enough, usually with a few applications of a drain speed spell. They will no longer attack. They will still be hostile and actively pursuing the player, or other targets, but they seem to no longer be able to attack in melee at all. If you hit them with a heal speed spell, they will go back to attacking like normal again, but if reduced below some point, they will be unable to attack once again.
To Reproduce
- Make a drain speed spell, make it whatever effect, on touch usually works well.
- Go up to an enemy NPC that is hostile toward you and start spamming them with the drain speed effect.
- You will know it worked once they stop attacking all together, but are still actively pursuing you.
- You can lead them all around and have a staring contest, but they will not be able to attack in melee.
- If you wish, you can do an on touch "heal speed" spell on them, to confirm once their speed state is brought back up, they can once again attack.
- This may be somewhat difficult to reproduce because of this other mentioned bug: viewtopic.php?f=5&t=3912
Expected behavior
I never used the drain spell before in classic Daggerfall, but I assume the intended behavior would be for the enemy with the drained speed to still be able to attack, but only at an extremely slow rate, as is the case with the player having massively increased animation times for their melee attacks.
Screenshots
No screenshots as it this can be fairly easily reproduced with console commands. If needed I can add some.
Desktop (please complete the following information):
OS: Windows
Version: Alpha 0.10.24
Additional context
I have a hunch that the cause of this may be from this block of code in the "EnemyAttack.cs" script, but i'm not 100% sure. It either seems like a bug with the AI, or the enemy is literally not being allowed to have their MeleeAnimation timer reset with their speed at such low levels.:
EnemyAttack.cs
Code: Select all
void FixedUpdate()
{
// Unable to attack if AI disabled or paralyzed
if (GameManager.Instance.DisableAI || entityBehaviour.Entity.IsParalyzed)
return;
// Unable to attack when playing certain oneshot anims
if (mobile && mobile.IsPlayingOneShot() && mobile.OneShotPauseActionsWhilePlaying())
return;
// Countdown to next melee attack
MeleeTimer -= Time.deltaTime;
if (MeleeTimer < 0)
MeleeTimer = 0;
EnemyEntity entity = entityBehaviour.Entity as EnemyEntity;
int speed = entity.Stats.LiveSpeed;
// Note: Speed comparison here is reversed from classic. Classic's way makes fewer attack
// attempts at higher speeds, so it seems backwards.
if (GameManager.ClassicUpdate && (DFRandom.rand() % speed >= (speed >> 3) + 6 && MeleeTimer == 0))
{
if (!MeleeAnimation())
return;
ResetMeleeTimer();
}
}