AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
AreaTrigger_at_area_52_entrance Class Reference
Inheritance diagram for AreaTrigger_at_area_52_entrance:
AreaTriggerScript ScriptObject

Public Member Functions

 AreaTrigger_at_area_52_entrance ()
 
bool OnTrigger (Player *player, AreaTrigger const *trigger) override
 
- Public Member Functions inherited from AreaTriggerScript
bool IsDatabaseBound () const override
 
virtual bool OnTrigger (Player *, AreaTrigger const *)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 

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, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ AreaTrigger_at_area_52_entrance()

AreaTrigger_at_area_52_entrance::AreaTrigger_at_area_52_entrance ( )
inline
387 : AreaTriggerScript("at_area_52_entrance")
388 {
390 }
@ AT_AREA_52_EAST
Definition: areatrigger_scripts.cpp:381
@ AT_AREA_52_WEST
Definition: areatrigger_scripts.cpp:380
@ AT_AREA_52_NORTH
Definition: areatrigger_scripts.cpp:379
@ AT_AREA_52_SOUTH
Definition: areatrigger_scripts.cpp:378
Definition: AreaTriggerScript.h:24
std::map< uint32, time_t > _triggerTimes
Definition: areatrigger_scripts.cpp:434

References _triggerTimes, AT_AREA_52_EAST, AT_AREA_52_NORTH, AT_AREA_52_SOUTH, and AT_AREA_52_WEST.

Member Function Documentation

◆ OnTrigger()

bool AreaTrigger_at_area_52_entrance::OnTrigger ( Player player,
AreaTrigger const *  trigger 
)
inlineoverridevirtual

Reimplemented from AreaTriggerScript.

393 {
394 float x = 0.0f, y = 0.0f, z = 0.0f;
395
396 if (!player->IsAlive())
397 return false;
398
399 uint32 triggerId = trigger->entry;
400 if (GameTime::GetGameTime().count() - _triggerTimes[trigger->entry] < SUMMON_COOLDOWN)
401 return false;
402
403 switch (triggerId)
404 {
405 case AT_AREA_52_EAST:
406 x = 3044.176f;
407 y = 3610.692f;
408 z = 143.61f;
409 break;
410 case AT_AREA_52_NORTH:
411 x = 3114.87f;
412 y = 3687.619f;
413 z = 143.62f;
414 break;
415 case AT_AREA_52_WEST:
416 x = 3017.79f;
417 y = 3746.806f;
418 z = 144.27f;
419 break;
420 case AT_AREA_52_SOUTH:
421 x = 2950.63f;
422 y = 3719.905f;
423 z = 143.33f;
424 break;
425 }
426
427 player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
428 player->AddAura(SPELL_A52_NEURALYZER, player);
429 _triggerTimes[trigger->entry] = GameTime::GetGameTime().count();
430 return false;
431 }
std::uint32_t uint32
Definition: Define.h:107
@ SUMMON_COOLDOWN
Definition: areatrigger_scripts.cpp:376
@ NPC_SPOTLIGHT
Definition: areatrigger_scripts.cpp:375
@ SPELL_A52_NEURALYZER
Definition: areatrigger_scripts.cpp:374
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
Seconds GetGameTime()
Definition: GameTime.cpp:38
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18863
bool IsAlive() const
Definition: Unit.h:1654

References _triggerTimes, Unit::AddAura(), AT_AREA_52_EAST, AT_AREA_52_NORTH, AT_AREA_52_SOUTH, AT_AREA_52_WEST, AreaTrigger::entry, GameTime::GetGameTime(), Unit::IsAlive(), NPC_SPOTLIGHT, SPELL_A52_NEURALYZER, SUMMON_COOLDOWN, WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN.

Member Data Documentation

◆ _triggerTimes

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