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

Public Member Functions

 ValithriaDespawner (Creature *creature)
 
bool Execute (uint64, uint32) override
 
void operator() (Creature *creature) const
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()
 
virtual ~BasicEvent ()
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 

Private Attributes

Creature_creature
 

Additional Inherited Members

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

Constructor & Destructor Documentation

ValithriaDespawner::ValithriaDespawner ( Creature creature)
inlineexplicit
218  : _creature(creature)
219  {
220  }
Creature * _creature
Definition: boss_valithria_dreamwalker.cpp:272

Member Function Documentation

bool ValithriaDespawner::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

223  {
225  _creature->VisitNearbyGridObject(333.0f, worker);
226  return true;
227  }
Definition: GridNotifiers.h:474
void VisitNearbyGridObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:588
Creature * _creature
Definition: boss_valithria_dreamwalker.cpp:272

+ Here is the call graph for this function:

void ValithriaDespawner::operator() ( Creature creature) const
inline
230  {
231  switch (creature->GetEntry())
232  {
234  if (InstanceScript* instance = creature->GetInstanceScript())
235  instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature);
236  break;
238  case NPC_SUPPRESSER:
241  case NPC_MANA_VOID:
242  case NPC_COLUMN_OF_FROST:
243  case NPC_ROT_WORM:
244  creature->DespawnOrUnsummon();
245  return;
246  case NPC_RISEN_ARCHMAGE:
247  if (!creature->GetSpawnId())
248  {
249  creature->DespawnOrUnsummon();
250  return;
251  }
252  creature->Respawn(true);
253  break;
254  default:
255  return;
256  }
257 
258  uint32 corpseDelay = creature->GetCorpseDelay();
259  uint32 respawnDelay = creature->GetRespawnDelay();
260  creature->SetCorpseDelay(1);
261  creature->SetRespawnDelay(10);
262 
263  if (CreatureData const* data = creature->GetCreatureData())
264  creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation);
265  creature->DespawnOrUnsummon();
266 
267  creature->SetCorpseDelay(corpseDelay);
268  creature->SetRespawnDelay(respawnDelay);
269  }
Definition: InstanceScript.h:46
Definition: Creature.h:287
Definition: icecrown_citadel.h:278
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
uint32 GetRespawnDelay() const
Definition: Creature.h:637
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:487
CreatureData const * GetCreatureData() const
Definition: Creature.h:559
uint32 GetCorpseDelay() const
Definition: Creature.h:493
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:2537
Definition: icecrown_citadel.h:277
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:492
uint32_t uint32
Definition: Define.h:150
Definition: icecrown_citadel.h:284
Definition: icecrown_citadel.h:283
Definition: icecrown_citadel.h:280
void Respawn(bool force=false)
Definition: Creature.cpp:1697
Definition: icecrown_citadel.h:281
Definition: InstanceScript.h:141
uint32 GetEntry() const
Definition: Object.h:107
void SetRespawnDelay(uint32 delay)
Definition: Creature.h:638
Definition: icecrown_citadel.h:275
Definition: icecrown_citadel.h:282
Definition: icecrown_citadel.h:279

+ Here is the call graph for this function:

Member Data Documentation

Creature* ValithriaDespawner::_creature
private

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