|
@@ -1569,7 +1569,16 @@ ESpellCastProblem::ESpellCastProblem CBattleInfoCallback::battleIsImmune(const C
|
|
|
return ESpellCastProblem::STACK_IMMUNE_TO_SPELL;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ else if(spell->id == SpellID::HYPNOTIZE && caster) //do not resist hypnotize casted after attack, for example
|
|
|
+ {
|
|
|
+ //TODO: what with other creatures casting hypnotize, Faerie Dragons style?
|
|
|
+ ui64 subjectHealth = (subject->count - 1) * subject->MaxHealth() + subject->firstHPleft;
|
|
|
+ //apply 'damage' bonus for hypnotize, including hero specialty
|
|
|
+ ui64 maxHealth = calculateSpellBonus (caster->getPrimSkillLevel(PrimarySkill::SPELL_POWER)
|
|
|
+ * spell->power + spell->powers[caster->getSpellSchoolLevel(spell)], spell, caster, subject);
|
|
|
+ if (subjectHealth > maxHealth)
|
|
|
+ return ESpellCastProblem::STACK_IMMUNE_TO_SPELL;
|
|
|
+ }
|
|
|
}
|
|
|
else //no target stack on this tile
|
|
|
{
|