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

Public Member Functions

 boss_mal_ganisAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void DamageTaken (Unit *done_by, uint32 &damage) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *victim) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
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

uint32 uiCarrionSwarmTimer
 
uint32 uiMindBlastTimer
 
uint32 uiVampiricTouchTimer
 
uint32 uiSleepTimer
 
uint8 uiOutroStep
 
uint32 uiOutroTimer
 
bool bYelled
 
bool bYelled2
 
CombatPhases Phase
 
InstanceScriptinstance
 
- 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_mal_ganis::boss_mal_ganisAI::boss_mal_ganisAI ( Creature creature)
inline
72  : ScriptedAI(creature)
73  {
74  Initialize();
75  instance = creature->GetInstanceScript();
76  uiOutroStep = 0;
77  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
uint8 uiOutroStep
Definition: boss_mal_ganis.cpp:96
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: boss_mal_ganis.cpp:104
void Initialize()
Definition: boss_mal_ganis.cpp:79

+ Here is the call graph for this function:

Member Function Documentation

void boss_mal_ganis::boss_mal_ganisAI::DamageTaken ( Unit done_by,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

119  {
120  if (damage >= me->GetHealth() && done_by != me)
121  damage = me->GetHealth()-1;
122  }
Creature *const me
Definition: CreatureAI.h:71
uint32 GetHealth() const
Definition: Unit.h:1426

+ Here is the call graph for this function:

void boss_mal_ganis::boss_mal_ganisAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

113  {
114  Talk(SAY_AGGRO);
116  }
Definition: culling_of_stratholme.h:31
InstanceScript * instance
Definition: boss_mal_ganis.cpp:104
Definition: InstanceScript.h:59
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: boss_mal_ganis.cpp:43

+ Here is the call graph for this function:

void boss_mal_ganis::boss_mal_ganisAI::Initialize ( void  )
inline
80  {
81  bYelled = false;
82  bYelled2 = false;
83  Phase = COMBAT;
84  uiCarrionSwarmTimer = 6000;
85  uiMindBlastTimer = 11000;
86  uiVampiricTouchTimer = urand(10000, 15000);
87  uiSleepTimer = urand(15000, 20000);
88  uiOutroTimer = 1000;
89  }
uint32 uiCarrionSwarmTimer
Definition: boss_mal_ganis.cpp:91
uint32 uiMindBlastTimer
Definition: boss_mal_ganis.cpp:92
uint32 uiOutroTimer
Definition: boss_mal_ganis.cpp:97
bool bYelled2
Definition: boss_mal_ganis.cpp:100
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 uiSleepTimer
Definition: boss_mal_ganis.cpp:94
Definition: boss_mal_ganis.cpp:56
bool bYelled
Definition: boss_mal_ganis.cpp:99
Phase
Definition: boss_kiljaeden.cpp:153
uint32 uiVampiricTouchTimer
Definition: boss_mal_ganis.cpp:93

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_mal_ganis::boss_mal_ganisAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

231  {
234  // give achievement credit and LFG rewards to players. criteria use spell 58630 which doesn't exist, but it was created in spell_dbc
236  }
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:167
Definition: culling_of_stratholme.h:31
InstanceScript * instance
Definition: boss_mal_ganis.cpp:104
Definition: inflate.h:49
Definition: boss_mal_ganis.cpp:37
Definition: boss_mal_ganis.cpp:38
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273

+ Here is the call graph for this function:

void boss_mal_ganis::boss_mal_ganisAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

239  {
240  if (victim->GetTypeId() != TYPEID_PLAYER)
241  return;
242 
243  Talk(SAY_SLAY);
244  }
TypeID GetTypeId() const
Definition: Object.h:113
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: ObjectGuid.h:33
Definition: boss_mal_ganis.cpp:45

+ Here is the call graph for this function:

void boss_mal_ganis::boss_mal_ganisAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

107  {
108  Initialize();
110  }
Definition: culling_of_stratholme.h:31
InstanceScript * instance
Definition: boss_mal_ganis.cpp:104
void Initialize()
Definition: boss_mal_ganis.cpp:79
Definition: InstanceScript.h:58
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273

+ Here is the call graph for this function:

void boss_mal_ganis::boss_mal_ganisAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

125  {
126  switch (Phase)
127  {
128  case COMBAT:
129  //Return since we have no target
130  if (!UpdateVictim())
131  return;
132 
133  if (!bYelled && HealthBelowPct(30))
134  {
136  bYelled = true;
137  }
138 
139  if (!bYelled2 && HealthBelowPct(15))
140  {
142  bYelled2 = true;
143  }
144 
145  if (HealthBelowPct(1))
146  {
147  //Handle Escape Event: Don't forget to add Player::RewardPlayerAndGroupAtEvent
149  uiOutroStep = 1;
150  Phase = OUTRO;
151  return;
152  }
153 
155  if (pArthas->isDead())
156  {
157  EnterEvadeMode();
158  me->DisappearAndDie();
160  }
161 
162  if (uiCarrionSwarmTimer < diff)
163  {
165  uiCarrionSwarmTimer = 7000;
166  } else uiCarrionSwarmTimer -= diff;
167 
168  if (uiMindBlastTimer < diff)
169  {
170  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
171  DoCast(target, SPELL_MIND_BLAST);
172  uiMindBlastTimer = 6000;
173  } else uiMindBlastTimer -= diff;
174 
175  if (uiVampiricTouchTimer < diff)
176  {
178  uiVampiricTouchTimer = 32000;
179  } else uiVampiricTouchTimer -= diff;
180 
181  if (uiSleepTimer < diff)
182  {
183  Talk(SAY_SLEEP);
184  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
185  DoCast(target, SPELL_SLEEP);
186  uiSleepTimer = urand(15000, 20000);
187  } else uiSleepTimer -= diff;
188 
190  break;
191  case OUTRO:
192  if (uiOutroTimer < diff)
193  {
194  switch (uiOutroStep)
195  {
196  case 1:
197  Talk(SAY_OUTRO);
199  ++uiOutroStep;
200  uiOutroTimer = 8000;
201  break;
202  case 2:
204  me->HandleEmoteCommand(29);
206  ++uiOutroStep;
207  uiOutroTimer = 9000;
208  break;
209  case 3:
210  Talk(SAY_OUTRO);
211  ++uiOutroStep;
212  //uiOutroTimer = 16000;
213  break;
214  case 4:
215  me->HandleEmoteCommand(33);
216  ++uiOutroStep;
217  uiOutroTimer = 500;
218  break;
219  case 5:
220  me->SetVisible(false);
221  me->KillSelf();
222  break;
223 
224  }
225  } else uiOutroTimer -= diff;
226  break;
227  }
228  }
Definition: boss_mal_ganis.cpp:47
Definition: culling_of_stratholme.h:31
void KillSelf(bool durabilityLoss=true)
Definition: Unit.h:1515
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
uint8 uiOutroStep
Definition: boss_mal_ganis.cpp:96
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
uint32 uiCarrionSwarmTimer
Definition: boss_mal_ganis.cpp:91
Definition: boss_mal_ganis.cpp:34
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 uiMindBlastTimer
Definition: boss_mal_ganis.cpp:92
InstanceScript * instance
Definition: boss_mal_ganis.cpp:104
void MoveTargetedHome()
Definition: MotionMaster.cpp:201
uint32 uiOutroTimer
Definition: boss_mal_ganis.cpp:97
Definition: Creature.h:467
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: InstanceScript.h:60
Creature *const me
Definition: CreatureAI.h:71
bool bYelled2
Definition: boss_mal_ganis.cpp:100
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: boss_mal_ganis.cpp:48
Definition: culling_of_stratholme.h:27
Definition: UnitAI.h:35
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
void SetVisible(bool x)
Definition: Unit.cpp:10368
Definition: boss_mal_ganis.cpp:50
uint32 uiSleepTimer
Definition: boss_mal_ganis.cpp:94
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: boss_mal_ganis.cpp:56
Definition: boss_mal_ganis.cpp:46
Definition: UpdateFields.h:109
Definition: boss_mal_ganis.cpp:51
Definition: boss_mal_ganis.cpp:35
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
void HandleEmoteCommand(uint32 anim_id)
Definition: Unit.cpp:1444
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_mal_ganis.cpp:36
bool bYelled
Definition: boss_mal_ganis.cpp:99
Definition: boss_mal_ganis.cpp:33
Definition: Unit.h:1305
void DisappearAndDie()
Definition: Creature.cpp:256
Phase
Definition: boss_kiljaeden.cpp:153
Definition: boss_mal_ganis.cpp:57
Definition: Unit.h:698
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:2675
uint32 uiVampiricTouchTimer
Definition: boss_mal_ganis.cpp:93

+ Here is the call graph for this function:

Member Data Documentation

bool boss_mal_ganis::boss_mal_ganisAI::bYelled
bool boss_mal_ganis::boss_mal_ganisAI::bYelled2
InstanceScript* boss_mal_ganis::boss_mal_ganisAI::instance
CombatPhases boss_mal_ganis::boss_mal_ganisAI::Phase
uint32 boss_mal_ganis::boss_mal_ganisAI::uiCarrionSwarmTimer
uint32 boss_mal_ganis::boss_mal_ganisAI::uiMindBlastTimer
uint8 boss_mal_ganis::boss_mal_ganisAI::uiOutroStep
uint32 boss_mal_ganis::boss_mal_ganisAI::uiOutroTimer
uint32 boss_mal_ganis::boss_mal_ganisAI::uiSleepTimer
uint32 boss_mal_ganis::boss_mal_ganisAI::uiVampiricTouchTimer

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