Improved pet spellcasting AI (#202)
* Now checks CastSpell() return values
Now checks CastSpell() return values rather than assuming spell casts always succeed.
Made LivingHasEffect() public static.
* Improved pet spellcasting AI
Changed pets to use sorted spell lists and improved AI.
Pets will now stop melee attacking to cast offensive and defensive spells so long as they aren't being interrupted.
Pets now use instant spells when in melee.
Healing pets now check for heals in two passes to prioritize healing badly injured targets.
Now uses CastSpell() return value rather than assuming spell casts always succeed.
Added default case to CheckDefensiveSpell() which calls the base method.
* Changed Body.CastSpell() to return whether or not the spellcast started
* Multiple fixes
Improved spell sorting.
Changed CastSpell() to return whether or not the spell started casting successfully.
NPCTemplates are now always used to load values not found in the mob db table, so that mobs now get spells/styles/abilities even if the template is set to not replace mob values.
* Fixed CanCastInCombat() and pet spell scaling
CanCastInCombat() always returning true was leading to mobs attacking while casting spells. It now checks if the spell is instant cast or uninterruptible.
ScaleSpells() had the style snare and attack speed debuffs mixed up, so the snare values and debuff durations were being scaled.
* Changed CastSpell() to return whether the spell cast succeeded
* CastSpell() now returns whether or not the spellcast started
* CastSpell() now returns whether or not the spellcast started
* IsHealing now includes cure poison/disease spells, added TargetHasEffect()
IsHealing now includes cure poison/disease spells so they are properly sorted into healing spell lists.
TargetHasEffect() provides a more readable alternative to checking spell duration and LivingHasEffect()
* Optimized to only re-sort spells if they're scaled
* Changed to use newer ScalePetSpell() function
* Changed to use new ScalePetSpells()
* Removed m_template
m_template was no longer needed, and the ambiguity of it and m_npctemplate led to mistakes.