From 5285e8a16326e15bc643a2455afb54195e1b1ed8 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Mon, 2 Oct 2017 14:40:21 -0400 Subject: [PATCH] Rooted mobs cast spells instead of doing nothing. --- zone/mob_ai.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 58c856d77..8efdba38c 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -57,7 +57,11 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { if(AI_HasSpells() == false) return false; - if (iChance < 100) { + // Rooted mobs were just standing around when tar out of range. + // Any sane mob would cast if they can. + bool cast_only_option = (IsRooted() && !CombatRange(tar)); + + if (!cast_only_option && iChance < 100) { if (zone->random.Int(0, 100) >= iChance) return false; }