aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-12-15 00:14:55 -0300
committerariel- <ariel-@users.noreply.github.com>2017-12-15 01:46:52 -0300
commita36e804ae4639be40be17282e6c79fad9a769517 (patch)
treeddd718a5dee49d189de257cbd2748f6474e4b914 /src/server/scripts/Northrend
parent193bd3b45264326011814a5ee7694b9bbe13eb75 (diff)
Core/Auras: periodics refactor part 5: ported periodic trigger spell auras to scripts
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp44
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp25
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp27
3 files changed, 96 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index 4d3f243a4a7..a5c155714e4 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -832,6 +832,49 @@ class npc_anubarak_spike : public CreatureScript
};
};
+// 65920 - Pursuing Spikes
+// 65922 - Pursuing Spikes
+// 65923 - Pursuing Spikes
+class spell_pursuing_spikes : public AuraScript
+{
+ PrepareAuraScript(spell_pursuing_spikes);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_PERMAFROST, SPELL_SPIKE_FAIL });
+ }
+
+ bool Load() override
+ {
+ return InstanceHasScript(GetUnitOwner(), ToCrScriptName);
+ }
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ PreventDefaultAction();
+
+ Unit* permafrostCaster = nullptr;
+ if (Aura* permafrostAura = GetTarget()->GetAura(sSpellMgr->GetSpellIdForDifficulty(SPELL_PERMAFROST, GetTarget())))
+ permafrostCaster = permafrostAura->GetCaster();
+
+ if (permafrostCaster)
+ {
+ if (Creature* permafrostCasterCreature = permafrostCaster->ToCreature())
+ permafrostCasterCreature->DespawnOrUnsummon(3000);
+
+ GetTarget()->CastSpell(nullptr, SPELL_SPIKE_FAIL, false);
+ GetTarget()->RemoveAllAuras();
+ if (Creature* targetCreature = GetTarget()->ToCreature())
+ targetCreature->DisappearAndDie();
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_pursuing_spikes::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
class spell_impale : public SpellScriptLoader
{
public:
@@ -912,6 +955,7 @@ void AddSC_boss_anubarak_trial()
new npc_anubarak_spike();
new npc_frost_sphere();
+ RegisterAuraScript(spell_pursuing_spikes);
new spell_impale();
new spell_anubarak_leeching_swarm();
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index 3fa16f06a0c..4a832406e43 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -1375,6 +1375,30 @@ public:
}
};
+// 66882 - Slime Pool
+class spell_jormungars_slime_pool : public AuraScript
+{
+ PrepareAuraScript(spell_jormungars_slime_pool);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+
+ int32 const radius = static_cast<int32>(((aurEff->GetTickNumber() / 60.f) * 0.9f + 0.1f) * 10000.f * 2.f / 3.f);
+ GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_RADIUS_MOD, radius, nullptr, true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_jormungars_slime_pool::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
class spell_jormungars_snakes_spray : public SpellScriptLoader
{
public:
@@ -1461,6 +1485,7 @@ void AddSC_boss_northrend_beasts()
new boss_dreadscale();
new npc_slime_pool();
new spell_jormungars_paralytic_toxin();
+ RegisterAuraScript(spell_jormungars_slime_pool);
new spell_jormungars_snakes_spray("spell_jormungars_burning_spray", SPELL_BURNING_BILE);
new spell_jormungars_snakes_spray("spell_jormungars_paralytic_spray", SPELL_PARALYTIC_TOXIN);
new spell_jormungars_paralysis();
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index 02313e8d286..e37999c4993 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -94,6 +94,7 @@ enum Spells
SPELL_DETONATE_MANA = 27819,
SPELL_MANA_DETONATION_DAMAGE = 27820,
SPELL_FROST_BLAST = 27808,
+ SPELL_FROST_BLAST_DMG = 29879,
SPELL_CHAINS = 28410,
SPELL_CHAINS_DUMMY = 28408, // this holds the category cooldown - the main chains spell can't have one as it is cast multiple times
@@ -943,6 +944,31 @@ public:
}
};
+// 27808 - Frost Blast
+class spell_kelthuzad_frost_blast : public AuraScript
+{
+ PrepareAuraScript(spell_kelthuzad_frost_blast);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_FROST_BLAST_DMG });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+
+ // Stuns the target, dealing 26% of the target's maximum health in Frost damage every second for 4 sec.
+ if (Unit* caster = GetCaster())
+ caster->CastCustomSpell(SPELL_FROST_BLAST_DMG, SPELLVALUE_BASE_POINT0, int32(GetTarget()->CountPctFromMaxHealth(26)), GetTarget(), true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_kelthuzad_frost_blast::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
class at_kelthuzad_center : public AreaTriggerScript
{
public:
@@ -995,6 +1021,7 @@ void AddSC_boss_kelthuzad()
new npc_kelthuzad_guardian();
new spell_kelthuzad_chains();
new spell_kelthuzad_detonate_mana();
+ RegisterAuraScript(spell_kelthuzad_frost_blast);
new at_kelthuzad_center();
new achievement_just_cant_get_enough();
}