aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp85
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp38
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp84
-rw-r--r--src/server/scripts/Northrend/northrend_script_loader.cpp2
4 files changed, 118 insertions, 91 deletions
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
index fe5e9785505..f98788f926a 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
@@ -231,13 +231,13 @@ struct boss_auriaya : public BossAI
{
case EVENT_SONIC_SCREECH:
DoCastVictim(SPELL_SONIC_SCREECH);
- events.Repeat(Seconds(22), Seconds(30));
+ events.Repeat(22s, 30s);
break;
case EVENT_TERRIFYING_SCREECH:
Talk(EMOTE_FEAR);
DoCastSelf(SPELL_TERRIFYING_SCREECH);
- events.ScheduleEvent(EVENT_BLAST, Milliseconds(1));
- events.Repeat(Seconds(36), Seconds(45));
+ events.ScheduleEvent(EVENT_BLAST, 1ms);
+ events.Repeat(36s, 45s);
break;
case EVENT_BLAST:
DoCastAOE(SPELL_SENTINEL_BLAST);
@@ -253,7 +253,7 @@ struct boss_auriaya : public BossAI
case EVENT_SWARNING_GUARDIAN:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
DoCast(target, SPELL_SUMMON_SWARMING_GUARDIAN);
- events.Repeat(Seconds(25), Seconds(45));
+ events.Repeat(25s, 45s);
break;
case EVENT_BERSERK:
DoCastSelf(SPELL_BERSERK, true);
@@ -289,7 +289,7 @@ struct npc_sanctum_sentry : public ScriptedAI
void JustEngagedWith(Unit* /*who*/) override
{
_events.ScheduleEvent(EVENT_RIP, 6s);
- _events.ScheduleEvent(EVENT_SAVAGE_POUNCE, Milliseconds(1));
+ _events.ScheduleEvent(EVENT_SAVAGE_POUNCE, 1ms);
me->SetWalk(false);
}
@@ -315,16 +315,16 @@ struct npc_sanctum_sentry : public ScriptedAI
{
case EVENT_RIP:
DoCastVictim(SPELL_RIP_FLESH);
- _events.Repeat(Seconds(10), Seconds(12));
+ _events.Repeat(10s, 12s);
break;
case EVENT_SAVAGE_POUNCE:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, CatsTargetSelector(me, 10.0f, 15.0f)))
{
DoCast(target, SPELL_SAVAGE_POUNCE);
- _events.Repeat(Seconds(10));
+ _events.Repeat(10s);
break;
}
- _events.Repeat(Seconds(1));
+ _events.Repeat(1s);
break;
default:
break;
@@ -380,22 +380,39 @@ struct npc_feral_defender : public ScriptedAI
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
AttackStart(target);
_events.ScheduleEvent(EVENT_RUSH, 1s);
+ _events.ScheduleEvent(EVENT_FERAL_POUNCE, 5s);
+ break;
+ case EVENT_FERAL_POUNCE:
+ if (me->GetReactState() != REACT_PASSIVE)
+ {
+ if (Unit* target = me->GetVictim())
+ {
+ float distance = me->GetDistance2d(target);
+ if (distance > 5.0f && distance <= 45.0f)
+ {
+ DoCastVictim(SPELL_FERAL_POUNCE);
+ _events.Repeat(5s);
+ break;
+ }
+ }
+ }
+ _events.Repeat(1s);
break;
case EVENT_RUSH:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, CatsTargetSelector(me, 10.0f, 11.0f)))
{
DoCast(target, SPELL_FERAL_RUSH, true);
- _events.Repeat(Seconds(5));
+ _events.Repeat(5s);
break;
}
- _events.Repeat(Seconds(1));
+ _events.Repeat(1s);
break;
case EVENT_RESPAWN_DEFENDER:
me->SetDisableGravity(true);
me->SetHover(true);
DoCastSelf(SPELL_DROWNED_STATE, true);
- _events.ScheduleEvent(EVENT_RESPAWN_DEFENDER_2, Seconds(3));
- _events.ScheduleEvent(EVENT_RESPAWN_DEFENDER_3, Seconds(5));
+ _events.ScheduleEvent(EVENT_RESPAWN_DEFENDER_2, 3s);
+ _events.ScheduleEvent(EVENT_RESPAWN_DEFENDER_3, 5s);
break;
case EVENT_RESPAWN_DEFENDER_2:
me->RemoveAurasDueToSpell(SPELL_DROWNED_STATE);
@@ -407,6 +424,7 @@ struct npc_feral_defender : public ScriptedAI
me->SetReactState(REACT_AGGRESSIVE);
me->SetDisableGravity(false);
me->SetHover(false);
+ DoCastSelf(SPELL_RANDOM_AGRO_PERIODIC, true);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
AttackStart(target);
_events.ScheduleEvent(EVENT_RUSH, 1s);
@@ -432,6 +450,7 @@ struct npc_feral_defender : public ScriptedAI
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveAurasDueToSpell(SPELL_RANDOM_AGRO_PERIODIC);
DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH, true);
DoCastSelf(SPELL_FERAL_ESSENCE_APPLICATION_REMOVAL, true);
DoCastSelf(SPELL_SUMMON_ESSENCE, true);
@@ -462,7 +481,7 @@ struct npc_swarming_guardian : public ScriptedAI
void Reset() override
{
me->SetReactState(REACT_PASSIVE);
- _scheduler.Schedule(Seconds(1), [this](TaskContext /*context*/)
+ _scheduler.Schedule(1s, [this](TaskContext /*context*/)
{
me->SetReactState(REACT_AGGRESSIVE);
DoCastSelf(SPELL_AGRO_CREATOR);
@@ -574,45 +593,6 @@ class spell_auriaya_agro_creator : public SpellScript
}
};
-// 61906 - Random Aggro Periodic (5 sec)
-class spell_auriaya_random_agro_periodic : public AuraScript
-{
- PrepareAuraScript(spell_auriaya_random_agro_periodic);
-
- bool Validate(SpellInfo const* /*spellInfo*/) override
- {
- return ValidateSpellInfo({ SPELL_FERAL_POUNCE });
- }
-
- void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
- {
- Creature* owner = GetUnitOwner()->ToCreature();
- if (!owner || !owner->IsAIEnabled() || owner->HasReactState(REACT_PASSIVE))
- return;
-
- bool farTarget = true;
- Unit* target = owner->AI()->SelectTarget(SelectTargetMethod::Random, 0, CatsTargetSelector(owner, 15.0f, 25.0f));
- if (!target)
- {
- farTarget = false;
- target = owner->AI()->SelectTarget(SelectTargetMethod::Random, 0);
- }
-
- if (!target)
- return;
-
- owner->GetThreatManager().AddThreat(target, 3000000.0f, nullptr, true);
- if (farTarget)
- owner->CastSpell(target, SPELL_FERAL_POUNCE, true);
- owner->AI()->AttackStart(target);
- }
-
- void Register() override
- {
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_auriaya_random_agro_periodic::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
- }
-};
-
// 64456 - Feral Essence Application Removal
class spell_auriaya_feral_essence_removal : public SpellScript
{
@@ -702,7 +682,6 @@ void AddSC_boss_auriaya()
RegisterSpellScript(spell_auriaya_strenght_of_the_pack);
RegisterSpellScript(spell_auriaya_sentinel_blast);
RegisterSpellScript(spell_auriaya_agro_creator);
- RegisterSpellScript(spell_auriaya_random_agro_periodic);
RegisterSpellScript(spell_auriaya_feral_essence_removal);
RegisterSpellScript(spell_auriaya_feral_rush);
new achievement_nine_lives();
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index 25c079b1f5c..b8971dd31e9 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -25,8 +25,6 @@
#include "Map.h"
#include "Player.h"
#include "ScriptMgr.h"
-#include "Spell.h"
-#include "SpellScript.h"
#include "TemporarySummon.h"
#include "Vehicle.h"
#include "WorldStatePackets.h"
@@ -1089,43 +1087,7 @@ class instance_ulduar : public InstanceMapScript
}
};
-class spell_ulduar_teleporter : public SpellScriptLoader
-{
- public:
- spell_ulduar_teleporter() : SpellScriptLoader("spell_ulduar_teleporter") { }
-
- class spell_ulduar_teleporter_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_ulduar_teleporter_SpellScript);
-
- SpellCastResult CheckRequirement()
- {
- if (GetExplTargetUnit()->GetTypeId() != TYPEID_PLAYER)
- return SPELL_FAILED_DONT_REPORT;
-
- if (GetExplTargetUnit()->IsInCombat())
- {
- Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), GetSpell()->m_SpellVisual, GetSpell()->m_castId, SPELL_FAILED_AFFECTING_COMBAT);
- return SPELL_FAILED_AFFECTING_COMBAT;
- }
-
- return SPELL_CAST_OK;
- }
-
- void Register() override
- {
- OnCheckCast += SpellCheckCastFn(spell_ulduar_teleporter_SpellScript::CheckRequirement);
- }
- };
-
- SpellScript* GetSpellScript() const override
- {
- return new spell_ulduar_teleporter_SpellScript();
- }
-};
-
void AddSC_instance_ulduar()
{
new instance_ulduar();
- new spell_ulduar_teleporter();
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp
new file mode 100644
index 00000000000..6a01f6e86ab
--- /dev/null
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp
@@ -0,0 +1,84 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "Spell.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
+
+// 61906 - Random Aggro Periodic (5 sec)
+class spell_ulduar_random_aggro_periodic : public AuraScript
+{
+ PrepareAuraScript(spell_ulduar_random_aggro_periodic);
+
+ void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ Unit* target = GetTarget();
+ target->GetThreatManager().ResetAllThreat();
+ if (!target->IsAIEnabled())
+ return;
+
+ if (Unit* victim = target->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false))
+ {
+ target->GetThreatManager().AddThreat(victim, 3000000.0f, nullptr, true, true);
+ target->GetAI()->AttackStart(victim);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_ulduar_random_aggro_periodic::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
+// 64014 - Expedition Base Camp Teleport
+// 64025 - Halls of Invention Teleport
+// 64028 - Colossal Forge Teleport
+// 64029 - Shattered Walkway Teleport
+// 64030 - Antechamber Teleport
+// 64032 - Formation Grounds Teleport
+// 65042 - Prison of Yogg-Saron Teleport
+class spell_ulduar_teleporter : public SpellScript
+{
+ PrepareSpellScript(spell_ulduar_teleporter);
+
+ SpellCastResult CheckRequirement()
+ {
+ if (GetExplTargetUnit()->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_DONT_REPORT;
+
+ if (GetExplTargetUnit()->IsInCombat())
+ {
+ Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), GetSpell()->m_SpellVisual, GetSpell()->m_castId, SPELL_FAILED_AFFECTING_COMBAT);
+ return SPELL_FAILED_AFFECTING_COMBAT;
+ }
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register() override
+ {
+ OnCheckCast += SpellCheckCastFn(spell_ulduar_teleporter::CheckRequirement);
+ }
+};
+
+void AddSC_ulduar()
+{
+ RegisterSpellScript(spell_ulduar_teleporter);
+ RegisterSpellScript(spell_ulduar_random_aggro_periodic);
+}
diff --git a/src/server/scripts/Northrend/northrend_script_loader.cpp b/src/server/scripts/Northrend/northrend_script_loader.cpp
index 954314d28e7..4f435411732 100644
--- a/src/server/scripts/Northrend/northrend_script_loader.cpp
+++ b/src/server/scripts/Northrend/northrend_script_loader.cpp
@@ -122,6 +122,7 @@ void AddSC_boss_thorim();
void AddSC_boss_yogg_saron();
void AddSC_boss_algalon_the_observer();
void AddSC_instance_ulduar();
+void AddSC_ulduar();
// Utgarde Keep - Utgarde Keep
void AddSC_boss_keleseth();
void AddSC_boss_skarvald_dalronn();
@@ -317,6 +318,7 @@ void AddNorthrendScripts()
AddSC_boss_yogg_saron();
AddSC_boss_algalon_the_observer();
AddSC_instance_ulduar();
+ AddSC_ulduar();
// Utgarde Keep - Utgarde Keep
AddSC_boss_keleseth();
AddSC_boss_skarvald_dalronn();