AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_kologarn::boss_kologarnAI Struct Reference
Inheritance diagram for boss_kologarn::boss_kologarnAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_kologarnAI (Creature *pCreature)
 
void MoveInLineOfSight (Unit *who) override
 
void EnterEvadeMode (EvadeReason why) override
 
void AttachLeftArm ()
 
void AttachRightArm ()
 
void Reset () override
 
void DoAction (int32 param) override
 
uint32 GetData (uint32 param) const override
 
void AttackStart (Unit *who) override
 
void JustSummoned (Creature *cr) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void PassengerBoarded (Unit *who, int8, bool apply) override
 == Fields ======================================= More...
 
void DamageTaken (Unit *who, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
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)
 
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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () 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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
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 JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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)
 To specify the caster as target if the spell is self-cast. More...
 
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, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
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)
 Called when a summon reaches a waypoint or point movement finished. More...
 
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

InstanceScriptm_pInstance
 
Vehiclevehicle
 
ObjectGuid _left
 
ObjectGuid _right
 
EventMap events
 
SummonList summons
 
UniteyebeamTarget
 
bool _looksAchievement
 
bool breathReady
 
uint8 _rubbleAchievement
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- 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_kologarnAI()

boss_kologarn::boss_kologarnAI::boss_kologarnAI ( Creature pCreature)
inline
155 : ScriptedAI(pCreature), vehicle(me->GetVehicleKit()), summons(me), breathReady(false)
156 {
158 eyebeamTarget = nullptr;
159 assert(vehicle);
161 }
@ UNIT_STAND_STATE_SUBMERGED
Definition: UnitDefines.h:41
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
Vehicle * GetVehicleKit() const
Definition: Unit.h:1785
void SetStandState(uint8 state)
Definition: Unit.cpp:16726
InstanceScript * m_pInstance
Definition: boss_kologarn.cpp:163
Vehicle * vehicle
Definition: boss_kologarn.cpp:165
Unit * eyebeamTarget
Definition: boss_kologarn.cpp:170
bool breathReady
Definition: boss_kologarn.cpp:172
SummonList summons
Definition: boss_kologarn.cpp:168

References eyebeamTarget, WorldObject::GetInstanceScript(), m_pInstance, ScriptedAI::me, Unit::SetStandState(), UNIT_STAND_STATE_SUBMERGED, and vehicle.

Member Function Documentation

◆ AttachLeftArm()

void boss_kologarn::boss_kologarnAI::AttachLeftArm ( )
inline
199 {
201 arm->SetHealth(arm->GetMaxHealth());
203 {
204 accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY);
205 if (!me->HandleSpellClick(accessory, 0))
206 accessory->DespawnOrUnsummon();
207 else
208 {
209 _left = accessory->GetGUID();
210 accessory->SetOrientation(M_PI);
211 accessory->CastSpell(accessory, SPELL_ARM_RESPAWN_VISUAL, true);
212 }
213 }
214 }
@ NPC_LEFT_ARM
Definition: boss_kologarn.cpp:112
@ SPELL_ARM_RESPAWN_VISUAL
Definition: boss_kologarn.cpp:69
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ UNIT_MASK_ACCESSORY
Definition: UnitDefines.h:144
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
Definition: Unit.h:630
bool HandleSpellClick(Unit *clicker, int8 seatId=-1)
Definition: Unit.cpp:19554
ObjectGuid _left
Definition: boss_kologarn.cpp:166

References _left, ObjectAccessor::GetCreature(), Unit::HandleSpellClick(), ScriptedAI::me, NPC_LEFT_ARM, SPELL_ARM_RESPAWN_VISUAL, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, and UNIT_MASK_ACCESSORY.

Referenced by Reset(), and UpdateAI().

◆ AttachRightArm()

void boss_kologarn::boss_kologarnAI::AttachRightArm ( )
inline
217 {
219 arm->SetHealth(arm->GetMaxHealth());
221 {
222 accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY);
223 if (!me->HandleSpellClick(accessory, 1))
224 accessory->DespawnOrUnsummon();
225 else
226 {
227 _right = accessory->GetGUID();
228 accessory->SetOrientation(M_PI);
229 accessory->CastSpell(accessory, SPELL_ARM_RESPAWN_VISUAL, true);
230 }
231 }
232 }
@ NPC_RIGHT_ARM
Definition: boss_kologarn.cpp:113
ObjectGuid _right
Definition: boss_kologarn.cpp:166

References _right, ObjectAccessor::GetCreature(), Unit::HandleSpellClick(), ScriptedAI::me, NPC_RIGHT_ARM, SPELL_ARM_RESPAWN_VISUAL, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, and UNIT_MASK_ACCESSORY.

Referenced by Reset(), and UpdateAI().

◆ AttackStart()

void boss_kologarn::boss_kologarnAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

288 {
289 me->Attack(who, true);
290 }
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10272

References Unit::Attack(), and ScriptedAI::me.

◆ DamageTaken()

void boss_kologarn::boss_kologarnAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from ScriptedAI.

375 {
376 if (who && who->GetEntry() == me->GetEntry() && me->GetHealth())
377 {
378 damage = std::min(damage, me->GetHealth() - 1);
379 me->LowerPlayerDamageReq(damage);
380 }
381 }
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition: Creature.cpp:3806
uint32 GetEntry() const
Definition: Object.h:115
uint32 GetHealth() const
Definition: Unit.h:1029

References Object::GetEntry(), Unit::GetHealth(), Creature::LowerPlayerDamageReq(), and ScriptedAI::me.

◆ DoAction()

void boss_kologarn::boss_kologarnAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

262 {
263 if (param == DATA_KOLOGARN_LOOKS_ACHIEV)
264 _looksAchievement = false;
265 if (param == DATA_KOLOGARN_RUBBLE_ACHIEV)
266 {
267 // Means arm died
268 if (m_pInstance && (!_left || !_right))
270
272 }
273 }
@ DATA_KOLOGARN_LOOKS_ACHIEV
Definition: boss_kologarn.cpp:138
@ ACHIEVEMENT_DISARMED_CRITERIA
Definition: boss_kologarn.cpp:136
@ DATA_KOLOGARN_RUBBLE_ACHIEV
Definition: boss_kologarn.cpp:139
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition: DBCEnums.h:110
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:647
uint8 _rubbleAchievement
Definition: boss_kologarn.cpp:173
bool _looksAchievement
Definition: boss_kologarn.cpp:172

References _left, _looksAchievement, _right, _rubbleAchievement, ACHIEVEMENT_DISARMED_CRITERIA, ACHIEVEMENT_TIMED_TYPE_EVENT, DATA_KOLOGARN_LOOKS_ACHIEV, DATA_KOLOGARN_RUBBLE_ACHIEV, InstanceScript::DoStartTimedAchievement(), and m_pInstance.

◆ EnterEvadeMode()

void boss_kologarn::boss_kologarnAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

191 {
192 if (!_EnterEvadeMode(why))
193 return;
194 Reset();
195 me->setActive(false);
196 }
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:303
void setActive(bool isActiveObject)
Definition: Object.cpp:1094
void Reset() override
Definition: boss_kologarn.cpp:234

References CreatureAI::_EnterEvadeMode(), ScriptedAI::me, Reset(), and WorldObject::setActive().

Referenced by UpdateAI().

◆ GetData()

uint32 boss_kologarn::boss_kologarnAI::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

276 {
277 if (param == DATA_KOLOGARN_LOOKS_ACHIEV)
278 return _looksAchievement;
279 else if (param == DATA_KOLOGARN_RUBBLE_ACHIEV)
280 return (_rubbleAchievement >= 5);
281 else if (param == DATA_KOLOGARN_ARMS_ACHIEV)
282 return !_rubbleAchievement;
283
284 return 0;
285 }
@ DATA_KOLOGARN_ARMS_ACHIEV
Definition: boss_kologarn.cpp:140

References _looksAchievement, _rubbleAchievement, DATA_KOLOGARN_ARMS_ACHIEV, DATA_KOLOGARN_LOOKS_ACHIEV, and DATA_KOLOGARN_RUBBLE_ACHIEV.

◆ JustDied()

void boss_kologarn::boss_kologarnAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

299 {
301 me->StopMoving();
302 if (m_pInstance)
304
306
307 if (m_pInstance)
308 {
309 // Open the door inside Kologarn chamber
311 door->SetGoState(GO_STATE_ACTIVE);
312 }
313
315 bridge->SetGoState(GO_STATE_READY);
316
317 // Summon Chest
318 if (GameObject* go = me->SummonGameObject(RAID_MODE(GO_KOLOGARN_CHEST, GO_KOLOGARN_CHEST_HERO), 1839.62f, -35.98f, 448.81f, 3.6f, 0, 0, 0, 0, 7 * 86400))
319 {
320 me->RemoveGameObject(go, false);
321 go->SetSpellId(1); // hack to make it despawn
322 go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
323 go->SetLootRecipient(me);
324 }
326 arm->DespawnOrUnsummon(3000); // visual
328 arm->DespawnOrUnsummon(3000); // visual
330 me->SetDisableGravity(true);
331 }
Talk
Definition: hyjal.cpp:82
@ SAY_DEATH
Definition: boss_kologarn.cpp:37
@ GO_KOLOGARN_BRIDGE
Definition: ulduar.h:211
@ GO_KOLOGARN_DOORS
Definition: ulduar.h:212
@ GO_KOLOGARN_CHEST
Definition: ulduar.h:176
@ GO_KOLOGARN_CHEST_HERO
Definition: ulduar.h:177
@ TYPE_KOLOGARN
Definition: ulduar.h:37
GameObjectFlags
Definition: SharedDefines.h:1602
@ DONE
Definition: InstanceScript.h:60
@ GO_STATE_READY
Definition: GameObjectData.h:690
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:404
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3205
Definition: GameObject.h:120
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2466
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:2380
void RemoveGameObject(GameObject *gameObj, bool del)
Definition: Unit.cpp:6197
void StopMoving()
Definition: Unit.cpp:16650
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
Map * instance
Definition: InstanceScript.h:148
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References _left, _right, SummonList::DespawnAll(), DONE, WorldObject::FindNearestGameObject(), ObjectAccessor::GetCreature(), Map::GetGameObject(), InstanceScript::GetGuidData(), GO_KOLOGARN_BRIDGE, GO_KOLOGARN_CHEST, GO_KOLOGARN_CHEST_HERO, GO_KOLOGARN_DOORS, GO_STATE_ACTIVE, GO_STATE_READY, InstanceScript::instance, m_pInstance, ScriptedAI::me, ScriptedAI::RAID_MODE(), Unit::RemoveGameObject(), SAY_DEATH, ZoneScript::SetData(), Creature::SetDisableGravity(), Unit::SetUnitFlag(), Unit::StopMoving(), WorldObject::SummonGameObject(), summons, TYPE_KOLOGARN, and UNIT_FLAG_NOT_SELECTABLE.

◆ JustEngagedWith()

void boss_kologarn::boss_kologarnAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

384 {
385 if (m_pInstance)
387
388 events.ScheduleEvent(EVENT_SMASH, 8s);
389 events.ScheduleEvent(EVENT_SWEEP, 17s);
390 events.ScheduleEvent(EVENT_GRIP, 15s);
391 events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 10s);
392 events.ScheduleEvent(EVENT_PREPARE_BREATH, 3s);
393 //events.ScheduleEvent(EVENT_ENRAGE, x); no info
394
396 me->setActive(true);
397
398 // Close the door inside Kologarn chamber
399 if (m_pInstance)
400 {
402 {
403 door->SetGoState(GO_STATE_READY);
404 }
405 }
406 }
events
Definition: boss_sartura.cpp:43
@ SAY_AGGRO
Definition: boss_kologarn.cpp:31
@ EVENT_SMASH
Definition: boss_kologarn.cpp:100
@ EVENT_PREPARE_BREATH
Definition: boss_kologarn.cpp:107
@ EVENT_FOCUSED_EYEBEAM
Definition: boss_kologarn.cpp:105
@ EVENT_SWEEP
Definition: boss_kologarn.cpp:102
@ EVENT_GRIP
Definition: boss_kologarn.cpp:101
@ IN_PROGRESS
Definition: InstanceScript.h:58

References EVENT_FOCUSED_EYEBEAM, EVENT_GRIP, EVENT_PREPARE_BREATH, EVENT_SMASH, EVENT_SWEEP, Map::GetGameObject(), InstanceScript::GetGuidData(), GO_KOLOGARN_DOORS, GO_STATE_READY, IN_PROGRESS, InstanceScript::instance, m_pInstance, ScriptedAI::me, SAY_AGGRO, WorldObject::setActive(), ZoneScript::SetData(), and TYPE_KOLOGARN.

◆ JustSummoned()

void boss_kologarn::boss_kologarnAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

293 {
294 if (cr->GetEntry() != NPC_LEFT_ARM && cr->GetEntry() != NPC_RIGHT_ARM)
295 summons.Summon(cr);
296 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88

References Object::GetEntry(), NPC_LEFT_ARM, NPC_RIGHT_ARM, SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_kologarn::boss_kologarnAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

334 {
335 if (!urand(0, 2))
336 return;
337
338 Talk(SAY_SLAY);
339 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SAY_SLAY
Definition: boss_kologarn.cpp:32

References SAY_SLAY, and urand().

◆ MoveInLineOfSight()

void boss_kologarn::boss_kologarnAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

176 {
177 if (who->IsPlayer() && me->GetExactDist2d(who) < 45.0f && me->getStandState() == UNIT_STAND_STATE_SUBMERGED)
178 {
181 arm->CastSpell(arm, SPELL_ARM_RESPAWN_VISUAL, true);
183 arm->CastSpell(arm, SPELL_ARM_RESPAWN_VISUAL, true);
184 }
185
186 if (me->GetExactDist2d(who) < 30.0f)
188 }
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:169
bool IsPlayer() const
Definition: Object.h:200
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:165
uint8 getStandState() const
Definition: Unit.h:1642

References _left, _right, ObjectAccessor::GetCreature(), Position::GetExactDist2d(), Unit::getStandState(), Object::IsPlayer(), ScriptedAI::me, CreatureAI::MoveInLineOfSight(), Unit::SetStandState(), SPELL_ARM_RESPAWN_VISUAL, UNIT_STAND_STATE_STAND, and UNIT_STAND_STATE_SUBMERGED.

◆ PassengerBoarded()

void boss_kologarn::boss_kologarnAI::PassengerBoarded ( Unit ,
int8  ,
bool   
)
inlineoverridevirtual

== Fields =======================================

Reimplemented from CreatureAI.

342 {
343 if (!me->IsAlive())
344 return;
345
346 if (!apply)
347 {
348 // left arm
349 if (who->GetGUID() == _left)
350 {
351 _left.Clear();
352 if (me->IsInCombat())
353 {
355 events.ScheduleEvent(EVENT_RESTORE_ARM_LEFT, 50s);
356 }
357 }
358 else
359 {
360 _right.Clear();
361 if (me->IsInCombat())
362 {
364 events.ScheduleEvent(EVENT_RESTORE_ARM_RIGHT, 50s);
365 }
366 }
367
368 me->CastSpell(me, SPELL_ARM_DEAD, true);
369 if (!_right && !_left)
370 events.ScheduleEvent(EVENT_STONE_SHOUT, 5s);
371 }
372 }
@ SAY_RIGHT_ARM_GONE
Definition: boss_kologarn.cpp:34
@ SAY_LEFT_ARM_GONE
Definition: boss_kologarn.cpp:33
@ EVENT_RESTORE_ARM_LEFT
Definition: boss_kologarn.cpp:103
@ EVENT_RESTORE_ARM_RIGHT
Definition: boss_kologarn.cpp:104
@ EVENT_STONE_SHOUT
Definition: boss_kologarn.cpp:106
#define SPELL_ARM_DEAD
Definition: boss_kologarn.cpp:89
void Clear()
Definition: ObjectGuid.h:138
bool IsAlive() const
Definition: Unit.h:1654
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:1167
bool IsInCombat() const
Definition: Unit.h:884

References _left, _right, Unit::CastSpell(), ObjectGuid::Clear(), EVENT_RESTORE_ARM_LEFT, EVENT_RESTORE_ARM_RIGHT, EVENT_STONE_SHOUT, Object::GetGUID(), Unit::IsAlive(), Unit::IsInCombat(), ScriptedAI::me, SAY_LEFT_ARM_GONE, SAY_RIGHT_ARM_GONE, and SPELL_ARM_DEAD.

◆ Reset()

void boss_kologarn::boss_kologarnAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

235 {
237 _looksAchievement = true;
238
239 me->SetDisableGravity(true);
240 me->DisableRotate(true);
241
242 events.Reset();
244
245 if (m_pInstance)
246 {
248
249 // Open the door inside Kologarn chamber
251 door->SetGoState(GO_STATE_ACTIVE);
252 }
253
256
257 // Reset breath on pull
258 breathReady = false;
259 }
@ NOT_STARTED
Definition: InstanceScript.h:57
void DisableRotate(bool apply)
Definition: Unit.cpp:18275
void AttachLeftArm()
Definition: boss_kologarn.cpp:198
void AttachRightArm()
Definition: boss_kologarn.cpp:216

References _looksAchievement, _rubbleAchievement, AttachLeftArm(), AttachRightArm(), breathReady, SummonList::DespawnAll(), Unit::DisableRotate(), Map::GetGameObject(), InstanceScript::GetGuidData(), GO_KOLOGARN_DOORS, GO_STATE_ACTIVE, InstanceScript::instance, m_pInstance, ScriptedAI::me, NOT_STARTED, ZoneScript::SetData(), Creature::SetDisableGravity(), summons, and TYPE_KOLOGARN.

Referenced by EnterEvadeMode().

◆ UpdateAI()

void boss_kologarn::boss_kologarnAI::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Reimplemented from ScriptedAI.

409 {
410 if (!UpdateVictim())
411 {
413 return;
414 }
415
416 events.Update(diff);
418 return;
419
420 switch (events.ExecuteEvent())
421 {
423 breathReady = true;
424 break;
426 if (_left || _right)
427 {
428 return;
429 }
430
432 events.ScheduleEvent(EVENT_STONE_SHOUT, 2s);
433 break;
434 case EVENT_SMASH:
435 if (_left && _right)
437 else if (_left || _right)
439
440 events.DelayEvents(1s);
441 events.ScheduleEvent(EVENT_SMASH, 14s);
442 return;
443 case EVENT_SWEEP:
444 if (_left)
445 {
447 cr->CastSpell(cr, SPELL_ARM_SWEEP, false);
448
449 if (urand(0, 1))
451 }
452
453 events.DelayEvents(1s);
454 events.ScheduleEvent(EVENT_SWEEP, 17s);
455 return;
456 case EVENT_GRIP:
457 events.ScheduleEvent(EVENT_GRIP, 25s);
458 if (!_right)
459 break;
460
464 return;
466 {
467 events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 20s);
468
469 if ((eyebeamTarget = SelectTarget(SelectTargetMethod::MinDistance, 0, 0, true)))
470 {
472 }
473
475 return;
476 }
478 // shouldn't happen
480 return;
482 // shouldn't happen
484 return;
485 }
486
487 //Make sure our attack is ready and we aren't currently casting before checking distance
488 if (me->isAttackReady() && me->GetVictim()) // victim could die by a spell (IMPORTANT!!!) and kologarn entered evade mode
489 {
490 //If we are within range melee the target
492 {
495 return;
496 }
497 else if (Unit* tgt = me->SelectNearbyTarget())
498 {
501 return;
502 }
503
504 if (breathReady)
507 }
508 }
#define SPELL_STONE_GRIP
Definition: boss_kologarn.cpp:91
#define SPELL_STONE_SHOUT
Definition: boss_kologarn.cpp:96
#define SPELL_PETRIFYING_BREATH
Definition: boss_kologarn.cpp:86
@ NPC_SWEEP_TRIGGER
Definition: boss_kologarn.cpp:114
#define SPELL_ARM_SWEEP
Definition: boss_kologarn.cpp:90
@ SPELL_FOCUSED_EYEBEAM_SUMMON
Definition: boss_kologarn.cpp:58
@ SAY_GRAB_PLAYER
Definition: boss_kologarn.cpp:36
@ SAY_SHOCKWAVE
Definition: boss_kologarn.cpp:35
@ EMOTE_STONE_GRIP
Definition: boss_kologarn.cpp:39
@ EMOTE_EYES
Definition: boss_kologarn.cpp:40
#define SPELL_ONEARMED_OVERHEAD_SMASH
Definition: boss_kologarn.cpp:88
#define SPELL_OVERHEAD_SMASH
Definition: boss_kologarn.cpp:87
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:93
bool UpdateVictim()
Definition: CreatureAI.cpp:280
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
Unit * SelectNearbyTarget(Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
Definition: Unit.cpp:16984
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:664
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition: Unit.cpp:2565
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:838
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:642
void EnterEvadeMode(EvadeReason why) override
Definition: boss_kologarn.cpp:190

References _left, _right, AttachLeftArm(), AttachRightArm(), Unit::AttackerStateUpdate(), breathReady, Unit::CastSpell(), EMOTE_EYES, EMOTE_STONE_GRIP, EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_FOCUSED_EYEBEAM, EVENT_GRIP, EVENT_PREPARE_BREATH, EVENT_RESTORE_ARM_LEFT, EVENT_RESTORE_ARM_RIGHT, EVENT_SMASH, EVENT_STONE_SHOUT, EVENT_SWEEP, eyebeamTarget, WorldObject::FindNearestCreature(), Unit::GetVictim(), Unit::HasUnitState(), Unit::isAttackReady(), Unit::IsWithinMeleeRange(), ScriptedAI::me, NPC_SWEEP_TRIGGER, Unit::resetAttackTimer(), SAY_GRAB_PLAYER, SAY_SHOCKWAVE, Unit::SelectNearbyTarget(), UnitAI::SelectTarget(), SPELL_ARM_SWEEP, SPELL_FOCUSED_EYEBEAM_SUMMON, SPELL_ONEARMED_OVERHEAD_SMASH, SPELL_OVERHEAD_SMASH, SPELL_PETRIFYING_BREATH, SPELL_STONE_GRIP, SPELL_STONE_SHOUT, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ _left

ObjectGuid boss_kologarn::boss_kologarnAI::_left

◆ _looksAchievement

bool boss_kologarn::boss_kologarnAI::_looksAchievement

Referenced by DoAction(), GetData(), and Reset().

◆ _right

ObjectGuid boss_kologarn::boss_kologarnAI::_right

◆ _rubbleAchievement

uint8 boss_kologarn::boss_kologarnAI::_rubbleAchievement

Referenced by DoAction(), GetData(), and Reset().

◆ breathReady

bool boss_kologarn::boss_kologarnAI::breathReady

Referenced by Reset(), and UpdateAI().

◆ events

EventMap boss_kologarn::boss_kologarnAI::events

◆ eyebeamTarget

Unit* boss_kologarn::boss_kologarnAI::eyebeamTarget

Referenced by boss_kologarnAI(), and UpdateAI().

◆ m_pInstance

InstanceScript* boss_kologarn::boss_kologarnAI::m_pInstance

◆ summons

SummonList boss_kologarn::boss_kologarnAI::summons

Referenced by JustDied(), JustSummoned(), and Reset().

◆ vehicle

Vehicle* boss_kologarn::boss_kologarnAI::vehicle

Referenced by boss_kologarnAI().