Skip to content

Commit 73bc61a

Browse files
authored
Scripts/Spells: Optimized Winter Veil Mistletoe and PX-238 Winter Wondervolt (#31190)
1 parent 53b3bf4 commit 73bc61a

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

src/server/scripts/Events/winter_veil.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ class spell_winter_veil_mistletoe : public SpellScript
4747

4848
void HandleScript(SpellEffIndex /*effIndex*/)
4949
{
50-
if (Player* target = GetHitPlayer())
51-
{
52-
uint32 spellId = RAND(SPELL_CREATE_HOLLY, SPELL_CREATE_MISTLETOE, SPELL_CREATE_SNOWFLAKES);
53-
GetCaster()->CastSpell(target, spellId, true);
54-
}
50+
GetCaster()->CastSpell(GetHitUnit(), RAND(SPELL_CREATE_HOLLY, SPELL_CREATE_MISTLETOE, SPELL_CREATE_SNOWFLAKES), true);
5551
}
5652

5753
void Register() override
@@ -86,18 +82,15 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScript
8682
return ValidateSpellInfo(WonderboltTransformSpells);
8783
}
8884

89-
void HandleScript(SpellEffIndex effIndex)
85+
void HandleScript(SpellEffIndex /*effIndex*/)
9086
{
91-
PreventHitDefaultEffect(effIndex);
87+
Unit* target = GetHitUnit();
9288

93-
if (Unit* target = GetHitUnit())
94-
{
95-
for (uint32 spell : WonderboltTransformSpells)
96-
if (target->HasAura(spell))
97-
return;
89+
for (uint32 spell : WonderboltTransformSpells)
90+
if (target->HasAura(spell))
91+
return;
9892

99-
target->CastSpell(target, Trinity::Containers::SelectRandomContainerElement(WonderboltTransformSpells), true);
100-
}
93+
target->CastSpell(target, Trinity::Containers::SelectRandomContainerElement(WonderboltTransformSpells), true);
10194
}
10295

10396
void Register() override

0 commit comments

Comments
 (0)