mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Core/Event: Add Darkmoon Fair Music during the event
This commit is contained in:
2
sql/updates/world/3.3.5/2016_10_08_02_world_335.sql
Normal file
2
sql/updates/world/3.3.5/2016_10_08_02_world_335.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Update Darkmoon Faire Music Doodad script
|
||||
UPDATE `gameobject_template` SET `ScriptName`='go_darkmoon_faire_music' WHERE `entry`=180335;
|
||||
@@ -1397,6 +1397,62 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*####
|
||||
## go_darkmoon_faire_music
|
||||
####*/
|
||||
|
||||
enum DarkmoonFaireMusic
|
||||
{
|
||||
MUSIC_DARKMOON_FAIRE_MUSIC = 8440
|
||||
};
|
||||
|
||||
enum DarkmoonFaireMusicEvents
|
||||
{
|
||||
EVENT_DFM_START_MUSIC = 1
|
||||
};
|
||||
|
||||
class go_darkmoon_faire_music : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_darkmoon_faire_music() : GameObjectScript("go_darkmoon_faire_music") { }
|
||||
|
||||
struct go_darkmoon_faire_musicAI : public GameObjectAI
|
||||
{
|
||||
uint32 rnd;
|
||||
|
||||
go_darkmoon_faire_musicAI(GameObject* go) : GameObjectAI(go)
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_DFM_START_MUSIC, 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DFM_START_MUSIC:
|
||||
if (!IsHolidayActive(HOLIDAY_DARKMOON_FAIRE_ELWYNN) || !IsHolidayActive(HOLIDAY_DARKMOON_FAIRE_THUNDER) || !IsHolidayActive(HOLIDAY_DARKMOON_FAIRE_SHATTRATH))
|
||||
break;
|
||||
go->PlayDirectMusic(MUSIC_DARKMOON_FAIRE_MUSIC);
|
||||
_events.ScheduleEvent(EVENT_DFM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
GameObjectAI* GetAI(GameObject* go) const override
|
||||
{
|
||||
return new go_darkmoon_faire_musicAI(go);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_go_scripts()
|
||||
{
|
||||
new go_cat_figurine();
|
||||
@@ -1436,4 +1492,5 @@ void AddSC_go_scripts()
|
||||
new go_toy_train_set();
|
||||
new go_brewfest_music();
|
||||
new go_midsummer_music();
|
||||
new go_darkmoon_faire_music();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user