mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Core/Units: treat CREATURE_FLAG_EXTRA_NO_COMBAT as a pseudo passive react state. Units with that flag will no longer enter combat with potential targets unless they are being engaged by their opponent or explicitely commanded to do so
* apply no combat flag on every creature and their difficulty entries that have been flagged in creaturedifficulty.db2
This commit is contained in:
8
sql/updates/world/4.3.4/2020_08_09_02_world.sql
Normal file
8
sql/updates/world/4.3.4/2020_08_09_02_world.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -108,7 +108,7 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
|
||||
if (me->IsEngaged())
|
||||
return;
|
||||
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false))
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) && !me->IsIgnoringCombat() && me->CanStartAttack(who, false))
|
||||
me->EngageWithTarget(who);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,6 @@
|
||||
return false;
|
||||
if (a->HasUnitState(UNIT_STATE_IN_FLIGHT) || b->HasUnitState(UNIT_STATE_IN_FLIGHT))
|
||||
return false;
|
||||
// ... both units must not be ignoring combat
|
||||
if (a->IsIgnoringCombat() || b->IsIgnoringCombat())
|
||||
return false;
|
||||
if (a->IsFriendlyTo(b) || b->IsFriendlyTo(a))
|
||||
return false;
|
||||
Player const* playerA = a->GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
@@ -2713,7 +2713,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (missInfo != SPELL_MISS_EVADE && spellHitTarget && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
|
||||
{
|
||||
if (Unit* unitCaster = m_caster->ToUnit())
|
||||
unitCaster->AtTargetAttacked(unit, m_spellInfo->HasInitialAggro());
|
||||
unitCaster->AtTargetAttacked(unit, m_spellInfo->HasInitialAggro() && !unitCaster->IsIgnoringCombat());
|
||||
|
||||
if (!unit->IsStandState())
|
||||
unit->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
@@ -7691,7 +7691,11 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier)
|
||||
return;
|
||||
|
||||
// This will only cause combat - the target will engage once the projectile hits (in DoAllEffectOnTarget)
|
||||
if (m_originalCaster && targetInfo.missCondition != SPELL_MISS_EVADE && !m_originalCaster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)) && (m_spellInfo->HasInitialAggro() || unit->IsEngaged()))
|
||||
if (m_originalCaster && targetInfo.missCondition != SPELL_MISS_EVADE
|
||||
&& !m_originalCaster->IsFriendlyTo(unit)
|
||||
&& (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))
|
||||
&& (m_spellInfo->HasInitialAggro() || unit->IsEngaged())
|
||||
&& !m_originalCaster->IsIgnoringCombat())
|
||||
m_originalCaster->SetInCombatWith(unit);
|
||||
|
||||
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
|
||||
Reference in New Issue
Block a user