TrinityCore
Loading...
Searching...
No Matches
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
34
42
43#define SPELL_THUNDERING_STOMP DUNGEON_MODE<uint32>(50774, 59370)
44
51
52enum Misc
53{
55};
56
57struct boss_drakos : public BossAI
58{
59 boss_drakos(Creature* creature) : BossAI(creature, DATA_DRAKOS) { }
60
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(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
162};
163
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
Spells
Definition PlayerAI.cpp:32
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
#define SpellEffectFn(F, I, N)
#define SpellCastFn(F)
@ UNIT_STATE_CASTING
Definition Unit.h:276
@ ACHIEV_TIMED_START_EVENT
#define SPELL_THUNDERING_STOMP
@ SPELL_SUMMON_UNSTABLE_SPHERE
@ SPELL_MAGIC_PULL_EFFECT
@ SPELL_MAGIC_PULL
void AddSC_boss_drakos()
@ SAY_DEATH
@ SAY_AGGRO
@ EMOTE_PULL
@ SAY_KILL
@ SAY_STOMP
@ SAY_PULL
@ EVENT_MAGIC_PULL
@ EVENT_BOMB_SUMMON
@ EVENT_STOMP
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
HookList< CastHandler > AfterCast
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
Definition Unit.h:635
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
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)
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
void OnSpellStart(SpellInfo const *spell) override
void OnSpellCast(SpellInfo const *spell) override
void KilledUnit(Unit *) override