mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Scripts/BlackTemple): Fatal Attraction (#19641)
* Fix it not being cast if no valid targets are available * Apply Patch 2.2 nerfs
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
--
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mother_shahraz_fatal_attraction_aura';
|
||||
@@ -208,8 +208,6 @@ class spell_mother_shahraz_fatal_attraction : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY));
|
||||
if (targets.size() <= 1)
|
||||
FinishCast(SPELL_FAILED_DONT_REPORT);
|
||||
}
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
@@ -249,12 +247,17 @@ class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true);
|
||||
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
|
||||
aurEff->SetAmount(aurEff->GetTickNumber());
|
||||
}
|
||||
if (Unit* caster = GetCaster())
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
|
||||
{
|
||||
if (aurEff->GetTickNumber() <= 2)
|
||||
{
|
||||
int32 damage = 1000 * aurEff->GetTickNumber();
|
||||
caster->CastCustomSpell(caster, SPELL_FATAL_ATTRACTION_DAMAGE, &damage, 0, 0, true);
|
||||
}
|
||||
else
|
||||
caster->CastSpell(caster, SPELL_FATAL_ATTRACTION_DAMAGE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
@@ -263,25 +266,6 @@ class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
if (effect->GetTickNumber() > uint32(effect->GetAmount() + 1))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mother_shahraz()
|
||||
{
|
||||
RegisterBlackTempleCreatureAI(boss_mother_shahraz);
|
||||
@@ -290,6 +274,5 @@ void AddSC_boss_mother_shahraz()
|
||||
RegisterSpellScript(spell_mother_shahraz_saber_lash_aura);
|
||||
RegisterSpellScript(spell_mother_shahraz_fatal_attraction);
|
||||
RegisterSpellScript(spell_mother_shahraz_fatal_attraction_dummy);
|
||||
RegisterSpellScript(spell_mother_shahraz_fatal_attraction_aura);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user