TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StartAttackEvent Class Reference

Public Member Functions

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

Private Attributes

ObjectGuid _summonerGuid
 
Creature_owner
 

Additional Inherited Members

- Public Attributes inherited from BasicEvent
bool to_Abort
 
uint64 m_addTime
 
uint64 m_execTime
 

Constructor & Destructor Documentation

StartAttackEvent::StartAttackEvent ( Creature summoner,
Creature owner 
)
inline
404  : _summonerGuid(summoner->GetGUID()), _owner(owner)
405  {
406  }
Creature * _owner
Definition: boss_yogg_saron.cpp:419
ObjectGuid _summonerGuid
Definition: boss_yogg_saron.cpp:418
ObjectGuid const & GetGUID() const
Definition: Object.h:105

Member Function Documentation

bool StartAttackEvent::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

409  {
412  if (Unit* target = _summoner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f))
413  _owner->AI()->AttackStart(target);
414  return true;
415  }
Definition: Unit.h:1131
Creature * _owner
Definition: boss_yogg_saron.cpp:419
Definition: Creature.h:467
Definition: UnitAI.h:35
CreatureAI * AI() const
Definition: Creature.h:525
ObjectGuid _summonerGuid
Definition: boss_yogg_saron.cpp:418
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: Unit.h:1305
void SetReactState(ReactStates st)
Definition: Creature.h:502
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

Member Data Documentation

Creature* StartAttackEvent::_owner
private
ObjectGuid StartAttackEvent::_summonerGuid
private

The documentation for this class was generated from the following file: