TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_ragnaros::boss_ragnarosAI Struct Reference

Public Member Functions

 boss_ragnarosAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *victim) override
 
void KilledUnit (Unit *) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
virtual ~BossAI ()
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
bool CanAIAttack (Unit const *target) const override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Private Attributes

uint32 _emergeTimer
 
uint8 _introState
 
bool _hasYelledMagmaBurst
 
bool _hasSubmergedOnce
 
bool _isBanished
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _EnterCombat ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _DespawnAtEvade ()
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_ragnaros::boss_ragnarosAI::boss_ragnarosAI ( Creature creature)
inline
83  : BossAI(creature, BOSS_RAGNAROS)
84  {
85  Initialize();
86  _introState = 0;
89  SetCombatMovement(false);
90  }
Definition: Unit.h:674
Definition: Unit.h:1129
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Creature *const me
Definition: CreatureAI.h:71
uint8 _introState
Definition: boss_ragnaros.cpp:304
Definition: molten_core.h:35
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:382
Definition: UpdateFields.h:109
void Initialize()
Definition: boss_ragnaros.cpp:92
void SetReactState(ReactStates st)
Definition: Creature.h:502
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444

+ Here is the call graph for this function:

Member Function Documentation

void boss_ragnaros::boss_ragnarosAI::EnterCombat ( Unit victim)
inlineoverridevirtual

Reimplemented from BossAI.

108  {
109  BossAI::EnterCombat(victim);
117  }
Definition: boss_ragnaros.cpp:62
Definition: boss_ragnaros.cpp:61
Definition: boss_ragnaros.cpp:66
void EnterCombat(Unit *) override
Definition: ScriptedCreature.h:356
Definition: boss_ragnaros.cpp:64
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_ragnaros.cpp:65
Definition: boss_ragnaros.cpp:67
Definition: boss_ragnaros.cpp:63

+ Here is the call graph for this function:

void boss_ragnaros::boss_ragnarosAI::Initialize ( void  )
inline
93  {
94  _emergeTimer = 90000;
95  _hasYelledMagmaBurst = false;
96  _hasSubmergedOnce = false;
97  _isBanished = false;
98  }
uint32 _emergeTimer
Definition: boss_ragnaros.cpp:303
bool _hasYelledMagmaBurst
Definition: boss_ragnaros.cpp:305
bool _hasSubmergedOnce
Definition: boss_ragnaros.cpp:306
bool _isBanished
Definition: boss_ragnaros.cpp:307

+ Here is the caller graph for this function:

void boss_ragnaros::boss_ragnarosAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

120  {
121  if (urand(0, 99) < 25)
122  Talk(SAY_KILL);
123  }
Definition: boss_ragnaros.cpp:41
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void boss_ragnaros::boss_ragnarosAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

101  {
102  BossAI::Reset();
103  Initialize();
105  }
Definition: UpdateFields.h:136
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Creature *const me
Definition: CreatureAI.h:71
void Reset() override
Definition: ScriptedCreature.h:355
void Initialize()
Definition: boss_ragnaros.cpp:92

+ Here is the call graph for this function:

void boss_ragnaros::boss_ragnarosAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

126  {
127  if (_introState != 2)
128  {
129  if (!_introState)
130  {
137  _introState = 1;
138  }
139 
140  events.Update(diff);
141 
142  while (uint32 eventId = events.ExecuteEvent())
143  {
144  switch (eventId)
145  {
146  case EVENT_INTRO_1:
148  break;
149  case EVENT_INTRO_2:
151  break;
152  case EVENT_INTRO_3:
154  break;
155  case EVENT_INTRO_4:
158  me->Kill(executus);
159  break;
160  case EVENT_INTRO_5:
163  _introState = 2;
164  break;
165  default:
166  break;
167  }
168  }
169  }
170  else
171  {
172  if (_isBanished && ((_emergeTimer <= diff) || (instance->GetData(DATA_RAGNAROS_ADDS)) > 8))
173  {
174  //Become unbanished again
176  me->setFaction(14);
180  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
181  AttackStart(target);
183 
184  //DoCast(me, SPELL_RAGEMERGE); //"phase spells" didnt worked correctly so Ive commented them and wrote solution witch doesnt need core support
185  _isBanished = false;
186  }
187  else if (_isBanished)
188  {
189  _emergeTimer -= diff;
190  //Do nothing while banished
191  return;
192  }
193 
194  //Return since we have no target
195  if (!UpdateVictim())
196  return;
197 
198  events.Update(diff);
199 
200  while (uint32 eventId = events.ExecuteEvent())
201  {
202  switch (eventId)
203  {
204  case EVENT_ERUPTION:
206  events.ScheduleEvent(EVENT_ERUPTION, urand(20000, 45000));
207  break;
210  if (urand(0, 1))
211  Talk(SAY_WRATH);
213  break;
216  if (urand(0, 1))
217  Talk(SAY_HAND);
219  break;
220  case EVENT_LAVA_BURST:
223  break;
227  break;
228  case EVENT_MAGMA_BLAST:
229  if (!me->IsWithinMeleeRange(me->GetVictim()))
230  {
233  {
234  //Say our dialog
236  _hasYelledMagmaBurst = true;
237  }
238  }
240  break;
241  case EVENT_SUBMERGE:
242  {
243  if (!_isBanished)
244  {
245  //Creature spawning and ragnaros becomming unattackable
246  //is not very well supported in the core //no it really isnt
247  //so added normaly spawning and banish workaround and attack again after 90 secs.
248  me->AttackStop();
249  DoResetThreat();
251  me->InterruptNonMeleeSpells(false);
252  //Root self
253  //DoCast(me, 23973);
254  me->setFaction(35);
259 
260  if (!_hasSubmergedOnce)
261  {
263 
264  // summon 8 elementals
265  for (uint8 i = 0; i < 8; ++i)
266  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
267  if (Creature* summoned = me->SummonCreature(12143, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
268  summoned->AI()->AttackStart(target);
269 
270  _hasSubmergedOnce = true;
271  _isBanished = true;
272  //DoCast(me, SPELL_RAGSUBMERGE);
273  _emergeTimer = 90000;
274 
275  }
276  else
277  {
279 
280  for (uint8 i = 0; i < 8; ++i)
281  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
282  if (Creature* summoned = me->SummonCreature(12143, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 900000))
283  summoned->AI()->AttackStart(target);
284 
285  _isBanished = true;
286  //DoCast(me, SPELL_RAGSUBMERGE);
287  _emergeTimer = 90000;
288  }
289  }
291  break;
292  }
293  default:
294  break;
295  }
296  }
297 
299  }
300  }
bool AttackStop()
Definition: Unit.cpp:7337
uint32 _emergeTimer
Definition: boss_ragnaros.cpp:303
Definition: boss_ragnaros.cpp:62
Definition: boss_ragnaros.cpp:61
Definition: molten_core.h:71
void Kill(Unit *victim, bool durabilityLoss=true)
Definition: Unit.cpp:13513
bool _hasYelledMagmaBurst
Definition: boss_ragnaros.cpp:305
Definition: UpdateFields.h:136
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: Unit.h:1131
Definition: boss_ragnaros.cpp:70
Definition: boss_ragnaros.cpp:73
Definition: Unit.h:1129
Definition: boss_ragnaros.cpp:50
Definition: boss_ragnaros.cpp:72
Definition: boss_ragnaros.cpp:39
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: boss_ragnaros.cpp:66
Definition: boss_ragnaros.cpp:42
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
Definition: Creature.h:467
Definition: SharedDefines.h:2444
Definition: boss_ragnaros.cpp:71
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: boss_ragnaros.cpp:69
Definition: boss_ragnaros.cpp:64
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_ragnaros.cpp:40
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: SharedDefines.h:2487
Definition: UnitAI.h:35
Definition: boss_ragnaros.cpp:56
Unit * GetVictim() const
Definition: Unit.h:1379
uint8 _introState
Definition: boss_ragnaros.cpp:304
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: boss_ragnaros.cpp:38
Definition: boss_ragnaros.cpp:55
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
uint32_t uint32
Definition: Define.h:150
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
Definition: Unit.cpp:508
Definition: boss_ragnaros.cpp:35
Definition: boss_ragnaros.cpp:33
bool _hasSubmergedOnce
Definition: boss_ragnaros.cpp:306
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: SharedDefines.h:2561
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: Object.h:55
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void Update(uint32 time)
Definition: EventMap.h:54
Definition: molten_core.h:34
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
void DoResetThreat()
Definition: ScriptedCreature.cpp:248
Definition: boss_ragnaros.cpp:47
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
Definition: boss_ragnaros.cpp:36
Definition: UpdateFields.h:109
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
Definition: boss_ragnaros.cpp:49
uint8_t uint8
Definition: Define.h:152
EventMap events
Definition: ScriptedCreature.h:371
void HandleEmoteCommand(uint32 anim_id)
Definition: Unit.cpp:1444
Definition: SharedDefines.h:2486
Definition: boss_ragnaros.cpp:37
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_ragnaros.cpp:65
Definition: Unit.h:1305
void SetReactState(ReactStates st)
Definition: Creature.h:502
Definition: Unit.h:698
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
InstanceScript *const instance
Definition: ScriptedCreature.h:340
bool _isBanished
Definition: boss_ragnaros.cpp:307
Definition: boss_ragnaros.cpp:67
Definition: boss_ragnaros.cpp:48
Definition: boss_ragnaros.cpp:63

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_ragnaros::boss_ragnarosAI::_emergeTimer
private
bool boss_ragnaros::boss_ragnarosAI::_hasSubmergedOnce
private
bool boss_ragnaros::boss_ragnarosAI::_hasYelledMagmaBurst
private
uint8 boss_ragnaros::boss_ragnarosAI::_introState
private
bool boss_ragnaros::boss_ragnarosAI::_isBanished
private

The documentation for this struct was generated from the following file: