protected void BrokeLockPickTest() { // When failed, a 25% chance to break the lockpick if (Utility.Random(4) == 0) { var item = (Item)m_Item; // You broke the lockpick. item.SendLocalizedMessageTo(m_From, 502074); m_From.PlaySound(0x3A4); m_Lockpick.Consume(); } }
protected void BrokeLockPickTest() { // When failed, a 25% chance to break the lockpick if (Utility.Random(4) == 0) { Item item = (Item)m_Item; // item.SendAsciiMessageTo(m_From, "You broke the lockpick."); m_From.PlaySound(0x3A4); m_Lockpick.Consume(); } }
protected void BrokeLockPickTest() { // When failed, a 25% chance to break the lockpick if (Utility.Random(4) == 0) { Item item = (Item)m_Item; // You broke the lockpick. //item.SendLocalizedMessageTo( m_From, 502074 ); m_From.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "You broke the lockpick.")); m_From.PlaySound(0x3A4); m_Lockpick.Consume(); } }
protected override void OnTick() { if (!(m_Item is Item)) { return; } Item item = (Item)m_Item; if (!m_From.InRange(item.GetWorldLocation(), 1)) { return; } if (m_Item.LockLevel == 0 || m_Item.LockLevel == -255) { // LockLevel of 0 means that the door can't be picklocked // LockLevel of -255 means it's magic locked item.SendLocalizedMessageTo(m_From, 502073); // This lock cannot be picked by normal means return; } if (m_From.Skills[SkillName.Lockpicking].Value < m_Item.RequiredSkill) { item.SendLocalizedMessageTo(m_From, 502072); // You don't see how that lock can be manipulated. return; } if (m_From.CheckTargetSkill(SkillName.Lockpicking, m_Item, m_Item.LockLevel - 1, m_Item.MaxLockLevel)) { item.SendLocalizedMessageTo(m_From, 502076); // The lock quickly yields to your skill. m_From.PlaySound(0x4A); m_Item.LockPick(m_From); m_From.RevealingAction(); } else { if (Utility.Random(3) == 0) { item.SendLocalizedMessageTo(m_From, 502074); // You broke the lockpick. m_From.PlaySound(0x3A4); m_Lockpick.Consume(); } item.SendLocalizedMessageTo(m_From, 502075); // You are unable to pick the lock. } }
protected void BrokeLockPickTest() { // When failed, a 25% chance to break the lockpick if (Utility.Random(4) == 0) { Item item = (Item)m_Item; // You broke the lockpick. if (m_Lockpick.ItemID == 0x3A75) { m_From.PlaySound(0x549); m_From.PrivateOverheadMessage(0, 1150, false, "You broke the key card.", m_From.NetState); } else { m_From.PlaySound(0x3A4); m_From.PrivateOverheadMessage(0, 1150, false, "You broke the lockpick.", m_From.NetState); } m_Lockpick.Consume(); } }
public void LockpickHold(Mobile from, Lockpick lockpick) { if (from == null || lockpick == null || this.Deleted || this == null) { return; } //NPC Ship if (m_Ship.MobileControlType != MobileControlType.Player) { if (m_Ship.HasCrewAlive()) { from.SendMessage("You cannot access that ship's hold while it's crew members still live."); return; } else { from.SendMessage("With the ship's crew dead, you may access the hold freely."); return; } } Effects.PlaySound(Location, Map, 0x241); from.BeginAction((typeof(Lockpick))); Timer.DelayCall(TimeSpan.FromSeconds(3.0), delegate() { if (from != null) { from.EndAction(typeof(Lockpick)); } if (this == null) { return; } if (this.Deleted) { return; } if (from.GetDistanceToSqrt(this) > 2) { from.SendMessage("You are too far away from the hold to continue lockpicking."); return; } if (!from.Alive) { return; } double lockpickingSkill = from.Skills[SkillName.Lockpicking].Value; double successChance = (lockpickingSkill - 95) * .02; //10% At GM double chanceResult = Utility.RandomDouble(); //Succeed Lockpicking if (chanceResult < successChance) { Effects.PlaySound(Location, Map, 0x4A); from.SendMessage("You succeed in breaking into the ship's hold"); base.OnDoubleClick(from); return; } //Fail Lockpicking else { if (Utility.RandomDouble() > .5) { Effects.PlaySound(Location, Map, 0x3A4); from.SendMessage("You fail to break into the ship's hold and break your lockpick in the process."); lockpick.Consume(); return; } else { from.SendMessage("You fail to break into the ship's hold"); return; } } }); }