TrinityCore
boss_interrogator_vishas.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 "scarlet_monastery.h"
19#include "InstanceScript.h"
20#include "ScriptedCreature.h"
21#include "ScriptMgr.h"
22
24{
30};
31
33{
35};
36
38{
40};
41
43{
45 {
46 Initialize();
47 }
48
50 {
51 _yellCount = 0;
52 }
53
54 void Reset() override
55 {
56 Initialize();
57 _Reset();
58 }
59
60 void JustEngagedWith(Unit* who) override
61 {
65 }
66
67 void KilledUnit(Unit* victim) override
68 {
69 if (victim->GetTypeId() == TYPEID_PLAYER)
71 }
72
73 void JustDied(Unit* /*killer*/) override
74 {
75 _JustDied();
77 {
78 if (vorrel->AI())
79 vorrel->AI()->Talk(SAY_TRIGGER_VORREL);
80 }
81 }
82
83 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
84 {
85 if (me->HealthBelowPctDamaged(60, damage) && _yellCount < 1)
86 {
88 ++_yellCount;
89 }
90
91 if (me->HealthBelowPctDamaged(30, damage) && _yellCount < 2)
92 {
94 ++_yellCount;
95 }
96 }
97
98 void ExecuteEvent(uint32 eventId) override
99 {
100 switch (eventId)
101 {
105 break;
106 default:
107 break;
108 }
109 }
110
111private:
113};
114
116{
118}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
DamageEffectType
Definition: UnitDefines.h:131
void AddSC_boss_interrogator_vishas()
@ SPELL_SHADOW_WORD_PAIN
@ EVENT_SHADOW_WORD_PAIN
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
Creature * GetCreature(uint32 type)
TypeID GetTypeId() const
Definition: Object.h:173
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
@ DATA_INTERROGATOR_VISHAS
@ DATA_VORREL
#define RegisterScarletMonasteryCreatureAI(ai)
void JustEngagedWith(Unit *who) override
void ExecuteEvent(uint32 eventId) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void KilledUnit(Unit *victim) override
boss_interrogator_vishas(Creature *creature)