AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
at_hol_hall_of_watchers Class Reference
Inheritance diagram for at_hol_hall_of_watchers:
OnlyOnceAreaTriggerScript AreaTriggerScript ScriptObject

Public Member Functions

 at_hol_hall_of_watchers ()
 
bool _OnTrigger (Player *player, const AreaTrigger *) override
 
- Public Member Functions inherited from OnlyOnceAreaTriggerScript
bool OnTrigger (Player *, AreaTrigger const *) override
 
- Public Member Functions inherited from AreaTriggerScript
bool IsDatabaseBound () const override
 
- Public Member Functions inherited from ScriptObject
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

Additional Inherited Members

- Protected Member Functions inherited from OnlyOnceAreaTriggerScript
void ResetAreaTriggerDone (InstanceScript *, uint32)
 
void ResetAreaTriggerDone (Player const *, AreaTrigger const *)
 
- Protected Member Functions inherited from AreaTriggerScript
 AreaTriggerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ at_hol_hall_of_watchers()

at_hol_hall_of_watchers::at_hol_hall_of_watchers ( )
inline
96: OnlyOnceAreaTriggerScript("at_hol_hall_of_watchers") {}
Definition AreaTriggerScript.h:36

Member Function Documentation

◆ _OnTrigger()

bool at_hol_hall_of_watchers::_OnTrigger ( Player player,
const AreaTrigger  
)
inlineoverridevirtual

Implements OnlyOnceAreaTriggerScript.

99 {
100 std::list<Creature*> creatures;
102 creatures.remove_if([&](Creature const* creature) -> bool
103 {
104 return !player->IsWithinLOSInMap(creature) || !creature->HasAura(SPELL_FREEZE_ANIM);
105 });
106
107 if (creatures.empty())
108 return false;
109
111
112 ObjectGuid target = player->GetGUID();
113
114 for (Creature* creature : creatures)
115 {
116 creature->SetHomePosition(player->GetPosition());
117 creature->AI()->DoCastSelf(SPELL_AWAKEN);
119
120 creature->m_Events.AddEventAtOffset([creature, target] {
121 creature->AI()->DoAction(ACTION_ACTIVATE_TITANIUM_VRYKUL);
122 if (Player* targetPlayer = ObjectAccessor::GetPlayer(*creature, target))
123 creature->AI()->AttackStart(targetPlayer);
124 }, 5s);
125 }
126
127 return false;
128 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:279
creatures
Definition boss_prince_malchezaar.cpp:51
Definition Creature.h:47
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:339
CreatureAI * AI() const
Definition Creature.h:145
void AddEventAtOffset(BasicEvent *event, Milliseconds offset, uint8 eventGroup=0)
Definition EventProcessor.h:108
Definition ObjectGuid.h:118
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
Definition Player.h:1071
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:391
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:27
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5790
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:734
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1380
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2511
EventProcessor m_Events
Definition Object.h:731
@ NPC_TITANIUM_SIEGEBREAKER
Definition halls_of_lightning.h:49
@ NPC_TITANIUM_THUNDERER
Definition halls_of_lightning.h:48
@ ACTION_ACTIVATE_TITANIUM_VRYKUL
Definition halls_of_lightning.h:61
@ SPELL_FREEZE_ANIM
Definition instance_halls_of_lightning.cpp:89
@ SPELL_AWAKEN
Definition instance_halls_of_lightning.cpp:90
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:79
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:220
void GetPosition(float &x, float &y) const
Definition Position.h:126

References ACTION_ACTIVATE_TITANIUM_VRYKUL, EventProcessor::AddEventAtOffset(), Creature::AI(), UnitAI::AttackStart(), UnitAI::DoAction(), UnitAI::DoCastSelf(), WorldObject::GetCreatureListWithEntryInGrid(), Object::GetGUID(), ObjectAccessor::GetPlayer(), Position::GetPosition(), Unit::HasAura(), WorldObject::IsWithinLOSInMap(), WorldObject::m_Events, NPC_TITANIUM_SIEGEBREAKER, NPC_TITANIUM_THUNDERER, Acore::Containers::RandomResize(), Unit::RemoveUnitFlag(), Creature::SetHomePosition(), SPELL_AWAKEN, SPELL_FREEZE_ANIM, UNIT_FLAG_NOT_SELECTABLE, and urand().


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