Scripts/Spells: Implemented Flurry (#29145)

This commit is contained in:
Aqua Deus
2023-07-24 21:11:06 +02:00
committed by GitHub
parent 821d7c6f57
commit 47d4fa0985
2 changed files with 75 additions and 0 deletions
@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_mage_flurry','spell_mage_flurry_damage');
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(44614,'spell_mage_flurry'),
(228354,'spell_mage_flurry_damage');
+71
View File
@@ -62,6 +62,7 @@ enum MageSpells
SPELL_MAGE_FEEL_THE_BURN = 383391,
SPELL_MAGE_FINGERS_OF_FROST = 44544,
SPELL_MAGE_FIRE_BLAST = 108853,
SPELL_MAGE_FLURRY_DAMAGE = 228596,
SPELL_MAGE_FIRESTARTER = 205026,
SPELL_MAGE_FROST_NOVA = 122,
SPELL_MAGE_GIRAFFE_FORM = 32816,
@@ -94,6 +95,7 @@ enum MageSpells
SPELL_MAGE_CHAIN_REACTION_DUMMY = 278309,
SPELL_MAGE_CHAIN_REACTION = 278310,
SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE = 210833,
SPELL_MAGE_WINTERS_CHILL = 228358
};
// 110909 - Alter Time Aura
@@ -772,6 +774,73 @@ class spell_mage_flame_on : public AuraScript
}
};
// 44614 - Flurry
class spell_mage_flurry : public SpellScript
{
class FlurryEvent : public BasicEvent
{
public:
FlurryEvent(Unit* caster, ObjectGuid const& target, ObjectGuid const& originalCastId, int32 count)
: _caster(caster), _target(target), _originalCastId(originalCastId), _count(count) { }
bool Execute(uint64 time, uint32 /*diff*/) override
{
Unit* target = ObjectAccessor::GetUnit(*_caster, _target);
if (!target)
return true;
_caster->CastSpell(target, SPELL_MAGE_FLURRY_DAMAGE, CastSpellExtraArgs(TRIGGERED_IGNORE_CAST_IN_PROGRESS).SetOriginalCastId(_originalCastId));
if (!--_count)
return true;
_caster->m_Events.AddEvent(this, Milliseconds(time) + randtime(300ms, 400ms));
return false;
}
private:
Unit* _caster;
ObjectGuid _target;
ObjectGuid _originalCastId;
int32 _count;
};
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FLURRY_DAMAGE });
}
void EffectHit(SpellEffIndex /*effIndex*/) const
{
GetCaster()->m_Events.AddEventAtOffset(new FlurryEvent(GetCaster(), GetHitUnit()->GetGUID(), GetSpell()->m_castId, GetEffectValue() - 1), randtime(300ms, 400ms));
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_flurry::EffectHit, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 228354 - Flurry (damage)
class spell_mage_flurry_damage : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_WINTERS_CHILL });
}
void HandleDamage(SpellEffIndex /*effIndex*/) const
{
GetCaster()->CastSpell(GetHitUnit(), SPELL_MAGE_WINTERS_CHILL, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_flurry_damage::HandleDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
// 116 - Frostbolt
class spell_mage_frostbolt : public SpellScript
{
@@ -1467,6 +1536,8 @@ void AddSC_mage_spell_scripts()
RegisterSpellScript(spell_mage_firestarter);
RegisterSpellScript(spell_mage_firestarter_dots);
RegisterSpellScript(spell_mage_flame_on);
RegisterSpellScript(spell_mage_flurry);
RegisterSpellScript(spell_mage_flurry_damage);
RegisterSpellScript(spell_mage_frostbolt);
RegisterSpellScript(spell_mage_hyper_impact);
RegisterSpellScript(spell_mage_ice_barrier);