fix(Core/Spells): Taunt always set proper target while channelling sp… (#13948)

* fix(Core/Spells): Taunt always set proper target while channelling spells.

Fixes #13841

* Update.

* Update.
This commit is contained in:
UltraNix
2023-08-06 03:16:05 +02:00
committed by GitHub
parent e8507435ff
commit c3acf75618
4 changed files with 19 additions and 17 deletions

View File

@@ -14643,6 +14643,8 @@ void Unit::TauntApply(Unit* taunter)
return;
SetInFront(taunter);
SetGuidValue(UNIT_FIELD_TARGET, taunter->GetGUID());
if (creature->IsAIEnabled)
creature->AI()->AttackStart(taunter);
@@ -14681,6 +14683,7 @@ void Unit::TauntFadeOut(Unit* taunter)
if (target && target != taunter)
{
SetGuidValue(UNIT_FIELD_TARGET, target->GetGUID());
SetInFront(target);
if (creature->IsAIEnabled)
creature->AI()->AttackStart(target);

View File

@@ -1101,6 +1101,20 @@ void AuraEffect::PeriodicTick(AuraApplication* aurApp, Unit* caster) const
Unit* target = aurApp->GetTarget();
// Update serverside orientation of tracking channeled auras on periodic update ticks
// exclude players because can turn during channeling and shouldn't desync orientation client/server
if (caster && !caster->IsPlayer() && m_spellInfo->IsChanneled() && m_spellInfo->HasAttribute(SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL))
{
ObjectGuid const channelGuid = caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT);
if (!channelGuid.IsEmpty() && channelGuid != caster->GetGUID())
{
if (WorldObject const* objectTarget = ObjectAccessor::GetWorldObject(*caster, channelGuid))
{
caster->SetInFront(objectTarget);
}
}
}
switch (GetAuraType())
{
case SPELL_AURA_PERIODIC_DUMMY:
@@ -6122,14 +6136,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
GetBase()->GetUnitOwner()->CastSpell(target, triggeredSpellInfo, true, 0, this, GetBase()->GetUnitOwner()->GetGUID());
return;
}
// Slime Spray - temporary here until preventing default effect works again
// added on 9.10.2010
case 69508:
{
if (caster)
caster->CastSpell(target, triggerSpellId, true, nullptr, nullptr, caster->GetGUID());
return;
}
// Trial of the Crusader, Jaraxxus, Spinning Pain Spike
case 66283:
{

View File

@@ -3317,9 +3317,6 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/)
if (HostileReference* forcedVictim = unitTarget->GetThreatMgr().GetOnlineContainer().getReferenceByTarget(m_caster))
unitTarget->GetThreatMgr().setCurrentVictim(forcedVictim);
}
if (unitTarget->ToCreature()->IsAIEnabled && !unitTarget->ToCreature()->HasReactState(REACT_PASSIVE))
unitTarget->ToCreature()->AI()->AttackStart(m_caster);
}
void Spell::EffectWeaponDmg(SpellEffIndex effIndex)

View File

@@ -277,13 +277,9 @@ public:
{
if (Creature* c = me->SummonCreature(NPC_OOZE_SPRAY_STALKER, *target, TEMPSUMMON_TIMED_DESPAWN, 8000))
{
me->SetOrientation(me->GetAngle(c));
me->SetControlled(true, UNIT_STATE_ROOT);
me->DisableRotate(true);
me->SetFacingTo(me->GetAngle(c));
me->SendMovementFlagUpdate();
me->SetFacingToObject(c);
Talk(EMOTE_SLIME_SPRAY);
me->CastSpell(c, SPELL_SLIME_SPRAY, false);
DoCastSelf(SPELL_SLIME_SPRAY);
}
}
events.DelayEvents(1);