예제 #1
0
 public Item(uint Id, uint DefinitionId, uint UserId, uint RoomId, Vector3 RoomPos, string RoomWallPos, int Rotation,
             string Flags, string DisplayFlags, bool Untradable, uint SoundManagerId, int SoundManagerOrder, double ExpireTimestamp)
 {
     mId                  = Id;
     mDefinitionId        = DefinitionId;
     mUserId              = UserId;
     mRoomId              = RoomId;
     mRoomPos             = RoomPos;
     mRoomWallPos         = RoomWallPos;
     mRoomRot             = Rotation;
     mFlags               = Flags;
     mDisplayFlags        = DisplayFlags;
     mInitialFlags        = Flags;
     mUntradable          = Untradable;
     mCachedDefinition    = ItemDefinitionManager.GetDefinition(mDefinitionId);
     mTmpInteractingUsers = new Dictionary <int, uint>();
     mSoundManagerId      = SoundManagerId;
     mSoundManagerOrder   = SoundManagerOrder;
     mExpireTimestamp     = ExpireTimestamp;
 }
예제 #2
0
        public Item(uint Id, uint DefinitionId, uint UserId, uint RoomId, Vector3 RoomPos, string RoomWallPos, int Rotation,
                    string Flags, string DisplayFlags, bool Untradable, uint SoundManagerId, int SoundManagerOrder, double ExpireTimestamp, WiredManager WiredManager)
        {
            mId                  = Id;
            mDefinitionId        = DefinitionId;
            mUserId              = UserId;
            mRoomId              = RoomId;
            mRoomPos             = RoomPos;
            mRoomWallPos         = RoomWallPos;
            mRoomRot             = Rotation;
            mFlags               = Flags;
            mDisplayFlags        = DisplayFlags;
            mInitialFlags        = Flags;
            mUntradable          = Untradable;
            mCachedDefinition    = ItemDefinitionManager.GetDefinition(mDefinitionId);
            mTmpInteractingUsers = new Dictionary <int, uint> ();
            mSoundManagerId      = SoundManagerId;
            mSoundManagerOrder   = SoundManagerOrder;
            mExpireTimestamp     = ExpireTimestamp;


            if (WiredManager != null && (mCachedDefinition.Behavior == ItemBehavior.WiredCondition || mCachedDefinition.Behavior == ItemBehavior.WiredTrigger || mCachedDefinition.Behavior == ItemBehavior.WiredEffect))
            {
                mWiredData = WiredManager.LoadWired(Id, mCachedDefinition.BehaviorData);
                if (mCachedDefinition.Behavior == ItemBehavior.WiredTrigger)
                {
                    switch (WiredTypesUtil.TriggerFromInt(mCachedDefinition.BehaviorData))
                    {
                    case WiredTriggerTypes.periodically:
                        RequestUpdate(mWiredData.Data2);
                        break;

                    case WiredTriggerTypes.walks_on_furni:
                    case WiredTriggerTypes.walks_off_furni:
                        WiredManager.RegisterWalkItems(mId);
                        break;
                    }
                }
            }
        }