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

Public Member Functions

 go_bear_trapAI (GameObject *gameObject)
 
void Initialize ()
 
void UpdateAI (uint32 const 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

EventMap _events
 

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

go_bear_trap::go_bear_trapAI::go_bear_trapAI ( GameObject gameObject)
inline
424 : GameObjectAI(gameObject)
425 {
426 Initialize();
427 }
Definition: GameObjectAI.h:33
void Initialize()
Definition: go_scripts.cpp:429

References Initialize().

Member Function Documentation

◆ Initialize()

void go_bear_trap::go_bear_trapAI::Initialize ( )
inline
430 {
432 }
@ EVENT_CHECK
Definition: go_scripts.cpp:412
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
EventMap _events
Definition: go_scripts.cpp:461

References _events, EVENT_CHECK, and EventMap::ScheduleEvent().

Referenced by go_bear_trapAI().

◆ UpdateAI()

void go_bear_trap::go_bear_trapAI::UpdateAI ( uint32 const  diff)
inlineoverridevirtual

Reimplemented from GameObjectAI.

435 {
436 _events.Update(diff);
437
438 while (uint32 eventId = _events.ExecuteEvent())
439 {
440 switch (eventId)
441 {
442 case EVENT_CHECK:
443 {
445 {
446 bear->CastSpell(bear, SPELL_BEAR_CAPTURED_IN_TRAP);
448 }
449 else
450 {
452 }
453 break;
454 }
455 default:
456 break;
457 }
458 }
459 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_BEAR_CAPTURED_IN_TRAP
Definition: go_scripts.cpp:414
@ NPC_RABID_THISTLE_BEAR
Definition: go_scripts.cpp:413
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
GameObject *const me
Definition: GameObjectAI.h:35
Definition: Creature.h:43
void RemoveFromWorld() override
Definition: GameObject.cpp:168
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457

References _events, EVENT_CHECK, EventMap::ExecuteEvent(), WorldObject::FindNearestCreature(), GameObjectAI::me, NPC_RABID_THISTLE_BEAR, GameObject::RemoveFromWorld(), EventMap::ScheduleEvent(), SPELL_BEAR_CAPTURED_IN_TRAP, and EventMap::Update().

Member Data Documentation

◆ _events

EventMap go_bear_trap::go_bear_trapAI::_events
private

Referenced by Initialize(), and UpdateAI().