Skip to content

Commit

Permalink
Merge pull request #1455 from kevin-10/master
Browse files Browse the repository at this point in the history
bug fixes
  • Loading branch information
kevin-10 committed Jan 18, 2017
2 parents 11d5bae + 0af5f8b commit 7e04544
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Scripts/Services/PointsSystems/CleanUpBritanniaData.cs
Expand Up @@ -27,6 +27,9 @@ public static double GetPoints(Item item)
{
double points = 0;

if (item is IVvVItem && ((IVvVItem)item).IsVvVItem)
return points;

Type type = item.GetType();

if (Entries.ContainsKey(type))
Expand Down
5 changes: 1 addition & 4 deletions Scripts/Spells/Skill Masteries/Core/MasteryInfo.cs
Expand Up @@ -263,16 +263,13 @@ public static void OnMasteryChanged(Mobile m, SkillName oldMastery)
}

RemovePassiveBuffs(m);

foreach (MasteryInfo info in Infos.Where(i => i.Passive))
{
if (IsActivePassive(m, info.PassiveSpell))
{
if (info.PassiveSpell == PassiveSpell.AnticipateHit)
continue;

//Console.WriteLine("Toggling {0} passive spell", info.PassiveSpell.ToString());

switch (info.PassiveSpell)
{
case PassiveSpell.EnchantedSummoning:
Expand Down Expand Up @@ -370,7 +367,7 @@ public static int GetSpellID(PassiveSpell spell)
{
case PassiveSpell.EnchantedSummoning: return 714;
case PassiveSpell.AnticipateHit: return 715;
case PassiveSpell.Intuition: return 716;
case PassiveSpell.Intuition: return 717;
case PassiveSpell.SavingThrow: return 732;
case PassiveSpell.Potency: return 738;
case PassiveSpell.Knockout: return 741;
Expand Down
16 changes: 16 additions & 0 deletions Scripts/Spells/Skill Masteries/Core/SkillMasteryPrimer.cs
Expand Up @@ -112,6 +112,22 @@ public static SkillMasteryPrimer GetRandom(Volume volume = Volume.Three, Volume
if (available.Count == 0)
return null;

if (volume == Volume.Three && exclude == Volume.One) // Random loot drop, vol 2 is 3x more likely to drop
{
List<MasteryInfo> copy = new List<MasteryInfo>(available);

copy.ForEach(i =>
{
if (i.Volume == Volume.Two)
{
available.Add(i);
available.Add(i);
}
});

ColUtility.Free(copy);
}

MasteryInfo random = available[Utility.Random(available.Count)];

SkillMasteryPrimer primer = new SkillMasteryPrimer(random.SpellID, random.MasterySkill);
Expand Down
28 changes: 28 additions & 0 deletions Scripts/Spells/Skill Masteries/Core/SkillMasterySpell.cs
Expand Up @@ -18,6 +18,7 @@ public abstract class SkillMasterySpell : Spell
public static void Initialize()
{
CommandSystem.Register("LearnAllMasteries", AccessLevel.GameMaster, LearnAllSpells);
CommandSystem.Register("RandomMastery", AccessLevel.GameMaster, RandomMastery);
}

public UpkeepTimer Timer { get; set; }
Expand Down Expand Up @@ -1085,5 +1086,32 @@ public static void LearnAllSpells(CommandEventArgs e)
}
});
}

[Usage("RandomMastery")]
[Description("Drops a random mastery primer on target.")]
public static void RandomMastery(CommandEventArgs e)
{
e.Mobile.BeginTarget(-1, false, TargetFlags.None, (mobile, targeted) =>
{
Item mastery = SkillMasteryPrimer.GetRandom();
if (targeted is Mobile)
{
Mobile m = targeted as Mobile;
m.Backpack.DropItem(mastery);
e.Mobile.SendMessage("A mastery has been added to your pack!");
}
else if (targeted is IPoint3D)
{
IPoint3D p = targeted as IPoint3D;
mastery.MoveToWorld(new Point3D(p.X, p.Y, p.Z), e.Mobile.Map);
}
else
mastery.Delete();
});
}
}
}

0 comments on commit 7e04544

Please sign in to comment.