TrinityCore
boss_jandice_barov.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 "scholomance.h"
20#include "ScriptedCreature.h"
21
23{
26 SPELL_DROP_JOURNAL = 26096
27};
28
30{
35};
36
38{
39public:
40 boss_jandice_barov() : CreatureScript("boss_jandice_barov") { }
41
43 {
45
46 void JustSummoned(Creature* summoned) override
47 {
48 // Illusions should attack a random target.
50 summoned->AI()->AttackStart(target);
51
52 summons.Summon(summoned);
53 }
54
55 void JustEngagedWith(Unit* who) override
56 {
60 }
61
62 void JustDied(Unit* /*killer*/) override
63 {
64 _JustDied();
66 }
67
68 void UpdateAI(uint32 diff) override
69 {
70 if (!UpdateVictim())
71 return;
72
73 events.Update(diff);
74
76 return;
77
78 while (uint32 eventId = events.ExecuteEvent())
79 {
80 switch (eventId)
81 {
85 break;
86 case EVENT_ILLUSION:
88 me->SetUninteractible(true);
89 me->SetDisplayId(11686); // Invisible Model
93 break;
95 me->SetUninteractible(false);
96 me->SetDisplayId(11073); //Jandice Model
97 break;
98 default:
99 break;
100 }
101
103 return;
104 }
105 }
106 };
107
108 CreatureAI* GetAI(Creature* creature) const override
109 {
110 return GetScholomanceAI<boss_jandicebarovAI>(creature);
111 }
112};
113
115{
116 new boss_jandice_barov();
117}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_CURSE_OF_BLOOD
@ SPELL_ILLUSION
@ SPELL_DROP_JOURNAL
void AddSC_boss_jandicebarov()
@ EVENT_SET_VISIBILITY
@ EVENT_CURSE_OF_BLOOD
@ EVENT_ILLUSION
@ EVENT_CLEAVE
void _JustEngagedWith(Unit *who)
SummonList summons
EventMap events
void _JustDied()
bool UpdateVictim()
Definition: CreatureAI.cpp:245
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Definition: CreatureAI.cpp:328
Creature *const me
Definition: CreatureAI.h:61
void SetDisplayId(uint32 displayId, bool setNative=false) override
Definition: Creature.cpp:3402
CreatureAI * AI() const
Definition: Creature.h:214
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
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
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
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
Unit * GetVictim() const
Definition: Unit.h:715
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
CreatureAI * GetAI(Creature *creature) const override
@ DATA_JANDICE_BAROV
Definition: scholomance.h:36
void ModifyThreatByPercent(Unit *victim, int32 pct, Unit *who=nullptr)
void JustSummoned(Creature *summoned) override