From e582a8d17abcfb1d7f7024f6c4d0c7a49fc45559 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sun, 12 Aug 2018 15:35:38 -0400 Subject: [PATCH] Change spell logic to use min_hp from spell list. --- zone/mob_ai.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 18fc5d441..1e8aeb2b4 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -197,7 +197,10 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates } case SpellType_Escape: { - if (GetHPRatio() <= 5 ) + // If min_hp !=0 then the spell list has specified + // custom range and we're inside that range if we + // made it here. The hard coded <=5 is for unspecified. + if (AIspells[i].min_hp != 0 || GetHPRatio() <= 5) { AIDoSpellCast(i, tar, mana_cost); return true;