Misc fixes

This commit is contained in:
hondacrx
2024-01-28 15:23:54 -05:00
parent 6f4b7ddd9d
commit dbf63667ae
5 changed files with 16 additions and 4 deletions
@@ -120,6 +120,18 @@ namespace System.Collections.Generic
list.Resize(size);
}
public static void RandomShuffle<T>(this IList<T> 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<T>(this IList<T> array, int first, int count)
{
for (int n = count; n > 1;)
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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());