TrinityCore
boss_baron_rivendare.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 "ScriptedCreature.h"
20#include "SpellInfo.h"
21#include "stratholme.h"
22
24{
25 EMOTE_RAISE_DEAD = 0, // %s raises an undead servant back to life!
26 EMOTE_DEATH_PACT = 1 // %s attempts to cast Death Pact on his servants!
27};
28
30{
32 SPELL_CLEAVE = 15284,
34 SPELL_DEATH_PACT_1 = 17698, // Heal Rivendare and damage skeleton
35 SPELL_DEATH_PACT_2 = 17471, // Visual effect
36 SPELL_DEATH_PACT_3 = 17472, // Instant kill self only
37 SPELL_RAISE_DEAD = 17473, // Inits. 17698 and 17471
44 SPELL_UNHOLY_AURA = 17467
45};
46
48{
53};
54
56{
59};
60
62{
63public:
64 boss_baron_rivendare(Creature* creature) : BossAI(creature, BOSS_RIVENDARE), RaiseDead(false) { }
65
66 void JustEngagedWith(Unit* who) override
67 {
72
74 }
75
76 void UpdateAI(uint32 diff) override
77 {
78 if (!UpdateVictim())
79 return;
80
81 events.Update(diff);
82
84 return;
85
86 while (uint32 eventId = events.ExecuteEvent())
87 {
88 switch (eventId)
89 {
92 DoCast(target, SPELL_SHADOWBOLT);
93 events.Repeat(10s);
94 break;
95 case EVENT_CLEAVE:
97 events.Repeat(7s, 17s);
98 break;
101 events.Repeat(10s, 25s);
102 break;
103 case EVENT_RAISE_DEAD:
104 if (!RaiseDead)
105 {
107 for (uint32 const& summonSkeletons : RaiseDeadSpells)
108 DoCastSelf(summonSkeletons, true);
109 RaiseDead = true;
111 }
112 else
113 {
114 RaiseDead = false;
116 }
117 events.Repeat(12s);
118 break;
119 default:
120 break;
121 }
123 return;
124 }
125 }
126
127private:
129};
130
131// Death Pact 3 (17472) needs to be casted by the skeletons
133{
134 npc_summoned_skeleton(Creature* creature) : ScriptedAI(creature) { }
135
136 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
137 {
138 if (spellInfo->Id == SPELL_DEATH_PACT_2)
140 }
141};
142
144{
147}
Texts
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_CLEAVE
@ SPELL_RAISE_DEAD_3
@ SPELL_MORTALSTRIKE
@ SPELL_RAISE_DEAD_4
@ SPELL_DEATH_PACT_3
@ SPELL_RAISE_DEAD_5
@ SPELL_RAISE_DEAD_2
@ SPELL_SHADOWBOLT
@ SPELL_RAISE_DEAD_1
@ SPELL_RAISE_DEAD
@ SPELL_DEATH_PACT_2
@ SPELL_DEATH_PACT_1
@ SPELL_RAISE_DEAD_6
@ SPELL_UNHOLY_AURA
@ EMOTE_RAISE_DEAD
@ EMOTE_DEATH_PACT
uint32 const RaiseDeadSpells[6]
BaronRivendareEvents
@ EVENT_RAISE_DEAD
@ EVENT_SHADOWBOLT
@ EVENT_CLEAVE
@ EVENT_MORTALSTRIKE
void AddSC_boss_baron_rivendare()
void JustEngagedWith(Unit *who) override
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
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 Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
uint32 const Id
Definition: SpellInfo.h:325
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
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
@ BOSS_RIVENDARE
Definition: stratholme.h:40
#define RegisterStratholmeCreatureAI(ai_name)
Definition: stratholme.h:133
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
boss_baron_rivendare(Creature *creature)
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
npc_summoned_skeleton(Creature *creature)