aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-11-24 17:05:01 +0200
committerGitHub <noreply@github.com>2021-11-24 17:05:01 +0200
commitef4c878d260c0e01a6ab2f4391af46c261d04785 (patch)
tree342955a7b82bceb385cbfec6d01304145a927af3 /src
parenteb812bf3d510d9c6712448c4bb35983c91f97b4c (diff)
Scripts/Spells: Small cleanup for gen/item spell scripts (#27311)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp20
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp27
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp19
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp85
-rw-r--r--src/server/scripts/Spells/spell_item.cpp17
5 files changed, 66 insertions, 102 deletions
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
index 14cf629c3c8..549797c12fb 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp
@@ -25,6 +25,8 @@ EndScriptData */
#include "InstanceScript.h"
#include "Log.h"
#include "ScriptedCreature.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "sunwell_plateau.h"
enum Quotes
@@ -343,7 +345,25 @@ public:
}
};
+// 46394 - Burn
+class spell_brutallus_burn : public AuraScript
+{
+ PrepareAuraScript(spell_brutallus_burn);
+
+ void HandleEffectPeriodicUpdate(AuraEffect* aurEff)
+ {
+ if (aurEff->GetTickNumber() % 11 == 0)
+ aurEff->SetAmount(aurEff->GetAmount() * 2);
+ }
+
+ void Register() override
+ {
+ OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_brutallus_burn::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
+ }
+};
+
void AddSC_boss_brutallus()
{
new boss_brutallus();
+ RegisterSpellScript(spell_brutallus_burn);
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index 9dde3c80bab..27609a0688c 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
@@ -19,6 +19,7 @@
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
+#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#include "sunwell_plateau.h"
@@ -608,6 +609,31 @@ class spell_summon_blood_elves_periodic : public AuraScript
}
};
+// 46284 - Negative Energy Periodic
+class spell_muru_negative_energy_periodic : public AuraScript
+{
+ PrepareAuraScript(spell_muru_negative_energy_periodic);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+
+ CastSpellExtraArgs args(aurEff);
+ args.AddSpellMod(SPELLVALUE_MAX_TARGETS, aurEff->GetTickNumber() / 10 + 1);
+ GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, args);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_muru_negative_energy_periodic::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
void AddSC_boss_muru()
{
RegisterSunwellPlateauCreatureAI(boss_muru);
@@ -621,4 +647,5 @@ void AddSC_boss_muru()
RegisterSpellScript(spell_dark_fiend_skin);
RegisterSpellScript(spell_transform_visual_missile_periodic);
RegisterSpellScript(spell_summon_blood_elves_periodic);
+ RegisterSpellScript(spell_muru_negative_energy_periodic);
}
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index 251ff1538cb..99cbaff68f6 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -745,6 +745,24 @@ class spell_reliquary_of_souls_aura_of_desire : public AuraScript
}
};
+// 41337 - Aura of Anger
+class spell_reliquary_of_souls_aura_of_anger : public AuraScript
+{
+ PrepareAuraScript(spell_reliquary_of_souls_aura_of_anger);
+
+ void HandleEffectPeriodicUpdate(AuraEffect* aurEff)
+ {
+ if (AuraEffect* aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1))
+ aurEff1->ChangeAmount(aurEff1->GetAmount() + 5);
+ aurEff->SetAmount(100 * aurEff->GetTickNumber());
+ }
+
+ void Register() override
+ {
+ OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_reliquary_of_souls_aura_of_anger::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
+ }
+};
+
// 28819 - Submerge Visual
class spell_reliquary_of_souls_submerge : public AuraScript
{
@@ -815,6 +833,7 @@ void AddSC_boss_reliquary_of_souls()
RegisterBlackTempleCreatureAI(npc_enslaved_soul);
RegisterBlackTempleCreatureAI(npc_reliquary_combat_trigger);
RegisterSpellScript(spell_reliquary_of_souls_aura_of_desire);
+ RegisterSpellScript(spell_reliquary_of_souls_aura_of_anger);
RegisterSpellScript(spell_reliquary_of_souls_submerge);
RegisterSpellScript(spell_reliquary_of_souls_spite);
RegisterSpellScript(spell_reliquary_of_souls_frenzy);
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index f98e31fb1a4..1854ae17716 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -222,27 +222,6 @@ class spell_spawn_blood_pool : public SpellScript
}
};
-class spell_gen_arcane_charge : public SpellScript
-{
- PrepareSpellScript(spell_gen_arcane_charge);
-
- SpellCastResult CheckRequirement()
- {
- if (Unit* target = GetExplTargetUnit())
- {
- if (!(target->GetCreatureTypeMask() & CREATURE_TYPEMASK_DEMON_OR_UNDEAD))
- return SPELL_FAILED_DONT_REPORT;
- }
-
- return SPELL_CAST_OK;
- }
-
- void Register() override
- {
- OnCheckCast += SpellCheckCastFn(spell_gen_arcane_charge::CheckRequirement);
- }
-};
-
// 430 Drink
// 431 Drink
// 432 Drink
@@ -345,24 +324,6 @@ class spell_gen_arena_drink : public AuraScript
}
};
-// 41337 Aura of Anger
-class spell_gen_aura_of_anger : public AuraScript
-{
- PrepareAuraScript(spell_gen_aura_of_anger);
-
- void HandleEffectPeriodicUpdate(AuraEffect* aurEff)
- {
- if (AuraEffect* aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1))
- aurEff1->ChangeAmount(aurEff1->GetAmount() + 5);
- aurEff->SetAmount(100 * aurEff->GetTickNumber());
- }
-
- void Register() override
- {
- OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_aura_of_anger::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
- }
-};
-
// 28313 - Aura of Fear
class spell_gen_aura_of_fear : public AuraScript
{
@@ -757,23 +718,6 @@ class spell_gen_break_shield: public SpellScript
}
};
-// 46394 Brutallus Burn
-class spell_gen_burn_brutallus : public AuraScript
-{
- PrepareAuraScript(spell_gen_burn_brutallus);
-
- void HandleEffectPeriodicUpdate(AuraEffect* aurEff)
- {
- if (aurEff->GetTickNumber() % 11 == 0)
- aurEff->SetAmount(aurEff->GetAmount() * 2);
- }
-
- void Register() override
- {
- OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_burn_brutallus::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
- }
-};
-
// 48750 - Burning Depths Necrolyte Image
class spell_gen_burning_depths_necrolyte_image : public AuraScript
{
@@ -2424,31 +2368,6 @@ class spell_gen_moss_covered_feet : public AuraScript
}
};
-// 46284 - Negative Energy Periodic
-class spell_gen_negative_energy_periodic : public AuraScript
-{
- PrepareAuraScript(spell_gen_negative_energy_periodic);
-
- bool Validate(SpellInfo const* spellInfo) override
- {
- return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
- }
-
- void PeriodicTick(AuraEffect const* aurEff)
- {
- PreventDefaultAction();
-
- CastSpellExtraArgs args(aurEff);
- args.AddSpellMod(SPELLVALUE_MAX_TARGETS, aurEff->GetTickNumber() / 10 + 1);
- GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, args);
- }
-
- void Register() override
- {
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_negative_energy_periodic::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
- }
-};
-
enum Netherbloom : uint32
{
SPELL_NETHERBLOOM_POLLEN_1 = 28703
@@ -4496,9 +4415,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_allow_cast_from_item_only);
RegisterSpellScript(spell_gen_animal_blood);
RegisterSpellScript(spell_spawn_blood_pool);
- RegisterSpellScript(spell_gen_arcane_charge);
RegisterSpellScript(spell_gen_arena_drink);
- RegisterSpellScript(spell_gen_aura_of_anger);
RegisterSpellScript(spell_gen_aura_of_fear);
RegisterSpellScript(spell_gen_aura_service_uniform);
RegisterSpellScript(spell_gen_av_drekthar_presence);
@@ -4509,7 +4426,6 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_bonked);
RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_break_shield");
RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
- RegisterSpellScript(spell_gen_burn_brutallus);
RegisterSpellScript(spell_gen_burning_depths_necrolyte_image);
RegisterSpellScript(spell_gen_cannibalize);
RegisterSpellScript(spell_gen_chains_of_ice);
@@ -4567,7 +4483,6 @@ void AddSC_generic_spell_scripts()
RegisterSpellScriptWithArgs(spell_gen_mount, "spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
RegisterSpellScript(spell_gen_mounted_charge);
RegisterSpellScript(spell_gen_moss_covered_feet);
- RegisterSpellScript(spell_gen_negative_energy_periodic);
RegisterSpellScript(spell_gen_netherbloom);
RegisterSpellScript(spell_gen_nightmare_vine);
RegisterSpellScript(spell_gen_nitrous_boost);
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index f3ea37f51d4..952a7bb4d1a 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -2659,22 +2659,6 @@ class spell_magic_eater_food : public AuraScript
}
};
-class spell_item_shimmering_vessel : public SpellScript
-{
- PrepareSpellScript(spell_item_shimmering_vessel);
-
- void HandleDummy(SpellEffIndex /* effIndex */)
- {
- if (Creature* target = GetHitCreature())
- target->setDeathState(JUST_RESPAWNED);
- }
-
- void Register() override
- {
- OnEffectHitTarget += SpellEffectFn(spell_item_shimmering_vessel::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
-};
-
enum PurifyHelboarMeat
{
SPELL_SUMMON_PURIFIED_HELBOAR_MEAT = 29277,
@@ -4268,7 +4252,6 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_ashbringer);
RegisterSpellScript(spell_magic_eater_food);
- RegisterSpellScript(spell_item_shimmering_vessel);
RegisterSpellScript(spell_item_purify_helboar_meat);
RegisterSpellScript(spell_item_crystal_prison_dummy_dnd);
RegisterSpellScript(spell_item_nigh_invulnerability);