TrinityCore
boss_kazzara_the_hellforged.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 "CellImpl.h"
19#include "GameObject.h"
20#include "GridNotifiersImpl.h"
21#include "InstanceScript.h"
22#include "ScriptMgr.h"
23#include "ScriptedCreature.h"
25
27{
28 // Sundered NPCs
29 SPELL_FEAR = 220540,
30
31 // Kazzara
33 SPELL_KAZZARA_INTRO = 410541
34};
35
36// 201261 - Kazzara the Hellforged
38{
40
41 void JustAppeared() override
42 {
44 {
45 me->SetUninteractible(true);
46 me->SetImmuneToAll(true);
47 me->SetVisible(false);
48 }
49 }
50
51 void DoAction(int32 actionId) override
52 {
53 switch (actionId)
54 {
56 {
58 {
59 gate->SetFlag(GO_FLAG_IN_USE);
60 gate->SetGoState(GO_STATE_READY);
61 }
62
63 me->SetVisible(true);
64
67
68 scheduler.Schedule(1s + 500ms, [this](TaskContext /*context*/)
69 {
70 std::vector<Creature*> sunderedMobs;
71 GetCreatureListWithOptionsInGrid(sunderedMobs, me, 50.0f, { .StringId = "sundered_mob" });
72 for (Creature* sunderedMob : sunderedMobs)
73 {
74 if (!sunderedMob->IsAlive() || sunderedMob->IsInCombat())
75 continue;
76
77 sunderedMob->CastSpell(nullptr, SPELL_FEAR, false);
78 }
79 });
80
81 scheduler.Schedule(12s, [this](TaskContext /*context*/)
82 {
83 me->SetUninteractible(false);
84 me->SetImmuneToAll(false);
85 });
86 break;
87 }
88 default:
89 break;
90 }
91 }
92
93 void UpdateAI(uint32 diff) override
94 {
95 scheduler.Update(diff);
96 }
97};
98
100{
102}
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ DONE
void GetCreatureListWithOptionsInGrid(Container &container, WorldObject *source, float maxSearchRange, FindCreatureOptions const &options)
@ GO_FLAG_IN_USE
@ GO_STATE_READY
@ ACTION_START_KAZZARA_INTRO
@ DATA_KAZZARA_THE_HELLFORGED
#define RegisterAberrusTheShadowedCrucibleCreatureAI(ai_name)
void AddSC_boss_kazzara_the_hellforged()
InstanceScript *const instance
TaskScheduler scheduler
Creature *const me
Definition: CreatureAI.h:61
void SetImmuneToAll(bool apply) override
Definition: Creature.h:167
GameObject * GetGameObject(uint32 type)
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
void SetVisible(bool x)
Definition: Unit.cpp:8351
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
void DoAction(int32 actionId) override