public void Target( Container item ) { if ( CheckSequence() ) { SpellHelper.Turn( Caster, item ); object root = item.RootParent; if ( !item.IsAccessibleTo( Caster ) ) { item.OnDoubleClickNotAccessible( Caster ); } else if ( !item.CheckItemUse( Caster, item ) ) { } else if ( root != null && root is Mobile && root != Caster ) { item.OnSnoop( Caster ); } else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster, null ) ) { } else if ( Caster.Region.OnDoubleClick( Caster, item ) ) { Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5022 ); Effects.PlaySound( item.Location, item.Map, 0x1F5 ); item.DisplayTo( Caster ); item.OnItemUsed( Caster, item ); } } FinishSequence(); }
public static void Container_Snoop( Container cont, Mobile from ) { if (from.BeginAction(typeof(IAction))) { bool releaseLock = true; bool canSnoop = true; if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 1)) { Mobile root = cont.RootParent as Mobile; if (root != null && !root.Alive) canSnoop = false; else if (root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player) { from.SendLocalizedMessage(500209); // You can not peek into the container. canSnoop = false; } else if (root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed(from, root)) { from.SendLocalizedMessage(1001018); // You cannot perform negative acts on your target. canSnoop = false; } if (canSnoop) { if (from.AccessLevel > AccessLevel.Player) cont.DisplayTo(from); else { new InternalTimer(from, cont).Start(); releaseLock = false; } } } else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. if (releaseLock && from is PlayerMobile) ((PlayerMobile)from).EndPlayerAction(); } else from.SendAsciiMessage("You must wait to perform another action."); }
public static void Container_Snoop( Container cont, Mobile from ) { if ( from.AccessLevel > AccessLevel.Player || from.InRange( cont.GetWorldLocation(), 1 ) ) { 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.Mobile != from ) ns.Mobile.SendMessage( message ); } eable.Free(); } } if ( from.AccessLevel == AccessLevel.Player ) Titles.AwardKarma( from, -4, true ); if ( from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill( SkillName.Snooping, cont, 0.0, 100.0 ) ) { if ( cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap( from ) ) return; cont.DisplayTo( from ); } else { from.SendLocalizedMessage( 500210 ); // You failed to peek into the container. } } else { from.SendLocalizedMessage( 500446 ); // That is too far away. } }
public static void Container_Snoop( Container cont, Mobile from ) { /*if (!(from.Target is Stealing.StealingTarget) && DateTime.UtcNow < from.NextSkillTime) { from.SendMessage("You must wait a moment before you can snoop again."); return; }*/ if ( from.AccessLevel > AccessLevel.Player || from.InRange( cont.GetWorldLocation(), 1 ) ) { Mobile root = cont.RootParent as Mobile; if ( root != null ) { if ( root.Alive ) { if ( root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player ) { from.SendLocalizedMessage( 500209 ); // You can not peek into the container. return; } else if ( from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed( from, root ) ) { from.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts on your target. return; } else if ( from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random( 100 ) ) { Map map = from.Map; if ( map != null ) { root.SendMessage( String.Format( "You notice {0} attempting to peek into your belongings.", from.Name ) ); 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.Mobile != from && ns.Mobile != root ) ns.Mobile.SendMessage( message ); eable.Free(); } } } else return; } if ( from.AccessLevel == AccessLevel.Player ) Misc.Titles.AwardKarma(from, -4, true); if ( from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill( SkillName.Snooping, cont, 0.0, 100.0 ) ) { if (!(cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap(from))) { cont.DisplayTo(from); //from.NextSkillTime = DateTime.UtcNow.AddSeconds(cont.Parent is Container ? 0.315 : 1.15); } } else { from.SendLocalizedMessage( 500210 ); // You failed to peek into the container. if ( from.Skills[SkillName.Hiding].Value / 2 < Utility.Random( 100 ) ) from.RevealingAction(); } } else from.SendLocalizedMessage( 500446 ); // That is too far away. }
private static void RecurseOpen(Container c, Mobile from) { var parent = c.Parent as Container; if (parent != null) RecurseOpen(parent, from); c.DisplayTo(from); }
public static void OPENCONTAINERTO(TriggerObject trigObject, Container container, Mobile mob) { if (container != null && mob != null && mob.NetState != null) { container.DisplayTo(mob); } }
public static void Container_Snoop(Container cont, Mobile from) { if (from.AccessLevel > AccessLevel.Player || from.InRange(cont.GetWorldLocation(), 1)) { 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); System.Collections.ArrayList list = new System.Collections.ArrayList(); foreach (NetState ns in eable) list.Add( ns ); eable.Free(); foreach ( NetState ns in list ) { 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); } } } // custom change: only lose karma when snooping good guys if (from.AccessLevel == AccessLevel.Player && root != null && root.Karma > 0) Titles.AwardKarma(from, -5, true); if (from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0)) { TrapableContainer tc = cont as TrapableContainer; if ( from.AccessLevel == AccessLevel.Player && tc != null && tc.Trapped && tc.TrapType == TrapType.MagicTrap ) tc.ExecuteTrap( from ); cont.DisplayTo( from ); } else { from.SendLocalizedMessage(500210); // You failed to peek into the container. } } else { from.SendLocalizedMessage(500446); // That is too far away. } }