TrinityCore
boss_darkweaver_syth.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Boss_Darkweaver_Syth
20SD%Complete: 85
21SDComment: Shock spells/times need more work. Heroic partly implemented.
22SDCategory: Auchindoun, Sethekk Halls
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "ScriptedCreature.h"
27#include "sethekk_halls.h"
28
29enum Says
30{
34 SAY_DEATH = 3
35};
36
38{
39 SPELL_FROST_SHOCK = 21401, //37865
43
44 SPELL_CHAIN_LIGHTNING = 15659, //15305
45
46 SPELL_SUMMON_SYTH_FIRE = 33537, // Spawns 19203
47 SPELL_SUMMON_SYTH_ARCANE = 33538, // Spawns 19205
48 SPELL_SUMMON_SYTH_FROST = 33539, // Spawns 19204
49 SPELL_SUMMON_SYTH_SHADOW = 33540, // Spawns 19206
50
55};
56
58{
64};
65
67{
68 NPC_LAKKA = 18956,
70};
71
73{
75 {
76 Initialize();
77 }
78
80 {
81 _summon90 = false;
82 _summon50 = false;
83 _summon10 = false;
84 }
85
86 void Reset() override
87 {
88 Initialize();
89 _Reset();
90 }
91
92 void JustEngagedWith(Unit* who) override
93 {
100
102 }
103
104 void JustDied(Unit* /*killer*/) override
105 {
106 _JustDied();
108
109 if (Creature* lakka = me->FindNearestCreature(NPC_LAKKA, 500.0f, true))
110 lakka->AI()->Talk(SAY_LAKKA_FREE);
111 }
112
113 void KilledUnit(Unit* who) override
114 {
115 if (who->GetTypeId() == TYPEID_PLAYER)
116 Talk(SAY_SLAY);
117 }
118
119 void JustSummoned(Creature* summoned) override
120 {
122 summoned->AI()->AttackStart(target);
123
124 summons.Summon(summoned);
125 }
126
127 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
128 {
129 if (me->HealthBelowPctDamaged(90, damage) && !_summon90)
130 {
132 _summon90 = true;
133 }
134
135 if (me->HealthBelowPctDamaged(50, damage) && !_summon50)
136 {
138 _summon50 = true;
139 }
140
141 if (me->HealthBelowPctDamaged(10, damage) && !_summon10)
142 {
144 _summon10 = true;
145 }
146 }
147
149 {
151
152 if (me->IsNonMeleeSpellCast(false))
154
155 DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front
156 DoCast(me, SPELL_SUMMON_SYTH_FIRE, true); //back
157 DoCast(me, SPELL_SUMMON_SYTH_FROST, true); //left
158 DoCast(me, SPELL_SUMMON_SYTH_SHADOW, true); //right
159 }
160
161 void ExecuteEvent(uint32 eventId) override
162 {
163 switch (eventId)
164 {
167 DoCast(target, SPELL_FLAME_SHOCK);
169 break;
172 DoCast(target, SPELL_ARCANE_SHOCK);
174 break;
177 DoCast(target, SPELL_FROST_SHOCK);
179 break;
182 DoCast(target, SPELL_SHADOW_SHOCK);
184 break;
189 break;
190 default:
191 break;
192 }
193 }
194
195 private:
199};
200
202{
204}
uint32_t uint32
Definition: Define.h:142
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
DamageEffectType
Definition: UnitDefines.h:131
@ SPELL_FROST_BUFFET
@ SPELL_ARCANE_BUFFET
@ SPELL_SUMMON_SYTH_FIRE
@ SPELL_ARCANE_SHOCK
@ SPELL_FROST_SHOCK
@ SPELL_SUMMON_SYTH_ARCANE
@ SPELL_SUMMON_SYTH_FROST
@ SPELL_SUMMON_SYTH_SHADOW
@ SPELL_FLAME_SHOCK
@ SPELL_CHAIN_LIGHTNING
@ SPELL_SHADOW_BUFFET
@ SPELL_FLAME_BUFFET
@ SPELL_SHADOW_SHOCK
void AddSC_boss_darkweaver_syth()
@ SAY_LAKKA_FREE
@ EVENT_CHAIN_LIGHTNING
@ EVENT_ARCANE_SHOCK
@ EVENT_FROST_SHOCK
@ EVENT_FLAME_SHOCK
@ EVENT_SHADOW_SHOCK
Says
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Definition: CreatureAI.cpp:328
Creature *const me
Definition: CreatureAI.h:61
CreatureAI * AI() const
Definition: Creature.h:214
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
TypeID GetTypeId() const
Definition: Object.h:173
void Summon(Creature const *summon)
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:3059
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
@ DATA_DARKWEAVER_SYTH
Definition: sethekk_halls.h:31
#define RegisterSethekkHallsCreatureAI(ai_name)
Definition: sethekk_halls.h:57
void JustSummoned(Creature *summoned) override
boss_darkweaver_syth(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void KilledUnit(Unit *who) override
void JustEngagedWith(Unit *who) override
void ExecuteEvent(uint32 eventId) override
void JustDied(Unit *) override