Skip to content

Commit b75d047

Browse files
authored
Scripts/Spells: Implement Cataclysm Breath & Chaos Breath & Death Count (TrinityCore#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 TrinityCore#30320
1 parent 994b1df commit b75d047

File tree

3 files changed

+134
-38
lines changed

3 files changed

+134
-38
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--
2+
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sunwell_plateau_cataclysm_breath', 'spell_arcatraz_chaos_breath', 'spell_arcatraz_death_count');
3+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
4+
(46292, 'spell_sunwell_plateau_cataclysm_breath'),
5+
(36677, 'spell_arcatraz_chaos_breath'),
6+
(36660, 'spell_arcatraz_death_count'),
7+
(38820, 'spell_arcatraz_death_count');
8+
9+
DELETE FROM `smart_scripts` WHERE `entryorguid` = 20867 AND `source_type` = 0 AND `id` IN (8,9);

src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,54 @@
1515
* with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
/* ScriptData
19-
SDName: Sunwell_Plateau
20-
SD%Complete: 0
21-
SDComment: Placeholder, Epilogue after Kil'jaeden, Captain Selana Gossips
22-
EndScriptData */
23-
24-
/* ContentData
25-
npc_prophet_velen
26-
npc_captain_selana
27-
EndContentData */
28-
2918
#include "ScriptMgr.h"
30-
#include "ScriptedCreature.h"
19+
#include "Containers.h"
20+
#include "SpellScript.h"
21+
#include "Unit.h"
3122
#include "sunwell_plateau.h"
3223

33-
/*######
34-
## npc_prophet_velen
35-
######*/
36-
37-
enum ProphetSpeeches
24+
enum CataclysmBreath
3825
{
39-
PROPHET_SAY1 = -1580099,
40-
PROPHET_SAY2 = -1580100,
41-
PROPHET_SAY3 = -1580101,
42-
PROPHET_SAY4 = -1580102,
43-
PROPHET_SAY5 = -1580103,
44-
PROPHET_SAY6 = -1580104,
45-
PROPHET_SAY7 = -1580105,
46-
PROPHET_SAY8 = -1580106
26+
SPELL_CORROSIVE_POISON = 46293,
27+
SPELL_FEVERED_FATIGUE = 46294,
28+
SPELL_HEX = 46295,
29+
SPELL_NECROTIC_POISON = 46296,
30+
SPELL_PIERCING_SHADOW = 46297,
31+
SPELL_SHRINK = 46298,
32+
SPELL_WAVERING_WILL = 46299,
33+
SPELL_WITHERED_TOUCH = 46300
4734
};
4835

49-
enum LiadrinnSpeeches
36+
// 46292 - Cataclysm Breath
37+
class spell_sunwell_plateau_cataclysm_breath : public SpellScript
5038
{
51-
LIADRIN_SAY1 = -1580107,
52-
LIADRIN_SAY2 = -1580108,
53-
LIADRIN_SAY3 = -1580109
54-
};
39+
PrepareSpellScript(spell_sunwell_plateau_cataclysm_breath);
40+
41+
static constexpr std::array<uint32, 8> PossibleSpells = { SPELL_CORROSIVE_POISON, SPELL_FEVERED_FATIGUE, SPELL_HEX, SPELL_NECROTIC_POISON, SPELL_PIERCING_SHADOW, SPELL_SHRINK, SPELL_WAVERING_WILL, SPELL_WITHERED_TOUCH };
5542

56-
/*######
57-
## npc_captain_selana
58-
######*/
43+
bool Validate(SpellInfo const* /*spellInfo*/) override
44+
{
45+
return ValidateSpellInfo(PossibleSpells);
46+
}
5947

60-
#define CS_GOSSIP1 "Give me a situation report, Captain."
61-
#define CS_GOSSIP2 "What went wrong?"
62-
#define CS_GOSSIP3 "Why did they stop?"
63-
#define CS_GOSSIP4 "Your insight is appreciated."
48+
void HandleDummy(SpellEffIndex /*effIndex*/)
49+
{
50+
Unit* caster = GetCaster();
51+
std::array<uint32, 8> spellsToCast = PossibleSpells;
6452

65-
void AddSC_sunwell_plateau() { }
53+
Trinity::Containers::RandomShuffle(spellsToCast);
54+
55+
for (uint32 i = 0; i < 4; ++i)
56+
caster->CastSpell(caster, spellsToCast[i]);
57+
}
58+
59+
void Register() override
60+
{
61+
OnEffectHitTarget += SpellEffectFn(spell_sunwell_plateau_cataclysm_breath::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
62+
}
63+
};
64+
65+
void AddSC_sunwell_plateau()
66+
{
67+
RegisterSpellScript(spell_sunwell_plateau_cataclysm_breath);
68+
}

src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121

2222
#include "ScriptMgr.h"
2323
#include "arcatraz.h"
24+
#include "Containers.h"
2425
#include "InstanceScript.h"
2526
#include "MotionMaster.h"
2627
#include "ScriptedCreature.h"
2728
#include "SpellInfo.h"
29+
#include "SpellScript.h"
2830

2931
enum MillhouseTexts
3032
{
@@ -680,8 +682,90 @@ struct npc_warden_mellichar : public ScriptedAI
680682
bool _inProgress;
681683
};
682684

685+
enum ChaosBreath
686+
{
687+
SPELL_NECROTIC_POISON = 36693,
688+
SPELL_CORROSIVE_POISON = 36694,
689+
SPELL_FEVERED_FATIGUE = 36695,
690+
SPELL_WITHERED_TOUCH = 36696,
691+
SPELL_SHRINK = 36697,
692+
SPELL_PIERCING_SHADOW = 36698,
693+
SPELL_WAVERING_WILL = 36699,
694+
SPELL_HEX = 36700
695+
};
696+
697+
// 36677 - Chaos Breath
698+
class spell_arcatraz_chaos_breath : public SpellScript
699+
{
700+
PrepareSpellScript(spell_arcatraz_chaos_breath);
701+
702+
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 };
703+
704+
bool Validate(SpellInfo const* /*spellInfo*/) override
705+
{
706+
return ValidateSpellInfo(PossibleSpells);
707+
}
708+
709+
void HandleDummy(SpellEffIndex /*effIndex*/)
710+
{
711+
Unit* caster = GetCaster();
712+
std::array<uint32, 8> spellsToCast = PossibleSpells;
713+
714+
Trinity::Containers::RandomShuffle(spellsToCast);
715+
716+
for (uint32 i = 0; i < 3; ++i)
717+
caster->CastSpell(caster, spellsToCast[i]);
718+
}
719+
720+
void Register() override
721+
{
722+
OnEffectHitTarget += SpellEffectFn(spell_arcatraz_chaos_breath::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
723+
}
724+
};
725+
726+
enum DeathCountRemover
727+
{
728+
SPELL_DEATH_COUNT_DAMAGE = 36657,
729+
SPELL_DEATH_COUNT_DAMAGE_H = 38818,
730+
SPELL_DEATH_COUNT_REMOVER = 36660,
731+
SPELL_DEATH_COUNT_REMOVER_H = 38820
732+
};
733+
734+
// 36660, 38820 - Death Count
735+
class spell_arcatraz_death_count : public AuraScript
736+
{
737+
PrepareAuraScript(spell_arcatraz_death_count);
738+
739+
bool Validate(SpellInfo const* /*spell*/) override
740+
{
741+
return ValidateSpellInfo({ SPELL_DEATH_COUNT_DAMAGE, SPELL_DEATH_COUNT_DAMAGE_H });
742+
}
743+
744+
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
745+
{
746+
switch (GetId())
747+
{
748+
case SPELL_DEATH_COUNT_REMOVER:
749+
GetTarget()->RemoveAurasDueToSpell(SPELL_DEATH_COUNT_DAMAGE);
750+
break;
751+
case SPELL_DEATH_COUNT_REMOVER_H:
752+
GetTarget()->RemoveAurasDueToSpell(SPELL_DEATH_COUNT_DAMAGE_H);
753+
break;
754+
default:
755+
break;
756+
}
757+
}
758+
759+
void Register() override
760+
{
761+
AfterEffectApply += AuraEffectApplyFn(spell_arcatraz_death_count::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
762+
}
763+
};
764+
683765
void AddSC_arcatraz()
684766
{
685767
RegisterArcatrazCreatureAI(npc_millhouse_manastorm);
686768
RegisterArcatrazCreatureAI(npc_warden_mellichar);
769+
RegisterSpellScript(spell_arcatraz_chaos_breath);
770+
RegisterSpellScript(spell_arcatraz_death_count);
687771
}

0 commit comments

Comments
 (0)