TrinityCore
Loading...
Searching...
No Matches
boss_jeklik.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 "zulgurub.h"
19#include "ScriptedCreature.h"
20#include "ScriptMgr.h"
21#include "TemporarySummon.h"
22
31
33{
34 // Intro
37
38 // Phase one
41 SPELL_CHARGE = 22911,
43 SPELL_SWOOP = 23919,
45
46 // Phase two
52
53 // Frenzied Bloodseeker Bat
54 SPELL_ROOT_SELF = 23973, // They spawns with this aura
55
56 // Gurubashi Bat Rider
57 SPELL_LIQUID_FIRE_PERIODIC = 23968, // Periodically triggers 23969
58 SPELL_LIQUID_FIRE_DAMAGE = 23970, // Assumedly used in script of 23969
59 SPELL_SUMMON_LIQUID_FIRE = 23971 // Assumedly used in script of 23970
60};
61
78
80{
82 PHASE_TWO = 2
83};
84
85struct boss_jeklik : public BossAI
86{
87 boss_jeklik(Creature* creature) : BossAI(creature, DATA_JEKLIK), _calledRiders(false) { }
88
89 void Reset() override
90 {
92 _calledRiders = false;
93 _Reset();
94 }
95
114
115 void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
116 {
118 {
120 me->SetDisableGravity(false);
128 }
129
130 if (!_calledRiders && !HealthAbovePct(35))
131 {
132 _calledRiders = true;
134 //events.ScheduleEvent(EVENT_SPAWN_BAT_RIDER, 0s, 0, PHASE_TWO);
135 }
136 }
137
138 void EnterEvadeMode(EvadeReason /*why*/) override
139 {
142 }
143
144 void JustDied(Unit* /*killer*/) override
145 {
146 _JustDied();
148 }
149
150 void UpdateAI(uint32 diff) override
151 {
152 if (!UpdateVictim())
153 return;
154
155 events.Update(diff);
156
158 return;
159
160 while (uint32 eventId = events.ExecuteEvent())
161 {
162 switch (eventId)
163 {
164 // Phase one
167 events.Repeat(20s, 30s);
168 break;
171 events.Repeat(10s, 20s);
172 break;
174 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.f, true))
175 DoCast(target, SPELL_CHARGE);
176 events.Repeat(15s, 30s);
177 break;
180 events.Repeat(20s, 30s);
181 break;
182 case EVENT_SWOOP:
184 events.Repeat(15s, 20s);
185 break;
189 events.Repeat(1min);
190 break;
191 // Phase two
194 events.Repeat(25s, 30s);
195 break;
198 events.Repeat(35s, 45s);
199 break;
201 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.f, true))
203 events.Repeat(10s, 20s);
204 break;
205 case EVENT_MIND_FLAY:
207 events.Repeat(25s, 40s);
208 break;
209 case EVENT_GREAT_HEAL:
212 events.Repeat(25s);
213 break;
216// case EVENT_SPAWN_BAT_RIDER:
217// events.Repeat(10s);
218// break;
219 default:
220 break;
221 }
222
224 return;
225 }
226
228 }
229
230private:
232};
233
236{
238
239 void Reset() override
240 {
242 }
243
244 void UpdateAI(uint32 /*diff*/) override
245 {
246 if (!UpdateVictim())
247 return;
248
250 }
251};
252
uint32_t uint32
Definition Define.h:133
Spells
Definition PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
@ SPELL_SONIC_BURST
@ SPELL_CHARGE
@ SPELL_BAT_FORM
@ SPELL_SUMMON_LIQUID_FIRE
@ SPELL_CURSE_OF_BLOOD
@ SPELL_LIQUID_FIRE_DAMAGE
@ SPELL_SHADOW_WORD_PAIN
@ SPELL_GREEN_CHANNELING
@ SPELL_SUMMON_BATS
@ SPELL_ROOT_SELF
@ SPELL_BLOOD_LEECH
@ SPELL_LIQUID_FIRE_PERIODIC
@ SPELL_SWOOP
@ SPELL_MIND_FLAY
@ SPELL_GREAT_HEAL
@ SPELL_PIERCE_ARMOR
@ SPELL_PSYCHIC_SCREAM
@ SAY_DEATH
@ SAY_CALL_RIDERS
@ EMOTE_SUMMON_BATS
@ SAY_AGGRO
@ EMOTE_GREAT_HEAL
void AddSC_boss_jeklik()
@ PHASE_ONE
@ PHASE_TWO
@ EVENT_BLOOD_LEECH
@ EVENT_CHARGE_JEKLIK
@ EVENT_PSYCHIC_SCREAM
@ EVENT_SHADOW_WORD_PAIN
@ EVENT_SONIC_BURST
@ EVENT_SPAWN_BAT_RIDER
@ EVENT_SUMMON_BATS
@ EVENT_SWOOP
@ EVENT_GREAT_HEAL
@ EVENT_PIERCE_ARMOR
@ EVENT_CURSE_OF_BLOOD
@ EVENT_MIND_FLAY
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
bool IsInPhase(PhaseIndex phase) const
Definition EventMap.h:236
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
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
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool HealthAbovePct(uint32 pct) const
void ResetThreatList(Unit *who=nullptr)
void UpdateAI(uint32 diff) override
void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellInfo const *) override
void Reset() override
boss_jeklik(Creature *creature)
void JustDied(Unit *) override
void EnterEvadeMode(EvadeReason) override
void JustEngagedWith(Unit *who) override
npc_frenzied_bloodseeker_bat(Creature *creature)
void UpdateAI(uint32) override
#define RegisterZulGurubCreatureAI(ai_name)
Definition zulgurub.h:91
@ DATA_JEKLIK
Definition zulgurub.h:30