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
@@ -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;
@@ -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;
@@ -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));
}
@@ -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();
@@ -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);
}
+1 -1
View File
@@ -162,7 +162,7 @@ namespace Scripts.Northrend
if (PlayerInDalaranList.Empty())
return null;
return PlayerInDalaranList.PickRandom();
return PlayerInDalaranList.SelectRandom();
}
void SendMailToPlayer(Player player)
@@ -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);
}
@@ -1154,7 +1154,7 @@ namespace Scripts.Northrend.IcecrownCitadel
case EventTypes.ArnathPwShield:
{
List<Creature> 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)
@@ -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);
}
+1 -1
View File
@@ -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);
}
}
+6 -6
View File
@@ -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);
+1 -1
View File
@@ -1040,7 +1040,7 @@ namespace Scripts.Spells.Druid
return;
}
Unit target = tempTargets.PickRandom();
Unit target = tempTargets.SelectRandom();
targets.Clear();
targets.Add(target);
}
+4 -4
View File
@@ -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);
}
+1 -1
View File
@@ -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)
{
+1 -1
View File
@@ -769,7 +769,7 @@ namespace Scripts.World.NpcSpecial
if (!targets.Empty())
{
_lastTargetGUID = targets.PickRandom().GetGUID();
_lastTargetGUID = targets.SelectRandom().GetGUID();
return _lastTargetGUID;
}