fix(Scripts/Underbog): Underbog Shambler's Allergies should periodica… (#14563)

This commit is contained in:
UltraNix
2023-02-11 02:14:49 +01:00
committed by GitHub
parent d336b63f50
commit fbaa48e233
3 changed files with 33 additions and 23 deletions

View File

@@ -0,0 +1,2 @@
--
UPDATE `spell_script_names` SET `ScriptName`='spell_allergies' WHERE `spell_id`=31427;

View File

@@ -142,28 +142,6 @@ struct boss_the_black_stalker : public BossAI
}
};
class spell_gen_allergies : public AuraScript
{
PrepareAuraScript(spell_gen_allergies);
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
{
isPeriodic = true;
amplitude = urand(10 * IN_MILLISECONDS, 200 * IN_MILLISECONDS);
}
void Update(AuraEffect* /*effect*/)
{
SetDuration(0);
}
void Register() override
{
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_gen_allergies::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_allergies::Update, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 31704 - Levitate
class spell_the_black_stalker_levitate : public SpellScript
{
@@ -252,7 +230,6 @@ class spell_the_black_stalker_magnetic_pull : public SpellScript
void AddSC_boss_the_black_stalker()
{
RegisterUnderbogCreatureAI(boss_the_black_stalker);
RegisterSpellScript(spell_gen_allergies);
RegisterSpellScript(spell_the_black_stalker_levitate);
RegisterSpellScript(spell_the_black_stalker_levitation_pulse);
RegisterSpellScript(spell_the_black_stalker_someone_grab_me);

View File

@@ -40,7 +40,38 @@ class spell_fungal_decay : public AuraScript
}
};
enum AllergiesEnum
{
SPELL_SNEEZE = 31428
};
class spell_allergies : public AuraScript
{
PrepareAuraScript(spell_allergies);
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
{
isPeriodic = true;
amplitude = urand(10 * IN_MILLISECONDS, 60 * IN_MILLISECONDS);
}
void Update(AuraEffect* /*effect*/)
{
if (Unit* target = GetUnitOwner())
{
target->CastSpell(target, SPELL_SNEEZE, true);
}
}
void Register() override
{
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_allergies::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_allergies::Update, EFFECT_0, SPELL_AURA_DUMMY);
}
};
void AddSC_underbog()
{
RegisterSpellScript(spell_fungal_decay);
RegisterSpellScript(spell_allergies);
}