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

Public Member Functions

 go_direbrew_mole_machineAI (GameObject *go)
 
void Reset () override
 
void UpdateAI (uint32 diff) override
 
- 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

TaskScheduler _scheduler
 

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_direbrew_mole_machineAI()

go_direbrew_mole_machine::go_direbrew_mole_machineAI::go_direbrew_mole_machineAI ( GameObject go)
inline
1864: GameObjectAI(go) { }
Definition: GameObjectAI.h:33

Member Function Documentation

◆ Reset()

void go_direbrew_mole_machine::go_direbrew_mole_machineAI::Reset ( )
inlineoverridevirtual

Reimplemented from GameObjectAI.

1867 {
1869
1870 _scheduler.Schedule(Seconds(1), [this](TaskContext /*context*/)
1871 {
1874 })
1875 .Schedule(Seconds(4), [this](TaskContext /*context*/)
1876 {
1877 if (GameObject* trap = me->GetLinkedTrap())
1878 {
1879 trap->UseDoorOrButton();
1880 trap->SetLootState(GO_READY);
1881 }
1882 });
1883 }
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
@ SPELL_MOLE_MACHINE_EMERGE
Definition: brewfest.cpp:1474
@ GO_READY
Definition: GameObject.h:111
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: TaskScheduler.h:421
GameObject *const me
Definition: GameObjectAI.h:35
Definition: GameObject.h:120
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
Definition: GameObject.cpp:1431
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:2444
GameObject * GetLinkedTrap()
Definition: GameObject.cpp:2737
void CastSpell(Unit *target, uint32 spell)
Definition: GameObject.cpp:2087
TaskScheduler _scheduler
Definition: brewfest.cpp:1891

References _scheduler, GameObject::CastSpell(), GameObject::GetLinkedTrap(), GO_READY, GameObjectAI::me, TaskScheduler::Schedule(), GameObject::SetLootState(), SPELL_MOLE_MACHINE_EMERGE, and GameObject::UseDoorOrButton().

◆ UpdateAI()

void go_direbrew_mole_machine::go_direbrew_mole_machineAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from GameObjectAI.

1886 {
1887 _scheduler.Update(diff);
1888 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27

References _scheduler, and TaskScheduler::Update().

Member Data Documentation

◆ _scheduler

TaskScheduler go_direbrew_mole_machine::go_direbrew_mole_machineAI::_scheduler
private

Referenced by Reset(), and UpdateAI().