TrinityCore
Loading...
Searching...
No Matches
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
31
36
41
43{
48
50 {
51 _yellCount = 0;
52 }
53
54 void Reset() override
55 {
56 Initialize();
57 _Reset();
58 }
59
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
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
DamageEffectType
void AddSC_boss_interrogator_vishas()
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
EventMap events
Creature *const me
Definition CreatureAI.h:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
Creature * GetCreature(uint32 type)
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
Definition Unit.h:635
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
@ 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)