mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: use spell caster as a target of spells triggered by SPELL_EFFECT_FORCE_CAST
This commit is contained in:
@@ -1614,27 +1614,22 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
|
||||
{
|
||||
switch (m_spellInfo->Id)
|
||||
{
|
||||
case 52588: // Skeletal Gryphon Escape
|
||||
case 48598: // Ride Flamebringer Cue
|
||||
unitTarget->RemoveAura(damage);
|
||||
break;
|
||||
case 52588: // Skeletal Gryphon Escape
|
||||
unitTarget->RemoveAura(damage);
|
||||
unitTarget->CastSpell(unitTarget, spellInfo, true);
|
||||
return;
|
||||
case 52463: // Hide In Mine Car
|
||||
case 52349: // Overtake
|
||||
unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID);
|
||||
return;
|
||||
case 72378: // Blood Nova
|
||||
case 73058: // Blood Nova
|
||||
m_caster->CastSpell(unitTarget, 72380, true); // additional spell cast
|
||||
m_caster->CastSpell(unitTarget, damage, true); // additional spell cast
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Unit* caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget);
|
||||
|
||||
caster->CastSpell(unitTarget, spellInfo, true, NULL, NULL, m_originalCasterGUID);
|
||||
unitTarget->CastSpell(m_caster, spellInfo, true);
|
||||
}
|
||||
|
||||
void Spell::EffectForceCastWithValue(SpellEffIndex effIndex)
|
||||
@@ -1653,9 +1648,8 @@ void Spell::EffectForceCastWithValue(SpellEffIndex effIndex)
|
||||
return;
|
||||
}
|
||||
int32 bp = damage;
|
||||
Unit* caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget);
|
||||
|
||||
caster->CastCustomSpell(unitTarget, spellInfo->Id, &bp, &bp, &bp, true, NULL, NULL, m_originalCasterGUID);
|
||||
unitTarget->CastCustomSpell(m_caster, spellInfo->Id, &bp, &bp, &bp, true, NULL, NULL, m_originalCasterGUID);
|
||||
}
|
||||
|
||||
void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
||||
|
||||
@@ -426,20 +426,9 @@ class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
|
||||
unitList = m_unitList;
|
||||
}
|
||||
|
||||
void HandleForceCast(SpellEffIndex i)
|
||||
{
|
||||
Player* player = GetHitPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
player->CastSpell(GetTargetUnit(), GetSpellInfo()->EffectTriggerSpell[i], true); // Don't send m_originalCasterGUID param here or underlying
|
||||
PreventHitEffect(i); // AureEffect::HandleAuraControlVehicle will fail on caster == target
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC);
|
||||
OnEffect += SpellEffectFn(spell_ulduar_stone_grip_cast_target_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_1, TARGET_UNIT_AREA_ENEMY_SRC);
|
||||
OnUnitTargetSelect += SpellUnitTargetFn(spell_ulduar_stone_grip_cast_target_SpellScript::FillTargetsSubsequential, EFFECT_2, TARGET_UNIT_AREA_ENEMY_SRC);
|
||||
}
|
||||
|
||||
@@ -1170,15 +1170,8 @@ class spell_gen_launch : public SpellScriptLoader
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
SpellEntry const* const spell = GetSpellInfo();
|
||||
|
||||
if (Player* player = GetHitPlayer())
|
||||
{
|
||||
player->CastSpell(player,spell->EffectTriggerSpell[1],true); // changes the player's seat
|
||||
player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE,player); // prevents falling damage
|
||||
}
|
||||
}
|
||||
|
||||
void Launch()
|
||||
|
||||
Reference in New Issue
Block a user