AzerothCore 3.3.5a
OpenSource WoW Emulator
No Matches
boss_ahune Struct Reference
Inheritance diagram for boss_ahune:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_ahune (Creature *c)
void StartPhase1 ()
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
void SetGUID (ObjectGuid guid, int32 id) override
void UpdateAI (uint32 diff) override
void MoveInLineOfSight (Unit *) override
void EnterEvadeMode (EvadeReason why) override
void JustSummoned (Creature *summon) override
void SummonedCreatureDespawn (Creature *summon) override
void JustDied (Unit *) override
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 ~ScriptedAI () override
void AttackStartNoMove (Unit *target)
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
void UpdateAI (uint32 diff) override
void JustDied (Unit *) override
void KilledUnit (Unit *) override
void JustSummoned (Creature *) override
void SummonedCreatureDespawn (Creature *) override
void SpellHit (Unit *, SpellInfo const *) override
void SpellHitTarget (Unit *, SpellInfo const *) override
void MovementInform (uint32, uint32) override
void OnPossess (bool)
bool IsInRoom (const Position *pos, Axis axis, bool above)
void Reset () override
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
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 DoPlayMusic (uint32 soundId, bool zone)
void DoAddThreat (Unit *unit, float amount)
void DoModifyThreatByPercent (Unit *unit, int32 pct)
void DoResetThreat (Unit *unit)
void DoResetThreatList ()
float DoGetThreat (Unit *unit)
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 IsUniqueTimedEventDone (uint32 id) const
void SetUniqueTimedEventDone (uint32 id)
void ResetUniqueTimedEvent (uint32 id)
void ClearUniqueTimedEventsDone ()
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
bool HealthBelowPct (uint32 pct) const
bool HealthAbovePct (uint32 pct) const
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, 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
virtual bool CheckEvadeIfOutOfCombatArea () 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
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
void Talk (uint8 id, Milliseconds delay)
 CreatureAI (Creature *creature)
 ~CreatureAI () override
void MoveCircleChecks ()
void MoveBackwardsChecks ()
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
void TriggerAlert (Unit const *who) const
virtual bool CanRespawn ()
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
virtual void JustDied (Unit *)
virtual void KilledUnit (Unit *)
virtual void JustSummoned (Creature *)
virtual void IsSummonedBy (WorldObject *)
virtual void SummonedCreatureDespawn (Creature *)
virtual void SummonedCreatureDies (Creature *, Unit *)
virtual void SummonedCreatureDespawnAll ()
virtual void SpellHit (Unit *, SpellInfo const *)
virtual void SpellHitTarget (Unit *, SpellInfo const *)
virtual void AttackedBy (Unit *)
virtual bool IsEscorted ()
virtual void JustRespawned ()
virtual void MovementInform (uint32, uint32)
virtual void PathEndReached (uint32)
void OnCharmed (bool apply) override
virtual void JustReachedHome ()
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
virtual void ReceiveEmote (Player *, uint32)
virtual void OwnerAttackedBy (Unit *)
virtual void OwnerAttacked (Unit *)
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
virtual bool BeforeSpellClick (Unit *)
virtual void OnSpellClick (Unit *, bool &)
virtual bool CanSeeAlways (WorldObject const *)
virtual bool CanBeSeen (Player const *)
virtual bool CanAlwaysBeDetectable (WorldObject const *)
virtual void PetStopAttack ()
virtual bool CheckInRoom ()
CreatureBoundary const * GetBoundary () const
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
bool IsInBoundary (Position const *who=nullptr) const
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
virtual bool OnTeleportUnreacheablePlayer (Player *)
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
virtual ~UnitAI ()
virtual bool CanAIAttack (Unit const *) const
virtual void AttackStart (Unit *)
virtual void UpdateAI (uint32)=0
virtual void InitializeAI ()
virtual void Reset ()
virtual void OnCharmed (bool apply)=0
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 (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
virtual void HealReceived (Unit *, uint32 &)
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
virtual void HealDone (Unit *, uint32 &)
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
void AttackStartCaster (Unit *victim, float dist)
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
SpellCastResult DoCast (uint32 spellId)
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
void DoMeleeAttackIfReady ()
bool DoSpellAttackIfReady (uint32 spell)
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
virtual void SummonMovementInform (Creature *, uint32, uint32)
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 sQuestComplete (Player *, Quest const *)
virtual void sQuestReward (Player *, Quest const *, uint32)
virtual void sOnGameEvent (bool, uint16)
virtual std::string GetDebugInfo () const

Public Attributes

EventMap events
SummonList summons
ObjectGuid InvokerGUID
- Public Attributes inherited from ScriptedAI
bool IsFleeing

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
- Public Types inherited from CreatureAI
enum  EvadeReason {
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
- 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)
virtual void MoveInLineOfSight (Unit *)
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
- Protected Attributes inherited from CreatureAI
Creature *const me
EventMap events
TaskScheduler scheduler
CreatureBoundary const * _boundary
bool _negateBoundary
- Protected Attributes inherited from UnitAI
Unit *const me

Detailed Description

Constructor & Destructor Documentation

◆ boss_ahune()

boss_ahune::boss_ahune ( Creature c)
99 : ScriptedAI(c), summons(me)
100 {
101 SetCombatMovement(false);
105 events.Reset();
106 events.RescheduleEvent(EVENT_EMERGE, 12000);
107 events.RescheduleEvent(EVENT_INVOKER_SAY_1, 1000);
108 events.RescheduleEvent(EVENT_SUMMON_TOTEMS, 4000);
109 }
Definition: CreatureAI.h:67
Definition: Unit.h:449
Definition: boss_sartura.cpp:43
Definition: boss_ahune.cpp:76
Definition: boss_ahune.cpp:77
Definition: boss_ahune.cpp:80
Definition: ScriptedCreature.h:192
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
Definition: ScriptedCreature.cpp:522
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:540
Creature * me
Definition: ScriptedCreature.h:282
void Clear()
Definition: ObjectGuid.h:140
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495
ObjectGuid InvokerGUID
Definition: boss_ahune.cpp:113
SummonList summons
Definition: boss_ahune.cpp:112

References ObjectGuid::Clear(), EQUIP_UNEQUIP, EVENT_EMERGE, EVENT_INVOKER_SAY_1, EVENT_SUMMON_TOTEMS, InvokerGUID, ScriptedAI::me, ScriptedAI::SetCombatMovement(), ScriptedAI::SetEquipmentSlots(), Unit::SetUnitFlag(), and UNIT_FLAG_NON_ATTACKABLE.

Member Function Documentation

◆ EnterEvadeMode()

void boss_ahune::EnterEvadeMode ( EvadeReason  why)

Reimplemented from CreatureAI.

268 {
270 events.Reset();
275 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:196
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117

References SummonList::DespawnAll(), Creature::DespawnOrUnsummon(), CreatureAI::EnterEvadeMode(), ScriptedAI::me, Unit::SetUnitFlag(), summons, and UNIT_FLAG_NON_ATTACKABLE.

Referenced by UpdateAI().

◆ JustDied()

void boss_ahune::JustDied ( Unit )

Reimplemented from ScriptedAI.

308 {
310 me->DespawnOrUnsummon(15000);
311 if (GameObject* chest = me->SummonGameObject(187892, MinionSummonPos.GetPositionX(), MinionSummonPos.GetPositionY(), MinionSummonPos.GetPositionZ(), M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 900000000)) // loot
312 me->RemoveGameObject(chest, false);
314 bool finished = false;
316 me->GetMap()->DoForAllPlayers([&](Player* player)
317 {
320 if (player->GetGroup() && !finished)
321 {
322 finished = true;
323 sLFGMgr->FinishDungeon(player->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_FROST_LORD_AHUNE, me->FindMap());
324 }
325 });
326 }
const Position MinionSummonPos
Definition: boss_ahune.cpp:35
Definition: DBCEnums.h:130
Definition: GameObject.h:122
Map * GetMap() const
Definition: Object.h:517
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2357
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
Definition: Player.h:1056
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: PlayerUpdates.cpp:2131
Group * GetGroup()
Definition: Player.h:2431
void RemoveGameObject(GameObject *gameObj, bool del)
Definition: Unit.cpp:6135
void DoForAllPlayers(std::function< void(Player *)> exec)
Definition: Map.cpp:3817

References ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, SummonList::DespawnAll(), Creature::DespawnOrUnsummon(), Map::DoForAllPlayers(), Player::GetGroup(), WorldObject::GetMap(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ScriptedAI::me, MinionSummonPos, Unit::RemoveGameObject(), WorldObject::SummonGameObject(), summons, and Player::UpdateAchievementCriteria().

◆ JustEngagedWith()

void boss_ahune::JustEngagedWith ( Unit )

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

125 {
127 events.Reset();
128 StartPhase1();
129 }
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:94
void StartPhase1()
Definition: boss_ahune.cpp:115

References CreatureAI::DoZoneInCombat(), and StartPhase1().

◆ JustSummoned()

void boss_ahune::JustSummoned ( Creature summon)

Reimplemented from ScriptedAI.

278 {
279 summons.Summon(summon);
280 summon->SetInCombatWithZone();
282 if (summon->GetEntry() == NPC_AHUNITE_HAILSTONE)
283 {
284 // Doesn't work when cast normally or when added to
285 // creature template addon. Needs further investigation.
286 if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_CHILLING_AURA))
287 {
288 Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, summon, summon);
289 }
290 }
291 }
#define sSpellMgr
Definition: SpellMgr.h:825
Definition: boss_ahune.cpp:71
Definition: boss_ahune.cpp:59
Definition: DBCStructure.h:1636
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
void SetInCombatWithZone()
Definition: Creature.cpp:2732
uint32 GetEntry() const
Definition: Object.h:109
static Aura * TryRefreshStackOrCreate(SpellInfo const *spellproto, uint8 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, bool *refresh=nullptr, bool periodicReset=false)
Definition: SpellAuras.cpp:326
Definition: SpellInfo.h:314

References Object::GetEntry(), MAX_EFFECT_MASK, NPC_AHUNITE_HAILSTONE, Creature::SetInCombatWithZone(), SPELL_CHILLING_AURA, sSpellMgr, SummonList::Summon(), summons, and Aura::TryRefreshStackOrCreate().

◆ MoveInLineOfSight()

void boss_ahune::MoveInLineOfSight ( Unit )

Reimplemented from CreatureAI.


◆ SetGUID()

void boss_ahune::SetGUID ( ObjectGuid  guid,
int32  id 

Reimplemented from UnitAI.

132 {
133 if (id == SET_GUID_INVOKER)
134 {
135 InvokerGUID = guid;
136 }
137 }
Definition: boss_ahune.cpp:94

References InvokerGUID, and SET_GUID_INVOKER.

◆ StartPhase1()

void boss_ahune::StartPhase1 ( )
116 {
118 events.RescheduleEvent(EVENT_TOTEMS_ATTACK, 80000);
119 events.RescheduleEvent(EVENT_SPELL_COLD_SLAP, 1200);
120 events.RescheduleEvent(EVENT_SPELL_SUMMON_HAILSTONE, 2000);
121 events.RescheduleEvent(EVENT_SPELL_SUMMON_COLDWAVE, 5000);
122 }
Definition: boss_ahune.cpp:88
Definition: boss_ahune.cpp:89
Definition: boss_ahune.cpp:82
Definition: boss_ahune.cpp:87
Definition: boss_ahune.cpp:53
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169


Referenced by JustEngagedWith(), and UpdateAI().

◆ SummonedCreatureDespawn()

void boss_ahune::SummonedCreatureDespawn ( Creature summon)

Reimplemented from ScriptedAI.

294 {
295 if (summon && summon->GetEntry() == NPC_FROZEN_CORE)
296 {
297 if (summon->GetHealth() > 0)
298 {
299 me->SetHealth(summon->GetHealth());
300 summon->CastSpell(summon, SPELL_AHUNE_RESURFACES, true);
301 }
302 else
303 Unit::Kill(me, me, false);
304 }
305 }
Definition: boss_ahune.cpp:51
Definition: the_slave_pens.h:52
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17956
void SetHealth(uint32 val)
Definition: Unit.cpp:15464
uint32 GetHealth() const
Definition: Unit.h:1454

References Unit::CastSpell(), Object::GetEntry(), Unit::GetHealth(), Unit::Kill(), ScriptedAI::me, NPC_FROZEN_CORE, Unit::SetHealth(), and SPELL_AHUNE_RESURFACES.

◆ UpdateAI()

void boss_ahune::UpdateAI ( uint32  diff)

Reimplemented from ScriptedAI.

140 {
142 return;
144 events.Update(diff);
147 return;
149 switch (events.ExecuteEvent())
150 {
151 case 0:
152 break;
153 case EVENT_EMERGE:
154 me->SetVisible(true);
155 me->CastSpell(me, SPELL_EMERGE_0, false);
156 events.RescheduleEvent(EVENT_ATTACK, 2000);
157 break;
159 for (uint8 i = 0; i < 3; ++i)
161 break;
164 {
165 plr->Say("The Ice Stone has melted!", LANG_UNIVERSAL);
166 plr->CastSpell(plr, SPELL_MAKE_BONFIRE, true);
167 }
168 events.RescheduleEvent(EVENT_INVOKER_SAY_2, 2000);
169 break;
172 plr->Say("Ahune, your strength grows no more!", LANG_UNIVERSAL);
173 events.RescheduleEvent(EVENT_INVOKER_SAY_3, 2000);
174 break;
177 plr->Say("Your frozen reign will not come to pass!", LANG_UNIVERSAL);
178 break;
179 case EVENT_ATTACK:
180 events.Reset();
182 AttackStart(plr);
184 if (!me->IsInCombat())
185 {
187 return;
188 }
189 else
191 break;
193 for (uint8 i = 0; i < 3; ++i)
194 if (Creature* bunny = me->FindNearestCreature(NPC_TOTEM_BUNNY_1 + i, 150.0f, true))
195 bunny->CastSpell(me, SPELL_TOTEM_BEAM, false);
196 events.RescheduleEvent(EVENT_SUBMERGE, 10000);
197 break;
204 {
205 c->SetHealth(me->GetHealth());
206 }
207 events.Reset();
208 events.RescheduleEvent(EVENT_COMBAT_EMERGE, 25000);
209 events.RescheduleEvent(EVENT_EMERGE_WARNING, 20000);
210 break;
213 break;
217 me->CastSpell(me, SPELL_EMERGE_0, false);
218 // me->CastSpell(me, SPELL_AHUNE_RESURFACES, true); // done in SummonedCreatureDespawn
221 StartPhase1();
222 break;
225 if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0, 5.0f, true))
226 if (target->GetPositionZ() < me->GetPositionZ() + 6.0f)
227 {
228 int32 dmg = urand(5500, 6000);
229 me->CastCustomSpell(target, SPELL_COLD_SLAP, &dmg, nullptr, nullptr, false);
230 float x, y, z;
231 target->GetNearPoint(target, x, y, z, target->GetObjectSize(), 30.0f, target->GetAngle(me->GetPositionX(), me->GetPositionY()) + M_PI);
232 target->GetMotionMaster()->MoveJump(x, y, z + 20.0f, 10.0f, 20.0f);
233 }
234 events.RepeatEvent(1500);
235 break;
237 {
238 float dist = (float)urand(3, 10);
239 float angle = rand_norm() * 2 * M_PI;
240 me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle) * dist, MinionSummonPos.GetPositionY() + std::sin(angle) * dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_HAILSTONE, false);
241 }
242 break;
244 for (uint8 i = 0; i < 2; ++i)
245 {
246 float dist = (float)urand(3, 10);
247 float angle = rand_norm() * 2 * M_PI;
248 me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle) * dist, MinionSummonPos.GetPositionY() + std::sin(angle) * dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_COLDWAVE, false);
249 }
250 {
251 float dist = (float)urand(3, 10);
252 float angle = rand_norm() * 2 * M_PI;
253 me->CastSpell(MinionSummonPos.GetPositionX() + cos(angle) * dist, MinionSummonPos.GetPositionY() + std::sin(angle) * dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_FROSTWIND, false);
254 }
255 events.RepeatEvent(12000);
256 break;
258 default:
259 break;
260 }
263 }
std::int32_t int32
Definition: Define.h:104
std::uint8_t uint8
Definition: Define.h:110
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
double rand_norm()
Definition: Random.cpp:77
Definition: Object.h:44
Definition: Object.h:43
Definition: Unit.h:340
Definition: Unit.h:473
Definition: boss_halazzi.cpp:43
Definition: boss_fathomlord_karathress.cpp:25
Definition: boss_ahune.cpp:81
Definition: boss_ahune.cpp:85
Definition: boss_ahune.cpp:84
Definition: boss_ahune.cpp:79
Definition: boss_ahune.cpp:78
Definition: boss_ahune.cpp:83
Definition: boss_ahune.cpp:49
Definition: boss_ahune.cpp:54
Definition: boss_ahune.cpp:46
Definition: boss_ahune.cpp:50
Definition: boss_ahune.cpp:56
Definition: boss_ahune.cpp:48
Definition: boss_ahune.cpp:57
Definition: boss_ahune.cpp:47
Definition: boss_ahune.cpp:55
Definition: boss_ahune.cpp:39
Definition: boss_ahune.cpp:40
const Position TotemPos[3]
Definition: boss_ahune.cpp:34
Definition: the_slave_pens.h:55
Definition: SharedDefines.h:735
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:399
Definition: CreatureAI.h:94
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
Definition: Creature.h:46
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
Definition: Unit.h:1302
void SetVisible(bool x)
Definition: Unit.cpp:14220
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4722
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:1494
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1226
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
bool IsInCombat() const
Definition: Unit.h:1702
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1496
void EnterEvadeMode(EvadeReason why) override
Definition: boss_ahune.cpp:267

References ScriptedAI::AttackStart(), Unit::CastCustomSpell(), Unit::CastSpell(), SummonList::DespawnEntry(), UnitAI::DoMeleeAttackIfReady(), CreatureAI::DoSummon(), EMOTE_RESURFACE, EMOTE_RETREAT, EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_ATTACK, EVENT_COMBAT_EMERGE, EVENT_EMERGE, EVENT_EMERGE_WARNING, EVENT_INVOKER_SAY_1, EVENT_INVOKER_SAY_2, EVENT_INVOKER_SAY_3, EVENT_SPELL_COLD_SLAP, EVENT_SPELL_SUMMON_COLDWAVE, EVENT_SPELL_SUMMON_HAILSTONE, EVENT_SUBMERGE, EVENT_SUMMON_TOTEMS, EVENT_TOTEMS_ATTACK, WorldObject::FindNearestCreature(), Unit::GetHealth(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::HasUnitFlag(), Unit::HasUnitState(), InvokerGUID, Unit::IsInCombat(), LANG_UNIVERSAL, ScriptedAI::me, MinionSummonPos, NPC_FROZEN_CORE, NPC_TOTEM, NPC_TOTEM_BUNNY_1, rand_norm(), Unit::RemoveAura(), Unit::RemoveUnitFlag(), UnitAI::SelectTarget(), Creature::SetInCombatWithZone(), Unit::SetUnitFlag(), Unit::SetVisible(), SPELL_COLD_SLAP, SPELL_EMERGE_0, SPELL_MAKE_BONFIRE, SPELL_SELF_STUN, SPELL_SUBMERGE_0, SPELL_SUMMON_COLDWAVE, SPELL_SUMMON_FROSTWIND, SPELL_SUMMON_HAILSTONE, SPELL_TOTEM_BEAM, StartPhase1(), summons, TEMPSUMMON_TIMED_DESPAWN, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, TotemPos, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ events

EventMap boss_ahune::events

◆ InvokerGUID

ObjectGuid boss_ahune::InvokerGUID

Referenced by boss_ahune(), SetGUID(), and UpdateAI().

◆ summons

SummonList boss_ahune::summons