AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_suppression_device::go_suppression_deviceAI Struct Reference
Inheritance diagram for go_suppression_device::go_suppression_deviceAI:
GameObjectAI

Public Member Functions

 go_suppression_deviceAI (GameObject *go)
 
void InitializeAI () override
 
void UpdateAI (uint32 diff) override
 
void DoAction (int32 action) override
 
void Activate ()
 
void Deactivate ()
 
- Public Member Functions inherited from GameObjectAI
 GameObjectAI (GameObject *go)
 
virtual ~GameObjectAI ()
 
virtual void UpdateAI (uint32)
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual void SetGUID (ObjectGuid, int32)
 
virtual ObjectGuid GetGUID (int32) const
 
virtual bool GossipHello (Player *, bool)
 
virtual bool GossipSelect (Player *, uint32, uint32)
 
virtual bool GossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual bool QuestAccept (Player *, Quest const *)
 
virtual bool QuestReward (Player *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *)
 
virtual void Destroyed (Player *, uint32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void OnGameEvent (bool, uint16)
 
virtual void OnStateChanged (uint32, Unit *)
 
virtual void EventInform (uint32)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual void JustSummoned (Creature *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 

Private Attributes

InstanceScript_instance
 
EventMap _events
 
bool _active
 

Additional Inherited Members

- Static Public Member Functions inherited from GameObjectAI
static int32 Permissible (GameObject const *go)
 
- Protected Attributes inherited from GameObjectAI
GameObject *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ go_suppression_deviceAI()

go_suppression_device::go_suppression_deviceAI::go_suppression_deviceAI ( GameObject go)
inline
164: GameObjectAI(go), _instance(go->GetInstanceScript()), _active(true) { }
Definition: GameObjectAI.h:33
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
bool _active
Definition: boss_broodlord_lashlayer.cpp:244
InstanceScript * _instance
Definition: boss_broodlord_lashlayer.cpp:242

Member Function Documentation

◆ Activate()

void go_suppression_device::go_suppression_deviceAI::Activate ( )
inline
219 {
220 if (_active)
221 return;
222 _active = true;
223 if (me->GetGoState() == GO_STATE_ACTIVE)
228 me->Respawn();
229 }
@ EVENT_SUPPRESSION_CAST
Definition: boss_broodlord_lashlayer.cpp:51
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
@ GO_READY
Definition: GameObject.h:111
@ GO_STATE_READY
Definition: GameObjectData.h:690
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
GameObject *const me
Definition: GameObjectAI.h:35
void SetGoState(GOState state)
Definition: GameObject.cpp:2479
GOState GetGoState() const
Definition: GameObject.h:205
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2444
void Respawn()
Definition: GameObject.cpp:1320
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:219
EventMap _events
Definition: boss_broodlord_lashlayer.cpp:243

References _active, _events, EVENT_SUPPRESSION_CAST, GameObject::GetGoState(), GO_FLAG_NOT_SELECTABLE, GO_READY, GO_STATE_ACTIVE, GO_STATE_READY, GameObjectAI::me, GameObject::RemoveGameObjectFlag(), GameObject::Respawn(), EventMap::ScheduleEvent(), GameObject::SetGoState(), and GameObject::SetLootState().

Referenced by UpdateAI().

◆ Deactivate()

void go_suppression_device::go_suppression_deviceAI::Deactivate ( )
inline
232 {
233 if (!_active)
234 return;
235 _active = false;
239 }
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:190
void SetGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:218

References _active, _events, EventMap::CancelEvent(), EVENT_SUPPRESSION_CAST, GO_FLAG_NOT_SELECTABLE, GO_STATE_ACTIVE, GameObjectAI::me, GameObject::SetGameObjectFlag(), and GameObject::SetGoState().

Referenced by DoAction(), and InitializeAI().

◆ DoAction()

void go_suppression_device::go_suppression_deviceAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from GameObjectAI.

201 {
202 if (action == ACTION_DEACTIVATE)
203 {
205 }
206 else if (action == ACTION_DISARMED)
207 {
208 Deactivate();
210
212 {
214 }
215 }
216 }
@ DATA_BROODLORD_LASHLAYER
Definition: blackwing_lair.h:33
@ ACTION_DEACTIVATE
Definition: boss_broodlord_lashlayer.cpp:57
@ ACTION_DISARMED
Definition: boss_broodlord_lashlayer.cpp:58
@ EVENT_SUPPRESSION_RESET
Definition: boss_broodlord_lashlayer.cpp:52
@ DONE
Definition: InstanceScript.h:60
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
void Deactivate()
Definition: boss_broodlord_lashlayer.cpp:231

References _events, _instance, ACTION_DEACTIVATE, ACTION_DISARMED, EventMap::CancelEvent(), DATA_BROODLORD_LASHLAYER, Deactivate(), DONE, EVENT_SUPPRESSION_CAST, EVENT_SUPPRESSION_RESET, InstanceScript::GetBossState(), and EventMap::ScheduleEvent().

◆ InitializeAI()

void go_suppression_device::go_suppression_deviceAI::InitializeAI ( )
inlineoverridevirtual

◆ UpdateAI()

void go_suppression_device::go_suppression_deviceAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from GameObjectAI.

178 {
179 _events.Update(diff);
180
181 while (uint32 eventId = _events.ExecuteEvent())
182 {
183 switch (eventId)
184 {
186 if (me->GetGoState() == GO_STATE_READY)
187 {
189 me->SendCustomAnim(0);
190 }
192 break;
194 Activate();
195 break;
196 }
197 }
198 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_SUPPRESSION_AURA
Definition: boss_broodlord_lashlayer.cpp:40
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
void SendCustomAnim(uint32 anim)
Definition: GameObject.cpp:2152
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2087
void Activate()
Definition: boss_broodlord_lashlayer.cpp:218

References _events, Activate(), GameObject::CastSpell(), EVENT_SUPPRESSION_CAST, EVENT_SUPPRESSION_RESET, EventMap::ExecuteEvent(), GameObject::GetGoState(), GO_STATE_READY, GameObjectAI::me, EventMap::ScheduleEvent(), GameObject::SendCustomAnim(), SPELL_SUPPRESSION_AURA, and EventMap::Update().

Member Data Documentation

◆ _active

bool go_suppression_device::go_suppression_deviceAI::_active
private

Referenced by Activate(), and Deactivate().

◆ _events

EventMap go_suppression_device::go_suppression_deviceAI::_events
private

◆ _instance

InstanceScript* go_suppression_device::go_suppression_deviceAI::_instance
private

Referenced by DoAction(), and InitializeAI().