TrinityCore
Loading...
Searching...
No Matches
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
55
63
65{
66 SOUND_ID_DEATH = 17531
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
73// 39747 - Saviana Ragefire
75{
77
78 void Reset() override
79 {
80 _Reset();
82 me->SetCanFly(false);
83 me->SetDisableGravity(false);
84 }
85
95
96 void JustDied(Unit* /*killer*/) override
97 {
98 _JustDied();
100 }
101
102 void MovementInform(uint32 type, uint32 point) override
103 {
104 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
105 return;
106
107 switch (point)
108 {
109 case POINT_FLIGHT:
112 break;
113 case POINT_LAND:
115 break;
117 me->SetCanFly(false);
118 me->SetDisableGravity(false);
123 break;
124 case POINT_TAKEOFF:
126 break;
127 default:
128 break;
129 }
130 }
131
132 void EnterEvadeMode(EvadeReason /*why*/) override
133 {
135 }
136
137 void KilledUnit(Unit* victim) override
138 {
139 if (victim->GetTypeId() == TYPEID_PLAYER)
140 Talk(SAY_KILL);
141 }
142
143 void UpdateAI(uint32 diff) override
144 {
145 if (!UpdateVictim())
146 return;
147
148 events.Update(diff);
149
151 return;
152
153 while (uint32 eventId = events.ExecuteEvent())
154 {
155 switch (eventId)
156 {
157 case EVENT_FLIGHT:
158 {
159 me->SetCanFly(true);
160 me->SetDisableGravity(true);
162 me->AttackStop();
163 Position pos;
164 pos.Relocate(me);
165 pos.m_positionZ += 10.0f;
168 break;
169 }
172 break;
173 case EVENT_ENRAGE:
176 events.Repeat(24s);
177 break;
180 events.Repeat(20s, 30s);
181 break;
184 break;
187 break;
188 default:
189 break;
190 }
191
193 return;
194 }
195
197 }
198};
199
201{
202 public:
204
205 bool operator()(WorldObject* unit) const
206 {
207 return unit->GetTypeId() != TYPEID_PLAYER;
208 }
209};
210
211// 74452 - Conflagration
213{
215
216 bool Validate(SpellInfo const* /*spell*/) override
217 {
219 }
220
221 void FilterTargets(std::list<WorldObject*>& targets)
222 {
223 targets.remove_if(ConflagrationTargetSelector());
224 uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3);
225 if (targets.size() > maxSize)
226 Trinity::Containers::RandomResize(targets, maxSize);
227 }
228
235
241};
242
243// 74455 - Conflagration
260
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TARGET_UNIT_SRC_AREA_ENEMY
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ POINT_LAND_GROUND
void AddSC_boss_saviana_ragefire()
Position const SavianaRagefireFlyInPos
@ EVENT_FLAME_BREATH
@ EVENT_AIR_MOVEMENT
@ EVENT_GROUP_LAND_PHASE
@ EVENT_LAND_GROUND
@ EVENT_CONFLAGRATION
@ SPELL_CONFLAGRATION_2
@ SPELL_CONFLAGRATION
@ SPELL_FLAME_BREATH
@ SPELL_FLAME_BEACON
Position const SavianaRagefireFlyOutPos
Position const SavianaRagefireLandPos
@ SAY_CONFLAGRATION
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
EventMap events
bool operator()(WorldObject *unit) const
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetReactState(ReactStates st)
Definition Creature.h:119
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void CancelEventGroup(GroupIndex group)
Definition EventMap.cpp:165
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveTakeoff(uint32 id, Position const &pos, Optional< float > velocity={})
void MoveLand(uint32 id, Position const &pos, Optional< float > velocity={})
TypeID GetTypeId() const
Definition Object.h:93
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
bool SetCanFly(bool enable, bool packetOnly=false)
Definition Unit.cpp:13374
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
bool AttackStop()
Definition Unit.cpp:5645
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
void FilterTargets(std::list< WorldObject * > &targets)
void HandleDummy(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_saviana_conflagration_init)
PrepareSpellScript(spell_saviana_conflagration_throwback)
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:66
#define RegisterRubySanctumCreatureAI(ai_name)
@ DATA_SAVIANA_RAGEFIRE
float m_positionZ
Definition Position.h:58
void Relocate(float x, float y)
Definition Position.h:66
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