protected override void OnTick() { Container theirPack = m_Target.Backpack; if (theirPack == null) { m_From.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } else if ((m_From.Karma < 0 && 0.5 > Utility.RandomDouble()) || m_From.Criminal) { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500406); // Thou dost not look trustworthy... no gold for thee today! } else if (m_From.CheckTargetSkill(SkillName.Begging, m_Target, 0.0, 100.0)) { int totalGold = theirPack.GetAmount(typeof(Gold)); if (totalGold >= 25) { int toConsume = (int)(totalGold * m_From.Skills[SkillName.Begging].Value / 100.0); if (toConsume <= 0) { toConsume = 1; } toConsume = theirPack.ConsumeUpTo(typeof(Gold), toConsume); if (toConsume > 0) { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500405); // I feel sorry for thee... Gold gold = new Gold(toConsume); m_From.AddToBackpack(gold); m_From.PlaySound(gold.GetDropSound()); Titles.AlterNotoriety(m_From, -1, NotoCap.Dishonorable); } else { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any! } } else { m_Target.PublicOverheadMessage(MessageType.Regular, m_Target.SpeechHue, 500407); // I have not enough money to give thee any! } } else { m_Target.SendLocalizedMessage(500404); // They seem unwilling to give you any money. } m_From.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds(10.0); }
public static void Container_Snoop(Container cont, Mobile from) { if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 2)) { Mobile root = cont.RootParent as Mobile; if (root != null && !root.Alive) { return; } if (root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player) { from.SendLocalizedMessage(500209); // You can not peek into the container. return; } if (root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed(from, root)) { from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target. return; } if (root != null && from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random(100)) { Map map = from.Map; if (map != null) { string message = String.Format("You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name); IPooledEnumerable eable = map.GetClientsInRange(from.Location, 8); foreach (NetState ns in eable) { if (ns == root.NetState) { root.SendAsciiMessage("You notice {0} attempting to peek into your belongings!", from.Name); } else if (ns != from.NetState) { ns.Mobile.SendAsciiMessage(message); } } eable.Free(); } } if (from.AccessLevel == AccessLevel.Player && root != null && root.Karma > (int)Noto.Dishonorable) { Titles.AlterNotoriety(from, -1, NotoCap.LowNeutral); } //Titles.AwardKarma( from, -4, true ); if (from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0)) { if (from.AccessLevel == AccessLevel.Player && cont is TrapableContainer && ((TrapableContainer)cont).Trapped && ((TrapableContainer)cont).TrapType != TrapType.MagicTrap) { from.SendLocalizedMessage(500210); // You failed to peek into the container. return; } else { cont.DisplayTo(from); } } else { from.SendLocalizedMessage(500210); // You failed to peek into the container. } } else { from.SendLocalizedMessage(500446); // That is too far away. } }