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:
Stoabrogga
2019-06-14 07:51:29 +02:00
committed by Poszer
parent 613bb9d002
commit 5da61f1167
4 changed files with 59 additions and 1 deletions

View File

@@ -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);