TrinityCore
Loading...
Searching...
No Matches
boss_general_angerforge.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 "blackrock_depths.h"
20#include "ScriptedCreature.h"
21
23{
26 SPELL_CLEAVE = 20691
27};
28
37
39{
41 PHASE_TWO = 2
42};
43
45{
46 public:
47 boss_general_angerforge() : CreatureScript("boss_general_angerforge") { }
48
50 {
52
53 void Reset() override
54 {
55 _events.Reset();
56 }
57
65
66 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
67 {
69 {
73 }
74 }
75
76 void SummonAdd(Unit* victim)
77 {
78 if (Creature* SummonedAdd = DoSpawnCreature(8901, float(irand(-14, 14)), float(irand(-14, 14)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120s))
79 SummonedAdd->AI()->AttackStart(victim);
80 }
81
82 void SummonMedic(Unit* victim)
83 {
84 if (Creature* SummonedMedic = DoSpawnCreature(8894, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120s))
85 SummonedMedic->AI()->AttackStart(victim);
86 }
87
88 void UpdateAI(uint32 diff) override
89 {
90 if (!UpdateVictim())
91 return;
92
93 _events.Update(diff);
94
95 while (uint32 eventId = _events.ExecuteEvent())
96 {
97 switch (eventId)
98 {
102 break;
103 case EVENT_HAMSTRING:
106 break;
107 case EVENT_CLEAVE:
110 break;
111 case EVENT_MEDIC:
112 for (uint8 i = 0; i < 2; ++i)
114 break;
115 case EVENT_ADDS:
116 for (uint8 i = 0; i < 3; ++i)
119 break;
120 default:
121 break;
122 }
123 }
124
126 }
127
128 private:
130 };
131
132 CreatureAI* GetAI(Creature* creature) const override
133 {
134 return GetBlackrockDepthsAI<boss_general_angerforgeAI>(creature);
135 }
136};
137
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Spells
Definition PlayerAI.cpp:32
int32 irand(int32 min, int32 max)
Definition Random.cpp:35
DamageEffectType
Definition Unit.h:352
void AddSC_boss_general_angerforge()
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
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 Reset()
Definition EventMap.cpp:21
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
Unit * GetVictim() const
Definition Unit.h:859
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
CreatureAI * GetAI(Creature *creature) const override
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, Milliseconds despawntime)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override