public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Pose = (StatuePoses)reader.ReadInt();
            Material = (StatueMaterial)reader.ReadInt();

            if (version >= 1)
            {
                m_Plinth = reader.ReadItem() as Plinth;
                //m_HasPlinth = reader.ReadBool();
            }
            if (version >= 2)
            {
                m_Engraving = reader.ReadString();
            }
            if (version >= 3)
            {
                //m_HasPlinth = reader.ReadBool();
            m_Owner = reader.ReadMobile();
            }

            //m_Owner = reader.ReadMobile();
            //m_HasPlinth = reader.ReadBool();
            //Plinth = reader.ReadBool();

            if (!Statues.StatuesList.Contains(this))
            {
                Statues.StatuesList.Add(this);
            }
            StartUpdateStatue();

            //read( 3 )
            /*
            switch( version )
            {
            case 3: //maybe 3, maybe 4, or more?
            {
                m_Owner = reader.ReadMobile();

                goto case 2;
            }
            case 2:
            {
                m_Engraving = reader.ReadString();
                //read some others if they were serialized when version was 2?

                goto case 1;
            }
            case 1:
            {
                m_Plinth = reader.ReadItem() as Plinth;
                //as above

                goto case 0;
            }
            case 0:
            {
                Pose = (StatuePoses)reader.ReadInt();
                Material = (StatueMaterial)reader.ReadInt();
                break;
            }
            }
            */
        }
Exemple #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
            Pose = (StatuePoses)reader.ReadInt();
            Material = (StatueMaterial)reader.ReadInt();

            if (version >= 1)
            {
                m_Plinth = reader.ReadItem() as Plinth;
            }
            if (version >= 2)
            {
                Engraving = reader.ReadString();
            }
            if (version >= 3)
            {
                Owner = reader.ReadMobile();
            }
            if (!Statues.StatuesList.Contains(this))
            {
                Statues.StatuesList.Add(this);
            }
            StartUpdateStatue();
        }
Exemple #3
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            if ( m_Item.Deleted )
                return;

            Mobile from = sender.Mobile;
            int id = info.ButtonID;
            GameBoard board = m_Item.Board;

            switch ( id )
            {
                case 5: // move up
                    {
                        if ( m_SelectedRow == -1 )
                            return;

                        board.GamePanel.MoveUp( m_SelectedRow );
                        board.CurrentMovements++;

                        from.PlaySound( 0xFA );
                        from.SendGump( new PuzzleBoardGump( m_Item, m_SelectedRow ) );

                        break;
                    }
                case 6: // move down
                    {
                        if ( m_SelectedRow == -1 )
                            return;

                        board.GamePanel.MoveDown( m_SelectedRow );
                        board.CurrentMovements++;

                        from.PlaySound( 0xFA );
                        from.SendGump( new PuzzleBoardGump( m_Item, m_SelectedRow ) );

                        break;
                    }
                case 7: // apply
                    {
                        if ( board.IsCorrect() )
                        {
                            from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "Correct Code Entered. Crystal Lock Disengaged." );
                            from.PlaySound( 0xF7 );

                            m_Item.Delete();

                            Item reward;

                            switch ( Utility.Random( 10 ) )
                            {
                                default:
                                case 0: reward = new VoidEssence( 30 ); break;
                                case 1: reward = new SilverSerpentVenom( 30 ); break;
                                case 2: reward = new ScouringToxin( 30 ); break;
                                case 3: reward = new ToxicVenomSac( 30 ); break;
                                case 4: reward = new KneadingBowl(); break;
                                case 5: reward = new TotemPole(); break;
                                case 6: reward = new DustyPillow(); break;
                                case 7: reward = new Plinth(); break;
                                case 8: reward = new FlouredBreadBoard(); break;
                                case 9: reward = new LuckyCoin(); break;
                            }

                            from.PlaceInBackpack( reward );

                            PlayerMobile pm = from as PlayerMobile;

                            if ( pm != null && !Misc.TestCenter.Enabled )
                                pm.NextPuzzleAttempt = DateTime.Now + TimeSpan.FromDays( 1.0 );
                        }
                        else
                        {
                            m_Item.PublicOverheadMessage( MessageType.Regular, 0x3B2, true, "Incorrect Code Sequence. Access Denied" );
                            from.PlaySound( 0xFD );
                        }

                        break;
                    }
                case 8: // cancel
                    {
                        board.Reset();

                        from.PlaySound( 0xFB );
                        from.SendGump( new PuzzleBoardGump( m_Item, -1 ) );

                        break;
                    }
                default:
                    {
                        if ( id >= 1 && id <= 4 )
                            from.SendGump( new PuzzleBoardGump( m_Item, id - 1 ) );

                        break;
                    }
            }
        }