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

Public Member Functions

 boss_ossirianAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void SpellHit (Unit *caster, SpellInfo const *spell) override
 
void DoAction (int32 action) override
 
void EnterCombat (Unit *) override
 
void KilledUnit (Unit *) override
 
void EnterEvadeMode (EvadeReason why) override
 
void JustDied (Unit *) override
 
void Cleanup ()
 
void SpawnNextCrystal ()
 
void MoveInLineOfSight (Unit *who) 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 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 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 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 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)
 

Public Attributes

ObjectGuid TriggerGUID
 
ObjectGuid CrystalGUID
 
uint8 CrystalIterator
 
bool SaidIntro
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

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 ()
 
- 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)
 
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_ossirian::boss_ossirianAI::boss_ossirianAI ( Creature creature)
inline
90  : BossAI(creature, DATA_OSSIRIAN)
91  {
92  Initialize();
93  SaidIntro = false;
94  }
bool SaidIntro
Definition: boss_ossirian.cpp:106
Definition: ruins_of_ahnqiraj.h:30
void Initialize()
Definition: boss_ossirian.cpp:96
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444

+ Here is the call graph for this function:

Member Function Documentation

void boss_ossirian::boss_ossirianAI::Cleanup ( )
inline
180  {
181  if (GameObject* Crystal = me->GetMap()->GetGameObject(CrystalGUID))
182  Crystal->Use(me);
183  }
Map * GetMap() const
Definition: Object.h:543
Creature *const me
Definition: CreatureAI.h:71
Definition: GameObject.h:880
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
ObjectGuid CrystalGUID
Definition: boss_ossirian.cpp:104

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_ossirian::boss_ossirianAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

128  {
129  if (action == ACTION_TRIGGER_WEAKNESS)
130  if (Creature* Trigger = me->GetMap()->GetCreature(TriggerGUID))
131  if (!Trigger->HasUnitState(UNIT_STATE_CASTING))
132  Trigger->CastSpell(Trigger, SpellWeakness[urand(0, 4)], false);
133  }
Map * GetMap() const
Definition: Object.h:543
Definition: Unit.h:565
Definition: boss_ossirian.cpp:49
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
ObjectGuid TriggerGUID
Definition: boss_ossirian.cpp:103
uint32 const SpellWeakness[NUM_WEAKNESS]
Definition: boss_ossirian.cpp:80
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3535

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

136  {
137  _EnterCombat();
138  events.Reset();
142 
144  Talk(SAY_AGGRO);
145 
146  Map* map = me->GetMap();
147 
149  map->SendToPlayers(weather.Write());
150 
151  for (uint8 i = 0; i < NUM_TORNADOS; ++i)
152  {
154  if (Creature* Tornado = map->SummonCreature(NPC_SAND_VORTEX, Point))
155  Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
156  }
157 
159  }
Definition: boss_ossirian.cpp:54
void _EnterCombat()
Definition: ScriptedCreature.cpp:480
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
Definition: Object.cpp:2219
Map * GetMap() const
Definition: Object.h:543
Definition: boss_ossirian.cpp:55
void Reset()
Definition: EventMap.cpp:20
Definition: Creature.h:467
Definition: boss_ossirian.cpp:31
Definition: MiscPackets.h:400
void SpawnNextCrystal()
Definition: boss_ossirian.cpp:185
Creature *const me
Definition: CreatureAI.h:71
void GetRandomPoint(Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Definition: Object.cpp:1799
void SendToPlayers(WorldPacket const *data) const
Definition: Map.cpp:2914
Definition: boss_ossirian.cpp:56
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: Map.h:259
uint8 const NUM_TORNADOS
Definition: boss_ossirian.cpp:78
Definition: boss_ossirian.cpp:43
uint8_t uint8
Definition: Define.h:152
Definition: Position.h:27
EventMap events
Definition: ScriptedCreature.h:371
Definition: ruins_of_ahnqiraj.h:47
Definition: Weather.h:58
float RoomRadius
Definition: boss_ossirian.cpp:77
Position const RoomCenter
Definition: boss_ossirian.cpp:81
Definition: boss_ossirian.cpp:41

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

167  {
168  Cleanup();
171  }
void DespawnAll()
Definition: ScriptedCreature.cpp:66
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
SummonList summons
Definition: ScriptedCreature.h:372
void Cleanup()
Definition: boss_ossirian.cpp:179

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::Initialize ( void  )
inline
97  {
98  CrystalIterator = 0;
100  CrystalGUID.Clear();
101  }
ObjectGuid TriggerGUID
Definition: boss_ossirian.cpp:103
uint8 CrystalIterator
Definition: boss_ossirian.cpp:105
void Clear()
Definition: ObjectGuid.h:215
ObjectGuid CrystalGUID
Definition: boss_ossirian.cpp:104

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_ossirian::boss_ossirianAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

174  {
175  Cleanup();
176  _JustDied();
177  }
void _JustDied()
Definition: ScriptedCreature.cpp:471
void Cleanup()
Definition: boss_ossirian.cpp:179

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

162  {
163  Talk(SAY_SLAY);
164  }
Definition: boss_ossirian.cpp:32
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

207  {
208  if (!SaidIntro)
209  {
210  Talk(SAY_INTRO);
211  SaidIntro = true;
212  }
214  }
Definition: boss_ossirian.cpp:30
bool SaidIntro
Definition: boss_ossirian.cpp:106
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:128

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

109  {
110  _Reset();
111  Initialize();
112  }
void _Reset()
Definition: ScriptedCreature.cpp:457
void Initialize()
Definition: boss_ossirian.cpp:96

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::SpawnNextCrystal ( )
inline
186  {
188  CrystalIterator = 0;
189 
191  {
192  TriggerGUID = Trigger->GetGUID();
193  if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
194  CrystalCoordinates[CrystalIterator].GetPositionX(),
197  0, 0, 0, 0, 0, uint32(-1)))
198  {
199  CrystalGUID = Crystal->GetGUID();
200  ++CrystalIterator;
201  }
202  }
203  }
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
Definition: Object.cpp:2372
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=NULL, uint32 duration=0, Unit *summoner=NULL, uint32 spellId=0, uint32 vehId=0)
Definition: Object.cpp:2219
Map * GetMap() const
Definition: Object.h:543
Definition: Creature.h:467
uint8 const NUM_CRYSTALS
Definition: boss_ossirian.cpp:59
Creature *const me
Definition: CreatureAI.h:71
Definition: ruins_of_ahnqiraj.h:57
float GetPositionY() const
Definition: Position.h:105
float GetPositionZ() const
Definition: Position.h:106
ObjectGuid TriggerGUID
Definition: boss_ossirian.cpp:103
Definition: GameObject.h:880
Definition: ruins_of_ahnqiraj.h:48
uint8 CrystalIterator
Definition: boss_ossirian.cpp:105
Position CrystalCoordinates[NUM_CRYSTALS]
Definition: boss_ossirian.cpp:64
uint32_t uint32
Definition: g3dmath.h:168
float GetPositionX() const
Definition: Position.h:104
ObjectGuid CrystalGUID
Definition: boss_ossirian.cpp:104

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_ossirian::boss_ossirianAI::SpellHit ( Unit caster,
SpellInfo const spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

115  {
116  for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
117  {
118  if (spell->Id == SpellWeakness[i])
119  {
121  ((TempSummon*)caster)->UnSummon();
123  }
124  }
125  }
uint8 const NUM_WEAKNESS
Definition: boss_ossirian.cpp:79
Definition: TemporarySummon.h:40
void SpawnNextCrystal()
Definition: boss_ossirian.cpp:185
Creature *const me
Definition: CreatureAI.h:71
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
uint32 const SpellWeakness[NUM_WEAKNESS]
Definition: boss_ossirian.cpp:80
uint8_t uint8
Definition: Define.h:152
Definition: boss_ossirian.cpp:41

+ Here is the call graph for this function:

void boss_ossirian::boss_ossirianAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

217  {
218  if (!UpdateVictim())
219  return;
220 
221  events.Update(diff);
222 
223  // No kiting!
224  if (me->GetDistance(me->GetVictim()) > 60.00f && me->GetDistance(me->GetVictim()) < 120.00f)
226 
227  bool ApplySupreme = true;
228 
229  if (me->HasAura(SPELL_SUPREME))
230  ApplySupreme = false;
231  else
232  {
233  for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
234  {
235  if (me->HasAura(SpellWeakness[i]))
236  {
237  ApplySupreme = false;
238  break;
239  }
240  }
241  }
242 
243  if (ApplySupreme)
244  {
246  Talk(SAY_SUPREME);
247  }
248 
249  while (uint32 eventId = events.ExecuteEvent())
250  {
251  switch (eventId)
252  {
253  case EVENT_SILENCE:
255  events.ScheduleEvent(EVENT_SILENCE, urand(20000, 30000));
256  break;
257  case EVENT_CYCLONE:
260  break;
261  case EVENT_STOMP:
264  break;
265  default:
266  break;
267  }
268  }
269 
271  }
Definition: boss_ossirian.cpp:38
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
Definition: boss_ossirian.cpp:54
uint8 const NUM_WEAKNESS
Definition: boss_ossirian.cpp:79
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: boss_ossirian.cpp:55
Definition: boss_ossirian.cpp:40
Definition: boss_ossirian.cpp:42
Definition: boss_ossirian.cpp:39
Creature *const me
Definition: CreatureAI.h:71
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594
Unit * GetVictim() const
Definition: Unit.h:1379
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32_t uint32
Definition: Define.h:150
Definition: boss_ossirian.cpp:56
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
void Update(uint32 time)
Definition: EventMap.h:54
uint32 const SpellWeakness[NUM_WEAKNESS]
Definition: boss_ossirian.cpp:80
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
uint8_t uint8
Definition: Define.h:152
EventMap events
Definition: ScriptedCreature.h:371
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_ossirian.cpp:29
Definition: boss_ossirian.cpp:41

+ Here is the call graph for this function:

Member Data Documentation

ObjectGuid boss_ossirian::boss_ossirianAI::CrystalGUID
uint8 boss_ossirian::boss_ossirianAI::CrystalIterator
bool boss_ossirian::boss_ossirianAI::SaidIntro
ObjectGuid boss_ossirian::boss_ossirianAI::TriggerGUID

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