Merge pull request #766 from noudess/master

Change spell logic to use min_hp from spell list.
This commit is contained in:
Michael Cook (mackal) 2018-08-12 15:55:59 -04:00 committed by GitHub
commit 54abeba1ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;