From dbf63667aeaf33908367a8a1ac264aa818d5ba3c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 28 Jan 2024 15:23:54 -0500 Subject: [PATCH] Misc fixes --- Source/Framework/Util/CollectionExtensions.cs | 12 ++++++++++++ Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs | 2 +- Source/Scripts/BrokenIsles/ZoneMardum.cs | 2 +- Source/Scripts/World/GameObject.cs | 2 +- Source/Scripts/World/NpcsSpecial.cs | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Source/Framework/Util/CollectionExtensions.cs b/Source/Framework/Util/CollectionExtensions.cs index 9a019806d..9b855adf5 100644 --- a/Source/Framework/Util/CollectionExtensions.cs +++ b/Source/Framework/Util/CollectionExtensions.cs @@ -120,6 +120,18 @@ namespace System.Collections.Generic list.Resize(size); } + public static void RandomShuffle(this IList array) + { + for (int n = array.Count; n > 1;) + { + int k = (int)RandomHelper.Rand32(n); + --n; + T temp = array[n]; + array[n] = array[k]; + array[k] = temp; + } + } + public static void RandomShuffle(this IList array, int first, int count) { for (int n = count; n > 1;) diff --git a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs index e70eaeace..d2db321bd 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs @@ -19,7 +19,7 @@ namespace Game.AI PostEvent = 0x10 //can be set at complete and allow post event to run } - class FollowerAI : ScriptedAI + public class FollowerAI : ScriptedAI { ObjectGuid _leaderGUID; uint _updateFollowTimer; diff --git a/Source/Scripts/BrokenIsles/ZoneMardum.cs b/Source/Scripts/BrokenIsles/ZoneMardum.cs index 0d72c4358..dfd70d766 100644 --- a/Source/Scripts/BrokenIsles/ZoneMardum.cs +++ b/Source/Scripts/BrokenIsles/ZoneMardum.cs @@ -667,7 +667,7 @@ namespace Scripts.BrokenIsles.ZoneMardum public override void OnSceneStart(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate) { - Creature sevisObject = player.FindNearestCreatureWithOptions(30.0f, new() { CreatureId = AshtongueIntroData.NpcSevisBrightflameAshtongue, IgnorePhases = true }); + Creature sevisObject = player.FindNearestCreatureWithOptions(30.0f, new() new FindCreatureOptions() { CreatureId = AshtongueIntroData.NpcSevisBrightflameAshtongue, IgnorePhases = true }); if (sevisObject == null) return; diff --git a/Source/Scripts/World/GameObject.cs b/Source/Scripts/World/GameObject.cs index fb1fbb1f3..0262be388 100644 --- a/Source/Scripts/World/GameObject.cs +++ b/Source/Scripts/World/GameObject.cs @@ -679,7 +679,7 @@ namespace Scripts.World.GameObjects _rings = 12; } - // Dwarf hourly horn should only play a Math.Single time, each time the next hour begins. + // Dwarf hourly horn should only play a Single time, each time the next hour begins. if (_soundId == BellHourlyConst.Belltolldwarfgnome) { _rings = 1; diff --git a/Source/Scripts/World/NpcsSpecial.cs b/Source/Scripts/World/NpcsSpecial.cs index 5db77838b..299b77b1e 100644 --- a/Source/Scripts/World/NpcsSpecial.cs +++ b/Source/Scripts/World/NpcsSpecial.cs @@ -620,7 +620,7 @@ namespace Scripts.World.NpcsSpecial Creature patient = me.SummonCreature(patientEntry, point, TempSummonType.TimedDespawnOutOfCombat, TimeSpan.FromSeconds(5)); if (patient != null) { - //303, this flag appear to be required for client side item.spell to work (TargetMath.SingleFriend) + //303, this flag appear to be required for client side item.spell to work (TargetSingleFriend) patient.SetUnitFlag(UnitFlags.PlayerControlled); Patients.Add(patient.GetGUID());