TrinityCore
Loading...
Searching...
No Matches
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/*
19 * Chain Lightning repeat timer requires to be revisited
20 * The way he casts shocks is quite tricky, requires research and proper implementation. He can cast all 4 shocks in a row with 1 sec
21 delay between shocks in normal (sniff) and heroic (video). At the same time he can cast shocks with bigger delays(too short sniff).
22 Looks like he can't cast same shock more than once per 'wave'. Looks like shocks are always shuffled before using. Elementals casts
23 serverside spells on spawn and on death but looks like on-death spells has nothing to do with shocks. Maybe on-spawn does
24 */
25
26#include "ScriptMgr.h"
27#include "ScriptedCreature.h"
28#include "SpellScript.h"
29#include "SpellInfo.h"
30#include "sethekk_halls.h"
31
39
61
71
73{
74 NPC_LAKKA = 18956,
76};
77
85
86// 18472 - Darkweaver Syth
88{
90
91 void Reset() override
92 {
93 _Reset();
95 }
96
109
110 void JustSummoned(Creature* summoned) override
111 {
113 summoned->AI()->AttackStart(target);
114
115 summons.Summon(summoned);
116 }
117
118 void OnSpellCast(SpellInfo const* spellInfo) override
119 {
120 if (spellInfo->Id == SPELL_SUMMON_ELEMENTALS)
122 }
123
124 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
125 {
126 if (_phase < PHASE_HEALTH_90 && me->HealthBelowPctDamaged(90, damage))
127 {
128 _phase++;
130 }
131
132 if (_phase < PHASE_HEALTH_55 && me->HealthBelowPctDamaged(55, damage))
133 {
134 _phase++;
136 }
137
138 if (_phase < PHASE_HEALTH_10 && me->HealthBelowPctDamaged(10, damage))
139 {
140 _phase++;
142 }
143 }
144
145 void KilledUnit(Unit* /*who*/) override
146 {
147 Talk(SAY_SLAY);
148 }
149
150 void JustDied(Unit* /*killer*/) override
151 {
152 _JustDied();
154
155 if (Creature* lakka = me->FindNearestCreature(NPC_LAKKA, 500.0f, true))
156 lakka->AI()->Talk(SAY_LAKKA_FREE);
157 }
158
159 void ExecuteEvent(uint32 eventId) override
160 {
161 switch (eventId)
162 {
165 events.Repeat(10s, 15s);
166 break;
169 events.Repeat(10s, 15s);
170 break;
173 events.Repeat(10s, 15s);
174 break;
177 events.Repeat(10s, 15s);
178 break;
181 events.Repeat(20s, 35s);
182 break;
183 case EVENT_SUMMON:
185 break;
186 default:
187 break;
188 }
189 }
190
191private:
193};
194
195// 33595 - Summon Elementals
197{
198 bool Validate(SpellInfo const* /*spellInfo*/) override
199 {
200 return ValidateSpellInfo(
201 {
206 });
207 }
208
209 void HandleScript(SpellEffIndex /*effIndex*/)
210 {
211 Unit* caster = GetCaster();
212 caster->CastSpell(nullptr, SPELL_SUMMON_SYTH_ARCANE, true);
213 caster->CastSpell(nullptr, SPELL_SUMMON_SYTH_FIRE, true);
214 caster->CastSpell(nullptr, SPELL_SUMMON_SYTH_FROST, true);
215 caster->CastSpell(nullptr, SPELL_SUMMON_SYTH_SHADOW, true);
216 }
217
222};
223
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
#define SpellEffectFn(F, I, N)
DamageEffectType
@ EVENT_CHAIN_LIGHTNING
@ EVENT_ARCANE_SHOCK
@ EVENT_FROST_SHOCK
@ EVENT_FLAME_SHOCK
@ EVENT_SHADOW_SHOCK
void AddSC_boss_darkweaver_syth()
@ SPELL_FROST_SHOCK_H
@ 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_SUMMON_ELEMENTALS
@ SPELL_FLAME_SHOCK_H
@ SPELL_CHAIN_LIGHTNING
@ SPELL_SHADOW_SHOCK_H
@ SPELL_ARCANE_SHOCK_H
@ SPELL_SHADOW_SHOCK
@ SPELL_CHAIN_LIGHTNING_H
@ PHASE_HEALTH_90
@ PHASE_HEALTH_55
@ PHASE_HEALTH_10
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Creature *const me
Definition CreatureAI.h:63
CreatureAI * AI() const
Definition Creature.h:235
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
Definition Unit.h:647
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:1522
bool Validate(SpellInfo const *) override
@ DATA_DARKWEAVER_SYTH
#define RegisterSethekkHallsCreatureAI(ai_name)
T const & DUNGEON_MODE(T const &normal5, T const &heroic10) const
void JustSummoned(Creature *summoned) override
boss_darkweaver_syth(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustEngagedWith(Unit *who) override
void ExecuteEvent(uint32 eventId) override
void JustDied(Unit *) override
void OnSpellCast(SpellInfo const *spellInfo) override
void KilledUnit(Unit *) override