mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(DB/Core): Play "Lament of the Highborne" as music instead of sound (#1926)
* fix(DB/Core): Play "Lament of the Highborne" as music instead of sound * Update ScriptedCreature.cpp * Update rev_1559456042362460279.sql * Update rev_1559456042362460279.sql * Update rev_1559456042362460279.sql * Update rev_1559456042362460279.sql
This commit is contained in:
@@ -205,6 +205,45 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
|
||||
source->PlayDirectSound(soundId);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoPlayMusic(uint32 soundId, bool zone)
|
||||
{
|
||||
ObjectList* targets = NULL;
|
||||
|
||||
if (me && me->FindMap())
|
||||
{
|
||||
Map::PlayerList const &players = me->GetMap()->GetPlayers();
|
||||
targets = new ObjectList();
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
if (player->GetZoneId() == me->GetZoneId())
|
||||
{
|
||||
if (!zone)
|
||||
{
|
||||
if (player->GetAreaId() == me->GetAreaId())
|
||||
targets->push_back(player);
|
||||
}
|
||||
else
|
||||
targets->push_back(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (targets)
|
||||
{
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
(*itr)->SendPlayMusic(soundId, true);
|
||||
}
|
||||
|
||||
delete targets;
|
||||
}
|
||||
}
|
||||
|
||||
Creature* ScriptedAI::DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
|
||||
{
|
||||
return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime);
|
||||
|
||||
Reference in New Issue
Block a user