aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-12-14 17:59:05 -0300
committerariel- <ariel-@users.noreply.github.com>2017-12-15 01:46:51 -0300
commit193bd3b45264326011814a5ee7694b9bbe13eb75 (patch)
tree997ddaac253cc26ba8d8c00880160a449f6ea4c5 /src/server/scripts/Northrend
parent16e20711d277bc43ae3ac350208df73827306ea6 (diff)
Core/Auras: periodics refactor part 4: ported periodic dummy auras to scripts
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp33
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp51
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp17
3 files changed, 94 insertions, 7 deletions
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index 7050f20c1c9..33c4ffc7249 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -90,7 +90,10 @@ enum BossSpells
SPELL_POWER_TWINS = 65879,
SPELL_BERSERK = 64238,
SPELL_POWERING_UP = 67590,
- SPELL_SURGE_OF_SPEED = 65828
+ SPELL_SURGE_OF_SPEED = 65828,
+
+ SPELL_SUMMON_PERIODIC_LIGHT = 66152,
+ SPELL_SUMMON_PERIODIC_DARK = 66153
};
enum Events
@@ -695,6 +698,33 @@ class npc_bullet_controller : public CreatureScript
}
};
+// 66149 - Bullet Controller Periodic
+// 68396 - Bullet Controller Periodic
+class spell_bullet_controller : public AuraScript
+{
+ PrepareAuraScript(spell_bullet_controller);
+
+ bool Validate(SpellInfo const* /*spellInfo*/)
+ {
+ return ValidateSpellInfo({ SPELL_SUMMON_PERIODIC_LIGHT, SPELL_SUMMON_PERIODIC_DARK });
+ }
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+
+ caster->CastCustomSpell(SPELL_SUMMON_PERIODIC_LIGHT, SPELLVALUE_MAX_TARGETS, urand(1, 6), GetTarget(), true);
+ caster->CastCustomSpell(SPELL_SUMMON_PERIODIC_DARK, SPELLVALUE_MAX_TARGETS, urand(1, 6), GetTarget(), true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_bullet_controller::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
class spell_powering_up : public SpellScriptLoader
{
public:
@@ -907,6 +937,7 @@ void AddSC_boss_twin_valkyr()
new npc_essence_of_twin();
new npc_bullet_controller();
+ RegisterAuraScript(spell_bullet_controller);
new spell_powering_up();
new spell_valkyr_essences();
new spell_power_of_the_twins();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index 09f80db1f36..05e509c6987 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -34,6 +34,7 @@
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "Spell.h"
+#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "ulduar.h"
@@ -1464,6 +1465,54 @@ class achievement_orbit_uary : public AchievementCriteriaScript
}
};
+// 62399 Overload Circuit
+class spell_overload_circuit : public AuraScript
+{
+ PrepareAuraScript(spell_overload_circuit);
+
+ bool Validate(SpellInfo const* /*spellInfo*/)
+ {
+ return ValidateSpellInfo({ SPELL_SYSTEMS_SHUTDOWN });
+ }
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ if (!GetTarget()->GetMap()->IsDungeon() || int32(GetTarget()->GetAppliedAuras().count(GetId())) < (GetTarget()->GetMap()->Is25ManRaid() ? 4 : 2))
+ return;
+
+ GetTarget()->CastSpell(nullptr, SPELL_SYSTEMS_SHUTDOWN, true);
+ if (Unit* veh = GetTarget()->GetVehicleBase())
+ veh->CastSpell(nullptr, SPELL_SYSTEMS_SHUTDOWN, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_overload_circuit::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
+// 62292 Blaze
+class spell_tar_blaze : public AuraScript
+{
+ PrepareAuraScript(spell_tar_blaze);
+
+ bool Validate(SpellInfo const* spellInfo)
+ {
+ return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ // should we use custom damage?
+ GetTarget()->CastSpell(nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_tar_blaze::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
class spell_load_into_catapult : public SpellScriptLoader
{
enum Spells
@@ -1819,6 +1868,8 @@ void AddSC_boss_flame_leviathan()
new achievement_nuked_from_orbit();
new achievement_orbit_uary();
+ RegisterAuraScript(spell_overload_circuit);
+ RegisterAuraScript(spell_tar_blaze);
new spell_load_into_catapult();
new spell_auto_repair();
new spell_systems_shutdown();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
index 2b5e11c0d50..42e140ec066 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
@@ -642,7 +642,9 @@ struct boss_razorscale : public BossAI
DoCastSelf(SPELL_FIREBOLT);
break;
case EVENT_FUSE_ARMOR:
- DoCastVictim(SPELL_FUSE_ARMOR);
+ if (Unit* victim = me->GetVictim())
+ if (!victim->HasAura(SPELL_FUSED_ARMOR))
+ DoCast(victim, SPELL_FUSE_ARMOR);
events.Repeat(Seconds(10), Seconds(15));
break;
case EVENT_RESUME_MOVE_CHASE:
@@ -1660,7 +1662,7 @@ class spell_razorscale_summon_iron_dwarves : public SpellScript
}
};
-// 64771 - Fuse Armor
+// 64821 - Fuse Armor
class spell_razorscale_fuse_armor : public AuraScript
{
PrepareAuraScript(spell_razorscale_fuse_armor);
@@ -1670,15 +1672,18 @@ class spell_razorscale_fuse_armor : public AuraScript
return ValidateSpellInfo({ SPELL_FUSED_ARMOR });
}
- void HandleFused(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ void HandleFused(AuraEffect const* /*aurEff*/)
{
- if (GetStackAmount() == 5)
- GetTarget()->CastSpell(GetTarget(), SPELL_FUSED_ARMOR, true);
+ if (GetStackAmount() != GetSpellInfo()->StackAmount)
+ return;
+
+ GetTarget()->CastSpell(nullptr, SPELL_FUSED_ARMOR, true);
+ Remove();
}
void Register() override
{
- AfterEffectApply += AuraEffectRemoveFn(spell_razorscale_fuse_armor::HandleFused, EFFECT_1, SPELL_AURA_MOD_MELEE_HASTE, AURA_EFFECT_HANDLE_REAL);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_razorscale_fuse_armor::HandleFused, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};