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

Public Member Functions

 go_beaconAI (GameObject *gameObject)
 
void OnStateChanged (uint32 state, Unit *) 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 *)
 

Public Attributes

std::list< Creature * > creatureList
 

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

go_beacon::go_beaconAI::go_beaconAI ( GameObject gameObject)
inline
562: GameObjectAI(gameObject) { }
Definition: GameObjectAI.h:33

Member Function Documentation

◆ OnStateChanged()

void go_beacon::go_beaconAI::OnStateChanged ( uint32  state,
Unit  
)
inlineoverridevirtual

Reimplemented from GameObjectAI.

567 {
568 if (state == GO_ACTIVATED)
569 {
571 {
572 for (Creature* whelp : creatureList)
573 {
574 if (whelp->IsAlive() && !whelp->IsInCombat() && whelp->GetMotionMaster()->GetCurrentMovementGeneratorType() != HOME_MOTION_TYPE)
575 {
576 whelp->GetMotionMaster()->MovePoint(0, me->GetNearPosition(4.0f, whelp->GetOrientation()));
577 }
578 }
579 }
580 }
581 else if (state == GO_JUST_DEACTIVATED)
582 {
583 {
584 for (Creature* whelp : creatureList)
585 {
586 if (whelp->IsAlive() && !whelp->IsInCombat() && whelp->GetMotionMaster()->GetCurrentMovementGeneratorType() != HOME_MOTION_TYPE)
587 {
588 whelp->GetMotionMaster()->MoveTargetedHome();
589 }
590 }
591 }
592 }
593 else
594 {
595 creatureList.clear();
596 }
597 }
@ NPC_STONESCHYE_WHELP
Definition: zone_hellfire_peninsula.cpp:552
@ GO_ACTIVATED
Definition: GameObject.h:112
@ GO_JUST_DEACTIVATED
Definition: GameObject.h:113
@ HOME_MOTION_TYPE
Definition: MotionMaster.h:46
GameObject *const me
Definition: GameObjectAI.h:35
Definition: Creature.h:43
Position GetNearPosition(float dist, float angle, bool disableWarning=false)
Definition: Object.cpp:2739
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3097
std::list< Creature * > creatureList
Definition: zone_hellfire_peninsula.cpp:564

References creatureList, WorldObject::GetCreaturesWithEntryInRange(), WorldObject::GetNearPosition(), GO_ACTIVATED, GO_JUST_DEACTIVATED, HOME_MOTION_TYPE, GameObjectAI::me, and NPC_STONESCHYE_WHELP.

Member Data Documentation

◆ creatureList

std::list<Creature*> go_beacon::go_beaconAI::creatureList

Referenced by OnStateChanged().