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
425 : GameObjectAI(gameObject)
426 {
427 Initialize();
428 }
Definition: GameObjectAI.h:34
void Initialize()
Definition: go_scripts.cpp:430

References Initialize().

Member Function Documentation

◆ Initialize()

void go_bear_trap::go_bear_trapAI::Initialize ( )
inline
431 {
433 }
@ EVENT_CHECK
Definition: go_scripts.cpp:413
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
EventMap _events
Definition: go_scripts.cpp:462

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.

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

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