Server.Spells.Third.MagicLockSpell.Target C# (CSharp) Method

Target() public method

public Target ( Server.Items.LockableContainer targ ) : void
targ Server.Items.LockableContainer
return void
		public void Target( LockableContainer targ )
		{
			if ( Multis.BaseHouse.CheckLockedDownOrSecured( targ ) )
			{
				// You cannot cast this on a locked down item.
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 501761 );
			}
			else if ( targ.Locked || targ.LockLevel == 0 || targ is ParagonChest )
			{
				// Target must be an unlocked chest.
				Caster.SendLocalizedMessage( 501762 );
			}
			else if ( CheckSequence() )
			{
				SpellHelper.Turn( Caster, targ );

				Point3D loc = targ.GetWorldLocation();

				Effects.SendLocationParticles(
					EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
					0x376A, 9, 32, 5020 );

				Effects.PlaySound( loc, targ.Map, 0x1FA );

				// The chest is now locked!
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );

				targ.LockLevel = -255; // signal magic lock
				targ.Locked = true;
			}

			FinishSequence();
		}

Usage Example

コード例 #1
0
 protected override void OnTarget(Mobile from, object o)
 {
     if (o is LockableContainer)
     {
         m_Owner.Target((LockableContainer)o);
     }
     else
     {
         from.SendLocalizedMessage(501762);                       // Target must be an unlocked chest.
     }
 }
All Usage Examples Of Server.Spells.Third.MagicLockSpell::Target