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#include "ScriptMgr.h"
19#include "ScriptedCreature.h"
20#include "SpellScript.h"
21#include "SpellInfo.h"
22#include "sethekk_halls.h"
23
31
48
58
60{
61 NPC_LAKKA = 18956,
63};
64
72
73// 18472 - Darkweaver Syth
75{
77
78 void Reset() override
79 {
80 _Reset();
82 }
83
95
96 void JustDied(Unit* /*killer*/) override
97 {
98 _JustDied();
100
101 if (Creature* lakka = me->FindNearestCreature(NPC_LAKKA, 500.0f, true))
102 lakka->AI()->Talk(SAY_LAKKA_FREE);
103 }
104
105 void KilledUnit(Unit* who) override
106 {
107 if (who->GetTypeId() == TYPEID_PLAYER)
108 Talk(SAY_SLAY);
109 }
110
111 void JustSummoned(Creature* summoned) override
112 {
114 summoned->AI()->AttackStart(target);
115
116 summons.Summon(summoned);
117 }
118
119 void OnSpellCast(SpellInfo const* spell) override
120 {
121 if (spell->Id == SPELL_SUMMON_ELEMENTALS)
123 }
124
125 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
126 {
127 if (_phase < PHASE_HEALTH_90 && me->HealthBelowPctDamaged(90, damage))
128 {
129 _phase++;
131 }
132
133 if (_phase < PHASE_HEALTH_55 && me->HealthBelowPctDamaged(55, damage))
134 {
135 _phase++;
137 }
138
139 if (_phase < PHASE_HEALTH_10 && me->HealthBelowPctDamaged(10, damage))
140 {
141 _phase++;
143 }
144 }
145
146 void ExecuteEvent(uint32 eventId) override
147 {
148 switch (eventId)
149 {
152 events.Repeat(10s, 15s);
153 break;
156 events.Repeat(10s, 15s);
157 break;
160 events.Repeat(10s, 15s);
161 break;
164 events.Repeat(10s, 15s);
165 break;
168 events.Repeat(25s);
169 break;
170 case EVENT_SUMMON:
172 break;
173 default:
174 break;
175 }
176 }
177
178private:
180};
181
182// 33595 - Summon Elementals
212
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
Will ignore GCD.
#define SpellEffectFn(F, I, N)
DamageEffectType
Definition Unit.h:352
@ EVENT_CHAIN_LIGHTNING
@ EVENT_ARCANE_SHOCK
@ EVENT_FROST_SHOCK
@ EVENT_FLAME_SHOCK
@ EVENT_SHADOW_SHOCK
void AddSC_boss_darkweaver_syth()
@ 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_CHAIN_LIGHTNING
@ SPELL_SHADOW_SHOCK
@ PHASE_HEALTH_90
@ PHASE_HEALTH_55
@ PHASE_HEALTH_10
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
Creature *const me
Definition CreatureAI.h:82
CreatureAI * AI() const
Definition Creature.h:154
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
TypeID GetTypeId() const
Definition Object.h:93
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:30
Definition Unit.h:769
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2099
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_darkweaver_syth_summon_elementals)
bool Validate(SpellInfo const *) override
@ DATA_DARKWEAVER_SYTH
#define RegisterSethekkHallsCreatureAI(ai_name)
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 OnSpellCast(SpellInfo const *spell) override
void JustEngagedWith(Unit *who) override
void ExecuteEvent(uint32 eventId) override
void JustDied(Unit *) override