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

Public Member Functions

 AreaTrigger_at_brewfest ()
 
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
 

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 ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ AreaTrigger_at_brewfest()

AreaTrigger_at_brewfest::AreaTrigger_at_brewfest ( )
inline
378 : AreaTriggerScript("at_brewfest")
379 {
380 // Initialize for cooldown
382 }
@ AT_BREWFEST_DUROTAR
Definition: areatrigger_scripts.cpp:367
@ AT_BREWFEST_DUN_MOROGH
Definition: areatrigger_scripts.cpp:368
Definition: AreaTriggerScript.h:24
std::map< uint32, time_t > _triggerTimes
Definition: areatrigger_scripts.cpp:410

References _triggerTimes, AT_BREWFEST_DUN_MOROGH, and AT_BREWFEST_DUROTAR.

Member Function Documentation

◆ OnTrigger()

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

Reimplemented from AreaTriggerScript.

385 {
386 uint32 triggerId = trigger->entry;
387 // Second trigger happened too early after first, skip for now
389 return false;
390
391 switch (triggerId)
392 {
394 if (Creature* tapper = player->FindNearestCreature(NPC_TAPPER_SWINDLEKEG, 20.0f))
395 tapper->AI()->Talk(SAY_WELCOME, player);
396 break;
398 if (Creature* ipfelkofer = player->FindNearestCreature(NPC_IPFELKOFER_IRONKEG, 20.0f))
399 ipfelkofer->AI()->Talk(SAY_WELCOME, player);
400 break;
401 default:
402 break;
403 }
404
405 _triggerTimes[triggerId] = GameTime::GetGameTime().count();
406 return false;
407 }
std::uint32_t uint32
Definition: Define.h:108
@ NPC_IPFELKOFER_IRONKEG
Definition: areatrigger_scripts.cpp:365
@ SAY_WELCOME
Definition: areatrigger_scripts.cpp:370
@ AREATRIGGER_TALK_COOLDOWN
Definition: areatrigger_scripts.cpp:372
@ NPC_TAPPER_SWINDLEKEG
Definition: areatrigger_scripts.cpp:364
Seconds GetGameTime()
Definition: GameTime.cpp:38
Definition: Creature.h:46
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434

References _triggerTimes, AREATRIGGER_TALK_COOLDOWN, AT_BREWFEST_DUN_MOROGH, AT_BREWFEST_DUROTAR, AreaTrigger::entry, WorldObject::FindNearestCreature(), GameTime::GetGameTime(), NPC_IPFELKOFER_IRONKEG, NPC_TAPPER_SWINDLEKEG, and SAY_WELCOME.

Member Data Documentation

◆ _triggerTimes

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