mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +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()
|
void Spell::Delayed() // only called in DealDamage()
|
||||||
{
|
{
|
||||||
Unit* unitCaster = m_caster->ToUnit();
|
Player* playerCaster = m_caster->ToPlayer();
|
||||||
if (!unitCaster)
|
if (!playerCaster)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// spells not losing casting time
|
// 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 delaytime = 500; // spellcasting delay is normally 500ms
|
||||||
|
|
||||||
int32 delayReduce = 100; // must be initialized to 100 for percent modifiers
|
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);
|
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)
|
if (delayReduce >= 100)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -7026,16 +7026,16 @@ void Spell::Delayed() // only called in DealDamage()
|
|||||||
m_timer += delaytime;
|
m_timer += delaytime;
|
||||||
|
|
||||||
WorldPacket data(SMSG_SPELL_DELAYED, 8+4);
|
WorldPacket data(SMSG_SPELL_DELAYED, 8+4);
|
||||||
data << unitCaster->GetPackGUID();
|
data << playerCaster->GetPackGUID();
|
||||||
data << uint32(delaytime);
|
data << uint32(delaytime);
|
||||||
|
|
||||||
unitCaster->SendMessageToSet(&data, true);
|
playerCaster->SendMessageToSet(&data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::DelayedChannel()
|
void Spell::DelayedChannel()
|
||||||
{
|
{
|
||||||
Unit* unitCaster = m_caster->ToUnit();
|
Player* playerCaster = m_caster->ToPlayer();
|
||||||
if (!unitCaster)
|
if (!playerCaster)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_spellState != SPELL_STATE_CASTING)
|
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 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
|
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);
|
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)
|
if (delayReduce >= 100)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -7073,11 +7073,11 @@ void Spell::DelayedChannel()
|
|||||||
|
|
||||||
for (TargetInfo const& targetInfo : m_UniqueTargetInfo)
|
for (TargetInfo const& targetInfo : m_UniqueTargetInfo)
|
||||||
if (targetInfo.MissCondition == SPELL_MISS_NONE)
|
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);
|
unit->DelayOwnedAuras(m_spellInfo->Id, m_originalCasterGUID, delaytime);
|
||||||
|
|
||||||
// partially interrupt persistent area auras
|
// partially interrupt persistent area auras
|
||||||
if (DynamicObject* dynObj = unitCaster->GetDynObject(m_spellInfo->Id))
|
if (DynamicObject* dynObj = playerCaster->GetDynObject(m_spellInfo->Id))
|
||||||
dynObj->Delay(delaytime);
|
dynObj->Delay(delaytime);
|
||||||
|
|
||||||
SendChannelUpdate(m_timer);
|
SendChannelUpdate(m_timer);
|
||||||
|
|||||||
Reference in New Issue
Block a user