Core/Spells: use spell caster as a target of spells triggered by SPELL_EFFECT_FORCE_CAST

This commit is contained in:
QAston
2011-07-07 18:02:04 +02:00
parent 4147106373
commit 0dc90a2cbb
3 changed files with 4 additions and 28 deletions

View File

@@ -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);
}

View File

@@ -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()