AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_midsummer_music::go_midsummer_musicAI Struct Reference
Inheritance diagram for go_midsummer_music::go_midsummer_musicAI:
GameObjectAI

Public Member Functions

 go_midsummer_musicAI (GameObject *go)
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from GameObjectAI
 GameObjectAI (GameObject *go)
 
virtual ~GameObjectAI ()
 
virtual void UpdateAI (uint32)
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual void SetGUID (ObjectGuid, int32)
 
virtual ObjectGuid GetGUID (int32) const
 
virtual bool GossipHello (Player *, bool)
 
virtual bool GossipSelect (Player *, uint32, uint32)
 
virtual bool GossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual bool QuestAccept (Player *, Quest const *)
 
virtual bool QuestReward (Player *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *)
 
virtual void Destroyed (Player *, uint32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void OnGameEvent (bool, uint16)
 
virtual void OnStateChanged (uint32, Unit *)
 
virtual void EventInform (uint32)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual void JustSummoned (Creature *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 

Private Attributes

EventMap _events
 

Additional Inherited Members

- Static Public Member Functions inherited from GameObjectAI
static int32 Permissible (GameObject const *go)
 
- Protected Attributes inherited from GameObjectAI
GameObject *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ go_midsummer_musicAI()

go_midsummer_music::go_midsummer_musicAI::go_midsummer_musicAI ( GameObject go)
inline
834 : GameObjectAI(go)
835 {
837 }
@ EVENT_MM_START_MUSIC
Definition: go_scripts.cpp:824
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
Definition: GameObjectAI.h:33
EventMap _events
Definition: go_scripts.cpp:876

References _events, EVENT_MM_START_MUSIC, and EventMap::ScheduleEvent().

Member Function Documentation

◆ UpdateAI()

void go_midsummer_music::go_midsummer_musicAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from GameObjectAI.

840 {
841 _events.Update(diff);
842 while (uint32 eventId = _events.ExecuteEvent())
843 {
844 switch (eventId)
845 {
847 {
849 break;
850
851 std::list<Player*> targets;
855 for (Player* player : targets)
856 {
857 if (player->GetTeamId() == TEAM_HORDE)
858 {
860 }
861 else
862 {
864 }
865 }
866
867 _events.ScheduleEvent(EVENT_MM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
868 break;
869 }
870 default:
871 break;
872 }
873 }
874 }
std::uint32_t uint32
Definition: Define.h:107
@ EVENTMIDSUMMERFIREFESTIVAL_A
Definition: go_scripts.cpp:818
@ EVENTMIDSUMMERFIREFESTIVAL_H
Definition: go_scripts.cpp:819
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ HOLIDAY_FIRE_FESTIVAL
Definition: SharedDefines.h:2756
bool IsHolidayActive(HolidayIds id)
Definition: GameEventMgr.cpp:1909
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
GameObject *const me
Definition: GameObjectAI.h:35
void PlayDirectMusic(uint32 music_id, Player *target=nullptr)
Definition: Object.cpp:2927
float GetVisibilityRange() const
Definition: Object.cpp:1656
Definition: Player.h:1081
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:192
Definition: GridNotifiers.h:541
Definition: GridNotifiers.h:1354

References _events, EVENT_MM_START_MUSIC, EVENTMIDSUMMERFIREFESTIVAL_A, EVENTMIDSUMMERFIREFESTIVAL_H, EventMap::ExecuteEvent(), WorldObject::GetVisibilityRange(), HOLIDAY_FIRE_FESTIVAL, IsHolidayActive(), GameObjectAI::me, WorldObject::PlayDirectMusic(), EventMap::ScheduleEvent(), TEAM_HORDE, EventMap::Update(), and Cell::VisitWorldObjects().

Member Data Documentation

◆ _events

EventMap go_midsummer_music::go_midsummer_musicAI::_events
private

Referenced by go_midsummer_musicAI(), and UpdateAI().