Renamed PickRandom to SelectRandom

This commit is contained in:
hondacrx
2017-06-21 11:57:04 -04:00
parent d16d6d57f0
commit 430507a10a
28 changed files with 54 additions and 53 deletions
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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];
+1 -1
View File
@@ -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];
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -204,7 +204,7 @@ namespace Game
}).ToList();
if (!usableDisplays.Empty())
preferredMountDisplay = usableDisplays.PickRandom().DisplayID;
preferredMountDisplay = usableDisplays.SelectRandom().DisplayID;
}
}
}
+1 -1
View File
@@ -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
}
+2 -2
View File
@@ -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 <limit> random quests
do
{
ulong questId = newQuests.PickRandom();
ulong questId = newQuests.SelectRandom();
spawns.ActivateObject<Quest>(questId, poolId);
PoolObject tempObj = new PoolObject(questId, 0.0f);
Spawn1Object(tempObj);
+1 -1
View File
@@ -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))
+2 -2
View File
@@ -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);
}
}
}