aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp32
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp94
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp64
-rw-r--r--src/server/scripts/World/npcs_special.cpp32
-rw-r--r--src/server/scripts/World/world_script_loader.cpp2
5 files changed, 135 insertions, 89 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index 46bc2a11e89..15ccb12e2e9 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -104,7 +104,10 @@ enum Spells
SPELL_MORTAL_WOUND = 28467,
// Guardian of Icecrown
- SPELL_BLOOD_TAP = 28470
+ SPELL_BLOOD_TAP = 28470,
+
+ // Shadow Fissure
+ SPELL_VOID_BLAST = 27812
};
static const uint8 nGuardianSpawns = 4;
@@ -824,6 +827,32 @@ struct npc_kelthuzad_guardian : public ScriptedAI
uint32 _bloodTapTimer;
};
+struct npc_kelthuzad_shadow_fissure : public ScriptedAI
+{
+ npc_kelthuzad_shadow_fissure(Creature* creature) : ScriptedAI(creature) { }
+
+ void InitializeAI() override
+ {
+ me->SetReactState(REACT_PASSIVE);
+ }
+
+ void JustAppeared() override
+ {
+ _scheduler.Schedule(5s, [this](TaskContext /*task*/)
+ {
+ DoCastSelf(SPELL_VOID_BLAST);
+ });
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
// 28410 - Chains of Kel'Thuzad
class spell_kelthuzad_chains : public AuraScript
{
@@ -955,6 +984,7 @@ void AddSC_boss_kelthuzad()
RegisterNaxxramasCreatureAI(npc_kelthuzad_banshee);
RegisterNaxxramasCreatureAI(npc_kelthuzad_abomination);
RegisterNaxxramasCreatureAI(npc_kelthuzad_guardian);
+ RegisterNaxxramasCreatureAI(npc_kelthuzad_shadow_fissure);
RegisterSpellScript(spell_kelthuzad_chains);
RegisterSpellScript(spell_kelthuzad_detonate_mana);
RegisterSpellScript(spell_kelthuzad_frost_blast);
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
index 7012d142b6e..05e4f7cff0d 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp
@@ -38,19 +38,22 @@ enum Yells
enum Spells
{
- SPELL_FROST_AURA = 28531,
- SPELL_CLEAVE = 19983,
- SPELL_TAIL_SWEEP = 55697,
- SPELL_SUMMON_BLIZZARD = 28560,
- SPELL_LIFE_DRAIN = 28542,
- SPELL_ICEBOLT = 28522,
- SPELL_FROST_BREATH_ANTICHEAT = 29318, // damage effect ignoring LoS on the entrance platform to prevent cheese
- SPELL_FROST_BREATH = 28524, // damage effect below sapphiron
- SPELL_FROST_MISSILE = 30101, // visual only
- SPELL_BERSERK = 26662,
- SPELL_DIES = 29357,
- SPELL_CHECK_RESISTS = 60539,
- SPELL_SAPPHIRON_WING_BUFFET = 29328
+ SPELL_FROST_AURA = 28531,
+ SPELL_CLEAVE = 19983,
+ SPELL_TAIL_SWEEP = 55697,
+ SPELL_SUMMON_BLIZZARD = 28560,
+ SPELL_LIFE_DRAIN = 28542,
+ SPELL_ICEBOLT = 28522,
+ SPELL_FROST_BREATH_ANTICHEAT = 29318, // damage effect ignoring LoS on the entrance platform to prevent cheese
+ SPELL_FROST_BREATH = 28524, // damage effect below sapphiron
+ SPELL_FROST_MISSILE = 30101, // visual only
+ SPELL_BERSERK = 26662,
+ SPELL_DIES = 29357,
+ SPELL_CHECK_RESISTS = 60539,
+ SPELL_SUMMON_WING_BUFFET = 29329,
+ SPELL_WING_BUFFET_PERIODIC = 29327,
+ SPELL_WING_BUFFET_DESPAWN_PERIODIC = 29330,
+ SPELL_DESPAWN_BUFFET = 29336
};
enum Phases
@@ -81,7 +84,6 @@ enum Events
enum Misc
{
NPC_BLIZZARD = 16474,
- NPC_WING_BUFFET = 17025,
GO_ICEBLOCK = 181247,
// The Hundred Club
@@ -335,8 +337,7 @@ struct boss_sapphiron : public BossAI
case EVENT_LIFTOFF:
{
Talk(EMOTE_AIR_PHASE);
- if (Creature* buffet = DoSummon(NPC_WING_BUFFET, me, 0.0f, 0s, TEMPSUMMON_MANUAL_DESPAWN))
- _buffet = buffet->GetGUID();
+ DoCastSelf(SPELL_SUMMON_WING_BUFFET);
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetHover(true);
events.ScheduleEvent(EVENT_ICEBOLT, Seconds(7), 0, PHASE_FLIGHT);
@@ -381,13 +382,9 @@ struct boss_sapphiron : public BossAI
events.ScheduleEvent(EVENT_LAND, Seconds(3) + Milliseconds(500), 0, PHASE_FLIGHT);
return;
case EVENT_LAND:
+ DoCastSelf(SPELL_DESPAWN_BUFFET); /// @todo: at this point it should already despawn, probably that spell is used in another place
if (_delayedDrain)
CastDrain();
- if (Creature* cBuffet = ObjectAccessor::GetCreature(*me, _buffet))
- {
- cBuffet->DespawnOrUnsummon(1s);
- _buffet.Clear();
- }
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
Talk(EMOTE_GROUND_PHASE);
me->SetHover(false);
@@ -409,7 +406,6 @@ struct boss_sapphiron : public BossAI
private:
GuidVector _iceboltTargets;
- ObjectGuid _buffet;
bool _delayedDrain;
bool _canTheHundredClub;
};
@@ -449,6 +445,22 @@ private:
ObjectGuid _targetGuid;
};
+struct npc_sapphiron_wing_buffet : public ScriptedAI
+{
+ npc_sapphiron_wing_buffet(Creature* creature) : ScriptedAI(creature) { }
+
+ void InitializeAI() override
+ {
+ me->SetReactState(REACT_PASSIVE);
+ }
+
+ void JustAppeared() override
+ {
+ DoCastSelf(SPELL_WING_BUFFET_PERIODIC);
+ DoCastSelf(SPELL_WING_BUFFET_DESPAWN_PERIODIC);
+ }
+};
+
struct go_sapphiron_birth : public GameObjectAI
{
go_sapphiron_birth(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
@@ -580,6 +592,41 @@ class spell_sapphiron_summon_blizzard : public SpellScript
}
};
+// 29330 - Sapphiron's Wing Buffet Despawn
+class spell_sapphiron_wing_buffet_despawn_periodic : public AuraScript
+{
+ PrepareAuraScript(spell_sapphiron_wing_buffet_despawn_periodic);
+
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
+ {
+ Unit* target = GetTarget();
+ if (Creature* creature = target->ToCreature())
+ creature->DespawnOrUnsummon();
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_sapphiron_wing_buffet_despawn_periodic::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
+// 29336 - Despawn Buffet
+class spell_sapphiron_despawn_buffet : public SpellScript
+{
+ PrepareSpellScript(spell_sapphiron_despawn_buffet);
+
+ void HandleScriptEffect(SpellEffIndex /* effIndex */)
+ {
+ if (Creature* target = GetHitCreature())
+ target->DespawnOrUnsummon();
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_sapphiron_despawn_buffet::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
class achievement_the_hundred_club : public AchievementCriteriaScript
{
public:
@@ -595,9 +642,12 @@ void AddSC_boss_sapphiron()
{
RegisterNaxxramasCreatureAI(boss_sapphiron);
RegisterNaxxramasCreatureAI(npc_sapphiron_blizzard);
+ RegisterNaxxramasCreatureAI(npc_sapphiron_wing_buffet);
RegisterNaxxramasGameObjectAI(go_sapphiron_birth);
RegisterSpellScript(spell_sapphiron_change_blizzard_target);
RegisterSpellScript(spell_sapphiron_icebolt);
RegisterSpellScript(spell_sapphiron_summon_blizzard);
+ RegisterSpellScript(spell_sapphiron_wing_buffet_despawn_periodic);
+ RegisterSpellScript(spell_sapphiron_despawn_buffet);
new achievement_the_hundred_club();
}
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
deleted file mode 100644
index b4817c81523..00000000000
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 "Creature.h"
-#include "Map.h"
-#include "PassiveAI.h"
-#include "SpellInfo.h"
-#include "SpellMgr.h"
-
-class trigger_periodic : public CreatureScript
-{
-public:
- trigger_periodic() : CreatureScript("trigger_periodic") { }
-
- struct trigger_periodicAI : public NullCreatureAI
- {
- trigger_periodicAI(Creature* creature) : NullCreatureAI(creature)
- {
- spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0], me->GetMap()->GetDifficultyID()) : nullptr;
- interval = me->GetBaseAttackTime(BASE_ATTACK);
- timer = interval;
- }
-
- uint32 timer, interval;
- SpellInfo const* spell;
-
- void UpdateAI(uint32 diff) override
- {
- if (timer <= diff)
- {
- if (spell)
- me->CastSpell(me, spell->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(spell->Difficulty));
- timer = interval;
- }
- else
- timer -= diff;
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new trigger_periodicAI(creature);
- }
-};
-
-void AddSC_generic_creature()
-{
- new trigger_periodic();
-}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 4ebe7e96499..32f6c9bde6f 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -2598,6 +2598,37 @@ public:
}
};
+enum VoidZone
+{
+ SPELL_CONSUMPTION = 28874
+};
+
+struct npc_gen_void_zone : public ScriptedAI
+{
+ npc_gen_void_zone(Creature* creature) : ScriptedAI(creature) { }
+
+ void InitializeAI() override
+ {
+ me->SetReactState(REACT_PASSIVE);
+ }
+
+ void JustAppeared() override
+ {
+ _scheduler.Schedule(2s, [this](TaskContext /*task*/)
+ {
+ DoCastSelf(SPELL_CONSUMPTION);
+ });
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -2622,4 +2653,5 @@ void AddSC_npcs_special()
new npc_train_wrecker();
new npc_argent_squire_gruntling();
new npc_bountiful_table();
+ RegisterCreatureAI(npc_gen_void_zone);
}
diff --git a/src/server/scripts/World/world_script_loader.cpp b/src/server/scripts/World/world_script_loader.cpp
index ea930bd7529..3e28250d381 100644
--- a/src/server/scripts/World/world_script_loader.cpp
+++ b/src/server/scripts/World/world_script_loader.cpp
@@ -22,7 +22,6 @@
void AddSC_areatrigger_scripts();
void AddSC_conversation_scripts();
void AddSC_emerald_dragons();
-void AddSC_generic_creature();
void AddSC_go_scripts();
void AddSC_npc_guard();
void AddSC_item_scripts();
@@ -44,7 +43,6 @@ void AddWorldScripts()
AddSC_areatrigger_scripts();
AddSC_conversation_scripts();
AddSC_emerald_dragons();
- AddSC_generic_creature();
AddSC_go_scripts();
AddSC_npc_guard();
AddSC_item_scripts();