Core/Scripting: fixed hourly bell sounds

Port From (https://github.com/TrinityCore/TrinityCore/commit/eae73794177f88cff626984b866d33e97b1d208c)
This commit is contained in:
hondacrx
2022-01-06 20:15:43 -05:00
parent d2ba807c20
commit 8586381f6a
+47 -11
View File
@@ -299,6 +299,19 @@ namespace Scripts.World.GameObjects
public const uint KharazhanMapid = 532; public const uint KharazhanMapid = 532;
} }
struct ZoneIds
{
public const uint Tirisfal = 85;
public const uint Undercity = 1497;
public const uint DunMorogh = 1;
public const uint Ironforge = 1537;
public const uint Teldrassil = 141;
public const uint Darnassus = 1657;
public const uint Ashenvale = 331;
public const uint HillsbradFoothills = 267;
public const uint Duskwood = 42;
}
struct Misc struct Misc
{ {
// These Are In Seconds // These Are In Seconds
@@ -1257,22 +1270,45 @@ namespace Scripts.World.GameObjects
public override void InitializeAI() public override void InitializeAI()
{ {
uint zoneId = me.GetZoneId();
switch (me.GetEntry()) switch (me.GetEntry())
{ {
case GameObjectIds.HordeBell: case GameObjectIds.HordeBell:
_soundId = me.GetAreaId() == AreaIds.Undercity ? SoundIds.BellTollHorde : SoundIds.BellTollTribal; {
break; switch (zoneId)
case GameObjectIds.AllianceBell:
{ {
if (me.GetAreaId() == AreaIds.Ironforge1 || me.GetAreaId() == AreaIds.Ironforge2) case ZoneIds.Tirisfal:
_soundId = SoundIds.BellTolldwarfgnome; case ZoneIds.Undercity:
else if (me.GetAreaId() == AreaIds.Darnassus || me.GetZoneId() == AreaIds.TeldrassilZone) case ZoneIds.HillsbradFoothills:
_soundId = SoundIds.BellTollNightelf; case ZoneIds.Duskwood:
else _soundId = SoundIds.BellTollHorde; // undead bell sound
_soundId = SoundIds.BellTollAlliance; break;
default:
break; _soundId = SoundIds.BellTollTribal; // orc drum sound
break;
} }
break;
}
case GameObjectIds.AllianceBell:
{
switch (zoneId)
{
case ZoneIds.Ironforge:
case ZoneIds.DunMorogh:
_soundId = SoundIds.BellTolldwarfgnome; // horn sound
break;
case ZoneIds.Darnassus:
case ZoneIds.Teldrassil:
case ZoneIds.Ashenvale:
_soundId = SoundIds.BellTollNightelf; // nightelf bell sound
break;
default:
_soundId = SoundIds.BellTollAlliance; // human bell sound
break;
}
break;
}
case GameObjectIds.KharazhanBell: case GameObjectIds.KharazhanBell:
_soundId = SoundIds.BellTollKharazhan; _soundId = SoundIds.BellTollKharazhan;
break; break;