Spells/Evoker: Implemented Azure Strike (#28656)

This commit is contained in:
Aqua Deus
2023-01-26 08:16:14 +01:00
committed by GitHub
parent e0980b2c3f
commit eebacbc86e
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=362969 AND `ScriptName`='spell_evo_azure_strike';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(362969, 'spell_evo_azure_strike');

View File

@@ -20,9 +20,12 @@
* Ordered alphabetically using scriptname.
* Scriptnames of files in this file should be prefixed with "spell_evo_".
*/
#include "Containers.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "SpellScript.h"
@@ -34,6 +37,24 @@ enum EvokerSpells
SPELL_EVOKER_SOAR_RACIAL = 369536
};
// 362969 - Azure Strike (blue)
class spell_evo_azure_strike : public SpellScript
{
PrepareSpellScript(spell_evo_azure_strike);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove(GetExplTargetUnit());
Trinity::Containers::RandomResize(targets, GetEffectInfo(EFFECT_0).CalcValue(GetCaster()) - 1);
targets.push_back(GetExplTargetUnit());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_evo_azure_strike::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
// 358733 - Glide (Racial)
class spell_evo_glide : public SpellScript
{
@@ -75,5 +96,6 @@ class spell_evo_glide : public SpellScript
void AddSC_evoker_spell_scripts()
{
RegisterSpellScript(spell_evo_azure_strike);
RegisterSpellScript(spell_evo_glide);
}