From 430507a10ae5a70831940eab1b7ada4f42bd2ef3 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 21 Jun 2017 11:57:04 -0400 Subject: [PATCH] Renamed PickRandom to SelectRandom --- Framework/Util/CollectionExtensions.cs | 21 ++++++++++--------- Game/AI/CoreAI/UnitAI.cs | 4 ++-- Game/AI/SmartScripts/SmartScript.cs | 2 +- Game/BattlePets/BattlePetManager.cs | 4 ++-- Game/DataStorage/DB2Manager.cs | 2 +- Game/DungeonFinding/LFGQueue.cs | 2 +- Game/Entities/GameObject/GameObject.cs | 2 +- Game/Entities/Unit/Unit.cs | 2 +- Game/Handlers/TaxiHandler.cs | 2 +- Game/Loot/LootManager.cs | 2 +- Game/Pools/PoolManager.cs | 4 ++-- Game/Spells/Auras/AuraEffect.cs | 2 +- Game/Spells/SpellEffects.cs | 4 ++-- .../Karazhan/AttumenMidnight.cs | 2 +- .../AzjolNerub/Ahnkahet/InstanceAhnahet.cs | 2 +- .../AzjolNerub/AzjolNerub/BossAnubarak.cs | 2 +- .../AzjolNerub/BossKrikthirTheGatewatcher.cs | 2 +- .../TrialOfTheCrusader/LordJaraxxus.cs | 2 +- Scripts/Northrend/Dalaran.cs | 2 +- .../IcecrownCitadel/GunshipBattle.cs | 4 ++-- .../IcecrownCitadel/IcecrownCitadel.cs | 6 +++--- .../IcecrownCitadel/LadyDeathwhisper.cs | 4 ++-- Scripts/Northrend/Ulduar/FlameLeviathan.cs | 2 +- Scripts/Northrend/Ulduar/Mimiron.cs | 12 +++++------ Scripts/Spells/Druid.cs | 2 +- Scripts/Spells/Items.cs | 8 +++---- Scripts/Spells/Rogue.cs | 2 +- Scripts/World/NpcSpecial.cs | 2 +- 28 files changed, 54 insertions(+), 53 deletions(-) diff --git a/Framework/Util/CollectionExtensions.cs b/Framework/Util/CollectionExtensions.cs index 808332aab..a72b0b684 100644 --- a/Framework/Util/CollectionExtensions.cs +++ b/Framework/Util/CollectionExtensions.cs @@ -80,16 +80,6 @@ namespace System.Collections.Generic collection.RemoveAll(check.Invoke); } - public static T PickRandom(this IEnumerable source) - { - return source.PickRandom(1).Single(); - } - - public static IEnumerable PickRandom(this IEnumerable source, uint count) - { - return source.Shuffle().Take((int)count); - } - public static IEnumerable Shuffle(this IEnumerable source) { return source.OrderBy(x => Guid.NewGuid()); @@ -136,6 +126,17 @@ namespace System.Collections.Generic list = listCopy; } + + public static T SelectRandom(this IEnumerable source) + { + return source.SelectRandom(1).Single(); + } + + public static IEnumerable SelectRandom(this IEnumerable source, uint count) + { + return source.Shuffle().Take((int)count); + } + public static T SelectRandomElementByWeight(this IEnumerable sequence, Func weightSelector) { float totalWeight = sequence.Sum(weightSelector); diff --git a/Game/AI/CoreAI/UnitAI.cs b/Game/AI/CoreAI/UnitAI.cs index ee48fd34b..7a5e7f6a2 100644 --- a/Game/AI/CoreAI/UnitAI.cs +++ b/Game/AI/CoreAI/UnitAI.cs @@ -159,7 +159,7 @@ namespace Game.AI } case SelectAggroTarget.Random: { - return targetList.PickRandom(); + return targetList.SelectRandom(); } default: break; @@ -197,7 +197,7 @@ namespace Game.AI targetList.Reverse(); if (targetType == SelectAggroTarget.Random) - targetList = targetList.PickRandom(maxTargets).ToList(); + targetList = targetList.SelectRandom(maxTargets).ToList(); else targetList.Resize(maxTargets); diff --git a/Game/AI/SmartScripts/SmartScript.cs b/Game/AI/SmartScripts/SmartScript.cs index 3df3ba3a0..852edc9ba 100644 --- a/Game/AI/SmartScripts/SmartScript.cs +++ b/Game/AI/SmartScripts/SmartScript.cs @@ -2302,7 +2302,7 @@ namespace Game.AI { if (IsUnit(obj)) { - uint sound = sounds.PickRandom(); + uint sound = sounds.SelectRandom(); obj.PlayDirectSound(sound, onlySelf ? obj.ToPlayer() : null); Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: {0} ({1}), sound: {2}, onlyself: {3}", obj.GetName(), obj.GetGUID().ToString(), sound, onlySelf); diff --git a/Game/BattlePets/BattlePetManager.cs b/Game/BattlePets/BattlePetManager.cs index d7f9ff6d9..6018eb71d 100644 --- a/Game/BattlePets/BattlePetManager.cs +++ b/Game/BattlePets/BattlePetManager.cs @@ -129,7 +129,7 @@ namespace Game.BattlePets if (list.Empty()) return 3; // default B/B - return list.PickRandom(); + return list.SelectRandom(); } public static byte GetDefaultPetQuality(uint species) @@ -263,7 +263,7 @@ namespace Game.BattlePets byte quality = 0; if (_availableBreedsPerSpecies.ContainsKey(species)) - breed = _availableBreedsPerSpecies[species].PickRandom(); + breed = _availableBreedsPerSpecies[species].SelectRandom(); if (_defaultQualityPerSpecies.ContainsKey(species)) quality = _defaultQualityPerSpecies[species]; diff --git a/Game/DataStorage/DB2Manager.cs b/Game/DataStorage/DB2Manager.cs index a615aa8be..6d8dafaea 100644 --- a/Game/DataStorage/DB2Manager.cs +++ b/Game/DataStorage/DB2Manager.cs @@ -963,7 +963,7 @@ namespace Game.DataStorage if (listNameGen[gender].Empty()) return ""; - LocalizedString data = listNameGen[gender].PickRandom().Name; + LocalizedString data = listNameGen[gender].SelectRandom().Name; if (data.HasString(locale)) return data[locale]; diff --git a/Game/DungeonFinding/LFGQueue.cs b/Game/DungeonFinding/LFGQueue.cs index 1605f2d05..381abd1fc 100644 --- a/Game/DungeonFinding/LFGQueue.cs +++ b/Game/DungeonFinding/LFGQueue.cs @@ -526,7 +526,7 @@ namespace Game.DungeonFinding proposal.cancelTime = Time.UnixTime + SharedConst.LFGTimeProposal; proposal.state = LfgProposalState.Initiating; proposal.leader = ObjectGuid.Empty; - proposal.dungeonId = proposalDungeons.PickRandom(); + proposal.dungeonId = proposalDungeons.SelectRandom(); bool leader = false; foreach (var rolePair in proposalRoles) diff --git a/Game/Entities/GameObject/GameObject.cs b/Game/Entities/GameObject/GameObject.cs index 952dfdd84..c10afe6eb 100644 --- a/Game/Entities/GameObject/GameObject.cs +++ b/Game/Entities/GameObject/GameObject.cs @@ -1613,7 +1613,7 @@ namespace Game.Entities for (uint i = 0; i < info.Ritual.casterTargetSpellTargets; i++) { // m_unique_users can contain only player GUIDs - Player target = Global.ObjAccessor.GetPlayer(this, m_unique_users.PickRandom()); + Player target = Global.ObjAccessor.GetPlayer(this, m_unique_users.SelectRandom()); if (target != null) spellCaster.CastSpell(target, info.Ritual.casterTargetSpell, true); } diff --git a/Game/Entities/Unit/Unit.cs b/Game/Entities/Unit/Unit.cs index 148926d19..713196532 100644 --- a/Game/Entities/Unit/Unit.cs +++ b/Game/Entities/Unit/Unit.cs @@ -800,7 +800,7 @@ namespace Game.Entities return null; // select random - return targets.PickRandom(); + return targets.SelectRandom(); } public void EnterVehicle(Unit Base, sbyte seatId = -1) diff --git a/Game/Handlers/TaxiHandler.cs b/Game/Handlers/TaxiHandler.cs index 9ce5c8ad9..097c3f535 100644 --- a/Game/Handlers/TaxiHandler.cs +++ b/Game/Handlers/TaxiHandler.cs @@ -204,7 +204,7 @@ namespace Game }).ToList(); if (!usableDisplays.Empty()) - preferredMountDisplay = usableDisplays.PickRandom().DisplayID; + preferredMountDisplay = usableDisplays.SelectRandom().DisplayID; } } } diff --git a/Game/Loot/LootManager.cs b/Game/Loot/LootManager.cs index c6830615e..79a459897 100644 --- a/Game/Loot/LootManager.cs +++ b/Game/Loot/LootManager.cs @@ -1063,7 +1063,7 @@ namespace Game.Loots possibleLoot = EqualChanced; possibleLoot.RemoveAll(new LootGroupInvalidSelector(loot, lootMode).Check); if (!possibleLoot.Empty()) // If nothing selected yet - an item is taken from equal-chanced part - return possibleLoot.PickRandom(); + return possibleLoot.SelectRandom(); return null; // Empty drop from the group } diff --git a/Game/Pools/PoolManager.cs b/Game/Pools/PoolManager.cs index 933d2839a..4efc27605 100644 --- a/Game/Pools/PoolManager.cs +++ b/Game/Pools/PoolManager.cs @@ -822,7 +822,7 @@ namespace Game { do { - ulong questId = currentQuests.PickRandom(); + ulong questId = currentQuests.SelectRandom(); newQuests.Add(questId); currentQuests.Remove(questId); } while (newQuests.Count < limit && !currentQuests.Empty()); // failsafe @@ -834,7 +834,7 @@ namespace Game // activate random quests do { - ulong questId = newQuests.PickRandom(); + ulong questId = newQuests.SelectRandom(); spawns.ActivateObject(questId, poolId); PoolObject tempObj = new PoolObject(questId, 0.0f); Spawn1Object(tempObj); diff --git a/Game/Spells/Auras/AuraEffect.cs b/Game/Spells/Auras/AuraEffect.cs index 0e64da304..643c4dcaf 100644 --- a/Game/Spells/Auras/AuraEffect.cs +++ b/Game/Spells/Auras/AuraEffect.cs @@ -2110,7 +2110,7 @@ namespace Game.Spells }).ToList(); if (!usableDisplays.Empty()) - displayId = usableDisplays.PickRandom().DisplayID; + displayId = usableDisplays.SelectRandom().DisplayID; } // TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue) //if (MountVehicle const* mountVehicle = sObjectMgr->GetMountVehicle(mountEntry->Id)) diff --git a/Game/Spells/SpellEffects.cs b/Game/Spells/SpellEffects.cs index 7433e4322..719aa6917 100644 --- a/Game/Spells/SpellEffects.cs +++ b/Game/Spells/SpellEffects.cs @@ -294,7 +294,7 @@ namespace Game.Spells int maxTargets = Math.Min(3, attackers.Count); for (uint i = 0; i < maxTargets; ++i) { - Unit attacker = attackers.PickRandom(); + Unit attacker = attackers.SelectRandom(); AddUnitTarget(attacker, 1 << 1); attackers.Remove(attacker); } @@ -1408,7 +1408,7 @@ namespace Game.Spells if (!avalibleElixirs.Empty()) { // cast random elixir on target - m_caster.CastSpell(unitTarget, (uint)avalibleElixirs.PickRandom(), true, m_CastItem); + m_caster.CastSpell(unitTarget, (uint)avalibleElixirs.SelectRandom(), true, m_CastItem); } } } diff --git a/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs b/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs index d35a1a1cd..6fe5892e9 100644 --- a/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs +++ b/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs @@ -158,7 +158,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight } Unit target = null; if (!target_list.Empty()) - target = target_list.PickRandom(); + target = target_list.SelectRandom(); DoCast(target, SpellIds.BerserkerCharge); ChargeTimer = 20000; diff --git a/Scripts/Northrend/AzjolNerub/Ahnkahet/InstanceAhnahet.cs b/Scripts/Northrend/AzjolNerub/Ahnkahet/InstanceAhnahet.cs index d9c5cd4d6..56635d705 100644 --- a/Scripts/Northrend/AzjolNerub/Ahnkahet/InstanceAhnahet.cs +++ b/Scripts/Northrend/AzjolNerub/Ahnkahet/InstanceAhnahet.cs @@ -210,7 +210,7 @@ namespace Scripts.Northrend.AzjolNerub.Ahnkahet if (vInitiands.Empty()) return ObjectGuid.Empty; - return vInitiands.PickRandom(); + return vInitiands.SelectRandom(); } case DataTypes.AddJedogaVictim: return JedogaSacrifices; diff --git a/Scripts/Northrend/AzjolNerub/AzjolNerub/BossAnubarak.cs b/Scripts/Northrend/AzjolNerub/AzjolNerub/BossAnubarak.cs index 1d6e32d0a..c837dbd50 100644 --- a/Scripts/Northrend/AzjolNerub/AzjolNerub/BossAnubarak.cs +++ b/Scripts/Northrend/AzjolNerub/AzjolNerub/BossAnubarak.cs @@ -205,7 +205,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Anubarak me.GetCreatureListWithEntryInGrid(triggers, CreatureIds.WorldTrigger); if (!triggers.Empty()) { - var it = triggers.PickRandom(); + var it = triggers.SelectRandom(); it.CastSpell(it, SpellIds.SummonDarter, true); _events.Repeat(TimeSpan.FromSeconds(11)); } diff --git a/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs b/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs index 7aa578a46..5f48b16d2 100644 --- a/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs +++ b/Scripts/Northrend/AzjolNerub/AzjolNerub/BossKrikthirTheGatewatcher.cs @@ -889,7 +889,7 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher if (!targetList.Empty()) { // If there are, pick one of them at random - target = targetList.PickRandom(); + target = targetList.SelectRandom(); } // And hit only that one targetList.Clear(); diff --git a/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/LordJaraxxus.cs b/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/LordJaraxxus.cs index 10ac2b530..b8335fb13 100644 --- a/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/LordJaraxxus.cs +++ b/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/LordJaraxxus.cs @@ -543,7 +543,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader if (targets.Empty()) return; - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.Clear(); targets.Add(target); } diff --git a/Scripts/Northrend/Dalaran.cs b/Scripts/Northrend/Dalaran.cs index c6472ebb2..9bf54accf 100644 --- a/Scripts/Northrend/Dalaran.cs +++ b/Scripts/Northrend/Dalaran.cs @@ -162,7 +162,7 @@ namespace Scripts.Northrend if (PlayerInDalaranList.Empty()) return null; - return PlayerInDalaranList.PickRandom(); + return PlayerInDalaranList.SelectRandom(); } void SendMailToPlayer(Player player) diff --git a/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs b/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs index 246575ba8..bf27a09cf 100644 --- a/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs +++ b/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs @@ -2188,7 +2188,7 @@ namespace Scripts.Northrend.IcecrownCitadel if (!targets.Empty()) { - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.Clear(); targets.Add(target); } @@ -2250,7 +2250,7 @@ namespace Scripts.Northrend.IcecrownCitadel { if (!targets.Empty()) { - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.Clear(); targets.Add(target); } diff --git a/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs b/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs index ca0b41d59..051cc0543 100644 --- a/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs +++ b/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs @@ -1154,7 +1154,7 @@ namespace Scripts.Northrend.IcecrownCitadel case EventTypes.ArnathPwShield: { List targets = DoFindFriendlyMissingBuff(40.0f, InstanceSpells.SpellPowerWordShield(IsUndead)); - DoCast(targets.PickRandom(), InstanceSpells.SpellPowerWordShield(IsUndead)); + DoCast(targets.SelectRandom(), InstanceSpells.SpellPowerWordShield(IsUndead)); _events.ScheduleEvent(EventTypes.ArnathPwShield, RandomHelper.URand(15000, 20000)); break; } @@ -1656,7 +1656,7 @@ namespace Scripts.Northrend.IcecrownCitadel if (!targets.Empty()) { - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.Clear(); targets.Add(target); } @@ -1737,7 +1737,7 @@ namespace Scripts.Northrend.IcecrownCitadel return true; }); - targets = targets.PickRandom(2).ToList(); + targets = targets.SelectRandom(2).ToList(); } void Land(uint effIndex) diff --git a/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs b/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs index fbb36f636..b0e3fb10a 100644 --- a/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs +++ b/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs @@ -588,7 +588,7 @@ namespace Scripts.Northrend.IcecrownCitadel if (temp.Empty()) return; - Creature cultist = temp.PickRandom(); + Creature cultist = temp.SelectRandom(); DoCast(cultist, LadySpells.DARK_MARTYRDOM_T, true); } @@ -611,7 +611,7 @@ namespace Scripts.Northrend.IcecrownCitadel return; // select random cultist - Creature cultist = temp.PickRandom(); + Creature cultist = temp.SelectRandom(); DoCast(cultist, cultist.GetEntry() == CreatureIds.CultFanatic ? LadySpells.DARK_TRANSFORMATION_T : LadySpells.DARK_EMPOWERMENT_T, true); Talk(cultist.GetEntry() == CreatureIds.CultFanatic ? LadyTexts.SAY_DARK_TRANSFORMATION : LadyTexts.SAY_DARK_EMPOWERMENT); } diff --git a/Scripts/Northrend/Ulduar/FlameLeviathan.cs b/Scripts/Northrend/Ulduar/FlameLeviathan.cs index 8805ef7e7..79e338908 100644 --- a/Scripts/Northrend/Ulduar/FlameLeviathan.cs +++ b/Scripts/Northrend/Ulduar/FlameLeviathan.cs @@ -1639,7 +1639,7 @@ namespace Scripts.Northrend.Ulduar else { //! In the end, only one target should be selected - _target = targets.PickRandom(); + _target = targets.SelectRandom(); FilterTargetsSubsequently(targets); } } diff --git a/Scripts/Northrend/Ulduar/Mimiron.cs b/Scripts/Northrend/Ulduar/Mimiron.cs index e50d6d915..57b4638c1 100644 --- a/Scripts/Northrend/Ulduar/Mimiron.cs +++ b/Scripts/Northrend/Ulduar/Mimiron.cs @@ -1829,7 +1829,7 @@ namespace Scripts.Northrend.Ulduar if (_noTarget) return; - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.Clear(); targets.Add(target); } @@ -1964,12 +1964,12 @@ namespace Scripts.Northrend.Ulduar if (targets.Empty()) return; - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.RemoveAll(new AllWorldObjectsInRange(GetCaster(), 15.0f).Invoke); if (!targets.Empty()) - target = targets.PickRandom(); + target = targets.SelectRandom(); targets.Clear(); targets.Add(target); @@ -2289,12 +2289,12 @@ namespace Scripts.Northrend.Ulduar if (targets.Empty()) return; - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.RemoveAll(new AllWorldObjectsInRange(GetCaster(), 15.0f).Invoke); if (!targets.Empty()) - target = targets.PickRandom(); + target = targets.SelectRandom(); targets.Clear(); targets.Add(target); @@ -2567,7 +2567,7 @@ namespace Scripts.Northrend.Ulduar if (targets.Empty()) return; - WorldObject target = targets.PickRandom(); + WorldObject target = targets.SelectRandom(); targets.Clear(); targets.Add(target); diff --git a/Scripts/Spells/Druid.cs b/Scripts/Spells/Druid.cs index 171e86f4a..6935091df 100644 --- a/Scripts/Spells/Druid.cs +++ b/Scripts/Spells/Druid.cs @@ -1040,7 +1040,7 @@ namespace Scripts.Spells.Druid return; } - Unit target = tempTargets.PickRandom(); + Unit target = tempTargets.SelectRandom(); targets.Clear(); targets.Add(target); } diff --git a/Scripts/Spells/Items.cs b/Scripts/Spells/Items.cs index eb113404a..90375b746 100644 --- a/Scripts/Spells/Items.cs +++ b/Scripts/Spells/Items.cs @@ -734,7 +734,7 @@ namespace Scripts.Spells.Items PreventDefaultAction(); Unit caster = eventInfo.GetActor(); - uint spellId = triggeredSpells[(int)caster.GetClass()].PickRandom(); + uint spellId = triggeredSpells[(int)caster.GetClass()].SelectRandom(); caster.CastSpell(caster, spellId, true); if (RandomHelper.randChance(10)) @@ -960,7 +960,7 @@ namespace Scripts.Spells.Items if (randomSpells.Empty()) return; - uint spellId = randomSpells.PickRandom(); + uint spellId = randomSpells.SelectRandom(); caster.CastSpell(caster, spellId, true); } @@ -1293,7 +1293,7 @@ namespace Scripts.Spells.Items return; } - caster.CastSpell(caster, possibleSpells.PickRandom(), true); + caster.CastSpell(caster, possibleSpells.SelectRandom(), true); } public override void Register() @@ -2357,7 +2357,7 @@ namespace Scripts.Spells.Items void HandleTeleport(uint effIndex) { PreventHitDefaultEffect(effIndex); - uint spellId = SpellIds.WormholeTargetLocations.PickRandom(); + uint spellId = SpellIds.WormholeTargetLocations.SelectRandom(); GetCaster().CastSpell(GetHitUnit(), spellId, true); } diff --git a/Scripts/Spells/Rogue.cs b/Scripts/Spells/Rogue.cs index 28d419b08..d4b68386f 100644 --- a/Scripts/Spells/Rogue.cs +++ b/Scripts/Spells/Rogue.cs @@ -94,7 +94,7 @@ namespace Scripts.Spells.Rogue { while (!_targets.Empty()) { - ObjectGuid guid = _targets.PickRandom(); + ObjectGuid guid = _targets.SelectRandom(); Unit target = Global.ObjAccessor.GetUnit(GetTarget(), guid); if (target) { diff --git a/Scripts/World/NpcSpecial.cs b/Scripts/World/NpcSpecial.cs index 12dbebd7d..46a44faa7 100644 --- a/Scripts/World/NpcSpecial.cs +++ b/Scripts/World/NpcSpecial.cs @@ -769,7 +769,7 @@ namespace Scripts.World.NpcSpecial if (!targets.Empty()) { - _lastTargetGUID = targets.PickRandom().GetGUID(); + _lastTargetGUID = targets.SelectRandom().GetGUID(); return _lastTargetGUID; }