aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Outland
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2025-07-28 21:28:32 +0300
committerGitHub <noreply@github.com>2025-07-28 20:28:32 +0200
commitb75d047a33597a9f576632d07a4f3ba2546c5e6e (patch)
tree64b0fe6bbe849a08e069a4cf213ebea496d7bdf1 /src/server/scripts/Outland
parent994b1df1158a5f4a6c045f8c5b470be04b7ac46f (diff)
Scripts/Spells: Implement Cataclysm Breath & Chaos Breath & Death Count (#31172)
* Implement Cataclysm Breath (forces creature to cast 4 of 8 random spells) * Implement Chaos Breath (forces creature to cast 3 of 8 random spells) * Implement Death Count remover spell (replace SAI implementation with spell script) Closes #30320
Diffstat (limited to 'src/server/scripts/Outland')
-rw-r--r--src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
index 4ec8b22c8a5..3da8b09b26c 100644
--- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
+++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp
@@ -21,10 +21,12 @@
#include "ScriptMgr.h"
#include "arcatraz.h"
+#include "Containers.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
+#include "SpellScript.h"
enum MillhouseTexts
{
@@ -680,8 +682,90 @@ private:
bool _inProgress;
};
+enum ChaosBreath
+{
+ SPELL_NECROTIC_POISON = 36693,
+ SPELL_CORROSIVE_POISON = 36694,
+ SPELL_FEVERED_FATIGUE = 36695,
+ SPELL_WITHERED_TOUCH = 36696,
+ SPELL_SHRINK = 36697,
+ SPELL_PIERCING_SHADOW = 36698,
+ SPELL_WAVERING_WILL = 36699,
+ SPELL_HEX = 36700
+};
+
+// 36677 - Chaos Breath
+class spell_arcatraz_chaos_breath : public SpellScript
+{
+ PrepareSpellScript(spell_arcatraz_chaos_breath);
+
+ static constexpr std::array<uint32, 8> PossibleSpells = { SPELL_NECROTIC_POISON, SPELL_CORROSIVE_POISON, SPELL_FEVERED_FATIGUE, SPELL_WITHERED_TOUCH, SPELL_SHRINK, SPELL_PIERCING_SHADOW, SPELL_WAVERING_WILL, SPELL_HEX };
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(PossibleSpells);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ std::array<uint32, 8> spellsToCast = PossibleSpells;
+
+ Trinity::Containers::RandomShuffle(spellsToCast);
+
+ for (uint32 i = 0; i < 3; ++i)
+ caster->CastSpell(caster, spellsToCast[i]);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_arcatraz_chaos_breath::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+};
+
+enum DeathCountRemover
+{
+ SPELL_DEATH_COUNT_DAMAGE = 36657,
+ SPELL_DEATH_COUNT_DAMAGE_H = 38818,
+ SPELL_DEATH_COUNT_REMOVER = 36660,
+ SPELL_DEATH_COUNT_REMOVER_H = 38820
+};
+
+// 36660, 38820 - Death Count
+class spell_arcatraz_death_count : public AuraScript
+{
+ PrepareAuraScript(spell_arcatraz_death_count);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ return ValidateSpellInfo({ SPELL_DEATH_COUNT_DAMAGE, SPELL_DEATH_COUNT_DAMAGE_H });
+ }
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ switch (GetId())
+ {
+ case SPELL_DEATH_COUNT_REMOVER:
+ GetTarget()->RemoveAurasDueToSpell(SPELL_DEATH_COUNT_DAMAGE);
+ break;
+ case SPELL_DEATH_COUNT_REMOVER_H:
+ GetTarget()->RemoveAurasDueToSpell(SPELL_DEATH_COUNT_DAMAGE_H);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_arcatraz_death_count::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
void AddSC_arcatraz()
{
RegisterArcatrazCreatureAI(npc_millhouse_manastorm);
RegisterArcatrazCreatureAI(npc_warden_mellichar);
+ RegisterSpellScript(spell_arcatraz_chaos_breath);
+ RegisterSpellScript(spell_arcatraz_death_count);
}