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

AreaTrigger_at_brewfest::AreaTrigger_at_brewfest ( )
inline
333 : AreaTriggerScript("at_brewfest")
334 {
335 // Initialize for cooldown
337 }
@ AT_BREWFEST_DUROTAR
Definition: areatrigger_scripts.cpp:322
@ AT_BREWFEST_DUN_MOROGH
Definition: areatrigger_scripts.cpp:323
Definition: AreaTriggerScript.h:24
std::map< uint32, time_t > _triggerTimes
Definition: areatrigger_scripts.cpp:365

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.

340 {
341 uint32 triggerId = trigger->entry;
342 // Second trigger happened too early after first, skip for now
344 return false;
345
346 switch (triggerId)
347 {
349 if (Creature* tapper = player->FindNearestCreature(NPC_TAPPER_SWINDLEKEG, 20.0f))
350 tapper->AI()->Talk(SAY_WELCOME, player);
351 break;
353 if (Creature* ipfelkofer = player->FindNearestCreature(NPC_IPFELKOFER_IRONKEG, 20.0f))
354 ipfelkofer->AI()->Talk(SAY_WELCOME, player);
355 break;
356 default:
357 break;
358 }
359
360 _triggerTimes[triggerId] = GameTime::GetGameTime().count();
361 return false;
362 }
std::uint32_t uint32
Definition: Define.h:107
@ NPC_IPFELKOFER_IRONKEG
Definition: areatrigger_scripts.cpp:320
@ SAY_WELCOME
Definition: areatrigger_scripts.cpp:325
@ AREATRIGGER_TALK_COOLDOWN
Definition: areatrigger_scripts.cpp:327
@ NPC_TAPPER_SWINDLEKEG
Definition: areatrigger_scripts.cpp:319
Seconds GetGameTime()
Definition: GameTime.cpp:38
Definition: Creature.h:43
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457

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