예제 #1
0
            public override void OnResponse(NetState state, RelayInfo info)               //Function for GumpButtonType.Reply Buttons
            {
                Mobile to = state.Mobile;

                if (info.ButtonID == 1)
                {
                    from.CloseGump(typeof(WaitGump));
                    to.CloseGump(typeof(ProposalGump));
                    Item gRing = from.FindItemOnLayer(Layer.Ring);
                    Item rRing = to.FindItemOnLayer(Layer.Ring);
                    if (gRing == null && rRing == null)
                    {
                        //Marriage can proceed
                        to.Say("Oh yes! " + from.Name + " of course I will marry you.");
                        WeddingDeed.Delete();
                        WeddingRing newring1 = new WeddingRing(inscription, to.Name);
                        WeddingRing newring2 = new WeddingRing(inscription, from.Name);
                        from.EquipItem(newring1);
                        to.EquipItem(newring2);
                        from.PlaySound(0x40b);
                        World.Broadcast(0x481, true, "{0} and {1} have just been married. Congratulations!", from.Name, to.Name);
                    }
                    else if (gRing is WeddingRing)
                    {
                        from.SendMessage("You are already married!");
                        to.SendMessage("The other person is already maried!");
                    }
                    else if (rRing is WeddingRing)
                    {
                        to.SendMessage("You are already married!");
                        from.SendMessage("The other person is already maried!");
                    }
                    else
                    {
                        to.SendMessage("The marriage cannont proceed because one of you is wearing a ring.");
                        from.SendMessage("The marriage cannont proceed because one of you is wearing a ring.");
                    }
                }
                else if (info.ButtonID == 2)
                {
                    to.Say("I am sorry " + from.Name + " but I cannot marry you.");
                    WeddingDeed.Delete();
                    from.SendMessage("Alas, your proposal was declined and you lost your deed.");
                    from.CloseGump(typeof(WaitGump));
                    to.CloseGump(typeof(ProposalGump));
                }
                else
                {
                    from.CloseGump(typeof(WaitGump));
                    to.CloseGump(typeof(ProposalGump));
                }
            }
            //Function for GumpButtonType.Reply Buttons
            public override void OnResponse( NetState state, RelayInfo info )
            {
                Mobile to = state.Mobile;

                if ( info.ButtonID == 1)
                {
                    from.CloseGump( typeof( WaitGump ) );
                    to.CloseGump( typeof( ProposalGump ) );
                    Item gRing = from.FindItemOnLayer( Layer.Ring );
                    Item rRing = to.FindItemOnLayer( Layer.Ring );
                    if( gRing == null && rRing == null)
                    {
                        //Marriage can proceed
                        to.Say( "Oh yes! " + from.Name + " of cource I will marry you.");
                        WeddingDeed.Delete();
                        WeddingRing newring1 = new WeddingRing( inscription, from.Name, to.Name );
                        WeddingRing newring2 = new WeddingRing( inscription, to.Name, from.Name );
                        from.EquipItem( newring1 );
                        to.EquipItem( newring2 );
                        from.PlaySound( 0x40b );
                        World.Broadcast( 0x481, true, "{0} and {1} have just been married. Congratulations!", from.Name, to.Name );
                    }
                    else if(gRing is WeddingRing)
                    {
                        from.SendMessage("You are already married!");
                        to.SendMessage("The other person is already maried!");
                    }
                    else if(rRing is WeddingRing)
                    {
                        to.SendMessage("You are already married!");
                        from.SendMessage("The other person is already maried!");
                    }
                    else
                    {
                        to.SendMessage("The marriage cannont proceed because one of you is wearing a ring.");
                        from.SendMessage("The marriage cannont proceed because one of you is wearing a ring.");
                    }

                }
                else if (info.ButtonID == 2)
                {
                    to.Say( "I am sorry " + from.Name + " but I cannot marry you.");
                    WeddingDeed.Delete();
                    from.SendMessage("Alas, your proposal was declined and you lost your deed.");
                    from.CloseGump( typeof( WaitGump ) );
                    to.CloseGump( typeof( ProposalGump ) );
                }
                else
                {
                    from.CloseGump( typeof( WaitGump ) );
                    to.CloseGump( typeof( ProposalGump ) );
                }
            }