Welcome
Welcome to <strong>SunUO</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Facet Command for SunUO 0.x.x

Release your custom scripts to the public. By posting your scripts here it is automatically licensed under the terms of the GPL.

Facet Command for SunUO 0.x.x

Postby SiENcE on Fri Aug 24, 2007 12:28 pm

Facet changing command backported from RunUO2 to SunUO.

FacetCommand.cs
Code: Select all
/// <Summary>
/// Original Command by Rylock Released on 18/06/2004
/// For RunUO RC0.  This command now supports Tokuno
/// as of 20/05/2005 Modification by Greystar
/// as of 24/08/2007 Modification by SiENcE for SunUO support
/// </summary>

using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Items;

namespace Server.Scripts.Commands
{
   public class FacetCommand
   {
      public static void Initialize()
      {
         Server.Commands.Register( "Facet", AccessLevel.Counselor, new CommandEventHandler( Facet_OnCommand ) );
      }

      public static void Facet_OnCommand( CommandEventArgs e )
      {
         Mobile m = e.Mobile;
         m.SendGump( new FacetGump( m ) );
      }
   }

   public class FacetGump : Gump
   {
      private Mobile m_Owner;
      public Mobile Owner{ get{ return m_Owner; } set{ m_Owner = value; } }

      public FacetGump(Mobile owner) : base( 10, 10 )
      {
         owner.CloseGump( typeof( FacetGump ) );

         int gumpX = 0; int gumpY = 0;

         m_Owner = owner;

         Closable=true;
         Disposable=true;
         Dragable=true;
         Resizable=false;
         AddPage(0);
         AddBackground(222, 114, 100, 172, 9200);
         AddButton(231, 124, 2714, 2714, 1, GumpButtonType.Reply, 0);
         AddButton(231, 156, 2714, 2714, 2, GumpButtonType.Reply, 0);
         AddButton(231, 189, 2714, 2714, 3, GumpButtonType.Reply, 0);
         AddButton(231, 225, 2714, 2714, 4, GumpButtonType.Reply, 0);
         AddButton(231, 257, 2714, 2714, 5, GumpButtonType.Reply, 0);
         AddLabel(258, 124, 55, @"Felucca");
         AddLabel(258, 156, 55, @"Trammel");
         AddLabel(258, 192, 55, @"Ilshenar");
         AddLabel(258, 226, 55, @"Malas");
         AddLabel(258, 258, 55, @"Tokuno");
      }

      public override void OnResponse( NetState state, RelayInfo info )
      {
         Mobile from = state.Mobile;

         switch( info.ButtonID )
         {
            case 1:
               CityInfo city = new CityInfo( "Britain", "Town Center", 1475, 1645, 20 );

               from.MoveToWorld( city.Location, Map.Felucca );
               break;
            case 2:
               CityInfo city1 = new CityInfo( "Britain", "Town Center", 1475, 1645, 20 );

               from.MoveToWorld( city1.Location, Map.Trammel );
               break;
            case 3:
               CityInfo city2 = new CityInfo( "Lakeshire", "Town Center", 1203, 1124, -25 );

               from.MoveToWorld( city2.Location, Map.Ilshenar );
               break;
            case 4:
               CityInfo city3 = new CityInfo( "Luna", "Town Center", 989, 519, -50 );

               from.MoveToWorld( city3.Location, Map.Malas );
               break;
            case 5:
               CityInfo city4 = new CityInfo( "Zento", "Town Center", 738, 1248, 30 );

               from.MoveToWorld( city4.Location, Map.Tokuno );
               break;
         }
      }
   }
}
SiENcE
 
Posts: 14
Joined: Fri Aug 24, 2007 12:19 pm
Location: Munich

Return to Script Releases

Who is online

Users browsing this forum: No registered users and 0 guests

cron