mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Spells: Spell pushback now only affects players (as it should)
This commit is contained in:
@@ -6994,8 +6994,8 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 /
|
||||
|
||||
void Spell::Delayed() // only called in DealDamage()
|
||||
{
|
||||
Unit* unitCaster = m_caster->ToUnit();
|
||||
if (!unitCaster)
|
||||
Player* playerCaster = m_caster->ToPlayer();
|
||||
if (!playerCaster)
|
||||
return;
|
||||
|
||||
// spells not losing casting time
|
||||
@@ -7009,9 +7009,9 @@ void Spell::Delayed() // only called in DealDamage()
|
||||
int32 delaytime = 500; // spellcasting delay is normally 500ms
|
||||
|
||||
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
|
||||
if (Player* player = unitCaster->GetSpellModOwner())
|
||||
if (Player* player = playerCaster->GetSpellModOwner())
|
||||
player->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
|
||||
delayReduce += unitCaster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
|
||||
delayReduce += playerCaster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
|
||||
if (delayReduce >= 100)
|
||||
return;
|
||||
|
||||
@@ -7026,16 +7026,16 @@ void Spell::Delayed() // only called in DealDamage()
|
||||
m_timer += delaytime;
|
||||
|
||||
WorldPacket data(SMSG_SPELL_DELAYED, 8+4);
|
||||
data << unitCaster->GetPackGUID();
|
||||
data << playerCaster->GetPackGUID();
|
||||
data << uint32(delaytime);
|
||||
|
||||
unitCaster->SendMessageToSet(&data, true);
|
||||
playerCaster->SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Spell::DelayedChannel()
|
||||
{
|
||||
Unit* unitCaster = m_caster->ToUnit();
|
||||
if (!unitCaster)
|
||||
Player* playerCaster = m_caster->ToPlayer();
|
||||
if (!playerCaster)
|
||||
return;
|
||||
|
||||
if (m_spellState != SPELL_STATE_CASTING)
|
||||
@@ -7055,9 +7055,9 @@ void Spell::DelayedChannel()
|
||||
int32 delaytime = CalculatePct(duration, 25); // channeling delay is normally 25% of its time per hit
|
||||
|
||||
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
|
||||
if (Player* player = unitCaster->GetSpellModOwner())
|
||||
if (Player* player = playerCaster->GetSpellModOwner())
|
||||
player->ApplySpellMod(m_spellInfo->Id, SPELLMOD_NOT_LOSE_CASTING_TIME, delayReduce, this);
|
||||
delayReduce += unitCaster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
|
||||
delayReduce += playerCaster->GetTotalAuraModifier(SPELL_AURA_REDUCE_PUSHBACK) - 100;
|
||||
if (delayReduce >= 100)
|
||||
return;
|
||||
|
||||
@@ -7073,11 +7073,11 @@ void Spell::DelayedChannel()
|
||||
|
||||
for (TargetInfo const& targetInfo : m_UniqueTargetInfo)
|
||||
if (targetInfo.MissCondition == SPELL_MISS_NONE)
|
||||
if (Unit* unit = (unitCaster->GetGUID() == targetInfo.TargetGUID) ? unitCaster : ObjectAccessor::GetUnit(*unitCaster, targetInfo.TargetGUID))
|
||||
if (Unit* unit = (playerCaster->GetGUID() == targetInfo.TargetGUID) ? playerCaster : ObjectAccessor::GetUnit(*playerCaster, targetInfo.TargetGUID))
|
||||
unit->DelayOwnedAuras(m_spellInfo->Id, m_originalCasterGUID, delaytime);
|
||||
|
||||
// partially interrupt persistent area auras
|
||||
if (DynamicObject* dynObj = unitCaster->GetDynObject(m_spellInfo->Id))
|
||||
if (DynamicObject* dynObj = playerCaster->GetDynObject(m_spellInfo->Id))
|
||||
dynObj->Delay(delaytime);
|
||||
|
||||
SendChannelUpdate(m_timer);
|
||||
|
||||
Reference in New Issue
Block a user