diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 3594f9da6..d55e7ac7d 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -2447,7 +2447,7 @@ namespace Game.AI WorldObject obj = GetBaseObject(); if (obj != null) { - obj.GetMap().SetZoneOverrideLight(e.Action.overrideLight.zoneId, e.Action.overrideLight.areaLightId, e.Action.overrideLight.overrideLightId, e.Action.overrideLight.transitionMilliseconds); + obj.GetMap().SetZoneOverrideLight(e.Action.overrideLight.zoneId, e.Action.overrideLight.areaLightId, e.Action.overrideLight.overrideLightId, TimeSpan.FromMilliseconds(e.Action.overrideLight.transitionMilliseconds)); Log.outDebug(LogFilter.ScriptsAi, $"SmartScript::ProcessAction: SMART_ACTION_OVERRIDE_LIGHT: {obj.GetGUID()} sets zone override light (zoneId: {e.Action.overrideLight.zoneId}, " + $"areaLightId: {e.Action.overrideLight.areaLightId}, overrideLightId: {e.Action.overrideLight.overrideLightId}, transitionMilliseconds: {e.Action.overrideLight.transitionMilliseconds})"); } diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index 8460db12a..8f27fd908 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -3566,7 +3566,7 @@ namespace Game.Maps } } - public void SetZoneOverrideLight(uint zoneId, uint areaLightId, uint overrideLightId, uint transitionMilliseconds) + public void SetZoneOverrideLight(uint zoneId, uint areaLightId, uint overrideLightId, TimeSpan transitionTime) { if (!_zoneDynamicInfo.ContainsKey(zoneId)) _zoneDynamicInfo[zoneId] = new ZoneDynamicInfo(); @@ -3581,7 +3581,7 @@ namespace Game.Maps ZoneDynamicInfo.LightOverride lightOverride = new(); lightOverride.AreaLightId = areaLightId; lightOverride.OverrideLightId = overrideLightId; - lightOverride.TransitionMilliseconds = transitionMilliseconds; + lightOverride.TransitionMilliseconds = (uint)transitionTime.TotalMilliseconds; info.LightOverrides.Add(lightOverride); } @@ -3592,7 +3592,7 @@ namespace Game.Maps OverrideLight overrideLight = new(); overrideLight.AreaLightID = areaLightId; overrideLight.OverrideLightID = overrideLightId; - overrideLight.TransitionMilliseconds = transitionMilliseconds; + overrideLight.TransitionMilliseconds = (uint)transitionTime.TotalMilliseconds; foreach (var player in players) if (player.GetZoneId() == zoneId)