TrinityCore
boss_saviana_ragefire.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 "Containers.h"
20#include "Map.h"
21#include "MotionMaster.h"
22#include "ruby_sanctum.h"
23#include "ScriptedCreature.h"
24#include "SpellScript.h"
25
27{
28 SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528)
29 SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532)
30 EMOTE_ENRAGED = 2, // %s becomes enraged!
31 SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529)
32};
33
35{
38 SPELL_CONFLAGRATION_2 = 74454, // Unknown dummy effect
39 SPELL_ENRAGE = 78722,
41};
42
44{
51
52 // Event group
54};
55
57{
62};
63
64enum Misc
65{
67};
68
69Position const SavianaRagefireFlyOutPos = {3155.51f, 683.844f, 95.0f, 4.69f};
70Position const SavianaRagefireFlyInPos = {3151.07f, 636.443f, 79.540f, 4.69f};
71Position const SavianaRagefireLandPos = {3151.07f, 636.443f, 78.649f, 4.69f};
72
74{
76
77 void Reset() override
78 {
79 _Reset();
81 me->SetCanFly(false);
82 me->SetDisableGravity(false);
83 }
84
85 void JustEngagedWith(Unit* who) override
86 {
89 events.Reset();
93 }
94
95 void JustDied(Unit* /*killer*/) override
96 {
97 _JustDied();
99 }
100
101 void MovementInform(uint32 type, uint32 point) override
102 {
103 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
104 return;
105
106 switch (point)
107 {
108 case POINT_FLIGHT:
111 break;
112 case POINT_LAND:
114 break;
116 me->SetCanFly(false);
117 me->SetDisableGravity(false);
122 break;
123 case POINT_TAKEOFF:
125 break;
126 default:
127 break;
128 }
129 }
130
131 void EnterEvadeMode(EvadeReason /*why*/) override
132 {
134 }
135
136 void KilledUnit(Unit* victim) override
137 {
138 if (victim->GetTypeId() == TYPEID_PLAYER)
139 Talk(SAY_KILL);
140 }
141
142 void UpdateAI(uint32 diff) override
143 {
144 if (!UpdateVictim())
145 return;
146
147 events.Update(diff);
148
150 return;
151
152 while (uint32 eventId = events.ExecuteEvent())
153 {
154 switch (eventId)
155 {
156 case EVENT_FLIGHT:
157 {
158 me->SetCanFly(true);
159 me->SetDisableGravity(true);
161 me->AttackStop();
162 Position pos;
163 pos.Relocate(me);
164 pos.m_positionZ += 10.0f;
167 break;
168 }
171 break;
172 case EVENT_ENRAGE:
175 events.Repeat(Seconds(24));
176 break;
179 events.Repeat(Seconds(20), Seconds(30));
180 break;
183 break;
186 break;
187 default:
188 break;
189 }
190
192 return;
193 }
194 }
195};
196
198{
199 public:
201
202 bool operator()(WorldObject* unit) const
203 {
204 return unit->GetTypeId() != TYPEID_PLAYER;
205 }
206};
207
208// 74452 - Conflagration
210{
211 bool Validate(SpellInfo const* /*spell*/) override
212 {
214 }
215
216 void FilterTargets(std::list<WorldObject*>& targets)
217 {
218 targets.remove_if(ConflagrationTargetSelector());
219 uint8 maxSize = uint8(GetCaster()->GetMap()->Is25ManRaid() ? 6 : 3);
220 if (targets.size() > maxSize)
221 Trinity::Containers::RandomResize(targets, maxSize);
222 }
223
225 {
226 PreventHitDefaultEffect(effIndex);
229 }
230
231 void Register() override
232 {
235 }
236};
237
238// 74455 - Conflagration
240{
242 {
243 PreventHitDefaultEffect(effIndex);
246 }
247
248 void Register() override
249 {
251 }
252};
253
255{
259}
Texts
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
EvadeReason
Definition: UnitAICommon.h:30
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
@ UNIT_STATE_CASTING
Definition: Unit.h:270
void AddSC_boss_saviana_ragefire()
Position const SavianaRagefireFlyInPos
@ SOUND_ID_DEATH
@ SPELL_CONFLAGRATION_2
@ SPELL_CONFLAGRATION
@ SPELL_FLAME_BREATH
@ SPELL_FLAME_BEACON
Position const SavianaRagefireFlyOutPos
@ POINT_LAND_GROUND
Position const SavianaRagefireLandPos
@ SAY_CONFLAGRATION
@ EVENT_FLAME_BREATH
@ EVENT_AIR_MOVEMENT
@ EVENT_GROUP_LAND_PHASE
@ EVENT_LAND_GROUND
@ EVENT_CONFLAGRATION
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
EventMap events
void _JustDied()
bool operator()(WorldObject *unit) const
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
void SetReactState(ReactStates st)
Definition: Creature.h:160
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:153
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
void MoveTakeoff(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveLand(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
TypeID GetTypeId() const
Definition: Object.h:173
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
bool SetCanFly(bool enable)
Definition: Unit.cpp:12820
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool AttackStop()
Definition: Unit.cpp:5781
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
void FilterTargets(std::list< WorldObject * > &targets)
void HandleDummy(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
MovementPoints
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
#define RegisterRubySanctumCreatureAI(ai_name)
Definition: ruby_sanctum.h:138
@ DATA_SAVIANA_RAGEFIRE
Definition: ruby_sanctum.h:33
float m_positionZ
Definition: Position.h:55
constexpr void Relocate(float x, float y)
Definition: Position.h:63
void DoPlaySoundToSet(WorldObject *source, uint32 soundId)
void JustDied(Unit *) override
void JustEngagedWith(Unit *who) override
void KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason) override
boss_saviana_ragefire(Creature *creature)
void MovementInform(uint32 type, uint32 point) override
void UpdateAI(uint32 diff) override