Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation. - CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments - This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object. - A gajillion refactors to make everything behave the way it always has (cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
60 lines
1.9 KiB
C++
60 lines
1.9 KiB
C++
/*
|
|
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/*
|
|
* Scripts for spells with SPELLFAMILY_DEMONHUNTER and SPELLFAMILY_GENERIC spells used by demon hunter players.
|
|
* Ordered alphabetically using scriptname.
|
|
* Scriptnames of files in this file should be prefixed with "spell_dh_".
|
|
*/
|
|
|
|
#include "ScriptMgr.h"
|
|
#include "SpellAuraEffects.h"
|
|
#include "SpellMgr.h"
|
|
#include "SpellScript.h"
|
|
|
|
enum DemonHunterSpells
|
|
{
|
|
SPELL_CHAOS_STRIKE_ENERGIZE = 193840,
|
|
};
|
|
|
|
// 197125 - Chaos Strike
|
|
class spell_dh_chaos_strike : public AuraScript
|
|
{
|
|
PrepareAuraScript(spell_dh_chaos_strike);
|
|
|
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
{
|
|
return ValidateSpellInfo({ SPELL_CHAOS_STRIKE_ENERGIZE });
|
|
}
|
|
|
|
void HandleEffectProc(AuraEffect* aurEff, ProcEventInfo& /*eventInfo*/)
|
|
{
|
|
PreventDefaultAction();
|
|
GetTarget()->CastSpell(GetTarget(), SPELL_CHAOS_STRIKE_ENERGIZE, CastSpellExtraArgs(TRIGGERED_FULL_MASK).AddSpellBP0(aurEff->GetAmount()).SetTriggeringAura(aurEff));
|
|
}
|
|
|
|
void Register() override
|
|
{
|
|
OnEffectProc += AuraEffectProcFn(spell_dh_chaos_strike::HandleEffectProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
|
}
|
|
};
|
|
|
|
void AddSC_demon_hunter_spell_scripts()
|
|
{
|
|
RegisterAuraScript(spell_dh_chaos_strike);
|
|
}
|