branch sync, Constructable can now have an accesslevel defined.
This commit is contained in:
parent
fede41b710
commit
5d78b17be1
7 changed files with 52 additions and 11 deletions
|
|
@ -19,8 +19,6 @@
|
|||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Server
|
||||
|
|
@ -158,8 +156,21 @@ namespace Server
|
|||
[AttributeUsage( AttributeTargets.Constructor )]
|
||||
public class ConstructableAttribute : Attribute
|
||||
{
|
||||
public ConstructableAttribute()
|
||||
private AccessLevel m_AccessLevel;
|
||||
|
||||
public AccessLevel AccessLevel
|
||||
{
|
||||
get { return m_AccessLevel; }
|
||||
set { m_AccessLevel = value; }
|
||||
}
|
||||
|
||||
public ConstructableAttribute() : this( AccessLevel.Player ) //Lowest accesslevel for current functionality (Level determined by access to [add)
|
||||
{
|
||||
}
|
||||
|
||||
public ConstructableAttribute( AccessLevel accessLevel )
|
||||
{
|
||||
m_AccessLevel = accessLevel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3346,8 +3346,8 @@ namespace Server
|
|||
}
|
||||
|
||||
public virtual void OnAfterDuped( Item newItem )
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool OnDragLift( Mobile from )
|
||||
{
|
||||
|
|
@ -4289,6 +4289,11 @@ namespace Server
|
|||
((Mobile)m_Parent).OnItemUsed( from, item );
|
||||
}
|
||||
|
||||
public bool CheckItemUse( Mobile from )
|
||||
{
|
||||
return CheckItemUse( from, this );
|
||||
}
|
||||
|
||||
public virtual bool CheckItemUse( Mobile from, Item item )
|
||||
{
|
||||
if ( m_Parent is Item )
|
||||
|
|
@ -4307,6 +4312,13 @@ namespace Server
|
|||
((Mobile)m_Parent).OnItemLifted( from, item );
|
||||
}
|
||||
|
||||
public bool CheckLift( Mobile from )
|
||||
{
|
||||
LRReason reject = LRReason.Inspecific;
|
||||
|
||||
return CheckLift( from, this, ref reject );
|
||||
}
|
||||
|
||||
public virtual bool CheckLift( Mobile from, Item item, ref LRReason reject )
|
||||
{
|
||||
if ( m_Parent is Item )
|
||||
|
|
|
|||
|
|
@ -174,6 +174,17 @@ namespace Server.Items
|
|||
return base.CheckLift( from, item, ref reject );
|
||||
}
|
||||
|
||||
public override bool CheckItemUse( Mobile from, Item item )
|
||||
{
|
||||
if ( item != this && from.AccessLevel < AccessLevel.GameMaster && IsDecoContainer )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckItemUse( from, item );
|
||||
}
|
||||
|
||||
public bool CheckHold( Mobile m, Item item, bool message )
|
||||
{
|
||||
return CheckHold( m, item, message, true, 0, 0 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue