aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp2
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp37
-rw-r--r--src/server/scripts/Spells/spell_item.cpp98
3 files changed, 57 insertions, 80 deletions
diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
index a0cdc280f13..75b55d566d5 100644
--- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp
@@ -344,5 +344,5 @@ void AddSC_boss_bronjahm()
RegisterSpellScriptWithArgs(spell_bronjahm_soulstorm_visual, "spell_bronjahm_soulstorm_channel");
RegisterSpellScriptWithArgs(spell_bronjahm_soulstorm_visual, "spell_bronjahm_soulstorm_visual");
RegisterSpellScript(spell_bronjahm_soulstorm_targeting);
- RegisterSpellScript(achievement_bronjahm_soul_power);
+ new achievement_bronjahm_soul_power();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index cd8fcfb0663..6c6f88e0ba6 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -2200,33 +2200,22 @@ class spell_gen_interrupt : public AuraScript
}
};
-class spell_gen_increase_stats_buff : public SpellScriptLoader
+class spell_gen_increase_stats_buff : public SpellScript
{
- public:
- spell_gen_increase_stats_buff(char const* scriptName) : SpellScriptLoader(scriptName) { }
-
- class spell_gen_increase_stats_buff_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_gen_increase_stats_buff_SpellScript);
-
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- if (GetHitUnit()->IsInRaidWith(GetCaster()))
- GetCaster()->CastSpell(GetCaster(), GetEffectValue() + 1, true); // raid buff
- else
- GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); // single-target buff
- }
+ PrepareSpellScript(spell_gen_increase_stats_buff);
- void Register() override
- {
- OnEffectHitTarget += SpellEffectFn(spell_gen_increase_stats_buff_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ if (GetHitUnit()->IsInRaidWith(GetCaster()))
+ GetCaster()->CastSpell(GetCaster(), GetEffectValue() + 1, true); // raid buff
+ else
+ GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); // single-target buff
+ }
- SpellScript* GetSpellScript() const override
- {
- return new spell_gen_increase_stats_buff_SpellScript();
- }
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_increase_stats_buff::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
};
enum GenericLifebloom
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 22a2e8e9676..52baf698325 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -1336,66 +1336,54 @@ enum Heartpierce
// Item - 50641: Heartpierce (Heroic)
// 71892 - Item - Icecrown 25 Heroic Dagger Proc
-template <uint32 EnergySpellId, uint32 ManaSpellId, uint32 RageSpellId, uint32 RPSpellId>
-class spell_item_heartpierce : public SpellScriptLoader
+template <uint32 Energy, uint32 Mana, uint32 Rage, uint32 RunicPower>
+class spell_item_heartpierce : public AuraScript
{
- public:
- spell_item_heartpierce(char const* ScriptName) : SpellScriptLoader(ScriptName) { }
+ PrepareAuraScript(spell_item_heartpierce);
- template <uint32 Energy, uint32 Mana, uint32 Rage, uint32 RunicPower>
- class spell_item_heartpierce_AuraScript : public AuraScript
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(
{
- PrepareAuraScript(spell_item_heartpierce_AuraScript);
-
- bool Validate(SpellInfo const* /*spellInfo*/) override
- {
- return ValidateSpellInfo(
- {
- Energy,
- Mana,
- Rage,
- RunicPower
- });
- }
-
- void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
- {
- PreventDefaultAction();
- Unit* caster = eventInfo.GetActor();
-
- uint32 spellId;
- switch (caster->GetPowerType())
- {
- case POWER_MANA:
- spellId = Mana;
- break;
- case POWER_ENERGY:
- spellId = Energy;
- break;
- case POWER_RAGE:
- spellId = Rage;
- break;
- // Death Knights can't use daggers, but oh well
- case POWER_RUNIC_POWER:
- spellId = RunicPower;
- break;
- default:
- return;
- }
-
- caster->CastSpell(nullptr, spellId, aurEff);
- }
+ Energy,
+ Mana,
+ Rage,
+ RunicPower
+ });
+ }
- void Register() override
- {
- OnEffectProc += AuraEffectProcFn(spell_item_heartpierce_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
- }
- };
+ void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+ Unit* caster = eventInfo.GetActor();
- AuraScript* GetAuraScript() const override
+ uint32 spellId;
+ switch (caster->GetPowerType())
{
- return new spell_item_heartpierce_AuraScript<EnergySpellId, ManaSpellId, RageSpellId, RPSpellId>();
+ case POWER_MANA:
+ spellId = Mana;
+ break;
+ case POWER_ENERGY:
+ spellId = Energy;
+ break;
+ case POWER_RAGE:
+ spellId = Rage;
+ break;
+ // Death Knights can't use daggers, but oh well
+ case POWER_RUNIC_POWER:
+ spellId = RunicPower;
+ break;
+ default:
+ return;
}
+
+ caster->CastSpell(nullptr, spellId, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_item_heartpierce::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
};
enum HourglassSand
@@ -5002,8 +4990,8 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_frozen_shadoweave);
RegisterSpellScript(spell_item_gnomish_death_ray);
RegisterSpellScript(spell_item_harm_prevention_belt);
- new spell_item_heartpierce<SPELL_INVIGORATION_ENERGY, SPELL_INVIGORATION_MANA, SPELL_INVIGORATION_RAGE, SPELL_INVIGORATION_RP>("spell_item_heartpierce");
- new spell_item_heartpierce<SPELL_INVIGORATION_ENERGY_HERO, SPELL_INVIGORATION_MANA_HERO, SPELL_INVIGORATION_RAGE_HERO, SPELL_INVIGORATION_RP_HERO>("spell_item_heartpierce_hero");
+ RegisterSpellScriptWithArgs((spell_item_heartpierce<SPELL_INVIGORATION_ENERGY, SPELL_INVIGORATION_MANA, SPELL_INVIGORATION_RAGE, SPELL_INVIGORATION_RP>), "spell_item_heartpierce");
+ RegisterSpellScriptWithArgs((spell_item_heartpierce<SPELL_INVIGORATION_ENERGY_HERO, SPELL_INVIGORATION_MANA_HERO, SPELL_INVIGORATION_RAGE_HERO, SPELL_INVIGORATION_RP_HERO>), "spell_item_heartpierce_hero");
RegisterSpellScript(spell_item_hourglass_sand);
RegisterSpellScript(spell_item_crystal_spire_of_karabor);
RegisterSpellScript(spell_item_make_a_wish);