mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 10:37:06 +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);
|
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!
|
// All calculated do it!
|
||||||
// Do healing and triggers
|
// Do healing and triggers
|
||||||
if (m_healing)
|
if (m_healing)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11144"
|
#define REVISION_NR "11145"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue