mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +00:00
[11145] Creatures should get into combat if spell/attack is missed or resisted
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
3d4caa275b
commit
6bdbfc52d4
2 changed files with 15 additions and 1 deletions
|
|
@ -1011,6 +1011,20 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||
DoSpellHitOnUnit(m_caster, mask);
|
||||
}
|
||||
|
||||
if(missInfo == SPELL_MISS_MISS || missInfo == SPELL_MISS_RESIST)
|
||||
{
|
||||
Unit* realCaster = GetAffectiveCaster();
|
||||
if(realCaster && realCaster != unit)
|
||||
{
|
||||
if (!unit->isInCombat() && unit->GetTypeId() != TYPEID_PLAYER && ((Creature*)unit)->AI())
|
||||
((Creature*)unit)->AI()->AttackedBy(realCaster);
|
||||
|
||||
unit->AddThreat(realCaster);
|
||||
unit->SetInCombatWith(realCaster);
|
||||
realCaster->SetInCombatWith(unit);
|
||||
}
|
||||
}
|
||||
|
||||
// All calculated do it!
|
||||
// Do healing and triggers
|
||||
if (m_healing)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue