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

Public Member Functions

 boss_moroesAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void StartEvent ()
 
void EnterCombat (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void SpawnAdds ()
 
bool isAddlistEmpty ()
 
void DeSpawnAdds ()
 
void AddsAttack ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) 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
 
virtual void JustReachedHome ()
 
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 bool CanAIAttack (Unit const *) const
 
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)
 

Public Attributes

InstanceScriptinstance
 
ObjectGuid AddGUID [4]
 
uint32 Vanish_Timer
 
uint32 Blind_Timer
 
uint32 Gouge_Timer
 
uint32 Wait_Timer
 
uint32 CheckAdds_Timer
 
uint32 AddId [4]
 
bool InVanish
 
bool Enrage
 
- 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 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 CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_moroes::boss_moroesAI::boss_moroesAI ( Creature creature)
inline
106  : ScriptedAI(creature)
107  {
108  Initialize();
109  memset(AddId, 0, sizeof(AddId));
110 
111  instance = creature->GetInstanceScript();
112  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void Initialize()
Definition: boss_moroes.cpp:114
uint32 AddId[4]
Definition: boss_moroes.cpp:135
InstanceScript * instance
Definition: boss_moroes.cpp:126

+ Here is the call graph for this function:

Member Function Documentation

void boss_moroes::boss_moroesAI::AddsAttack ( )
inline
239  {
240  for (uint8 i = 0; i < 4; ++i)
241  {
242  if (!AddGUID[i].IsEmpty())
243  {
245  if (temp && temp->IsAlive())
246  {
247  temp->AI()->AttackStart(me->GetVictim());
248  DoZoneInCombat(temp);
249  } else
250  EnterEvadeMode();
251  }
252  }
253  }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
bool IsAlive() const
Definition: Unit.h:1692
Unit * GetVictim() const
Definition: Unit.h:1379
CreatureAI * AI() const
Definition: Creature.h:525
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
ObjectGuid AddGUID[4]
Definition: boss_moroes.cpp:128
uint8_t uint8
Definition: Define.h:152
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_moroes::boss_moroesAI::DeSpawnAdds ( )
inline
227  {
228  for (uint8 i = 0; i < 4; ++i)
229  {
230  if (!AddGUID[i].IsEmpty())
231  {
233  temp->DespawnOrUnsummon();
234  }
235  }
236  }
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
ObjectGuid AddGUID[4]
Definition: boss_moroes.cpp:128
uint8_t uint8
Definition: Define.h:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_moroes::boss_moroesAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

157  {
158  StartEvent();
159 
160  Talk(SAY_AGGRO);
161  AddsAttack();
162  DoZoneInCombat();
163  }
void AddsAttack()
Definition: boss_moroes.cpp:238
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void StartEvent()
Definition: boss_moroes.cpp:149
Definition: boss_moroes.cpp:32

+ Here is the call graph for this function:

void boss_moroes::boss_moroesAI::Initialize ( void  )
inline
115  {
116  Vanish_Timer = 30000;
117  Blind_Timer = 35000;
118  Gouge_Timer = 23000;
119  Wait_Timer = 0;
120  CheckAdds_Timer = 5000;
121 
122  Enrage = false;
123  InVanish = false;
124  }
uint32 Wait_Timer
Definition: boss_moroes.cpp:133
bool Enrage
Definition: boss_moroes.cpp:138
bool InVanish
Definition: boss_moroes.cpp:137
uint32 CheckAdds_Timer
Definition: boss_moroes.cpp:134
uint32 Gouge_Timer
Definition: boss_moroes.cpp:132
uint32 Vanish_Timer
Definition: boss_moroes.cpp:130
uint32 Blind_Timer
Definition: boss_moroes.cpp:131

+ Here is the caller graph for this function:

bool boss_moroes::boss_moroesAI::isAddlistEmpty ( )
inline
218  {
219  for (uint8 i = 0; i < 4; ++i)
220  if (AddId[i] == 0)
221  return true;
222 
223  return false;
224  }
uint32 AddId[4]
Definition: boss_moroes.cpp:135
uint8_t uint8
Definition: Define.h:152

+ Here is the caller graph for this function:

void boss_moroes::boss_moroesAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

171  {
172  Talk(SAY_DEATH);
173 
175 
176  DeSpawnAdds();
177 
178  //remove aura from spell Garrote when Moroes dies
180  }
Definition: boss_moroes.cpp:35
Definition: inflate.h:49
void DeSpawnAdds()
Definition: boss_moroes.cpp:226
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: boss_moroes.cpp:41
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: karazhan.h:27
InstanceScript * instance
Definition: boss_moroes.cpp:126
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:540

+ Here is the call graph for this function:

void boss_moroes::boss_moroesAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

166  {
167  Talk(SAY_KILL);
168  }
Definition: boss_moroes.cpp:34
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

void boss_moroes::boss_moroesAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

141  {
142  Initialize();
143  if (me->IsAlive())
144  SpawnAdds();
145 
147  }
void Initialize()
Definition: boss_moroes.cpp:114
void SpawnAdds()
Definition: boss_moroes.cpp:182
Creature *const me
Definition: CreatureAI.h:71
bool IsAlive() const
Definition: Unit.h:1692
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: InstanceScript.h:58
Definition: karazhan.h:27
InstanceScript * instance
Definition: boss_moroes.cpp:126

+ Here is the call graph for this function:

void boss_moroes::boss_moroesAI::SpawnAdds ( )
inline
183  {
184  DeSpawnAdds();
185 
186  if (isAddlistEmpty())
187  {
188  std::list<uint32> AddList;
189 
190  for (uint8 i = 0; i < 6; ++i)
191  AddList.push_back(Adds[i]);
192 
194 
195  uint8 i = 0;
196  for (std::list<uint32>::const_iterator itr = AddList.begin(); itr != AddList.end() && i < 4; ++itr, ++i)
197  {
198  uint32 entry = *itr;
199 
200  if (Creature* creature = me->SummonCreature(entry, Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
201  {
202  AddGUID[i] = creature->GetGUID();
203  AddId[i] = entry;
204  }
205  }
206  }
207  else
208  {
209  for (uint8 i = 0; i < 4; ++i)
210  {
211  if (Creature* creature = me->SummonCreature(AddId[i], Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
212  AddGUID[i] = creature->GetGUID();
213  }
214  }
215  }
bool isAddlistEmpty()
Definition: boss_moroes.cpp:217
void RandomResizeList(std::list< T > &list, uint32 size)
Definition: Containers.h:34
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
uint32 AddId[4]
Definition: boss_moroes.cpp:135
void DeSpawnAdds()
Definition: boss_moroes.cpp:226
Adds
Definition: boss_overlord_wyrmthalak.cpp:39
Position const Locations[4]
Definition: boss_moroes.cpp:76
uint32_t uint32
Definition: Define.h:150
Definition: Object.h:59
ObjectGuid AddGUID[4]
Definition: boss_moroes.cpp:128
uint8_t uint8
Definition: Define.h:152
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_moroes::boss_moroesAI::StartEvent ( )
inline
150  {
152 
153  DoZoneInCombat();
154  }
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: karazhan.h:27
InstanceScript * instance
Definition: boss_moroes.cpp:126

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_moroes::boss_moroesAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

256  {
257  if (!UpdateVictim())
258  return;
259 
261  {
262  EnterEvadeMode();
263  return;
264  }
265 
266  if (!Enrage && HealthBelowPct(30))
267  {
269  Enrage = true;
270  }
271 
272  if (CheckAdds_Timer <= diff)
273  {
274  for (uint8 i = 0; i < 4; ++i)
275  {
276  if (!AddGUID[i].IsEmpty())
277  {
279  if (temp && temp->IsAlive())
280  if (!temp->GetVictim())
281  temp->AI()->AttackStart(me->GetVictim());
282  }
283  }
284  CheckAdds_Timer = 5000;
285  } else CheckAdds_Timer -= diff;
286 
287  if (!Enrage)
288  {
289  //Cast Vanish, then Garrote random victim
290  if (Vanish_Timer <= diff)
291  {
293  InVanish = true;
294  Vanish_Timer = 30000;
295  Wait_Timer = 5000;
296  } else Vanish_Timer -= diff;
297 
298  if (Gouge_Timer <= diff)
299  {
301  Gouge_Timer = 40000;
302  } else Gouge_Timer -= diff;
303 
304  if (Blind_Timer <= diff)
305  {
306  std::list<Unit*> targets;
307  SelectTargetList(targets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
308  for (std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
309  if (!me->IsWithinMeleeRange(*i))
310  {
311  DoCast(*i, SPELL_BLIND);
312  break;
313  }
314  Blind_Timer = 40000;
315  } else Blind_Timer -= diff;
316  }
317 
318  if (InVanish)
319  {
320  if (Wait_Timer <= diff)
321  {
322  Talk(SAY_SPECIAL);
323 
324  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
325  target->CastSpell(target, SPELL_GARROTE, true);
326 
327  InVanish = false;
328  } else Wait_Timer -= diff;
329  }
330 
331  if (!InVanish)
333  }
Definition: boss_moroes.cpp:33
uint32 Wait_Timer
Definition: boss_moroes.cpp:133
bool UpdateVictim()
Definition: CreatureAI.cpp:233
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
bool Enrage
Definition: boss_moroes.cpp:138
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: Creature.h:467
Definition: boss_moroes.cpp:44
bool InVanish
Definition: boss_moroes.cpp:137
uint32 CheckAdds_Timer
Definition: boss_moroes.cpp:134
Definition: boss_moroes.cpp:42
float GetMeleeReach() const
Definition: Unit.cpp:486
Creature *const me
Definition: CreatureAI.h:71
uint32 Gouge_Timer
Definition: boss_moroes.cpp:132
Definition: UnitAI.h:35
bool IsAlive() const
Definition: Unit.h:1692
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: boss_moroes.cpp:43
CreatureAI * AI() const
Definition: Creature.h:525
Definition: boss_moroes.cpp:41
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
Definition: Unit.cpp:508
void SelectTargetList(std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:96
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: karazhan.h:27
uint32 Vanish_Timer
Definition: boss_moroes.cpp:130
InstanceScript * instance
Definition: boss_moroes.cpp:126
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
ObjectGuid AddGUID[4]
Definition: boss_moroes.cpp:128
uint8_t uint8
Definition: Define.h:152
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_moroes.cpp:40
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
uint32 Blind_Timer
Definition: boss_moroes.cpp:131

+ Here is the call graph for this function:

Member Data Documentation

ObjectGuid boss_moroes::boss_moroesAI::AddGUID[4]
uint32 boss_moroes::boss_moroesAI::AddId[4]
uint32 boss_moroes::boss_moroesAI::Blind_Timer
uint32 boss_moroes::boss_moroesAI::CheckAdds_Timer
bool boss_moroes::boss_moroesAI::Enrage
uint32 boss_moroes::boss_moroesAI::Gouge_Timer
InstanceScript* boss_moroes::boss_moroesAI::instance
bool boss_moroes::boss_moroesAI::InVanish
uint32 boss_moroes::boss_moroesAI::Vanish_Timer
uint32 boss_moroes::boss_moroesAI::Wait_Timer

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