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

Public Member Functions

 brann_bronzebeardAI (Creature *c)
 
void DespawnHeads ()
 
void SwitchHeadVisaul (uint8 headMask, bool activate)
 
void ResetEvent ()
 
void WaypointReached (uint32 id) override
 
void InitializeEvent ()
 
CreatureGetAbedneum ()
 
CreatureGetMarnak ()
 
CreatureGetKaddrak ()
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void Reset () override
 
void DoAction (int32 action) override
 
void JustSummoned (Creature *cr) override
 
void UpdateEscortAI (uint32 diff) override
 
void SummonCreatures (uint32 entry, uint8 count, uint8 pos)
 
void JustDied (Unit *) override
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
- 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

InstanceScriptpInstance
 
EventMap events
 
SummonList summons
 
ObjectGuid AbedneumGUID
 
ObjectGuid MarnakGUID
 
ObjectGuid KaddrakGUID
 
ObjectGuid darkMatterTargetGUID
 
uint8 WaveNum
 
bool TalkEvent
 
uint32 SpeechCount
 
uint32 SpeechPause
 
bool canExecuteEvents = true
 
bool leftEye = true
 
- 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 npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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

◆ brann_bronzebeardAI()

brann_bronzebeard::brann_bronzebeardAI::brann_bronzebeardAI ( Creature c)
inline
245 : npc_escortAI(c), summons(me)
246 {
248 }
Creature * me
Definition: ScriptedCreature.h:280
Definition: ScriptedEscortAI.h:53
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
SummonList summons
Definition: brann_bronzebeard.cpp:252
InstanceScript * pInstance
Definition: brann_bronzebeard.cpp:250

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ DamageTaken()

void brann_bronzebeard::brann_bronzebeardAI::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.

352 {
353 if (damage && pInstance)
355 }
@ DATA_BRANN_ACHIEVEMENT
Definition: halls_of_stone.h:54
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References DATA_BRANN_ACHIEVEMENT, pInstance, and ZoneScript::SetData().

◆ DespawnHeads()

void brann_bronzebeard::brann_bronzebeardAI::DespawnHeads ( )
inline
265 {
266 Creature* cr;
267 if ((cr = GetAbedneum())) cr->DespawnOrUnsummon();
268 if ((cr = GetMarnak())) cr->DespawnOrUnsummon();
269 if ((cr = GetKaddrak())) cr->DespawnOrUnsummon();
270
271 SwitchHeadVisaul(0x7, false);
272 }
Definition: Creature.h:43
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
Creature * GetKaddrak()
Definition: brann_bronzebeard.cpp:347
Creature * GetMarnak()
Definition: brann_bronzebeard.cpp:346
void SwitchHeadVisaul(uint8 headMask, bool activate)
Definition: brann_bronzebeard.cpp:274
Creature * GetAbedneum()
Definition: brann_bronzebeard.cpp:345

References Creature::DespawnOrUnsummon(), GetAbedneum(), GetKaddrak(), GetMarnak(), and SwitchHeadVisaul().

Referenced by ResetEvent().

◆ DoAction()

void brann_bronzebeard::brann_bronzebeardAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

390 {
391 switch (action)
392 {
394 Start(false, true, ObjectGuid::Empty, 0, true, false);
399 break;
401 {
403 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
404 if (!PlayerList.IsEmpty())
405 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
406 {
407 me->SetFaction(i->GetSource()->GetFaction());
408 break;
409 }
410
411 SetEscortPaused(false);
414 break;
415 }
417 SetNextWaypoint(1, false);
418 SetEscortPaused(false);
419 ResetEvent();
421 break;
427 SetEscortPaused(false);
428 ResetEvent();
430 DoCast(me, 58506, false);
433 break;
436 SetEscortPaused(false);
437 break;
439 if (pInstance)
441 SetEscortPaused(false);
444 me->SetOrientation(3.132660f);
446 events.ScheduleEvent(EVENT_SJONNIR_END_BRANN_YELL, 10000ms);
447 events.ScheduleEvent(EVENT_SJONNIR_END_BRANN_LAST_YELL, 22000ms);
448 break;
450 Reset();
451 SetNextWaypoint(33, true);
454 DoCast(me, 58506, false);
456 door->SetGoState(GO_STATE_READY);
457 break;
458 case ACTION_OPEN_DOOR:
459 Start(false, true, ObjectGuid::Empty, 0, true, false);
460 SetNextWaypoint(34, false);
461 SetEscortPaused(false);
462 me->RemoveAura(58506);
464 me->SetWalk(true);
465 me->SetSpeed(MOVE_WALK, 1.0f);
466 break;
467 }
468 }
events
Definition: boss_sartura.cpp:43
Talk
Definition: hyjal.cpp:82
@ EVENT_SJONNIR_END_BRANN_YELL
Definition: brann_bronzebeard.cpp:115
@ EVENT_SJONNIR_END_BRANN_LAST_YELL
Definition: brann_bronzebeard.cpp:116
@ BRANN_BRONZEBEARD
Definition: halls_of_stone.h:50
@ ACTION_OPEN_DOOR
Definition: halls_of_stone.h:86
@ ACTION_START_SJONNIR_FIGHT
Definition: halls_of_stone.h:87
@ ACTION_START_ESCORT_EVENT
Definition: halls_of_stone.h:82
@ ACTION_SJONNIR_WIPE_START
Definition: halls_of_stone.h:89
@ ACTION_START_TRIBUNAL
Definition: halls_of_stone.h:83
@ ACTION_GO_TO_SJONNIR
Definition: halls_of_stone.h:85
@ ACTION_TRIBUNAL_WIPE_START
Definition: halls_of_stone.h:84
@ ACTION_SJONNIR_DEAD
Definition: halls_of_stone.h:88
@ GO_SJONNIR_DOOR
Definition: halls_of_stone.h:67
@ SAY_BRANN_ESCORT_START
Definition: halls_of_stone.h:33
@ SAY_BRANN_ENTRANCE_MEET
Definition: halls_of_stone.h:41
@ EMOTE_STATE_STAND
Definition: SharedDefines.h:1918
@ EMOTE_STATE_READY_UNARMED
Definition: SharedDefines.h:1919
@ FACTION_ESCORTEE_N_NEUTRAL_PASSIVE
Definition: SharedDefines.h:211
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
@ GO_STATE_READY
Definition: GameObjectData.h:690
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ REACT_PASSIVE
Definition: Unit.h:548
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ UNIT_NPC_FLAG_NONE
Definition: UnitDefines.h:293
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: UnitDefines.h:295
@ MOVE_WALK
Definition: UnitDefines.h:328
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:184
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:449
void SetEscortPaused(bool on)
Definition: ScriptedEscortAI.cpp:523
bool SetNextWaypoint(uint32 pointId, float x, float y, float z, float orientation)
Definition: ScriptedEscortAI.cpp:534
void SetRegeneratingHealth(bool enable)
Definition: Creature.h:318
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition: Creature.cpp:3191
Definition: GameObject.h:120
Map * GetMap() const
Definition: Object.h:536
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
void SetOrientation(float orientation)
Definition: Position.h:111
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16704
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16689
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14429
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21316
void ReplaceAllNpcFlags(NPCFlags flags)
Definition: Unit.h:728
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
void Reset() override
Definition: brann_bronzebeard.cpp:357
void ResetEvent()
Definition: brann_bronzebeard.cpp:324
void InitializeEvent()
Definition: brann_bronzebeard.cpp:840

References ACTION_GO_TO_SJONNIR, ACTION_OPEN_DOOR, ACTION_SJONNIR_DEAD, ACTION_SJONNIR_WIPE_START, ACTION_START_ESCORT_EVENT, ACTION_START_SJONNIR_FIGHT, ACTION_START_TRIBUNAL, ACTION_TRIBUNAL_WIPE_START, MapRefMgr::begin(), BRANN_BRONZEBEARD, UnitAI::DoCast(), EMOTE_STATE_READY_UNARMED, EMOTE_STATE_STAND, ObjectGuid::Empty, MapRefMgr::end(), EVENT_SJONNIR_END_BRANN_LAST_YELL, EVENT_SJONNIR_END_BRANN_YELL, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, FACTION_FRIENDLY, ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetMap(), Map::GetPlayers(), GO_SJONNIR_DOOR, GO_STATE_READY, InitializeEvent(), LinkedListHead::IsEmpty(), ScriptedAI::me, MOVE_WALK, pInstance, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAura(), Unit::ReplaceAllNpcFlags(), Reset(), ResetEvent(), SAY_BRANN_ENTRANCE_MEET, SAY_BRANN_ESCORT_START, Unit::SendMovementFlagUpdate(), ZoneScript::SetData(), npc_escortAI::SetEscortPaused(), Unit::SetFaction(), npc_escortAI::SetNextWaypoint(), Position::SetOrientation(), Creature::SetReactState(), Creature::SetRegeneratingHealth(), Unit::SetSpeed(), Unit::SetUInt32Value(), Creature::SetWalk(), npc_escortAI::Start(), Unit::StopMovingOnCurrentPos(), UNIT_NPC_EMOTESTATE, UNIT_NPC_FLAG_GOSSIP, UNIT_NPC_FLAG_NONE, and UNIT_NPC_FLAG_QUESTGIVER.

◆ GetAbedneum()

Creature * brann_bronzebeard::brann_bronzebeardAI::GetAbedneum ( )
inline
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
ObjectGuid AbedneumGUID
Definition: brann_bronzebeard.cpp:253

References AbedneumGUID, ObjectAccessor::GetCreature(), and ScriptedAI::me.

Referenced by DespawnHeads(), and UpdateEscortAI().

◆ GetKaddrak()

Creature * brann_bronzebeard::brann_bronzebeardAI::GetKaddrak ( )
inline
ObjectGuid KaddrakGUID
Definition: brann_bronzebeard.cpp:255

References ObjectAccessor::GetCreature(), KaddrakGUID, and ScriptedAI::me.

Referenced by DespawnHeads(), and UpdateEscortAI().

◆ GetMarnak()

Creature * brann_bronzebeard::brann_bronzebeardAI::GetMarnak ( )
inline
ObjectGuid MarnakGUID
Definition: brann_bronzebeard.cpp:254

References ObjectAccessor::GetCreature(), MarnakGUID, and ScriptedAI::me.

Referenced by DespawnHeads(), and UpdateEscortAI().

◆ InitializeEvent()

void brann_bronzebeard::brann_bronzebeardAI::InitializeEvent ( )
841{
842 Creature* cr = nullptr;
843 if ((cr = me->SummonCreature(NPC_KADDRAK, 923.7f, 326.9f, 219.5f, 2.1f, TEMPSUMMON_TIMED_DESPAWN, 580000)))
844 {
846 KaddrakGUID = cr->GetGUID();
847 }
848 if ((cr = me->SummonCreature(NPC_MARNAK, 895.974f, 363.571f, 219.337f, 5.5f, TEMPSUMMON_TIMED_DESPAWN, 580000)))
849 {
851 MarnakGUID = cr->GetGUID();
852 }
853 if ((cr = me->SummonCreature(NPC_ABEDNEUM, 892.25f, 331.25f, 223.86f, 0.6f, TEMPSUMMON_TIMED_DESPAWN, 580000)))
854 {
856 AbedneumGUID = cr->GetGUID();
857 }
858
859 TalkEvent = true;
860
861 events.Reset();
862
863 // Viusals
864 events.ScheduleEvent(EVENT_KADDRAK_VISUAL, 30s);
865 events.ScheduleEvent(EVENT_MARNAK_VISUAL, 105s);
866 events.ScheduleEvent(EVENT_ABEDNEUM_VISUAL, 207s);
867
868 // Fight
869 events.ScheduleEvent(EVENT_SUMMON_MONSTERS, 47s);
870 events.ScheduleEvent(EVENT_KADDRAK_HEAD, 47s);
871 events.ScheduleEvent(EVENT_MARNAK_HEAD, 115s);
872 events.ScheduleEvent(EVENT_ABEDNEUM_HEAD, 217s);
873 events.ScheduleEvent(EVENT_TRIBUNAL_END, 310s);
874}
@ EVENT_MARNAK_VISUAL
Definition: brann_bronzebeard.cpp:83
@ EVENT_ABEDNEUM_VISUAL
Definition: brann_bronzebeard.cpp:81
@ EVENT_ABEDNEUM_HEAD
Definition: brann_bronzebeard.cpp:84
@ EVENT_TRIBUNAL_END
Definition: brann_bronzebeard.cpp:106
@ EVENT_SUMMON_MONSTERS
Definition: brann_bronzebeard.cpp:88
@ EVENT_KADDRAK_VISUAL
Definition: brann_bronzebeard.cpp:82
@ EVENT_MARNAK_HEAD
Definition: brann_bronzebeard.cpp:86
@ EVENT_KADDRAK_HEAD
Definition: brann_bronzebeard.cpp:85
@ NPC_KADDRAK
Definition: halls_of_stone.h:76
@ NPC_MARNAK
Definition: halls_of_stone.h:77
@ NPC_ABEDNEUM
Definition: halls_of_stone.h:78
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
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
bool TalkEvent
Definition: brann_bronzebeard.cpp:260

References AbedneumGUID, EVENT_ABEDNEUM_HEAD, EVENT_ABEDNEUM_VISUAL, EVENT_KADDRAK_HEAD, EVENT_KADDRAK_VISUAL, EVENT_MARNAK_HEAD, EVENT_MARNAK_VISUAL, EVENT_SUMMON_MONSTERS, EVENT_TRIBUNAL_END, Object::GetGUID(), KaddrakGUID, MarnakGUID, ScriptedAI::me, NPC_ABEDNEUM, NPC_KADDRAK, NPC_MARNAK, Creature::SetInCombatWithZone(), WorldObject::SummonCreature(), TalkEvent, and TEMPSUMMON_TIMED_DESPAWN.

Referenced by DoAction().

◆ JustDied()

void brann_bronzebeard::brann_bronzebeardAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from npc_escortAI.

814 {
815 ResetEvent();
816 if (pInstance)
817 {
819 {
820 brann->HandleEmoteCommand(EMOTE_STATE_DEAD);
821 brann->setDeathState(DeathState::JustDied);
822 brann->Respawn();
824 {
825 brann->AI()->DoAction(ACTION_TRIBUNAL_WIPE_START);
827 }
829 {
830 brann->AI()->DoAction(ACTION_SJONNIR_WIPE_START);
831 }
832 }
835 }
836 }
@ BOSS_TRIBUNAL_OF_AGES
Definition: halls_of_stone.h:48
@ NPC_BRANN
Definition: halls_of_stone.h:80
@ EMOTE_STATE_DEAD
Definition: SharedDefines.h:1941
@ FAIL
Definition: InstanceScript.h:59
@ DONE
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:57
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51

References ACTION_SJONNIR_WIPE_START, ACTION_TRIBUNAL_WIPE_START, BOSS_TRIBUNAL_OF_AGES, DONE, EMOTE_STATE_DEAD, FAIL, ObjectAccessor::GetCreature(), ZoneScript::GetData(), InstanceScript::GetGuidData(), ScriptedAI::me, NOT_STARTED, NPC_BRANN, pInstance, ResetEvent(), and ZoneScript::SetData().

◆ JustSummoned()

void brann_bronzebeard::brann_bronzebeardAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

471 {
472 if (cr->GetEntry() == NPC_ABEDNEUM || cr->GetEntry() == NPC_KADDRAK || cr->GetEntry() == NPC_MARNAK)
473 cr->SetCanFly(true);
474 else
475 summons.Summon(cr);
476 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
bool SetCanFly(bool enable, bool packetOnly=false) override
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition: Creature.cpp:3290
uint32 GetEntry() const
Definition: Object.h:115

References Object::GetEntry(), NPC_ABEDNEUM, NPC_KADDRAK, NPC_MARNAK, Creature::SetCanFly(), SummonList::Summon(), and summons.

◆ Reset()

void brann_bronzebeard::brann_bronzebeardAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

358 {
359 RemoveEscortState(0x7); // all states
360 SetDespawnAtFar(false);
361 SetDespawnAtEnd(false);
362 ResetEvent();
363
367
368 if (pInstance)
369 {
372
374 {
377 door->SetGoState(GO_STATE_ACTIVE);
378 }
379
381 {
384 door->SetGoState(GO_STATE_ACTIVE);
385 }
386 }
387 }
@ BOSS_SJONNIR
Definition: halls_of_stone.h:49
@ GO_TRIBUNAL_ACCESS_DOOR
Definition: halls_of_stone.h:61
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
void SetDespawnAtFar(bool despawn)
Definition: ScriptedEscortAI.h:105
void RemoveEscortState(uint32 escortState)
Definition: ScriptedEscortAI.h:111
void SetDespawnAtEnd(bool despawn)
Definition: ScriptedEscortAI.h:104

References BOSS_SJONNIR, BOSS_TRIBUNAL_OF_AGES, BRANN_BRONZEBEARD, DATA_BRANN_ACHIEVEMENT, DONE, FACTION_FRIENDLY, ZoneScript::GetData(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_SJONNIR_DOOR, GO_STATE_ACTIVE, GO_TRIBUNAL_ACCESS_DOOR, ScriptedAI::me, pInstance, REACT_PASSIVE, npc_escortAI::RemoveEscortState(), Unit::ReplaceAllNpcFlags(), ResetEvent(), ZoneScript::SetData(), npc_escortAI::SetDespawnAtEnd(), npc_escortAI::SetDespawnAtFar(), Unit::SetFaction(), Creature::SetReactState(), UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.

Referenced by DoAction().

◆ ResetEvent()

void brann_bronzebeard::brann_bronzebeardAI::ResetEvent ( )
inline
325 {
327 tribunal->SetGoState(GO_STATE_READY);
328
330 tribunalSkyFloor->SetGoState(GO_STATE_READY);
331
332 events.Reset();
334 DespawnHeads();
335
336 WaveNum = 0;
337 SpeechCount = 0;
338 SpeechPause = 0;
339 TalkEvent = false;
340 }
@ GO_TRIBUNAL_CONSOLE
Definition: halls_of_stone.h:60
@ GO_SKY_FLOOR
Definition: halls_of_stone.h:65
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void DespawnHeads()
Definition: brann_bronzebeard.cpp:264
uint32 SpeechPause
Definition: brann_bronzebeard.cpp:261
uint32 SpeechCount
Definition: brann_bronzebeard.cpp:261
uint8 WaveNum
Definition: brann_bronzebeard.cpp:258

References SummonList::DespawnAll(), DespawnHeads(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_SKY_FLOOR, GO_STATE_READY, GO_TRIBUNAL_CONSOLE, ScriptedAI::me, pInstance, SpeechCount, SpeechPause, summons, TalkEvent, and WaveNum.

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

◆ SummonCreatures()

void brann_bronzebeard::brann_bronzebeardAI::SummonCreatures ( uint32  entry,
uint8  count,
uint8  pos 
)
inline
795 {
796 Creature* cr;
797 for (int i = 0; i < count; ++i)
798 {
799 if (pos == 0)
800 cr = me->SummonCreature(entry, 943.088f + urand(0, 5), 401.378f + urand(0, 5), 206.078f, 3.8f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); //left
801 else
802 cr = me->SummonCreature(entry, 964.302f + urand(0, 4), 378.942f + urand(0, 4), 206.078f, 3.85f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); //right
803
804 if (cr)
805 {
806 cr->AI()->AttackStart(me);
807 cr->AddThreat(me, 100.0f);
809 }
810 }
811 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:51
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
CreatureAI * AI() const
Definition: Creature.h:140
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14653

References Unit::AddThreat(), Creature::AI(), UnitAI::AttackStart(), ScriptedAI::me, Creature::SetInCombatWithZone(), WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, and urand().

Referenced by UpdateEscortAI().

◆ SwitchHeadVisaul()

void brann_bronzebeard::brann_bronzebeardAI::SwitchHeadVisaul ( uint8  headMask,
bool  activate 
)
inline
275 {
276 if (!pInstance)
277 return;
278
279 GameObject* go = nullptr;
280 if (headMask & 0x1) // Kaddrak
282 {
283 if (activate)
284 {
285 go->SendCustomAnim(0);
286 }
287 else
288 {
289 go->SendCustomAnim(1);
290 if (go->GetGoState() == GO_STATE_ACTIVE)
292 }
293 }
294 if (headMask & 0x2) // Marnak
296 {
297 if (activate)
298 {
299 go->SendCustomAnim(0);
300 }
301 else
302 {
303 go->SendCustomAnim(1);
304 if (go->GetGoState() == GO_STATE_ACTIVE)
306 }
307 }
308 if (headMask & 0x4) // Abedneum
310 {
311 if (activate)
312 {
313 go->SendCustomAnim(0);
314 }
315 else
316 {
317 go->SendCustomAnim(1);
318 if (go->GetGoState() == GO_STATE_ACTIVE)
320 }
321 }
322 }
@ GO_ABEDNEUM
Definition: halls_of_stone.h:64
@ GO_KADDRAK
Definition: halls_of_stone.h:62
@ GO_MARNAK
Definition: halls_of_stone.h:63
void SetGoState(GOState state)
Definition: GameObject.cpp:2479
GOState GetGoState() const
Definition: GameObject.h:205
void SendCustomAnim(uint32 anim)
Definition: GameObject.cpp:2152
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322

References Map::GetGameObject(), GameObject::GetGoState(), InstanceScript::GetGuidData(), WorldObject::GetMap(), GO_ABEDNEUM, GO_KADDRAK, GO_MARNAK, GO_STATE_ACTIVE, GO_STATE_READY, ScriptedAI::me, pInstance, GameObject::SendCustomAnim(), and GameObject::SetGoState().

Referenced by DespawnHeads(), and UpdateEscortAI().

◆ UpdateEscortAI()

void brann_bronzebeard::brann_bronzebeardAI::UpdateEscortAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

479 {
480 events.Update(diff);
481
482 if (uint32 eventId = events.ExecuteEvent())
483 {
484 switch (eventId)
485 {
487 {
488 SwitchHeadVisaul(0x1, true);
489 break;
490 }
492 {
493 SwitchHeadVisaul(0x2, true);
494 break;
495 }
497 {
498 SwitchHeadVisaul(0x4, true);
499 break;
500 }
501 case EVENT_KADDRAK_HEAD: // Phase 1
502 {
503 if (!canExecuteEvents)
504 return;
505 if (Creature* kaddrak = GetKaddrak())
506 {
507 if (Player* plr = SelectTargetFromPlayerList(100.0f))
509 }
510
511 events.RescheduleEvent(EVENT_KADDRAK_SWITCH_EYE, 1000ms);
512 events.Repeat(1500ms);
513 break;
514 }
516 {
517 if (!canExecuteEvents)
518 return;
519 if (Creature* kaddrak = GetKaddrak())
520 {
521 if (leftEye)
522 kaddrak->UpdatePosition(927.9f, 330.9f, 219.4f, 2.4f, true);
523 else
524 kaddrak->UpdatePosition(923.7f, 326.9f, 219.5f, 2.1f, true);
525
526 leftEye = !leftEye;
527 kaddrak->StopMovingOnCurrentPos();
528 }
529
530 break;
531 }
532 case EVENT_MARNAK_HEAD: // Phase 2
533 {
534 if (!canExecuteEvents)
535 return;
536
537 if (Creature* marnak = GetMarnak())
538 {
539 if (Creature* cr = me->SummonCreature(NPC_DARK_MATTER_TARGET, 899.843f, 355.271f, 214.301f, 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
540 {
541 cr->SetCanFly(true);
542
543 //right eye
544 if (Creature* cra = me->SummonCreature(NPC_DARK_MATTER, marnak->GetPositionX(), marnak->GetPositionY(), marnak->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000))
545 cra->CastSpell(cra, SPELL_DARK_MATTER_VISUAL_CHANNEL, false);
546
547 //left eye
548 if (Creature* crb = me->SummonCreature(NPC_DARK_MATTER, 891.543f, 359.5252f, 219.338f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000))
549 crb->CastSpell(crb, SPELL_DARK_MATTER_VISUAL_CHANNEL, false);
550
551 darkMatterTargetGUID = cr->GetGUID();
552
553 events.RescheduleEvent(EVENT_DARK_MATTER_START, 5000ms);
554 }
555 }
556 events.Repeat(30s);
557 break;
558 }
560 {
562 {
563 darkMatterTarget->CastSpell(darkMatterTarget, SPELL_DARK_MATTER_VISUAL, false);
564 if (Player* plr = SelectTargetFromPlayerList(100.0f))
565 {
566 if (!plr)
567 return; //no target
568
569 float speed = 10.0f;
570 float tooFarAwaySpeed = me->GetDistance(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ()) / (5000.0f * 0.001f);
571 if (speed < tooFarAwaySpeed)
572 speed = tooFarAwaySpeed;
573
574 darkMatterTarget->MonsterMoveWithSpeed(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), speed);
575
576 if (darkMatterTarget->GetDistance(plr) < 15.0f)
577 {
578 events.RescheduleEvent(EVENT_DARK_MATTER_END, 3000ms);
579 }
580 else if (darkMatterTarget->GetDistance(plr) < 30.0f)
581 {
582 events.RescheduleEvent(EVENT_DARK_MATTER_END, 3500ms);
583 }
584 else
585 {
586 events.RescheduleEvent(EVENT_DARK_MATTER_END, 4500ms);
587 }
588 }
589 }
590 break;
591 }
593 {
595 {
596 darkMatterTarget->CastSpell(darkMatterTarget, darkMatterTarget->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true);
597 darkMatterTarget->DespawnOrUnsummon(500);
598 }
599 break;
600 }
601 case EVENT_ABEDNEUM_HEAD: // Phase 3
602 {
603 if (!canExecuteEvents)
604 return;
605 if (GetAbedneum())
606 {
607 Player* plr = SelectTargetFromPlayerList(100.0f);
608 if (!plr)
609 break;
610
612 {
613 // summon another abedneum to create double beam, despawn just after trigger despawn
614 me->SummonCreature(NPC_ABEDNEUM, 897.0f, 326.9f, 223.5f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 12000);
616 }
617 }
618 events.Repeat(15s);
619 break;
620 }
622 {
623 if (!canExecuteEvents)
624 return;
625 uint32 Time = 40000 - (2500 * WaveNum);
627 if (WaveNum > 2)
628 events.ScheduleEvent(EVENT_SUMMON_STORMCALLER, urand(10 - WaveNum, 15 - WaveNum) * 1000);
629 if (WaveNum > 5)
630 events.ScheduleEvent(EVENT_SUMMON_CUSTODIAN, urand(10 - WaveNum, 15 - WaveNum) * 1000);
631
632 WaveNum++;
633 events.RepeatEvent(Time);
634 break;
635 }
637 {
638 if (!canExecuteEvents)
639 return;
640
642
643 break;
644 }
646 {
647 if (!canExecuteEvents)
648 return;
649
651
652 break;
653 }
655 {
656 canExecuteEvents = false;
657 // Has to be here!
658 events.Reset();
659 //DespawnHeads();
661
662 // Spawn Chest and quest credit
663 if (Player* plr = SelectTargetFromPlayerList(200.0f))
664 {
665 if (GameObject* go = plr->SummonGameObject((IsHeroic() ? GO_TRIBUNAL_CHEST_H : GO_TRIBUNAL_CHEST), 880.406f, 345.164f, 203.706f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0))
666 {
667 plr->RemoveGameObject(go, false);
668 go->SetLootMode(1);
669 go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
670 }
671
673 }
674
675 events.ScheduleEvent(EVENT_BREEN_WAITING, 11s);
676 events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 92s);
677 events.ScheduleEvent(EVENT_TALK_FACE_CHANGE, 97s); //kaddrak speaks
678 events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 168s);
679 events.ScheduleEvent(EVENT_TALK_FACE_CHANGE, 173s); //marnak speaks
680 events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 239s);
681 events.ScheduleEvent(EVENT_TALK_FACE_CHANGE, 244s); //abedneum speaks
682 events.ScheduleEvent(EVENT_GO_TO_SJONNIR, 251s);
683 events.ScheduleEvent(EVENT_SKY_ROOM_FLOOR_CHANGE, 253s);
684 break;
685 }
687 {
688 SetEscortPaused(false);
689 if (pInstance)
690 {
693 me->CastSpell(me, 59046, true); // credit
694 }
695
699
700 break;
701 }
703 {
704 if (pInstance)
706 break;
707 }
709 {
710 if (pInstance)
712 break;
713 }
715 {
717 break;
718 }
719 case EVENT_DOOR_OPEN:
720 {
723
724 if (pInstance)
725 {
727 {
728 door->SetGoState(GO_STATE_ACTIVE);
731 }
732 }
733
734 break;
735 }
737 {
738 SetEscortPaused(false);
739 break;
740 }
742 {
744 break;
745 }
747 {
748 events.Reset();
749 SetEscortPaused(false);
751 break;
752 }
753 }
754 }
755
757
758 if (TalkEvent)
759 {
760 SpeechPause += diff;
762 {
763 Creature* cs = nullptr;
764 switch (Conversation[SpeechCount].creature)
765 {
766 case NPC_BRANN:
767 cs = me;
768 break;
769 case NPC_ABEDNEUM:
770 cs = GetAbedneum();
771 break;
772 case NPC_KADDRAK:
773 cs = GetKaddrak();
774 break;
775 case NPC_MARNAK:
776 cs = GetMarnak();
777 break;
778 }
779
780 if (cs)
781 {
784 }
785
786 if (SpeechCount < 38)
788 else
789 TalkEvent = false;
790 }
791 }
792 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_SEARING_GAZE
Definition: brann_bronzebeard.cpp:56
@ QUEST_HALLS_OF_STONE
Definition: brann_bronzebeard.cpp:75
@ SPELL_DARK_MATTER
Definition: brann_bronzebeard.cpp:54
@ SPELL_DARK_MATTER_VISUAL_CHANNEL
Definition: brann_bronzebeard.cpp:53
@ SPELL_DARK_MATTER_H
Definition: brann_bronzebeard.cpp:55
@ SPELL_GLARE_OF_THE_TRIBUNAL
Definition: brann_bronzebeard.cpp:50
@ SPELL_SEARING_GAZE_H
Definition: brann_bronzebeard.cpp:57
@ SPELL_DARK_MATTER_VISUAL
Definition: brann_bronzebeard.cpp:52
@ SPELL_GLARE_OF_THE_TRIBUNAL_H
Definition: brann_bronzebeard.cpp:51
@ NPC_DARK_RUNE_STORMCALLER
Definition: brann_bronzebeard.cpp:40
@ NPC_SEARING_GAZE_TRIGGER
Definition: brann_bronzebeard.cpp:44
@ NPC_DARK_MATTER_TARGET
Definition: brann_bronzebeard.cpp:43
@ NPC_DARK_MATTER
Definition: brann_bronzebeard.cpp:42
@ NPC_IRON_GOLEM_CUSTODIAN
Definition: brann_bronzebeard.cpp:41
@ NPC_DARK_RUNE_PROTECTOR
Definition: brann_bronzebeard.cpp:39
@ EVENT_SUMMON_STORMCALLER
Definition: brann_bronzebeard.cpp:89
@ EVENT_BREEN_WAITING
Definition: brann_bronzebeard.cpp:107
@ EVENT_DARK_MATTER_START
Definition: brann_bronzebeard.cpp:91
@ EVENT_SKY_ROOM_FLOOR_CHANGE
Definition: brann_bronzebeard.cpp:109
@ EVENT_TALK_FACE_CHANGE
Definition: brann_bronzebeard.cpp:108
@ EVENT_KADDRAK_SWITCH_EYE
Definition: brann_bronzebeard.cpp:87
@ EVENT_GO_TO_SJONNIR
Definition: brann_bronzebeard.cpp:112
@ EVENT_DARK_MATTER_END
Definition: brann_bronzebeard.cpp:92
@ EVENT_RESUME_ESCORT
Definition: brann_bronzebeard.cpp:114
@ EVENT_DOOR_OPEN
Definition: brann_bronzebeard.cpp:113
@ EVENT_SUMMON_CUSTODIAN
Definition: brann_bronzebeard.cpp:90
static Yells Conversation[]
Definition: brann_bronzebeard.cpp:126
@ GO_TRIBUNAL_CHEST
Definition: halls_of_stone.h:68
@ GO_TRIBUNAL_CHEST_H
Definition: halls_of_stone.h:69
@ SAY_BRANN_VICTORY_SJONNIR_2
Definition: halls_of_stone.h:40
@ SAY_BRANN_VICTORY_SJONNIR_1
Definition: halls_of_stone.h:39
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
GameObjectFlags
Definition: SharedDefines.h:1602
@ SPECIAL
Definition: InstanceScript.h:61
@ MOVEMENTFLAG_NONE
Definition: UnitDefines.h:343
virtual void DoAction(int32)
Definition: UnitAI.h:212
bool IsHeroic() const
Definition: ScriptedCreature.h:379
const T & DUNGEON_MODE(const T &normal5, const T &heroic10) const
Definition: ScriptedCreature.h:388
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
virtual void UpdateEscortAI(uint32 diff)
Definition: ScriptedEscortAI.cpp:318
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition: Object.cpp:2903
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1256
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
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
Definition: Player.h:1081
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition: PlayerQuest.cpp:1817
void RemoveGameObject(GameObject *gameObj, bool del)
Definition: Unit.cpp:6197
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:21144
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:734
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
uint32 timer
Definition: brann_bronzebeard.cpp:123
void SummonCreatures(uint32 entry, uint8 count, uint8 pos)
Definition: brann_bronzebeard.cpp:794
ObjectGuid darkMatterTargetGUID
Definition: brann_bronzebeard.cpp:256
bool leftEye
Definition: brann_bronzebeard.cpp:349
bool canExecuteEvents
Definition: brann_bronzebeard.cpp:262

References ACTION_GO_TO_SJONNIR, Unit::AddUnitMovementFlag(), Creature::AI(), BOSS_TRIBUNAL_OF_AGES, BRANN_BRONZEBEARD, canExecuteEvents, Unit::CastSpell(), Conversation, darkMatterTargetGUID, SummonList::DespawnAll(), UnitAI::DoAction(), DONE, ScriptedAI::DUNGEON_MODE(), EMOTE_STATE_READY_UNARMED, EMOTE_STATE_STAND, EVENT_ABEDNEUM_HEAD, EVENT_ABEDNEUM_VISUAL, EVENT_BREEN_WAITING, EVENT_DARK_MATTER_END, EVENT_DARK_MATTER_START, EVENT_DOOR_OPEN, EVENT_GO_TO_SJONNIR, EVENT_KADDRAK_HEAD, EVENT_KADDRAK_SWITCH_EYE, EVENT_KADDRAK_VISUAL, EVENT_MARNAK_HEAD, EVENT_MARNAK_VISUAL, EVENT_RESUME_ESCORT, EVENT_SJONNIR_END_BRANN_LAST_YELL, EVENT_SJONNIR_END_BRANN_YELL, EVENT_SKY_ROOM_FLOOR_CHANGE, EVENT_SUMMON_CUSTODIAN, EVENT_SUMMON_MONSTERS, EVENT_SUMMON_STORMCALLER, EVENT_TALK_FACE_CHANGE, EVENT_TRIBUNAL_END, GetAbedneum(), ObjectAccessor::GetCreature(), WorldObject::GetDistance(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GetKaddrak(), GetMarnak(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_SJONNIR_DOOR, GO_STATE_ACTIVE, GO_TRIBUNAL_CHEST, GO_TRIBUNAL_CHEST_H, ScriptedAI::IsHeroic(), LANG_UNIVERSAL, leftEye, ScriptedAI::me, MOVEMENTFLAG_NONE, NPC_ABEDNEUM, NPC_BRANN, NPC_DARK_MATTER, NPC_DARK_MATTER_TARGET, NPC_DARK_RUNE_PROTECTOR, NPC_DARK_RUNE_STORMCALLER, NPC_IRON_GOLEM_CUSTODIAN, NPC_KADDRAK, NPC_MARNAK, NPC_SEARING_GAZE_TRIGGER, pInstance, WorldObject::PlayDirectSound(), QUEST_HALLS_OF_STONE, Unit::ReplaceAllNpcFlags(), SAY_BRANN_VICTORY_SJONNIR_1, SAY_BRANN_VICTORY_SJONNIR_2, ScriptedAI::SelectTargetFromPlayerList(), Unit::SendMovementFlagUpdate(), ZoneScript::SetData(), npc_escortAI::SetEscortPaused(), Unit::SetUInt32Value(), SPECIAL, SpeechCount, SpeechPause, SPELL_DARK_MATTER, SPELL_DARK_MATTER_H, SPELL_DARK_MATTER_VISUAL, SPELL_DARK_MATTER_VISUAL_CHANNEL, SPELL_GLARE_OF_THE_TRIBUNAL, SPELL_GLARE_OF_THE_TRIBUNAL_H, SPELL_SEARING_GAZE, SPELL_SEARING_GAZE_H, WorldObject::SummonCreature(), SummonCreatures(), WorldObject::SummonGameObject(), summons, SwitchHeadVisaul(), TalkEvent, TEMPSUMMON_TIMED_DESPAWN, Yells::timer, UNIT_NPC_EMOTESTATE, UNIT_NPC_FLAG_GOSSIP, UNIT_NPC_FLAG_NONE, UNIT_NPC_FLAG_QUESTGIVER, npc_escortAI::UpdateEscortAI(), urand(), WaveNum, and Unit::Yell().

◆ WaypointReached()

void brann_bronzebeard::brann_bronzebeardAI::WaypointReached ( uint32  id)
overridevirtual

Implements npc_escortAI.

877{
878 switch (id)
879 {
880 // Stop before stairs and ask to start
881 case 14:
882 SetEscortPaused(true);
883 if (pInstance)
884 {
889 }
890 break;
891 // In front of Console
892 case 16:
893 SetEscortPaused(true);
894 if (pInstance)
895 {
899 tribunal->SetGoState(GO_STATE_ACTIVE);
900 }
901 break;
902 //Tribunal end, stand in the middle of the sky room
903 case 17:
904 SetEscortPaused(true);
905 me->SetOrientation(3.91672f);
907 break;
908 //Run to the skyroom door and then teleport before Sjonnir's door
909 case 18:
910 SetEscortPaused(true);
911 SetNextWaypoint(33, false);
912 if (pInstance)
913 {
917 cr->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
918 me->SetOrientation(3.132660f);
919 DoCast(me, 58506, false);
921 me->SetHomePosition(1199.8f, 667.138f, 196.242f, 3.12967f);
922 me->Relocate(1199.8f, 667.138f, 196.242f, 3.12967f);
923 }
924 break;
925 // Before Sjonnir's door
926 case 33:
927 SetEscortPaused(true);
928 break;
929 //Walk to the door, run after opening it
930 case 34:
931 SetEscortPaused(true);
934 events.ScheduleEvent(EVENT_DOOR_OPEN, 1500);
935 me->SetWalk(false);
936 me->SetSpeed(MOVE_RUN, 1.0f, false);
937 events.ScheduleEvent(EVENT_RESUME_ESCORT, 3500);
938 break;
939 //Brann stops in front of Sjonnir and awaits the start of the battle.
940 case 36:
941 SetEscortPaused(true);
945 break;
946 //Brann steps back and uses the Sjonnir console.
947 case 38:
948 SetEscortPaused(true);
950 if (pInstance)
951 {
953 console->SetGoState(GO_STATE_ACTIVE);
954 }
955 break;
956 //After Sjonnir's death, Brann steps away from the console and talk.
957 case 39:
958 SetEscortPaused(true);
959 break;
960 //Brann steps back and uses the Sjonnir console.
961 case 40:
962 SetEscortPaused(true);
964 break;
965 }
966}
@ NPC_SJONNIR
Definition: halls_of_stone.h:79
@ GO_SJONNIR_CONSOLE
Definition: halls_of_stone.h:66
@ SAY_BRANN_FRONT_OF_SJONNIR
Definition: halls_of_stone.h:34
@ SAY_BRANN_EVENT_INTRO_1
Definition: halls_of_stone.h:38
@ EMOTE_ONESHOT_CHEER
Definition: SharedDefines.h:1898
@ EMOTE_STATE_USE_STANDING
Definition: SharedDefines.h:1944
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
void Relocate(float x, float y)
Definition: Position.h:72
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:2000

References BOSS_TRIBUNAL_OF_AGES, BRANN_BRONZEBEARD, EMOTE_ONESHOT_CHEER, EMOTE_STATE_READY_UNARMED, EMOTE_STATE_USE_STANDING, EVENT_DOOR_OPEN, EVENT_RESUME_ESCORT, ObjectAccessor::GetCreature(), ObjectAccessor::GetGameObject(), GO_SJONNIR_CONSOLE, GO_STATE_ACTIVE, GO_TRIBUNAL_CONSOLE, IN_PROGRESS, MOVE_RUN, NPC_SJONNIR, SAY_BRANN_EVENT_INTRO_1, SAY_BRANN_FRONT_OF_SJONNIR, UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_EMOTESTATE, UNIT_NPC_FLAG_GOSSIP, and UNIT_NPC_FLAG_QUESTGIVER.

Member Data Documentation

◆ AbedneumGUID

ObjectGuid brann_bronzebeard::brann_bronzebeardAI::AbedneumGUID

Referenced by GetAbedneum(), and InitializeEvent().

◆ canExecuteEvents

bool brann_bronzebeard::brann_bronzebeardAI::canExecuteEvents = true

Referenced by UpdateEscortAI().

◆ darkMatterTargetGUID

ObjectGuid brann_bronzebeard::brann_bronzebeardAI::darkMatterTargetGUID

Referenced by UpdateEscortAI().

◆ events

EventMap brann_bronzebeard::brann_bronzebeardAI::events

◆ KaddrakGUID

ObjectGuid brann_bronzebeard::brann_bronzebeardAI::KaddrakGUID

Referenced by GetKaddrak(), and InitializeEvent().

◆ leftEye

bool brann_bronzebeard::brann_bronzebeardAI::leftEye = true

Referenced by UpdateEscortAI().

◆ MarnakGUID

ObjectGuid brann_bronzebeard::brann_bronzebeardAI::MarnakGUID

Referenced by GetMarnak(), and InitializeEvent().

◆ pInstance

InstanceScript* brann_bronzebeard::brann_bronzebeardAI::pInstance

◆ SpeechCount

uint32 brann_bronzebeard::brann_bronzebeardAI::SpeechCount

Referenced by ResetEvent(), and UpdateEscortAI().

◆ SpeechPause

uint32 brann_bronzebeard::brann_bronzebeardAI::SpeechPause

Referenced by ResetEvent(), and UpdateEscortAI().

◆ summons

SummonList brann_bronzebeard::brann_bronzebeardAI::summons

◆ TalkEvent

bool brann_bronzebeard::brann_bronzebeardAI::TalkEvent

◆ WaveNum

uint8 brann_bronzebeard::brann_bronzebeardAI::WaveNum

Referenced by ResetEvent(), and UpdateEscortAI().