mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +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);
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#define CAST_AI(a, b) (dynamic_cast<a*>(b))
|
||||
|
||||
typedef std::list<WorldObject*> ObjectList;
|
||||
|
||||
class InstanceScript;
|
||||
|
||||
class SummonList
|
||||
@@ -237,6 +239,9 @@ struct ScriptedAI : public CreatureAI
|
||||
//Plays a sound to all nearby players
|
||||
void DoPlaySoundToSet(WorldObject* source, uint32 soundId);
|
||||
|
||||
//Plays music for all players in the zone (zone = true) or the area (zone = false)
|
||||
void DoPlayMusic(uint32 soundId, bool zone);
|
||||
|
||||
//Drops all threat to 0%. Does not remove players from the threat list
|
||||
void DoResetThreat();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user