aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp122
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
-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
5 files changed, 95 insertions, 129 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 33842796bf3..544d3b95933 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1001,7 +1001,7 @@ void AuraEffect::PeriodicTick(AuraApplication* aurApp, Unit* caster) const
switch (GetAuraType())
{
case SPELL_AURA_PERIODIC_DUMMY:
- HandlePeriodicDummyAuraTick(target, caster);
+ // handled via scripts
break;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
HandlePeriodicTriggerSpellAuraTick(target, caster);
@@ -5066,126 +5066,6 @@ void AuraEffect::HandleMastery(AuraApplication const* aurApp, uint8 mode, bool /
target->UpdateMastery();
}
-void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
-{
- switch (GetSpellInfo()->SpellFamilyName)
- {
- case SPELLFAMILY_GENERIC:
- switch (GetId())
- {
- case 66149: // Bullet Controller Periodic - 10 Man
- case 68396: // Bullet Controller Periodic - 25 Man
- {
- if (!caster)
- break;
-
- caster->CastCustomSpell(66152, SPELLVALUE_MAX_TARGETS, urand(1, 6), target, true);
- caster->CastCustomSpell(66153, SPELLVALUE_MAX_TARGETS, urand(1, 6), target, true);
- break;
- }
- case 62292: // Blaze (Pool of Tar)
- // should we use custom damage?
- target->CastSpell(nullptr, GetSpellEffectInfo()->TriggerSpell, true);
- break;
- case 62399: // Overload Circuit
- if (target->GetMap()->IsDungeon() && int(target->GetAppliedAuras().count(62399)) >= (target->GetMap()->IsHeroic() ? 4 : 2))
- {
- target->CastSpell(target, 62475, true); // System Shutdown
- if (Unit* veh = target->GetVehicleBase())
- veh->CastSpell(target, 62475, true);
- }
- break;
- case 64821: // Fuse Armor (Razorscale)
- if (GetBase()->GetStackAmount() == GetSpellInfo()->StackAmount)
- {
- target->CastSpell(target, 64774, true, nullptr, nullptr, GetCasterGUID());
- target->RemoveAura(64821);
- }
- break;
- }
- break;
- case SPELLFAMILY_MAGE:
- {
- // Mirror Image
- if (GetId() == 55342)
- // Set name of summons to name of caster
- target->CastSpell(nullptr, GetSpellEffectInfo()->TriggerSpell, true);
- break;
- }
- case SPELLFAMILY_DRUID:
- {
- switch (GetSpellInfo()->Id)
- {
- // Frenzied Regeneration
- case 22842:
- {
- // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
- // Should be manauser
- if (target->GetPowerType() != POWER_RAGE)
- break;
- uint32 rage = target->GetPower(POWER_RAGE);
- // Nothing todo
- if (rage == 0)
- break;
- int32 mod = (rage < 100) ? rage : 100;
- int32 points = target->CalculateSpellDamage(target, GetSpellInfo(), 1);
- int32 regen = target->GetMaxHealth() * (mod * points / 10) / 1000;
- target->CastCustomSpell(target, 22845, &regen, nullptr, nullptr, true, nullptr, this);
- target->SetPower(POWER_RAGE, rage-mod);
- break;
- }
- }
- break;
- }
- case SPELLFAMILY_HUNTER:
- {
- // Explosive Shot
- if (GetSpellInfo()->SpellFamilyFlags[1] & 0x80000000)
- {
- if (caster)
- caster->CastCustomSpell(53352, SPELLVALUE_BASE_POINT0, m_amount, target, true, nullptr, this);
- break;
- }
- switch (GetSpellInfo()->Id)
- {
- // Feeding Frenzy Rank 1
- case 53511:
- if (target->GetVictim() && target->EnsureVictim()->HealthBelowPct(35))
- target->CastSpell(target, 60096, true, nullptr, this);
- return;
- // Feeding Frenzy Rank 2
- case 53512:
- if (target->GetVictim() && target->EnsureVictim()->HealthBelowPct(35))
- target->CastSpell(target, 60097, true, nullptr, this);
- return;
- default:
- break;
- }
- break;
- }
- case SPELLFAMILY_SHAMAN:
- if (GetId() == 52179) // Astral Shift
- {
- // Periodic need for remove visual on stun/fear/silence lost
- if (!target->HasUnitFlag(UnitFlags(UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)))
- target->RemoveAurasDueToSpell(52179);
- break;
- }
- break;
- case SPELLFAMILY_DEATHKNIGHT:
- switch (GetId())
- {
- case 49016: // Hysteria
- uint32 damage = uint32(target->CountPctFromMaxHealth(1));
- target->DealDamage(target, damage, nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
- break;
- }
- break;
- default:
- break;
- }
-}
-
void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const
{
// generic casting code with custom spells and target/caster customs
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 332322f4019..c2e5ae24759 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -325,7 +325,6 @@ class TC_GAME_API AuraEffect
void HandleTriggerSpellOnPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// aura effect periodic tick handlers
- void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;
void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const;
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const;
void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const;
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 c3c22ef0172..c1150e6e47a 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -88,7 +88,11 @@ 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
@@ -685,6 +689,32 @@ class npc_bullet_controller : public CreatureScript
}
};
+// 66149 - 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:
@@ -871,6 +901,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 5192129aa6f..cb5599cbcea 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -36,6 +36,7 @@
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "Spell.h"
+#include "SpellAuraEffects.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "ulduar.h"
@@ -1466,6 +1467,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->GetEffect(EFFECT_0)->TriggerSpell });
+ }
+
+ void PeriodicTick(AuraEffect const* aurEff)
+ {
+ // should we use custom damage?
+ GetTarget()->CastSpell(nullptr, GetSpellInfo()->GetEffect(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
@@ -1824,6 +1873,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 8b4771c5f70..eeb5b293aee 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp
@@ -640,7 +640,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:
@@ -1658,7 +1660,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);
@@ -1668,15 +1670,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);
}
};