public override void GetContextMenuEntries(Mobile from, List <ContextMenuEntry> list) { base.GetContextMenuEntries(from, list); if (HarvestSystem != null) { BaseHarvestTool.AddContextMenuEntries(from, this, list, HarvestSystem); } }
public static void EndDig(Mobile from, Item tool) { Timer it = (Timer)m_IsDigging[from]; if (it != null) { it.Stop(); } m_IsDigging.Remove(from); BaseHarvestTool t = (BaseHarvestTool)tool; t.UsesRemaining -= 1; if (t.UsesRemaining == 0) { tool.Delete(); from.SendMessage("You have worn out your tool!"); } if (from.CheckSkill(SkillName.Forensics, 0, 100)) { int bonus = 1; if (tool is SturdyShovel) { bonus = 2; } if (tool is GraveDiggersShovel) { bonus = 4; } if (tool is GoldenShovel) { bonus = 6; } if (tool is DiamondShovel) { bonus = 8; } if (tool is SummonShovel) { bonus = 10; } Double chance = from.Skills[SkillName.Forensics].Value / 10 * bonus; if (tool is SummonShovel && Utility.Random(1000) < chance) { int roll = Utility.Random(100); Mobile spawn; if (roll < 50) { spawn = new FailSafe(); spawn.MoveToWorld(from.Location, from.Map); spawn.Combatant = from; spawn.Z++; World.Broadcast(0x35, true, "{0} has summoned Fail Safe!", from.Name); } else { spawn = new Grobbubatus(); spawn.MoveToWorld(from.Location, from.Map); spawn.Combatant = from; spawn.Z++; World.Broadcast(0x35, true, "{0} has summoned Grobbubatus!", from.Name); } } else if (Utility.Random(100) < chance) { int roll = Utility.Random(2); switch (roll) { case 0: from.AddToBackpack(GiveReward(from, tool)); break; case 1: from.AddToBackpack(Runescribing.GetResoureDrop(false, true)); break; } } else { if (Utility.Random(100) < 25 - bonus) { from.SendMessage("You have disturbed the dead!"); BaseCreature m = null; try { m = Activator.CreateInstance(m_Dead[Utility.Random(m_Dead.Length)]) as BaseCreature; } catch { } m.Location = from.Location; m.Map = from.Map; if (m.IsParagon) { m.IsParagon = false; } World.AddMobile(m); m.Combatant = from; m.Z++; } else { from.SendMessage("You skillfully dig the area but do not find anything."); } } } else { if (Utility.Random(100) < 50) { from.SendMessage("You have disturbed the dead!"); BaseCreature m = null; try { m = Activator.CreateInstance(m_Dead[Utility.Random(m_Dead.Length)]) as BaseCreature; } catch { } m.Location = from.Location; m.Map = from.Map; if (m.IsParagon) { m.IsParagon = false; } World.AddMobile(m); m.Combatant = from; m.Z++; } else { from.SendMessage("You fail to discover anything of interest."); } } }