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

Public Member Functions

 AreaTrigger_at_area_52_entrance ()
 
bool OnTrigger (Player *player, AreaTriggerEntry const *areaTrigger, bool) override
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 

Private Attributes

std::map< uint32, time_t > _triggerTimes
 

Additional Inherited Members

- Protected Member Functions inherited from AreaTriggerScript
 AreaTriggerScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 

Constructor & Destructor Documentation

AreaTrigger_at_area_52_entrance::AreaTrigger_at_area_52_entrance ( )
inline
361  : AreaTriggerScript("at_area_52_entrance")
362  {
364  }
Definition: areatrigger_scripts.cpp:353
AreaTriggerScript(const char *name)
Definition: ScriptMgr.cpp:1598
std::map< uint32, time_t > _triggerTimes
Definition: areatrigger_scripts.cpp:407
Definition: areatrigger_scripts.cpp:352
Definition: areatrigger_scripts.cpp:354
Definition: areatrigger_scripts.cpp:355

Member Function Documentation

bool AreaTrigger_at_area_52_entrance::OnTrigger ( Player player,
AreaTriggerEntry const areaTrigger,
bool   
)
inlineoverridevirtual

Reimplemented from AreaTriggerScript.

367  {
368  float x = 0.0f, y = 0.0f, z = 0.0f;
369 
370  if (!player->IsAlive())
371  return false;
372 
373  if (sWorld->GetGameTime() - _triggerTimes[areaTrigger->ID] < SUMMON_COOLDOWN)
374  return false;
375 
376  switch (areaTrigger->ID)
377  {
378  case AT_AREA_52_EAST:
379  x = 3044.176f;
380  y = 3610.692f;
381  z = 143.61f;
382  break;
383  case AT_AREA_52_NORTH:
384  x = 3114.87f;
385  y = 3687.619f;
386  z = 143.62f;
387  break;
388  case AT_AREA_52_WEST:
389  x = 3017.79f;
390  y = 3746.806f;
391  z = 144.27f;
392  break;
393  case AT_AREA_52_SOUTH:
394  x = 2950.63f;
395  y = 3719.905f;
396  z = 143.33f;
397  break;
398  }
399 
400  player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
401  player->AddAura(SPELL_A52_NEURALYZER, player);
402  _triggerTimes[areaTrigger->ID] = sWorld->GetGameTime();
403  return false;
404  }
Definition: areatrigger_scripts.cpp:350
Definition: areatrigger_scripts.cpp:348
Definition: areatrigger_scripts.cpp:353
Definition: areatrigger_scripts.cpp:349
#define sWorld
Definition: World.h:887
std::map< uint32, time_t > _triggerTimes
Definition: areatrigger_scripts.cpp:407
Definition: areatrigger_scripts.cpp:352
Definition: Object.h:56
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
Definition: areatrigger_scripts.cpp:354
Definition: areatrigger_scripts.cpp:355
G3D::int16 x
Definition: Vector2int16.h:37

Member Data Documentation

std::map<uint32, time_t> AreaTrigger_at_area_52_entrance::_triggerTimes
private

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