Esempio n. 1
0
        public override void OnResponse(GameClient state, RelayInfo info)
        {
            if (m_Statue == null || m_Statue.Deleted)
            {
                return;
            }

            bool sendGump = false;

            if (info.ButtonID == (int)Buttons.Sculpt)
            {
                if (m_Maker is CharacterStatueDeed)
                {
                    CharacterStatue backup = ((CharacterStatueDeed)m_Maker).Statue;

                    if (backup != null)
                    {
                        backup.Delete();
                    }
                }

                if (m_Maker != null)
                {
                    m_Maker.Delete();
                }

                m_Statue.Sculpt(state.Mobile);
            }
            else if (info.ButtonID == (int)Buttons.PosePrev)
            {
                m_Statue.Pose = (StatuePose)(((int)m_Statue.Pose + 5) % 6);
                sendGump      = true;
            }
            else if (info.ButtonID == (int)Buttons.PoseNext)
            {
                m_Statue.Pose = (StatuePose)(((int)m_Statue.Pose + 1) % 6);
                sendGump      = true;
            }
            else if (info.ButtonID == (int)Buttons.DirPrev)
            {
                m_Statue.Direction = (Direction)(((int)m_Statue.Direction + 7) % 8);
                m_Statue.InvalidatePose();
                sendGump = true;
            }
            else if (info.ButtonID == (int)Buttons.DirNext)
            {
                m_Statue.Direction = (Direction)(((int)m_Statue.Direction + 1) % 8);
                m_Statue.InvalidatePose();
                sendGump = true;
            }
            else if (info.ButtonID == (int)Buttons.MatPrev)
            {
                m_Statue.Material = (StatueMaterial)(((int)m_Statue.Material + 3) % 4);
                sendGump          = true;
            }
            else if (info.ButtonID == (int)Buttons.MatNext)
            {
                m_Statue.Material = (StatueMaterial)(((int)m_Statue.Material + 1) % 4);
                sendGump          = true;
            }
            else if (info.ButtonID == (int)Buttons.Restore)
            {
                if (m_Maker is CharacterStatueDeed)
                {
                    CharacterStatue backup = ((CharacterStatueDeed)m_Maker).Statue;

                    if (backup != null)
                    {
                        m_Statue.Restore(backup);
                    }
                }

                sendGump = true;
            }
            else
            {
                m_Statue.Delete();
            }

            if (sendGump)
            {
                state.Mobile.SendGump(new CharacterStatueGump(m_Maker, m_Statue, m_Owner));
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
            }
        }
Esempio n. 2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Statue == null || m_Statue.Deleted)
            {
                return;
            }

            bool sendGump = false;

            bool hasmat = m_Statue.StatueType <= StatueType.Bronze;

            if (info.ButtonID == (int)Buttons.Sculpt)
            {
                if (m_Backup != null)
                {
                    m_Backup.Delete();
                }

                m_Statue.Sculpt(state.Mobile);
            }
            else if (info.ButtonID == (int)Buttons.PosePrev)
            {
                m_Statue.Pose = (StatuePose)(((int)m_Statue.Pose + 5) % 6);
                sendGump      = true;
            }
            else if (info.ButtonID == (int)Buttons.PoseNext)
            {
                m_Statue.Pose = (StatuePose)(((int)m_Statue.Pose + 1) % 6);
                sendGump      = true;
            }
            else if (info.ButtonID == (int)Buttons.DirPrev)
            {
                m_Statue.Direction = (Direction)(((int)m_Statue.Direction + 7) % 8);
                m_Statue.InvalidatePose();
                sendGump = true;
            }
            else if (info.ButtonID == (int)Buttons.DirNext)
            {
                m_Statue.Direction = (Direction)(((int)m_Statue.Direction + 1) % 8);
                m_Statue.InvalidatePose();
                sendGump = true;
            }
            else if (hasmat && info.ButtonID == (int)Buttons.MatPrev)
            {
                m_Statue.Material = (StatueMaterial)(((int)m_Statue.Material + 3) % 4);
                sendGump          = true;
            }
            else if (hasmat && info.ButtonID == (int)Buttons.MatNext)
            {
                m_Statue.Material = (StatueMaterial)(((int)m_Statue.Material + 1) % 4);
                sendGump          = true;
            }
            else if (info.ButtonID == (int)Buttons.Restore)
            {
                if (m_Backup != null)
                {
                    m_Statue.Restore(m_Backup);
                }
                else
                {
                    m_Owner.SendMessage("No restoration available.");
                }

                sendGump = true;
            }
            else
            {
                CloseGump();
            }

            if (sendGump)
            {
                state.Mobile.SendGump(new CharacterStatueGump(m_Statue, m_Owner, m_Backup));
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
            }
        }