AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
StartMovementEvent Class Reference
Inheritance diagram for StartMovementEvent:
BasicEvent

Public Member Functions

 StartMovementEvent (Creature *summoner, Creature *owner)
 
bool Execute (uint64, uint32) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool Execute (uint64, uint32)
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Private Attributes

Creature_summoner
 
Creature_owner
 

Detailed Description

Constructor & Destructor Documentation

◆ StartMovementEvent()

StartMovementEvent::StartMovementEvent ( Creature summoner,
Creature owner 
)
inline
503: _summoner(summoner), _owner(owner) {}
Creature * _owner
Definition: boss_the_lich_king.cpp:520
Creature * _summoner
Definition: boss_the_lich_king.cpp:519

Member Function Documentation

◆ Execute()

bool StartMovementEvent::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

506 {
509 if (Unit* target = _owner->SelectVictim())
510 _owner->AI()->AttackStart(target);
511 if (!_owner->GetVictim())
512 if (Unit* target = _summoner->AI()->SelectTarget(SelectTargetMethod::Random, 0, NonTankLKTargetSelector(_summoner)))
513 _owner->AI()->AttackStart(target);
515 return true;
516 }
@ REACT_AGGRESSIVE
Definition: Unit.h:550
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:106
bool isThreatListEmpty() const
Definition: ThreatMgr.h:224
Unit * SelectVictim()
Definition: Unit.cpp:14733
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
CreatureAI * AI() const
Definition: Creature.h:140
Definition: Unit.h:630
Unit * GetVictim() const
Definition: Unit.h:853
ThreatMgr & GetThreatMgr()
Definition: Unit.h:903
Definition: boss_the_lich_king.cpp:407

References _owner, _summoner, Creature::AI(), UnitAI::AttackStart(), CreatureAI::DoZoneInCombat(), Unit::GetThreatMgr(), Unit::GetVictim(), ThreatMgr::isThreatListEmpty(), REACT_AGGRESSIVE, UnitAI::SelectTarget(), Creature::SelectVictim(), and Creature::SetReactState().

Member Data Documentation

◆ _owner

Creature* StartMovementEvent::_owner
private

Referenced by Execute().

◆ _summoner

Creature* StartMovementEvent::_summoner
private

Referenced by Execute().