public virtual void GivePowerScrolls()
{
List<Mobile> toGive = new List<Mobile>();
List<DamageStore> rights = GetLootingRights();
for (int i = rights.Count - 1; i >= 0; --i)
{
DamageStore ds = rights[i];
if (ds.m_HasRight && InRange(ds.m_Mobile, 100) && ds.m_Mobile.Map == this.Map)
toGive.Add(ds.m_Mobile);
}
if (toGive.Count == 0)
return;
for (int i = 0; i < toGive.Count; i++)
{
Mobile m = toGive[i];
if (!(m is PlayerMobile))
continue;
bool gainedPath = false;
int pointsToGain = 800;
if (VirtueHelper.Award(m, VirtueName.Valor, pointsToGain, ref gainedPath))
{
if (gainedPath)
m.SendLocalizedMessage(1054032); // You have gained a path in Valor!
else
m.SendLocalizedMessage(1054030); // You have gained in Valor!
//No delay on Valor gains
}
}
// Randomize - Primers
for (int i = 0; i < toGive.Count; ++i)
{
int rand = Utility.Random(toGive.Count);
Mobile hold = toGive[i];
toGive[i] = toGive[rand];
toGive[rand] = hold;
}
if (this.Map != Map.Felucca)
{
for (int i = 0; i < ChampionSystem.PowerScrollAmount; ++i)
{
Mobile m = toGive[i % toGive.Count];
SkillMasteryPrimer p = CreateRandomPrimer();
m.SendLocalizedMessage(1156209); // You have received a mastery primer!
GivePowerScrollTo(m, p, this);
}
}
else
{
for (int i = 0; i < CHANGETOAMOUNTGIVENINFEL; ++i)
{
Mobile m = toGive[i % toGive.Count];
SkillMasteryPrimer p = CreateRandomPrimer();
m.SendLocalizedMessage(1156209); // You have received a mastery primer!
GivePowerScrollTo(m, p, this);
}
}
if (this.Map != Map.Felucca)
return;
// Randomize - PowerScrolls
for (int i = 0; i < toGive.Count; ++i)
{
int rand = Utility.Random(toGive.Count);
Mobile hold = toGive[i];
toGive[i] = toGive[rand];
toGive[rand] = hold;
}
for (int i = 0; i < ChampionSystem.PowerScrollAmount; ++i)
{
Mobile m = toGive[i % toGive.Count];
PowerScroll ps = CreateRandomPowerScroll();
m.SendLocalizedMessage(1049524); // You have received a scroll of power!
GivePowerScrollTo(m, ps, this);
}
ColUtility.Free(toGive);
}