示例#1
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            SecureLevel level = m_Info.Level;

            switch ( info.ButtonID )
            {
                case 1:
                    level = SecureLevel.Owner;
                    break;
                case 2:
                    level = SecureLevel.CoOwners;
                    break;
                case 3:
                    level = SecureLevel.Friends;
                    break;
                case 4:
                    level = SecureLevel.Anyone;
                    break;
            }

            if ( m_Info.Level == level )
            {
                state.Mobile.SendLocalizedMessage( 1061281 ); // Access level unchanged.
            }
            else
            {
                m_Info.Level = level;
                state.Mobile.SendLocalizedMessage( 1061280 ); // New access level set.
            }
        }
示例#2
0
 public override void OnResponse( GameClient state, RelayInfo info )
 {
     if ( info.ButtonID == 1 && !m_House.Deleted )
     {
         m_House.EndConfirmTransfer( m_From, m_To );
     }
 }
示例#3
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            switch ( info.ButtonID )
            {
                case 0: // Close/Cancel
                    {
                        from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.

                        break;
                    }
                case 1: // OK
                    {
                        TextRelay entry = info.GetTextEntry( 0 );
                        string code = ( entry == null ? "" : entry.Text.Trim() );

                        if ( code != "" )
                        {
                            from.SendLocalizedMessage( 1062098 ); // Your promotional code has been submitted.  We are processing your request.

                            PromotionalType type = PromotionalType.None;
                            bool success = false;
                            ( (PlayerMobile) from ).LastPromotionCode = code;

                            // TODO: Send query for inputed promo-code to database
                            // We must receive following results: bool success, PromotionalType type, string code

                            from.SendGump( new PromotionMessageGump( success, type, code ) );
                        }

                        break;
                    }
            }
        }
示例#4
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.

                        break;
                    }
                case 1:
                    {
                        from.SendGump( new TargetInvolvedPlayersGump( text, m_Type, "", "", "" ) );

                        break;
                    }
                case 2:
                    {
                        from.SendGump( new TypeNamesOfInvolvedPlayersGump( text, m_Type, "", "", "" ) );

                        break;
                    }
                case 3:
                    {
                        from.SendGump( new SelectNamesOfInvolvedPlayersFromListGump( text, m_Type ) );

                        break;
                    }
            }
        }
示例#5
0
        public override void OnResponse(Server.Network.GameClient state, RelayInfo info)
        {
            if (m_Quester == null)
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                Mobile m = state.Mobile;

                if (HeritageQuester.Check(m))
                {
                    HeritageQuester.AddPending(m, m_Quester);
                    Timer.DelayCall(TimeSpan.FromMinutes(1), new TimerStateCallback(CloseHeritageGump), m);

                    state.Mobile.Send(new HeritagePacket(m.Female, (short)(m_Quester.Race.RaceID + 1)));
                }
            }
        }
示例#6
0
        public static void Trace( this PacketReader reader, GameClient client )
        {
            try
            {
                using ( StreamWriter sw = new StreamWriter( "Packets.log", true ) )
                {
                    byte[] buffer = reader.Buffer;

                    if ( buffer.Length > 0 )
                        sw.WriteLine( "Client: {0}: Unhandled packet 0x{1:X2}", client, buffer[0] );

                    using ( MemoryStream ms = new MemoryStream( buffer ) )
                        Utility.FormatBuffer( sw, ms, buffer.Length );

                    sw.WriteLine();
                    sw.WriteLine();
                }
            }
            catch
            {
            }
        }
示例#7
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            int m_Rank = ( m_Mobile as PlayerMobile ).GuildRank;

            if ( m_Guild.BadMember( m_Mobile ) )
            {
                return;
            }

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        m_Mobile.CloseGump( typeof( ReceiveWarGump ) );

                        BaseGuild[] guilds = Guild.Search( "" );

                        m_Mobile.SendGump( new DiplomacyGump( m_Mobile, m_Guild, new ArrayList( guilds ), 2 ) );

                        break;
                    }
                case 201:
                    {
                        if ( m_Rank != 4 && m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063440 ); // You don't have permission to negotiate wars.
                            return;
                        }

                        if ( i_Guild != null )
                        {
                            m_Guild.WarInvitations.Remove( i_Guild );
                            i_Guild.WarDeclarations.Remove( m_Guild );

                            i_Guild.RemoveEnemy( m_Guild );
                            i_Guild.DelWar( m_Guild );

                            m_Mobile.CloseGump( typeof( ReceiveWarGump ) );
                        }

                        break;
                    }
                case 200:
                    {
                        if ( m_Rank != 4 && m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063440 ); // You don't have permission to negotiate wars.
                            return;
                        }

                        if ( i_Guild != null )
                        {
                            m_Guild.WarInvitations.Remove( i_Guild );
                            i_Guild.WarDeclarations.Remove( m_Guild );

                            m_Guild.AddEnemy( i_Guild );

                            Guild a_Guild, wa_Guild;

                            if ( m_Guild.Allies.Count > 0 )
                            {
                                for ( int i = 0; i < m_Guild.Allies.Count; i++ )
                                {
                                    a_Guild = m_Guild.Allies[i] as Guild;

                                    a_Guild.WarInitializations.Add( i_Guild );

                                    a_Guild.AddWar( i_Guild, 0, i_Guild.GetMaxKills( m_Guild ), i_Guild.GetWarTime( m_Guild ), i_Guild.GetExpTime( m_Guild ) );
                                    a_Guild.AddEnemy( i_Guild );

                                    if ( i_Guild.AllianceLeader )
                                    {
                                        for ( int j = 0; j < i_Guild.Allies.Count; j++ )
                                        {
                                            wa_Guild = i_Guild.Allies[j] as Guild;

                                            a_Guild.AddWar( wa_Guild, 0, i_Guild.GetMaxKills( m_Guild ), i_Guild.GetWarTime( m_Guild ), i_Guild.GetExpTime( m_Guild ) );
                                            a_Guild.AddEnemy( wa_Guild );

                                            wa_Guild.AddWar( a_Guild, 0, i_Guild.GetMaxKills( m_Guild ), i_Guild.GetWarTime( m_Guild ), i_Guild.GetExpTime( m_Guild ) );
                                            wa_Guild.AddEnemy( a_Guild );
                                        }
                                    }
                                }
                            }

                            m_Guild.AddWar( i_Guild, 0, i_Guild.GetMaxKills( m_Guild ), i_Guild.GetWarTime( m_Guild ), i_Guild.GetExpTime( m_Guild ) );

                            if ( i_Guild.AllianceLeader )
                            {
                                for ( int i = 0; i < i_Guild.Allies.Count; i++ )
                                {
                                    a_Guild = i_Guild.Allies[i] as Guild;

                                    m_Guild.AddWar( a_Guild, 0, i_Guild.GetMaxKills( m_Guild ), i_Guild.GetWarTime( m_Guild ), i_Guild.GetExpTime( m_Guild ) );
                                    m_Guild.AddEnemy( a_Guild );
                                }
                            }

                            m_Guild.WarInitializations.Add( i_Guild );

                            m_Guild.GuildMessage( 1018020, "" ); // Guild Message: Your guild is now at war.
                            i_Guild.GuildMessage( 1018020, "" ); // Guild Message: Your guild is now at war.

                            m_Mobile.SendLocalizedMessage( 1070752 ); // The proposal has been updated.

                            m_Mobile.CloseGump( typeof( ReceiveWarGump ) );
                        }

                        break;
                    }
                case 202:
                    {
                        if ( m_Rank != 4 && m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063440 ); // You don't have permission to negotiate wars.
                            return;
                        }

                        if ( i_Guild != null )
                        {
                            m_Guild.WarInvitations.Remove( i_Guild );
                            i_Guild.WarDeclarations.Remove( m_Guild );

                            i_Guild.RemoveEnemy( m_Guild );

                            i_Guild.DelWar( m_Guild );
                        }

                        m_Mobile.CloseGump( typeof( ReceiveWarGump ) );
                        m_Mobile.SendGump( new DeclareWarGump( m_Mobile, i_Guild ) );

                        break;
                    }
            }
        }
示例#8
0
 public void SendTo( GameClient state )
 {
     state.Send( new DisplayHuePicker( this ) );
     state.AddHuePicker( this );
 }
示例#9
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            int m_Rank = ( m_Mobile as PlayerMobile ).GuildRank;

            if ( m_Guild.BadMember( m_Mobile ) )
            {
                return;
            }

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        BaseGuild[] guilds = Guild.Search( "" );

                        m_Mobile.SendGump( new DiplomacyGump( m_Mobile, m_Guild, new ArrayList( guilds ), 2 ) );

                        break;
                    }
                case 400:
                    {
                        if ( m_Rank != 4 && m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063440 ); // You don't have permission to negotiate wars.

                            return;
                        }
                        else
                        {
                            m_Mobile.SendGump( new DeclareWarGump( m_Mobile, t_Guild ) );
                        }

                        break;
                    }
                case 305:
                    {
                        if ( m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063436 ); // You don't have permission to negotiate an alliance.

                            return;
                        }
                        else
                        {
                            if ( t_Guild != null && ( t_Guild.Enemies.Count <= 0 ) && ( m_Guild.Enemies.Count <= 0 ) )
                            {
                                if ( m_Guild.Allies.Count == 0 && m_Guild.AllyDeclarations.Count == 0 && t_Guild.Allies.Count <= 0 )
                                {
                                    m_Mobile.Prompt = new GuildAllyPrompt( m_Mobile, t_Guild, m_Guild );
                                }
                                else
                                {
                                    if ( m_Guild.AllianceLeader && t_Guild.AllyDeclarations.Count == 0 && t_Guild.Allies.Count == 0 )
                                    {
                                        if ( !m_Guild.AllyDeclarations.Contains( t_Guild ) )
                                        {
                                            m_Guild.AllyDeclarations.Add( t_Guild );

                                            m_Mobile.SendLocalizedMessage( 1070750, t_Guild.Name );
                                        }

                                        if ( !t_Guild.AllyInvitations.Contains( m_Guild ) )
                                        {
                                            t_Guild.AllyInvitations.Add( m_Guild );
                                        }
                                    }
                                    else
                                    {
                                        m_Mobile.SendLocalizedMessage( 1070748 ); // Failed to create alliance.
                                    }
                                }
                            }
                        }

                        break;
                    }
            }
        }
示例#10
0
文件: Gump.cs 项目: Ravenwolfe/xrunuo
 public void SendTo( GameClient state )
 {
     state.AddGump( this );
     state.Send( Compile() );
 }
示例#11
0
        public static bool MovementThrottle_Callback( GameClient ns )
        {
            PlayerMobile pm = ns.Mobile as PlayerMobile;

            if ( pm == null || !pm.UsesFastwalkPrevention )
                return true;

            return ( pm.m_NextMovementTime < DateTime.Now );
        }
示例#12
0
        public override void OnResponse( GameClient from, RelayInfo info )
        {
            if ( m_SpecialHairDye.Deleted )
            {
                return;
            }

            Mobile m = from.Mobile;
            int[] switches = info.Switches;

            if ( !m_SpecialHairDye.IsChildOf( m.Backpack ) )
            {
                m.SendLocalizedMessage( 1042010 ); //You must have the objectin your backpack to use it.
                return;
            }

            if ( info.ButtonID != 0 && switches.Length > 0 )
            {
                if ( m.HairItemID == 0 )
                {
                    m.SendLocalizedMessage( 502623 ); // You have no hair to dye and cannot use this
                }
                else
                {
                    // To prevent this from being exploited, the hue is abstracted into an internal list

                    int entryIndex = switches[0] / 100;
                    int hueOffset = switches[0] % 100;

                    if ( entryIndex >= 0 && entryIndex < m_Entries.Length )
                    {
                        SpecialHairDyeEntry e = m_Entries[entryIndex];

                        if ( hueOffset >= 0 && hueOffset < e.HueCount )
                        {
                            m_SpecialHairDye.Delete();

                            int hue = e.HueStart + hueOffset;

                            m.HairHue = hue;

                            m.SendLocalizedMessage( 501199 ); // You dye your hair
                            m.PlaySound( 0x4E );
                        }
                    }
                }
            }
            else
            {
                m.SendLocalizedMessage( 501200 ); // You decide not to dye your hair
            }
        }
示例#13
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            if ( info.ButtonID == 1 && !m_House.Deleted )
            {
                if ( m_House.IsOwner( m_Mobile ) )
                {
                    if ( m_House.MovingCrate != null || m_House.InternalizedVendors.Count > 0 )
                    {
                        m_Mobile.SendLocalizedMessage( 1080455 ); // You can not resize your house at this time. Please remove all items fom the moving crate and try again.
                        return;
                    }
                    /*
                    else if ( m_House.PlayerVendors.Count > 0 )
                    {
                        m_Mobile.SendLocalizedMessage( 503236 ); // You need to collect your vendor's belongings before moving.
                        return;
                    }
                    */
                    else if ( m_House.HasRentedVendors && m_House.VendorInventories.Count > 0 )
                    {
                        m_Mobile.SendLocalizedMessage( 1062679 ); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
                        return;
                    }
                    else if ( m_House.HasRentedVendors )
                    {
                        m_Mobile.SendLocalizedMessage( 1062680 ); // You cannot do that that while you still have contract vendors in your house.
                        return;
                    }
                    else if ( m_House.VendorInventories.Count > 0 )
                    {
                        m_Mobile.SendLocalizedMessage( 1062681 ); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
                        return;
                    }

                    if ( m_Mobile.AccessLevel >= AccessLevel.GameMaster )
                    {
                        m_Mobile.SendMessage( "You do not get a refund for your house as you are not a player" );
                        m_House.RemoveKeys( m_Mobile );
                        new TempNoHousingRegion( m_House, m_Mobile );
                        m_House.Delete();
                    }
                    else
                    {
                        Item toGive = null;

                        if ( m_House.Price > 0 )
                            toGive = new BankCheck( m_House.Price );
                        else
                            toGive = m_House.GetDeed();

                        if ( toGive != null )
                        {
                            BankBox box = m_Mobile.BankBox;

                            if ( box.TryDropItem( m_Mobile, toGive, false ) )
                            {
                                if ( toGive is BankCheck )
                                    m_Mobile.SendLocalizedMessage( 1060397, ( (BankCheck) toGive ).Worth.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box.

                                m_House.RemoveKeys( m_Mobile );
                                new TempNoHousingRegion( m_House, m_Mobile );
                                m_House.Delete();
                            }
                            else
                            {
                                toGive.Delete();
                                m_Mobile.SendLocalizedMessage( 500390 ); // Your bank box is full.
                            }
                        }
                        else
                        {
                            m_Mobile.SendMessage( "Unable to refund house." );
                        }
                    }
                }
                else
                {
                    m_Mobile.SendLocalizedMessage( 501320 ); // Only the house owner may do this.
                }
            }
            else if ( info.ButtonID == 0 )
            {
                m_Mobile.CloseGump( typeof( ConfirmHouseResize ) );
                m_Mobile.SendGump( new HouseGump( HouseGumpPage.Customize, m_Mobile, m_House ) );
            }
        }
示例#14
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            if ( m_Guild.BadMember( m_Mobile ) )
                return;

            if ( info.ButtonID >= 1000 && info.ButtonID < ( 1000 + m_List.Count ) )
            {
                Mobile m = (Mobile) m_List[info.ButtonID - 1000];

                if ( m != null && !m.Deleted )
                    m_Mobile.SendGump( new RosterMiscGump( m_Mobile, m, m_Guild ) );
            }

            /* Main Gump Buttons */
            if ( info.ButtonID == 100 ) // My Guild
            {
                m_Mobile.SendGump( new MyGuildGump( m_Mobile, m_Guild ) );
            }
            else if ( info.ButtonID == 110 ) // Roster
            {
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 2, "" ) );
            }
            else if ( info.ButtonID == 120 ) // Diplomacy
            {
                BaseGuild[] guilds = Guild.Search( "" );
                if ( guilds.Length > 0 )
                {
                    m_Mobile.SendGump( new DiplomacyGump( m_Mobile, m_Guild, new ArrayList( guilds ), 2 ) );
                }
            }

            /* Search Button */
            else if ( info.ButtonID == 750 )
            {
                string text = info.GetTextEntry( 3535 ).Text;

                text = text.Trim();

                if ( text.Length >= 3 )
                    m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 4, text ) );
                else
                    m_Mobile.SendMessage( "Search string must be at least three letters in length." );
            }

            /* Sort buttons */
            else if ( info.ButtonID == 400 ) // Sort for Name
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 10, "" ) );
            else if ( info.ButtonID == 401 ) // Sort for Name
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 0, "" ) );

            else if ( info.ButtonID == 402 ) // Sort for Rank
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 11, "" ) );
            else if ( info.ButtonID == 403 ) // Sort for Rank
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 1, "" ) );

            else if ( info.ButtonID == 404 ) // Sort for LastOn
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 12, "" ) );
            else if ( info.ButtonID == 405 ) // Sort for LastOn
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 2, "" ) );

            else if ( info.ButtonID == 406 ) // Sort for Guild Title
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 13, "" ) );
            else if ( info.ButtonID == 407 ) // Sort for Guild Title
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, 3, "" ) );

            /* Pag Buttons */
            else if ( info.ButtonID == 800 ) // Av. Pag
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, m_SortType, m_FindText, m_Page + 1 ) );
            else if ( info.ButtonID == 801 ) // Re. Page
                m_Mobile.SendGump( new RosterGump( m_Mobile, m_Guild, m_SortType, m_FindText, m_Page - 1 ) );

            /* Invite Player Button */
            else if ( info.ButtonID == 900 )
            {
                if ( ( m_Guild.Leader == m_Mobile ) || ( ( m_Mobile as PlayerMobile ).GuildRank == 3 ) )
                {
                    m_Mobile.Target = new InviteTarget( m_Mobile, m_Guild );
                    m_Mobile.SendLocalizedMessage( 1063048 ); // Whom do you wish to invite into your guild?
                }
                else
                {
                    m_Mobile.SendLocalizedMessage( 503301 ); //	 You don't have permission to do that.
                }
            }
        }
示例#15
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.

                        break;
                    }
                case 1:
                    {
                        from.SendLocalizedMessage( 1070956 ); // Which player is this complaint about?

                        from.Target = new SelectTarget( text, m_Type, first, second, third, 1 );

                        break;
                    }
                case 2:
                    {
                        from.SendLocalizedMessage( 1070956 ); // Which player is this complaint about?

                        from.Target = new SelectTarget( text, m_Type, first, second, third, 2 );

                        break;
                    }
                case 3:
                    {
                        from.SendLocalizedMessage( 1070956 ); // Which player is this complaint about?

                        from.Target = new SelectTarget( text, m_Type, first, second, third, 3 );

                        break;
                    }
                case 4:
                    {
                        string information = String.Format( " Involved Players: \n {0} \n {1} \n {2}", first, second, third );
                        text += information;

                        PageQueue.Enqueue( new PageEntry( from, text, m_Type ) );

                        break;
                    }
            }
        }
示例#16
0
 public void SendTo( GameClient state )
 {
     state.AddMenu( this );
     state.Send( new DisplayItemListMenu( this ) );
 }
示例#17
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = m_Owner;

            switch ( info.ButtonID )
            {
                case 0: // Closed
                    {
                        return;
                    }
                case 1: // Up
                    {
                        if ( m_Category.Parent != null )
                        {
                            int index = Array.IndexOf( m_Category.Parent.Nodes, m_Category ) / EntryCount;

                            if ( index < 0 )
                            {
                                index = 0;
                            }

                            from.SendGump( new CategorizedAddGump( from, m_Category.Parent, index ) );
                        }

                        break;
                    }
                case 2: // Previous
                    {
                        if ( m_Page > 0 )
                        {
                            from.SendGump( new CategorizedAddGump( from, m_Category, m_Page - 1 ) );
                        }

                        break;
                    }
                case 3: // Next
                    {
                        if ( ( m_Page + 1 ) * EntryCount < m_Category.Nodes.Length )
                        {
                            from.SendGump( new CategorizedAddGump( from, m_Category, m_Page + 1 ) );
                        }

                        break;
                    }
                default:
                    {
                        int index = ( m_Page * EntryCount ) + ( info.ButtonID - 4 );

                        if ( index >= 0 && index < m_Category.Nodes.Length )
                        {
                            m_Category.Nodes[index].OnClick( from, m_Page );
                        }

                        break;
                    }
            }
        }
示例#18
0
 public virtual void OnResponse( GameClient state, int index )
 {
 }
示例#19
0
 public virtual void OnCancel( GameClient state )
 {
 }
示例#20
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            int m_Rank = ( m_Mobile as PlayerMobile ).GuildRank;

            if ( m_Guild.BadMember( m_Mobile ) )
                return;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        m_Mobile.CloseGump( typeof( ProcessWarGump ) );

                        BaseGuild[] guilds = Guild.Search( "" );

                        m_Mobile.SendGump( new DiplomacyGump( m_Mobile, m_Guild, new ArrayList( guilds ), 2 ) );

                        break;
                    }
                case 100:
                    {
                        if ( m_Rank != 4 && m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063440 ); // You don't have permission to negotiate wars.

                            return;
                        }

                        if ( w_Guild != null && m_Guild.Allies.Count == 0 || ( m_Guild.Allies.Count > 0 && m_Guild.AllianceLeader ) )
                        {
                            m_Guild.RemoveEnemy( w_Guild );

                            Guild a_Guild, wa_Guild;

                            if ( m_Guild.Allies.Count > 0 )
                            {
                                for ( int i = 0; i < m_Guild.Allies.Count; i++ )
                                {
                                    a_Guild = m_Guild.Allies[i] as Guild;

                                    a_Guild.RemoveEnemy( w_Guild );

                                    for ( int j = 0; j < w_Guild.Allies.Count; j++ )
                                    {
                                        wa_Guild = w_Guild.Allies[j] as Guild;

                                        a_Guild.RemoveEnemy( wa_Guild );
                                    }
                                }
                            }

                            for ( int j = 0; j < w_Guild.Allies.Count; j++ )
                            {
                                wa_Guild = w_Guild.Allies[j] as Guild;

                                m_Guild.RemoveEnemy( wa_Guild );
                            }

                            m_Mobile.SendLocalizedMessage( 1070740, w_Guild.Name ); // You have lost the war with ~1_val~.

                            w_Guild.Leader.SendLocalizedMessage( 1070740, m_Guild.Name ); // You have lost the war with ~1_val~.

                            m_Mobile.CloseGump( typeof( ProcessWarGump ) );
                        }
                        else
                        {
                            m_Mobile.SendMessage( 0, "Only Alliance Leader must Surrender a guild war." ); // ???
                        }

                        break;
                    }
            }
        }
示例#21
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            if ( m_Token.Deleted || !m_Token.IsChildOf( sender.Mobile.Backpack ) )
                return;

            int idx = info.ButtonID - 100;

            if ( idx >= 0 && idx < Earrings.Length )
            {
                EarringEntry entry = Earrings[idx];

                Item earrings = (Item) Activator.CreateInstance( entry.Type );

                sender.Mobile.PlaceInBackpack( earrings );

                m_Token.Delete();
            }
        }
示例#22
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            Container cont = from.BankBox;

            bool backMoney = false;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        break;
                    }
                case 200:
                    {
                        int Amount = 25000;

                        string name = info.GetTextEntry( 444 ).Text;

                        name = name.Trim();

                        if ( name == "" )
                        {
                            from.SendLocalizedMessage( 1070884 ); // Guild name cannot be blank.
                            return;
                        }

                        string abbr = info.GetTextEntry( 555 ).Text;

                        abbr = abbr.Trim();

                        if ( abbr == "" )
                        {
                            from.SendLocalizedMessage( 1070885 ); // You must provide a guild abbreviation.
                            return;
                        }

                        if ( abbr.Length > 4 )
                        {
                            from.SendLocalizedMessage( 1063037, "4" ); // An abbreviation cannot exceed ~1_val~ characters in length.
                            return;
                        }

                        foreach ( Faction faction in Faction.Factions )
                        {
                            if ( abbr == faction.Definition.Abbreviation )
                            {
                                from.SendLocalizedMessage( 501153 ); // That abbreviation is not available.
                                return;
                            }
                        }

                        if ( cont != null && cont.ConsumeTotal( typeof( Gold ), Amount ) )
                        {
                            from.SendLocalizedMessage( 1060398, Amount.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.

                            if ( !ValidateName( from, name ) )
                                backMoney = true;

                            BaseGuild[] guilds = Guild.Search( "" );
                            for ( int i = 0; i < guilds.Length; i++ )
                            {
                                if ( abbr.ToLower() == ( guilds[i] as BaseGuild ).Abbreviation.ToLower() )
                                {
                                    from.SendLocalizedMessage( 501153 ); // That abbreviation is not available.
                                    backMoney = true;
                                }
                            }

                            if ( !backMoney )
                            {
                                Guild guild = new Guild( from, name, "none" );
                                from.Guild = guild;
                                ( from as PlayerMobile ).GuildRank = 5;

                                Guildstone gm = new Guildstone( guild );
                                gm.MoveToWorld( new Point3D( 0, 0, 0 ), Map.Trammel );
                                guild.Guildstone = gm;
                                Guild g = from.Guild as Guild;
                                g.Abbreviation = abbr;

                                from.SendLocalizedMessage( 1063238 ); // Your new guild has been founded.
                            }

                            if ( backMoney && cont != null )
                            {
                                cont.AddItem( new Gold( Amount ) );
                                from.SendLocalizedMessage( 1060397, Amount.ToString() ); // ~1_AMOUNT~ gold has been deposited into your bank box.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage( 1063001, Amount.ToString() ); // You do not possess the ~1_val~ gold piece fee required to create a guild.
                        }

                        break;
                    }
                case 151:
                    {
                        if ( ( from as PlayerMobile ).AcceptGuildInvites == true )
                        {
                            ( from as PlayerMobile ).AcceptGuildInvites = false;
                            from.SendLocalizedMessage( 1070698 ); // You are now ignoring guild invitations.
                        }
                        else
                        {
                            ( from as PlayerMobile ).AcceptGuildInvites = true;
                            from.SendLocalizedMessage( 1070699 ); // You are now accepting guild invitations.
                        }

                        break;
                    }
            }
        }
示例#23
0
        //private static Hashtable m_Table = new Hashtable();
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            int index = info.ButtonID - 1;

            if ( index >= 0 && index < m_Entries.Length )
            {
                SummonFamiliarEntry entry = m_Entries[index];

                double necro = m_From.Skills[SkillName.Necromancy].Base;
                double spirit = m_From.Skills[SkillName.SpiritSpeak].Base;

                BaseCreature check = (BaseCreature) SummonFamiliarSpell.Table[m_From];

                if ( check != null && !check.Deleted )
                {
                    m_From.SendLocalizedMessage( 1061605 ); // You already have a familiar.
                }
                else if ( necro < entry.ReqNecromancy || spirit < entry.ReqSpiritSpeak )
                {
                    // That familiar requires ~1_NECROMANCY~ Necromancy and ~2_SPIRIT~ Spirit Speak.
                    m_From.SendLocalizedMessage( 1061606, String.Format( "{0:F1}\t{1:F1}", entry.ReqNecromancy, entry.ReqSpiritSpeak ) );

                    m_From.CloseGump( typeof( SummonFamiliarGump ) );
                    m_From.SendGump( new SummonFamiliarGump( m_From, SummonFamiliarSpell.Entries ) );
                }
                else if ( entry.Type == null )
                {
                    m_From.SendMessage( "That familiar has not yet been defined." );

                    m_From.CloseGump( typeof( SummonFamiliarGump ) );
                    m_From.SendGump( new SummonFamiliarGump( m_From, SummonFamiliarSpell.Entries ) );
                }
                else
                {
                    try
                    {
                        BaseCreature bc = (BaseCreature) Activator.CreateInstance( entry.Type );

                        bc.Skills.MagicResist = m_From.Skills.MagicResist;

                        if ( BaseCreature.Summon( bc, m_From, m_From.Location, -1, TimeSpan.FromDays( 1.0 ) ) )
                        {
                            m_From.FixedParticles( 0x3728, 1, 10, 9910, EffectLayer.Head );
                            bc.PlaySound( bc.GetIdleSound() );
                            SummonFamiliarSpell.Table[m_From] = bc;
                        }
                    }
                    catch
                    {
                    }
                }
            }
            else
            {
                m_From.SendLocalizedMessage( 1061825 ); // You decide not to summon a familiar.
            }
        }
示例#24
0
        public override void OnResponse(Server.Network.GameClient sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (from.AccessLevel < AccessLevel.Administrator)
            {
                return;
            }

            TextRelay d = info.GetTextEntry(0);
            TextRelay h = info.GetTextEntry(1);
            TextRelay m = info.GetTextEntry(2);
            TextRelay s = info.GetTextEntry(3);

            TimeSpan duration;
            bool     shouldSet;

            //string fromString = from.ToString();

            switch (info.ButtonID)
            {
            case 0:
            {
                for (int i = 0; i < m_List.Count; ++i)
                {
                    Account a = (Account)m_List[i];

                    a.SetUnspecifiedBan(from);
                }

                from.SendMessage("Duration unspecified.");
                return;
            }

            case 1:                     // infinite
            {
                duration  = TimeSpan.MaxValue;
                shouldSet = true;
                break;
            }

            case 2:                     // From D:H:M:S
            {
                if (d != null && h != null && m != null && s != null)
                {
                    try
                    {
                        duration  = new TimeSpan(Utility.ToInt32(d.Text), Utility.ToInt32(h.Text), Utility.ToInt32(m.Text), Utility.ToInt32(s.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 3:                     // From D
            {
                if (d != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromDays(Utility.ToDouble(d.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 4:                     // From H
            {
                if (h != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromHours(Utility.ToDouble(h.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 5:                     // From M
            {
                if (m != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromMinutes(Utility.ToDouble(m.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 6:                     // From S
            {
                if (s != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromSeconds(Utility.ToDouble(s.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            default:
                return;
            }

            if (shouldSet)
            {
                for (int i = 0; i < m_List.Count; ++i)
                {
                    Account a = (Account)m_List[i];

                    a.SetBanTags(from, DateTime.Now, duration);
                }

                if (duration == TimeSpan.MaxValue)
                {
                    from.SendMessage("Duration is infinite.");
                }
                else
                {
                    from.SendMessage("Duration is {0}.", duration);
                }
            }
            else
            {
                from.SendMessage("Values improperly formatted.");
                from.SendGump(new BanDurationGump(m_List));
            }
        }
示例#25
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.

                        break;
                    }
                case 1:
                    {
                        PageQueue.Enqueue( new PageEntry( from, text, m_Type ) );

                        break;
                    }
            }
        }
示例#26
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            StopClose();

            if ( Factions.Sigil.ExistsOn( m_Mobile ) )
            {
                m_Mobile.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
            }
            else if ( info.ButtonID == 0 )
            {
                if ( m_Mobile == m_Sender )
                {
                    m_Mobile.SendLocalizedMessage( 1010588 ); // You choose not to go to any city.
                }
            }
            else
            {
                int index = info.ButtonID - 1;
                StuckMenuEntry[] entries = GetEntriesFor( m_Mobile );

                if ( index >= 0 && index < entries.Length )
                    Teleport( entries[index] );
            }
        }
示例#27
0
        public override void OnResponse( GameClient state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        from.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.

                        break;
                    }
                case 4:
                    {
                        TextRelay entry = info.GetTextEntry( 0 );
                        first = ( entry == null ? "" : entry.Text.Trim() );

                        entry = info.GetTextEntry( 1 );
                        second = ( entry == null ? "" : entry.Text.Trim() );

                        entry = info.GetTextEntry( 2 );
                        third = ( entry == null ? "" : entry.Text.Trim() );

                        string information = String.Format( " Involved Players: \n {0} \n {1} \n {2}", first, second, third );
                        text += information;

                        PageQueue.Enqueue( new PageEntry( from, text, m_Type ) );

                        break;
                    }
            }
        }
示例#28
0
        public override void OnResponse( GameClient from, RelayInfo info )
        {
            if ( m_MelisandeHairDye.Deleted )
                return;

            Mobile m = from.Mobile;
            int[] switches = info.Switches;

            if ( !m_MelisandeHairDye.IsChildOf( m.Backpack ) )
            {
                m.SendLocalizedMessage( 1042010 ); //You must have the objectin your backpack to use it.
                return;
            }

            Item hair = m.FindItemOnLayer( Layer.Hair );
            Item beard = m.FindItemOnLayer( Layer.FacialHair );

            if ( info.ButtonID != 0 )
            {
                if ( m.HairItemID == 0 && m.FacialHairItemID == 0 )
                {
                    m.SendLocalizedMessage( 502623 ); // You have no hair to dye and cannot use this
                }
                else
                {
                    if ( m.HairItemID != 0 )
                        m.HairHue = m_MelisandeHairDye.Hue;
                    if ( m.FacialHairItemID != 0 )
                        m.FacialHairHue = m_MelisandeHairDye.Hue;

                    m.SendLocalizedMessage( 501199 );  // You dye your hair
                    m_MelisandeHairDye.Delete();
                    m.PlaySound( 0x4E );
                }
            }
            else
            {
                m.SendLocalizedMessage( 501200 ); // You decide not to dye your hair
            }
        }
示例#29
0
            public override void OnResponse( GameClient sender, RelayInfo info )
            {
                switch ( info.ButtonID )
                {
                    case 1: // Go to shard website
                        {
                            sender.LaunchBrowser( Environment.Config.Website );
                            break;
                        }
                    case 2: // List of skills
                        {
                            string[] strings = Enum.GetNames( typeof( SkillName ) );

                            Array.Sort( strings );

                            StringBuilder sb = new StringBuilder();

                            if ( strings.Length > 0 )
                            {
                                sb.Append( strings[0] );
                            }

                            for ( int i = 1; i < strings.Length; ++i )
                            {
                                string v = strings[i];

                                if ( ( sb.Length + 1 + v.Length ) >= 256 )
                                {
                                    sender.Send( new AsciiMessage( Server.Serial.MinusOne, -1, MessageType.Label, 0x35, 3, "System", sb.ToString() ) );
                                    sb = new StringBuilder();
                                    sb.Append( v );
                                }
                                else
                                {
                                    sb.Append( ' ' );
                                    sb.Append( v );
                                }
                            }

                            if ( sb.Length > 0 )
                            {
                                sender.Send( new AsciiMessage( Server.Serial.MinusOne, -1, MessageType.Label, 0x35, 3, "System", sb.ToString() ) );
                            }

                            break;
                        }
                    case 3: // Command list
                        {
                            sender.Mobile.SendAsciiMessage( 0x482, "The command prefix is \"{0}\"", Server.CommandSystem.CommandPrefix );
                            Server.Scripts.Commands.CommandHandlers.Help_OnCommand( new CommandEventArgs( sender.Mobile, "help", "", new string[0] ) );

                            break;
                        }
                }
            }
示例#30
0
文件: Gump.cs 项目: Ravenwolfe/xrunuo
 public virtual void OnResponse( GameClient sender, RelayInfo info )
 {
 }
示例#31
0
        public override void OnResponse( GameClient sender, RelayInfo info )
        {
            int m_Rank = ( m_Mobile as PlayerMobile ).GuildRank;

            if ( m_Guild.BadMember( m_Mobile ) )
                return;

            switch ( info.ButtonID )
            {
                case 0:
                    {
                        m_Mobile.CloseGump( typeof( DeclareWarGump ) );
                        m_Mobile.SendGump( new DiplomacyMiscGump( m_Mobile, t_Guild ) );

                        break;
                    }
                case 1:
                    {
                        if ( m_Rank != 4 && m_Rank != 5 )
                        {
                            m_Mobile.SendLocalizedMessage( 1063440 ); // You don't have permission to negotiate wars.

                            return;
                        }
                        if ( t_Guild != null )
                        {
                            int text_int = 0;
                            TextRelay text;

                            try
                            {
                                text = info.GetTextEntry( 176 );

                                text_int = ( ( text.Text.Length == 0 ) ? (int) 0 : Convert.ToInt32( text.Text.Trim() ) );
                            }
                            catch
                            {
                                text_int = 0;
                            }

                            if ( text_int >= 999 )
                            {
                                text_int = 999;
                            }

                            uint hour_int = 0;

                            try
                            {
                                text = info.GetTextEntry( 175 );

                                hour_int = ( ( text.Text.Length == 0 ) ? (uint) 0 : Convert.ToUInt32( text.Text.Trim() ) );
                            }
                            catch
                            {
                                hour_int = 0;
                            }

                            if ( hour_int > 0 || text_int > 0 )
                            {
                                if ( hour_int >= 999 )
                                {
                                    hour_int = 999;

                                    text_int = 0;
                                }

                                t_Guild.DelWar( m_Guild );

                                m_Guild.WarDeclarations.Remove( t_Guild );

                                t_Guild.WarInvitations.Remove( m_Guild );

                                m_Guild.AddWar( t_Guild, 0, text_int, 60 * hour_int, 60 * hour_int );
                            }

                            if ( !m_Guild.WarDeclarations.Contains( t_Guild ) )
                            {
                                m_Guild.WarDeclarations.Add( t_Guild );

                                m_Mobile.SendLocalizedMessage( 1070751, t_Guild.Name ); // War proposal has been sent to ~1_val~.
                            }

                            if ( !t_Guild.WarInvitations.Contains( m_Guild ) )
                            {
                                t_Guild.WarInvitations.Add( m_Guild );

                                t_Guild.Leader.SendLocalizedMessage( 1070781, m_Guild.Name ); // ~1_val~ has proposed a war.
                            }
                        }

                        m_Mobile.CloseGump( typeof( DeclareWarGump ) );

                        break;
                    }
            }
        }
示例#32
0
文件: Gump.cs 项目: Ravenwolfe/xrunuo
 public virtual void OnServerClose( GameClient owner )
 {
 }