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

Public Member Functions

 AreaTrigger_at_sunwell_madrigosa ()
 
bool OnTrigger (Player *player, AreaTrigger const *) 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 ()
 

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

AreaTrigger_at_sunwell_madrigosa::AreaTrigger_at_sunwell_madrigosa ( )
inline
503: AreaTriggerScript("at_sunwell_madrigosa") {}
Definition: AreaTriggerScript.h:24

Member Function Documentation

◆ OnTrigger()

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

Reimplemented from AreaTriggerScript.

506 {
507 if (InstanceScript* instance = player->GetInstanceScript())
508 if (instance->GetBossState(DATA_MADRIGOSA) != DONE)
509 {
510 instance->SetBossState(DATA_MADRIGOSA, NOT_STARTED);
511 instance->SetBossState(DATA_MADRIGOSA, DONE);
512 if (Creature* creature = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_MADRIGOSA)))
513 creature->AI()->DoAction(ACTION_START_EVENT);
514 }
515
516 return true;
517 }
@ DONE
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:57
@ NPC_MADRIGOSA
Definition: sunwell_plateau.h:54
@ DATA_MADRIGOSA
Definition: sunwell_plateau.h:30
@ ACTION_START_EVENT
Definition: boss_brutallus.cpp:62
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Definition: Creature.h:46
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: InstanceScript.h:142

References ACTION_START_EVENT, DATA_MADRIGOSA, DONE, ObjectAccessor::GetCreature(), WorldObject::GetInstanceScript(), NOT_STARTED, and NPC_MADRIGOSA.