TrinityCore
boss_drakos.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 "InstanceScript.h"
19#include "ScriptedCreature.h"
20#include "ScriptMgr.h"
21#include "SpellScript.h"
22#include "SpellInfo.h"
23#include "oculus.h"
24
26{
32 EMOTE_PULL = 5
33};
34
36{
39
41};
42
43#define SPELL_THUNDERING_STOMP DUNGEON_MODE<uint32>(50774, 59370)
44
46{
50};
51
52enum Misc
53{
55};
56
57struct boss_drakos : public BossAI
58{
59 boss_drakos(Creature* creature) : BossAI(creature, DATA_DRAKOS) { }
60
61 void JustEngagedWith(Unit* who) override
62 {
65
69 }
70
71 void OnSpellStart(SpellInfo const* spell) override
72 {
73 if (spell->Id == SPELL_MAGIC_PULL)
74 {
77 }
78 }
79
80 void OnSpellCast(SpellInfo const* spell) override
81 {
82 if (spell->Id == SPELL_THUNDERING_STOMP)
83 if (roll_chance_i(50))
85 }
86
87 void KilledUnit(Unit* /*victim*/) override
88 {
90 }
91
92 void JustDied(Unit* /*killer*/) override
93 {
94 _JustDied();
96
97 // start achievement timer (kill Eregos within 20 min)
99 }
100
101 void UpdateAI(uint32 diff) override
102 {
103 if (!UpdateVictim())
104 return;
105
106 events.Update(diff);
107
109 return;
110
111 while (uint32 eventId = events.ExecuteEvent())
112 {
113 switch (eventId)
114 {
117 events.Repeat(2s);
118 break;
119 case EVENT_MAGIC_PULL:
121 events.Repeat(6s, 14s);
122 break;
123 case EVENT_STOMP:
125 events.Repeat(10s, 20s);
126 break;
127 default:
128 break;
129 }
130
132 return;
133 }
134 }
135};
136
137// 51336 - Magic Pull
139{
140 bool Validate(SpellInfo const* /*spellInfo*/) override
141 {
143 }
144
145 void HandleDummy(SpellEffIndex /*effIndex*/)
146 {
148 }
149
151 {
152 Unit* caster = GetCaster();
153 for (uint8 i = 0; i < 5; i++)
154 caster->CastSpell(caster, SPELL_SUMMON_UNSTABLE_SPHERE, true);
155 }
156
157 void Register() override
158 {
161 }
162};
163
165{
168}
Texts
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
bool roll_chance_i(int chance)
Definition: Random.h:59
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_DUMMY
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellCastFn(F)
Definition: SpellScript.h:825
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ ACHIEV_TIMED_START_EVENT
Definition: boss_drakos.cpp:54
#define SPELL_THUNDERING_STOMP
Definition: boss_drakos.cpp:43
@ SPELL_SUMMON_UNSTABLE_SPHERE
Definition: boss_drakos.cpp:37
@ SPELL_MAGIC_PULL_EFFECT
Definition: boss_drakos.cpp:40
@ SPELL_MAGIC_PULL
Definition: boss_drakos.cpp:38
void AddSC_boss_drakos()
@ SAY_DEATH
Definition: boss_drakos.cpp:29
@ SAY_AGGRO
Definition: boss_drakos.cpp:27
@ EMOTE_PULL
Definition: boss_drakos.cpp:32
@ SAY_KILL
Definition: boss_drakos.cpp:28
@ SAY_STOMP
Definition: boss_drakos.cpp:31
@ SAY_PULL
Definition: boss_drakos.cpp:30
@ EVENT_MAGIC_PULL
Definition: boss_drakos.cpp:48
@ EVENT_BOMB_SUMMON
Definition: boss_drakos.cpp:47
@ EVENT_STOMP
Definition: boss_drakos.cpp:49
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
uint32 const Id
Definition: SpellInfo.h:325
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
HookList< CastHandler > AfterCast
Definition: SpellScript.h:824
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
void Register() override
@ DATA_DRAKOS
Definition: oculus.h:31
#define RegisterOculusCreatureAI(ai_name)
Definition: oculus.h:116
boss_drakos(Creature *creature)
Definition: boss_drakos.cpp:59
void JustDied(Unit *) override
Definition: boss_drakos.cpp:92
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
Definition: boss_drakos.cpp:61
void OnSpellStart(SpellInfo const *spell) override
Definition: boss_drakos.cpp:71
void OnSpellCast(SpellInfo const *spell) override
Definition: boss_drakos.cpp:80
void KilledUnit(Unit *) override
Definition: boss_drakos.cpp:87