Example #1
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;
                        }
                }
            }