TrinityCore
boss_overlord_wyrmthalak.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_spire.h"
20#include "ScriptedCreature.h"
21#include "TemporarySummon.h"
22
24{
26 SPELL_SHOUT = 23511,
27 SPELL_CLEAVE = 20691,
28 SPELL_KNOCKAWAY = 20686
29};
30
32{
37};
38
39enum Adds
40{
43};
44
45const Position SummonLocation1 = { -39.355f, -513.456f, 88.472f, 4.679f };
46const Position SummonLocation2 = { -49.875f, -511.896f, 88.195f, 4.613f };
47
49{
51 {
52 Initialize();
53 }
54
56 {
57 Summoned = false;
58 }
59
61
62 void Reset() override
63 {
64 _Reset();
65 Initialize();
66 }
67
68 void JustEngagedWith(Unit* who) override
69 {
75 }
76
77 void JustDied(Unit* /*killer*/) override
78 {
79 _JustDied();
80 }
81
82 void UpdateAI(uint32 diff) override
83 {
84 if (!UpdateVictim())
85 return;
86
87 if (!Summoned && HealthBelowPct(51))
88 {
89 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
90 {
92 warlord->AI()->AttackStart(target);
94 berserker->AI()->AttackStart(target);
95 Summoned = true;
96 }
97 }
98
99 events.Update(diff);
100
102 return;
103
104 while (uint32 eventId = events.ExecuteEvent())
105 {
106 switch (eventId)
107 {
108 case EVENT_BLAST_WAVE:
111 break;
112 case EVENT_SHOUT:
115 break;
116 case EVENT_CLEAVE:
119 break;
120 case EVENT_KNOCK_AWAY:
123 break;
124 }
125
127 return;
128 }
129 }
130};
131
133{
135}
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
#define RegisterBlackrockSpireCreatureAI(ai_name)
@ DATA_OVERLORD_WYRMTHALAK
@ NPC_SPIRESTONE_WARLORD
@ NPC_SMOLDERTHORN_BERSERKER
const Position SummonLocation2
void AddSC_boss_overlordwyrmthalak()
const Position SummonLocation1
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
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 ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
bool HealthBelowPct(uint32 pct) const
boss_overlord_wyrmthalak(Creature *creature)
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override