RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

FS Player Government System

RoninGT

Sorceror
FS Player Government System

FS Player Government System BETA 4

UPDATED 8.13.2005
FIXED: Known Crashs

There is another update coming soon this one just address's the known crashs people are having i wanted to get this one out and in play before i start adding newer stuff work the problems that are in the system before adding more stuff.

UPDATED 6.19.2005
FIXED: Maintenace Amounts (Were not correct)
FIXED: Context Menu For City Res Stones
FIXED: Starting & Updating City Limits (Were to large)

ADDED: Settings for limiting the amount of players per city.
ADDED: Settings for limiting the amount of players banned per city.
ADDED: Settings for adjusting city limit ranges.
ADDED: Settings for adjusting search area for placing city.
ADDED: Staff Command [FindCities Lets staff view all cities in game. Breaks down to how many cities per map, and shows list of all cities so staff can goto each city.

UPDATE 6.13.2005
FIXED: Voting Stone Bug (Crash)
FIXED: City Rename Prompt (Now Updates Citizens Titles)

ADDED: City Lamp Post (Craft Menu)
ADDED: City Trash Barrel (Craft Menu)

Just replace DefArchetect.cs, VotingStoneGump.cs, CityRenamePrompt.cs with the new ones in this release Add the CityTrashBarrel.cs and CityLampPost.cs To upgrade from BETA 1 to BETA 2

All files are in rar format then ziped so i could compress the 5 zips into 3

WARNING READ BEFORE DOWNLOADING

This verison of the system is in BETA stages, Meaning that not all of its features are in the system yet, Also means there could be bugs that i have not found yet. Its meant for testing proposes only. I dont have a large enough player base to test the system like it should be tested. I have tested it enough to tell you that all the main features/functions are apear to work correctly. I will update this system offen.

With that said. On with the show.

I first would like to give thanks to a few people

ArteGordon
You have helped me more times than i can count, and you always there when i need you. Thank you for all your help and thanks for putting up with me :)

Maeve
Thank you for letting me use your server as the testing ground for this system. Thanks for you help on this project and others. and for donating your bank stone script :p

Sage/Peg/FoxXxy (FS Staff)
Thank you for your help on the buildings in this system and your help with ideas.

Viago
I used Viagos stable stone V2 as a liner to create the one featured in this system

Krazeykow
I used Krazeykow's Corpse Stone as a liner for the Resurrection stone featured in this system.

Everyone Else
To everyone else on the support boards who has helped in this project and maybe didnt know, I have been keeping it hush for a few months now :)

BankStone script donated by maeve, Author of script unknown.

FS Player Government System Overview

The system is designed to let players create thier own cities, governments. In the past a player could only have his/her house placed near their friends and call it a self proclaimed city. With this system a player can host and manage there own real city, With guards, Mayor Elections, Taxes, Treasury, Wars, Allies, Moongate Registarion System, and much more. I will try to cover each feature in this post.

City Halls
A city hall is the corner stone of the player city, It houses the city management stone, and election stone. Here the mayor can manage the many features of the FSGovSystem. In order for a player to place a city hall they must have at least 35 Forensics, (Also needed to run for mayor) Once they have this they need to seek out a City Hall Deed (Crafted by Carps/Smiths with Archetect Tool made by tinkers) Now a city hall must be placed at least 500 tiles away from any other city / guarded area. Once this is done the player then has 24 hours to get 20 citizens into the city, In order to become a citizen the player must own a house withing city limits then be added to the city stone. All chars from an account can join the city as long as they own a house within city limits on that account. So you can get 5 citizens on your average account.

Elections / Voting
There is an election every 14 days, There can be only 2 candates running at per each election. Each time a canidate gets a vote they are rewarded .1 points in forensics, I citizen can only vote once per election. If the current mayor is out voted the new mayor takes control over the city and the old mayor becomes a normal citizen. So it is not wise to decore the city with your best weapons. Cause you can be outvoted.

Taxes / Treasury / Maintenace
Once the city is at the proper level, The Mayor can levy taxes, Taxes goto the city treasury, Which in turn is used for the city maintenace each week, Maintenace costs very depending on the stats of the city. The mayor can veiw the cost via the Maintenace report off the main Management stone menu. Now as mayor you can withdraw and depoist gold into and out of the city treasury. As a citizen you may only depoist gold. Each week taxes are collected from citizens, If the citizen lacks the gold needed, they will be put on a Back Taxes list, and the system will try to collect every time they log in, If the player owes 10k and has 15k it will take the full amount needed, however if the players owes 10k and only has 5k in bank on login it will take that 5k update the amount owed and try again next login. Taxes very from Income Tax, Property Tax, and Travel Tax, Income and Property are charged weekly however Travel tax is only charged when someone used a city moongate comeing or going from the city. If the city owns a stable, Each time a pet is stabled the 30 gold is added to the city treasury, If the city owns a Healer, They can apply a Res, and Body Retreavil Fee for using the res stone. If the city treasury runs low and the city updates and they amount needed for maintenace is not in the treasury the city will delete.

Moongate Registration System
All Public Moongates will now have a feature "Player City Menu" from here you can veiw all cities that own a moongate and Are registered. If that city has a travel tax the player will be charged for coming and leaving the city using the public moongate... For Example. Your in luna and want to goto "Bobs City" the city has a 100 gold travel tax, You will have to pay that before going to city via a menu, Then apon leaving you use the moongate in bobs city again you will be charged a leaving fee of 100 gold, Its call Incoming/Outgoing Cities. If you read the script :)

Wars/Allies
This is fairly simple. Kinda like guilds, but different, Not much more i can say lol

City Banning
When a player is banned from the city. They become orange and attackable to all citizens in the city (Only while they are in the city) I did this because if the player was denied access to that region it could block areas from that player and cause issues. This way there life is in their own hands if they deside to enter. Also you cannot ban a citizen of the city, Or anyone who owns a house within the city.

Guards Feature
If the city is at the required level the mayor can choose weather or not to enable guards in the region.

City Growth
As the city gets more citizens the cities size will change, Starting a city is 50x50 from the city hall, and can grow as big as 250x250, As the city levels its title rank will change when entering the city you will get a message such as "You have entered the village of bob's city." these ranks are customiable via the Settings Script (PlayerGovernmentSystem.cs) as well as many other features. Ranks includes

Level 1 = Outpost
Level 2 = Village
Level 3 = Township
Level 4 = City
Level 5 = Metroloplis
Level 6 = Empire

Also as the city grows it will get more Decore room so you can add items around the city for eye candy :)

Admin Settings
Almost all of the features in this system are customizable, See PlayerGovernmentSystem.cs it has all the settings there you can tweak for your server. From Min / Max citizens per city, To Update and Voting Times, Ranks, Etc.

In closing i hope you enjoy the system. I have worked on it for 5 months now, and its far from being done. I have alot more ideas for this one. I would love to hear your feedback on the system Suggestions, Comments, Bug Reports.

Ronin

Install

ALWAYS BACKUP FILES BEFORE REPLACING!!!

Distros Changed...
PlayerMobile.cs
Notority.cs
DefTinker.cs
LoginStats.cs
PublicMoongate.cs

Read docs on how to update your distros, Stock Distros with FSGov edits are included with the system for those who use WinMerge.

Drop the rest in your customs folder and have fun running your empire.
 

Attachments

  • FSGov BETA 4.zip
    280.6 KB · Views: 1,539

Greystar

Wanderer
RoninGT said:
FS Player Government System BETA 1

Drop the rest in your customs folder and have fun running your empire.


Hey Ronin thats incredible, we shoulda been co admins on a shard or something. This is eventually what I was planning to do with my killable guards to, if you could add one simple feature to your script... make it so that the mayor has to Higher guards and they would have a salary as well. Since I have multiple guard types they could higher multiple types of guards of course certain types (ie mages and paladin guards) will cost more but are also worth more cause of their spellcasting abilities. I was also going to use my guardposts as replacement for standard guardedregions then of course disable them. Once Again cool, I will be watching this and even though its beta I may still plug it in anyways since you've always taken well to contructive criticism.
 

RoninGT

Sorceror
Thank you, I like the hirable guards idea. I was thinking the same thing. Ill look over your system and check it out maybe contact you via icq and kick around some ideas if thats cool.

Ronin
 

Greystar

Wanderer
RoninGT said:
Thank you, I like the hirable guards idea. I was thinking the same thing. Ill look over your system and check it out maybe contact you via icq and kick around some ideas if thats cool.

Ronin


its cool ill start up my ICQ again incase you decide to message me (have it turned off at the moment).
 

LordHogFred

Knight
RoninGT said:
LordHogFred
Yes all features listed work... but i am still adding LoL

Miles84
Thanks

Ronin

Ok cool, definatley putting it in then. I've been waiting for this!

By the way, just a suggestion. How about adding hireable resource gatherers? Basically buildings that when added to the city have a weekly resource gather rate and all citizens can help themselves to a weekly amount of wood, ore, leather, etc at the expense of a high maintenence (thus high tax rate). Also the buildings (lumberjacks hut, ore mine, etc) would come in different "levels" each one producing higher yield but costing more. I have been wanting to add this resource system to my shard for a while but haven't been able to do so, so I thought that I'd make it a public idea so that you might be able to add it to your system. If you're interested I have already made several "levels" of building types if you would like me to send them to you.

Just thought you might like it :p

Chz :),
 

Greystar

Wanderer
LordHogFred said:
Ok cool, definatley putting it in then. I've been waiting for this!

By the way, just a suggestion. How about adding hireable resource gatherers? Basically buildings that when added to the city have a weekly resource gather rate and all citizens can help themselves to a weekly amount of wood, ore, leather, etc at the expense of a high maintenence (thus high tax rate). Also the buildings (lumberjacks hut, ore mine, etc) would come in different "levels" each one producing higher yield but costing more. I have been wanting to add this resource system to my shard for a while but haven't been able to do so, so I thought that I'd make it a public idea so that you might be able to add it to your system. If you're interested I have already made several "levels" of building types if you would like me to send them to you.

Just thought you might like it :p

Chz :),


This makes me think of Age of Empires series of games.. But it would be cool ;).
 

RoninGT

Sorceror
LordHogFred
Yes i like that idea.. This system is cloned after SWG player gov system. They have the same thing. Remember its a beta i have alot more to add to it.

Also if anyone wants to submit any building designs. They are all in the form of addons I used Aryas Addon Gen to create them. I am always looking for new buildings. I plan in a future update to replace all the stock buildings with new ones the ones we have now are good but i want better :)

Ronin
 

LordHogFred

Knight
Oh by the way I don't suppose you could be kind enough to update my custom PublicMoongate please?

Code:
using System; 
using System.Collections; 
using Server; 
using Server.Gumps; 
using Server.Network; 
using Server.Mobiles; 

namespace Server.Items 
{ 
   public class PublicMoongate : Item 
   { 
      [Constructable] 
      public PublicMoongate() : base( 0xF6C ) 
      { 
         Movable = false; 
	   Hue = 0; 
         Light = LightType.Circle300; 
      } 

      public PublicMoongate( Serial serial ) : base( serial ) 
      { 
      } 

      public override void OnDoubleClick( Mobile from ) 
      { 
         if ( !from.Player ) 
            return; 

         if ( from.InRange( GetWorldLocation(), 1 ) ) 
            UseGate( from ); 
         else 
            from.SendLocalizedMessage( 500446 ); // That is too far away, u idiot. 
      } 

      public override bool OnMoveOver( Mobile m ) 
      { 
         return !m.Player || UseGate( m ); 
      } 

      public bool UseGate( Mobile m ) 
      { 
         if ( m.Criminal ) 
         { 
            m.SendLocalizedMessage( 1005561, "", 0x22 ); // Your a criminal smart one.... 
            return false; 
         } 
         else if ( Server.Spells.SpellHelper.CheckCombat( m ) ) 
         { 
            m.SendLocalizedMessage( 1005564, "", 0x22 ); // Typical newbie, trying to run.... 
            return false; 
         } 
         else 
         { 
            m.CloseGump( typeof( MoongateGump ) ); 
            m.SendGump( new MoongateGump( m, this ) ); 

            Effects.PlaySound( m.Location, m.Map, 0x20E ); 
            return true; 
         } 
      } 

      public override void Serialize( GenericWriter writer ) 
      { 
         base.Serialize( writer ); 

         writer.Write( (int) 0 ); // version 
      } 

      public override void Deserialize( GenericReader reader ) 
      { 
         base.Deserialize( reader ); 

         int version = reader.ReadInt(); 
      } 

      public static void Initialize() 
      { 
         Server.Commands.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) ); 
      } 

      [Usage( "MoonGen" )] 
      [Description( "Generates public moongates. Removes all old moongates." )] 
      public static void MoonGen_OnCommand( CommandEventArgs e ) 
      { 
         DeleteAll(); 

         int count = 0; 

         count += MoonGen( PMList.Trammel ); 
         count += MoonGen( PMList.Felucca ); 
         count += MoonGen( PMList.Ilshenar ); 
         count += MoonGen( PMList.Malas );
	   count += MoonGen( PMList.TokunoIslands ); 

         World.Broadcast( 0x35, true, "{0} moongates generated.", count ); 
      } 

      private static void DeleteAll() 
      { 
         ArrayList list = new ArrayList(); 

         foreach ( Item item in World.Items.Values ) 
         { 
            if ( item is PublicMoongate ) 
               list.Add( item ); 
         } 

         foreach ( Item item in list ) 
            item.Delete(); 

         if ( list.Count > 0 ) 
            World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count ); 
      } 

      private static int MoonGen( PMList list ) 
      { 
         foreach ( PMEntry entry in list.Entries ) 
         { 
            Item item = new PublicMoongate(); 

            item.MoveToWorld( entry.Location, list.Map ); 

            if ( entry.Text == "Umbra" )   // was - if ( entry.Number == 1060642 ) 
               item.Hue = 0x497; 
         } 

         return list.Entries.Length; 
      } 
   } 

// ** BEGIN CHANGES DESTINATIONS ** 
   public class PMEntry 
   { 
      private Point3D m_Location; 
      private string m_Text;            // was - private int m_Number; 

      public Point3D Location 
      { 
         get 
         { 
            return m_Location; 
         } 
      } 

      public string Text            // was - public int Number 
      { 
         get 
         { 
            return m_Text;         // was - return m_Number; 
         } 
      } 

      public PMEntry( Point3D loc, string text )   // was - public PMEntry( Point3D loc, int number ) 
      { 
         m_Location = loc; 
         m_Text = text;            // was - m_Number = number; 
      } 
   } 
// ** END CHANGES DESTINATIONS ** 

// ** BEGIN CHANGES FACETS ** 
   public class PMList 
   { 
      private string m_Text, m_SelText;         // was - private int m_Number, m_SelNumber; 
      private Map m_Map; 
      private PMEntry[] m_Entries; 

      public string Text            // was - public int Number 
      { 
         get 
         { 
            return m_Text;         // was - return m_Number; 
         } 
      } 

      public string SelText            // was - public int SelNumber 
      { 
         get 
         { 
            return m_SelText;      // was - return m_SelNumber; 
         } 
      } 

      public Map Map 
      { 
         get 
         { 
            return m_Map; 
         } 
      } 

      public PMEntry[] Entries 
      { 
         get 
         { 
            return m_Entries; 
         } 
      } 

//      public PMList( int number, int selNumber, Map map, PMEntry[] entries ) 
      public PMList( string text, string selText, Map map, PMEntry[] entries ) 
      { 
         m_Text = text;            // was - m_Number = number; 
         m_SelText = selText;         // was - m_SelNumber = selNumber; 
         m_Map = map; 
         m_Entries = entries; 
      } 
// ** END CHANGES FACETS 

// ** BEGIN CHANGES DESTINATIONS & FACETS ** Change cliloc number to text. 
// ** Change PMList lines if changing facets in this script. Do this for all facets. 
// ** Change PMEntry lines if changing destination names in this script. Do this for all destinations. 
      public static readonly PMList Trammel = 
         new PMList( "Trammel", "<BASEFONT COLOR=#2DDC1B>Trammel</BASEFONT>", Map.Trammel, new PMEntry[] 
            { 
               new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow 
               new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain 
               new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom 
               new PMEntry( new Point3D(  771,  752, 5 ), "Yew" ), // Yew 
               new PMEntry( new Point3D( 2701,  692, 5 ), "Minoc" ), // Minoc 
               new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic 
               new PMEntry( new Point3D(  643, 2067, 5 ), "Skara Brae" ), // Skara Brae 
               new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia 
               new PMEntry( new Point3D( 3763, 2771, 50), "Haven" ),  // Haven 
		   new PMEntry( new Point3D( 3767, 1295, 0), "Nujel'm" ), //Nujel'm
		   new PMEntry( new Point3D( 2805, 1004, 0), "Vesper") //Vesper
            } ); 

      public static readonly PMList Felucca = 
         new PMList( "Felucca", "<BASEFONT COLOR=#2DDC1B>Felucca</BASEFONT>", Map.Felucca, new PMEntry[] 
            { 
 
               new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow 
               new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain 
               new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom 
               new PMEntry( new Point3D(  771,  752, 5 ), "Yew" ), // Yew 
               new PMEntry( new Point3D( 2701,  692, 5 ), "Minoc" ), // Minoc 
               new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic 
               new PMEntry( new Point3D(  643, 2067, 5 ), "Skara Brae" ), // Skara Brae 
               new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia 
               new PMEntry( new Point3D( 2711, 2234, 0 ), "Buccaneer's Den" ), // Buccaneer's Den
		   new PMEntry( new Point3D( 3767, 1295, 0), "Nujel'm" ) //Nujel'm
            } ); 

      public static readonly PMList Ilshenar = 
         new PMList( "Ilshenar", "<BASEFONT COLOR=#2DDC1B>Ilshenar</BASEFONT>", Map.Ilshenar, new PMEntry[] 
            { 
               new PMEntry( new Point3D( 1215,  467, -13 ), "Compassion" ), // Compassion 
               new PMEntry( new Point3D(  722, 1366, -60 ), "Honesty" ), // Honesty 
               new PMEntry( new Point3D(  744,  724, -28 ), "Honor" ), // Honor 
               new PMEntry( new Point3D(  281, 1016,   0 ), "Humility" ), // Humility 
               new PMEntry( new Point3D(  987, 1011, -32 ), "Justice" ), // Justice 
               new PMEntry( new Point3D( 1174, 1286, -30 ), "Sacrifice" ), // Sacrifice 
               new PMEntry( new Point3D( 1532, 1340, - 3 ), "Spirituality" ), // Spirituality 
               new PMEntry( new Point3D(  528,  216, -45 ), "Valor" ), // Valor 
               new PMEntry( new Point3D( 1721,  218,  96 ), "Chaos" )  // Chaos 
            } ); 

      public static readonly PMList Malas = 
         new PMList( "Malas", "<BASEFONT COLOR=#2DDC1B>Malas</BASEFONT>", Map.Malas, new PMEntry[] 
            { 
               new PMEntry( new Point3D( 1015,  527, -65 ), "Luna" ), // Luna 
               new PMEntry( new Point3D( 1997, 1386, -85 ), "Umbra" )  // Umbra 
            } ); 

//SE Map
	public static readonly PMList TokunoIslands =
	new PMList( "Tokuno Islands", "<BASEFONT COLOR=#2DDC1B>Tokuno Islands</BASEFONT>", Map.Maps[4], new PMEntry[]
		{
		new PMEntry( new Point3D( 1169,  998, 41 ), "Isamu-Jima" ), 
		new PMEntry( new Point3D( 802,  1204, 25 ), "Makoto-Jima" ),
		new PMEntry( new Point3D( 270, 628, 15 ), "Homare-Jima" )  
		} );


// ** END CHANGES DESTINATIONS & FACETS ** 

      public static readonly PMList[] UORLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, TokunoIslands  }; 
      public static readonly PMList[] LBRLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, TokunoIslands  }; 
      public static readonly PMList[] AOSLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, TokunoIslands }; 
      public static readonly PMList[] RedLists = new PMList[]{ Felucca }; 
   } 

   public class MoongateGump : Gump 
   { 
      private Mobile m_Mobile; 
      private Item m_Moongate; 
      private PMList[] m_Lists; 

      public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 ) 
      { 
         m_Mobile = mobile; 
         m_Moongate = moongate; 

         PMList[] checkLists; 

         if ( mobile.Player ) 
         { 
            if ( mobile.Kills >= 5 ) 
            { 
               checkLists = PMList.RedLists; 
            } 
            else 
            { 
               int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags; 

               if ( Core.AOS && (flags & 0x8) != 0 ) 
                  checkLists = PMList.AOSLists; 
               else if ( (flags & 0x4) != 0 ) 
                  checkLists = PMList.LBRLists; 
               else 
                  checkLists = PMList.UORLists; 
            } 
         } 
         else 
         { 
            checkLists = PMList.AOSLists; 
         } 

         m_Lists = new PMList[checkLists.Length]; 

         for ( int i = 0; i < m_Lists.Length; ++i ) 
            m_Lists[i] = checkLists[i]; 

         for ( int i = 0; i < m_Lists.Length; ++i ) 
         { 
            if ( m_Lists[i].Map == mobile.Map ) 
            { 
               PMList temp = m_Lists[i]; 

               m_Lists[i] = m_Lists[0]; 
               m_Lists[0] = temp; 

               break; 
            } 
         } 

         AddPage( 0 ); 

         AddBackground( 0, 0, 380, 335, 5054 ); 

         AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 ); 
         AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY 

         AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 ); 
         AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL 

         AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination: 

         for ( int i = 0; i < checkLists.Length; ++i ) 
         { 
            AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 ); 
// ** BEGIN CHANGES FACETS ** 
//            AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false ); 
            AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].Text, false, false ); 
// ** END CHANGES FACETS ** 
         } 

         for ( int i = 0; i < m_Lists.Length; ++i ) 
            RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) ); 
      } 

      private void RenderPage( int index, int offset ) 
      { 
         PMList list = m_Lists[index]; 

         AddPage( index + 1 ); 

         AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 ); 
// ** BEGIN CHANGES FACETS ** 
//         AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false ); 
         AddHtml( 30, 35 + (offset * 25), 150, 20, list.SelText, false, false ); 
// ** END CHANGES FACETS ** 
         PMEntry[] entries = list.Entries; 

         for ( int i = 0; i < entries.Length; ++i ) 
         { 
            AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i ); 
// ** BEGIN CHANGES DESTINATIONS ** 
//            AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false ); 
            AddHtml( 225, 35 + (i * 25), 150, 20, entries[i].Text, false, false ); 
// ** END CHANGES DESTINATIONS ** 
         } 
      } 

      public override void OnResponse( NetState state, RelayInfo info ) 
      { 
         if ( info.ButtonID == 0 ) // Cancel 
            return; 
         else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null ) 
            return; 

         int[] switches = info.Switches; 

         if ( switches.Length == 0 ) 
            return; 

         int switchID = switches[0]; 
         int listIndex = switchID / 100; 
         int listEntry = switchID % 100; 

         if ( listIndex < 0 || listIndex >= m_Lists.Length ) 
            return; 

         PMList list = m_Lists[listIndex]; 

         if ( listEntry < 0 || listEntry >= list.Entries.Length ) 
            return; 

         PMEntry entry = list.Entries[listEntry]; 

         if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map ) 
         { 
            m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate. 
         } 
         else if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca ) 
         { 
            m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there. 
         } 
         else if ( m_Mobile.Criminal ) 
         { 
            m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Your a criminal smart one.... 
         } 
         else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) ) 
         { 
            m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Typical newbie, trying to run.... 
         } 
         else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) ) 
         { 
            m_Mobile.SendLocalizedMessage( 1019003 ); // Smooth, Your already there.... 
         } 
         else 
         { 
            BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map ); 

            m_Mobile.Combatant = null; 
            m_Mobile.Warmode = false; 
            m_Mobile.Hidden = true; 
            m_Mobile.Map = list.Map; 
            m_Mobile.Location = entry.Location; 

            Effects.PlaySound( entry.Location, list.Map, 0x1FE ); 
         } 
      } 
   } 
}

Thanks :),
 

RoninGT

Sorceror
Here you got, I didnt clean the code up, When you copy and paste off here the code comes out chopy for some reason... that drives me nuts lol but here it is.

Code:
using System; 
using System.Collections; 
using Server; 
using Server.Gumps; 
using Server.Network; 
using Server.Mobiles; 
using Server.Regions;

namespace Server.Items 
{ 
   public class PublicMoongate : Item 
   { 
      [Constructable] 
      public PublicMoongate() : base( 0xF6C ) 
      { 
         Movable = false; 
	   Hue = 0; 
         Light = LightType.Circle300; 
      } 

      public PublicMoongate( Serial serial ) : base( serial ) 
      { 
      } 

      public override void OnDoubleClick( Mobile from ) 
      { 
         if ( !from.Player ) 
            return; 

         if ( from.InRange( GetWorldLocation(), 1 ) ) 
            UseGate( from ); 
         else 
            from.SendLocalizedMessage( 500446 ); // That is too far away, u idiot. 
      } 

      public override bool OnMoveOver( Mobile m ) 
      { 
         return !m.Player || UseGate( m ); 
      } 

      public bool UseGate( Mobile m ) 
      { 
         if ( m.Criminal ) 
         { 
            m.SendLocalizedMessage( 1005561, "", 0x22 ); // Your a criminal smart one.... 
            return false; 
         } 
         else if ( Server.Spells.SpellHelper.CheckCombat( m ) ) 
         { 
            m.SendLocalizedMessage( 1005564, "", 0x22 ); // Typical newbie, trying to run.... 
            return false; 
         } 
         else 
         { 
            m.CloseGump( typeof( MoongateGump ) ); 
            m.SendGump( new MoongateGump( m, this ) ); 

            Effects.PlaySound( m.Location, m.Map, 0x20E ); 
            return true; 
         } 
      } 

      public override void Serialize( GenericWriter writer ) 
      { 
         base.Serialize( writer ); 

         writer.Write( (int) 0 ); // version 
      } 

      public override void Deserialize( GenericReader reader ) 
      { 
         base.Deserialize( reader ); 

         int version = reader.ReadInt(); 
      } 

      public static void Initialize() 
      { 
         Server.Commands.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) ); 
      } 

      [Usage( "MoonGen" )] 
      [Description( "Generates public moongates. Removes all old moongates." )] 
      public static void MoonGen_OnCommand( CommandEventArgs e ) 
      { 
         DeleteAll(); 

         int count = 0; 

         count += MoonGen( PMList.Trammel ); 
         count += MoonGen( PMList.Felucca ); 
         count += MoonGen( PMList.Ilshenar ); 
         count += MoonGen( PMList.Malas );
	   count += MoonGen( PMList.TokunoIslands ); 

         World.Broadcast( 0x35, true, "{0} moongates generated.", count ); 
      } 

      private static void DeleteAll() 
      { 
         ArrayList list = new ArrayList(); 

         foreach ( Item item in World.Items.Values ) 
         { 
            if ( item is PublicMoongate ) 
               list.Add( item ); 
         } 

         foreach ( Item item in list ) 
            item.Delete(); 

         if ( list.Count > 0 ) 
            World.Broadcast( 0x35, true, "{0} moongates removed.", list.Count ); 
      } 

      private static int MoonGen( PMList list ) 
      { 
         foreach ( PMEntry entry in list.Entries ) 
         { 
            Item item = new PublicMoongate(); 

            item.MoveToWorld( entry.Location, list.Map ); 

            if ( entry.Text == "Umbra" )   // was - if ( entry.Number == 1060642 ) 
               item.Hue = 0x497; 
         } 

         return list.Entries.Length; 
      } 
   } 

// ** BEGIN CHANGES DESTINATIONS ** 
   public class PMEntry 
   { 
      private Point3D m_Location; 
      private string m_Text;            // was - private int m_Number; 

      public Point3D Location 
      { 
         get 
         { 
            return m_Location; 
         } 
      } 

      public string Text            // was - public int Number 
      { 
         get 
         { 
            return m_Text;         // was - return m_Number; 
         } 
      } 

      public PMEntry( Point3D loc, string text )   // was - public PMEntry( Point3D loc, int number ) 
      { 
         m_Location = loc; 
         m_Text = text;            // was - m_Number = number; 
      } 
   } 
// ** END CHANGES DESTINATIONS ** 

// ** BEGIN CHANGES FACETS ** 
   public class PMList 
   { 
      private string m_Text, m_SelText;         // was - private int m_Number, m_SelNumber; 
      private Map m_Map; 
      private PMEntry[] m_Entries; 

      public string Text            // was - public int Number 
      { 
         get 
         { 
            return m_Text;         // was - return m_Number; 
         } 
      } 

      public string SelText            // was - public int SelNumber 
      { 
         get 
         { 
            return m_SelText;      // was - return m_SelNumber; 
         } 
      } 

      public Map Map 
      { 
         get 
         { 
            return m_Map; 
         } 
      } 

      public PMEntry[] Entries 
      { 
         get 
         { 
            return m_Entries; 
         } 
      } 

//      public PMList( int number, int selNumber, Map map, PMEntry[] entries ) 
      public PMList( string text, string selText, Map map, PMEntry[] entries ) 
      { 
         m_Text = text;            // was - m_Number = number; 
         m_SelText = selText;         // was - m_SelNumber = selNumber; 
         m_Map = map; 
         m_Entries = entries; 
      } 
// ** END CHANGES FACETS 

// ** BEGIN CHANGES DESTINATIONS & FACETS ** Change cliloc number to text. 
// ** Change PMList lines if changing facets in this script. Do this for all facets. 
// ** Change PMEntry lines if changing destination names in this script. Do this for all destinations. 
      public static readonly PMList Trammel = 
         new PMList( "Trammel", "<BASEFONT COLOR=#2DDC1B>Trammel</BASEFONT>", Map.Trammel, new PMEntry[] 
            { 
               new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow 
               new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain 
               new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom 
               new PMEntry( new Point3D(  771,  752, 5 ), "Yew" ), // Yew 
               new PMEntry( new Point3D( 2701,  692, 5 ), "Minoc" ), // Minoc 
               new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic 
               new PMEntry( new Point3D(  643, 2067, 5 ), "Skara Brae" ), // Skara Brae 
               new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia 
               new PMEntry( new Point3D( 3763, 2771, 50), "Haven" ),  // Haven 
		   new PMEntry( new Point3D( 3767, 1295, 0), "Nujel'm" ), //Nujel'm
		   new PMEntry( new Point3D( 2805, 1004, 0), "Vesper") //Vesper
            } ); 

      public static readonly PMList Felucca = 
         new PMList( "Felucca", "<BASEFONT COLOR=#2DDC1B>Felucca</BASEFONT>", Map.Felucca, new PMEntry[] 
            { 
 
               new PMEntry( new Point3D( 4467, 1283, 5 ), "Moonglow" ), // Moonglow 
               new PMEntry( new Point3D( 1336, 1997, 5 ), "Britain" ), // Britain 
               new PMEntry( new Point3D( 1499, 3771, 5 ), "Jhelom" ), // Jhelom 
               new PMEntry( new Point3D(  771,  752, 5 ), "Yew" ), // Yew 
               new PMEntry( new Point3D( 2701,  692, 5 ), "Minoc" ), // Minoc 
               new PMEntry( new Point3D( 1828, 2948,-20), "Trinsic" ), // Trinsic 
               new PMEntry( new Point3D(  643, 2067, 5 ), "Skara Brae" ), // Skara Brae 
               new PMEntry( new Point3D( 3563, 2139, 34), "Magincia" ), // Magincia 
               new PMEntry( new Point3D( 2711, 2234, 0 ), "Buccaneer's Den" ), // Buccaneer's Den
		   new PMEntry( new Point3D( 3767, 1295, 0), "Nujel'm" ) //Nujel'm
            } ); 

      public static readonly PMList Ilshenar = 
         new PMList( "Ilshenar", "<BASEFONT COLOR=#2DDC1B>Ilshenar</BASEFONT>", Map.Ilshenar, new PMEntry[] 
            { 
               new PMEntry( new Point3D( 1215,  467, -13 ), "Compassion" ), // Compassion 
               new PMEntry( new Point3D(  722, 1366, -60 ), "Honesty" ), // Honesty 
               new PMEntry( new Point3D(  744,  724, -28 ), "Honor" ), // Honor 
               new PMEntry( new Point3D(  281, 1016,   0 ), "Humility" ), // Humility 
               new PMEntry( new Point3D(  987, 1011, -32 ), "Justice" ), // Justice 
               new PMEntry( new Point3D( 1174, 1286, -30 ), "Sacrifice" ), // Sacrifice 
               new PMEntry( new Point3D( 1532, 1340, - 3 ), "Spirituality" ), // Spirituality 
               new PMEntry( new Point3D(  528,  216, -45 ), "Valor" ), // Valor 
               new PMEntry( new Point3D( 1721,  218,  96 ), "Chaos" )  // Chaos 
            } ); 

      public static readonly PMList Malas = 
         new PMList( "Malas", "<BASEFONT COLOR=#2DDC1B>Malas</BASEFONT>", Map.Malas, new PMEntry[] 
            { 
               new PMEntry( new Point3D( 1015,  527, -65 ), "Luna" ), // Luna 
               new PMEntry( new Point3D( 1997, 1386, -85 ), "Umbra" )  // Umbra 
            } ); 

//SE Map
	public static readonly PMList TokunoIslands =
	new PMList( "Tokuno Islands", "<BASEFONT COLOR=#2DDC1B>Tokuno Islands</BASEFONT>", Map.Maps[4], new PMEntry[]
		{
		new PMEntry( new Point3D( 1169,  998, 41 ), "Isamu-Jima" ), 
		new PMEntry( new Point3D( 802,  1204, 25 ), "Makoto-Jima" ),
		new PMEntry( new Point3D( 270, 628, 15 ), "Homare-Jima" )  
		} );


// ** END CHANGES DESTINATIONS & FACETS ** 

      public static readonly PMList[] UORLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, TokunoIslands  }; 
      public static readonly PMList[] LBRLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, TokunoIslands  }; 
      public static readonly PMList[] AOSLists = new PMList[]{ Trammel, Felucca, Ilshenar, Malas, TokunoIslands }; 
      public static readonly PMList[] RedLists = new PMList[]{ Felucca }; 
   } 

   public class MoongateGump : Gump 
   { 
      private Mobile m_Mobile; 
      private Item m_Moongate; 
      private PMList[] m_Lists; 

      public MoongateGump( Mobile mobile, Item moongate ) : base( 100, 100 ) 
      { 
         m_Mobile = mobile; 
         m_Moongate = moongate; 

         PMList[] checkLists; 

         if ( mobile.Player ) 
         { 
            if ( mobile.Kills >= 5 ) 
            { 
               checkLists = PMList.RedLists; 
            } 
            else 
            { 
               int flags = mobile.NetState == null ? 0 : mobile.NetState.Flags; 

               if ( Core.AOS && (flags & 0x8) != 0 ) 
                  checkLists = PMList.AOSLists; 
               else if ( (flags & 0x4) != 0 ) 
                  checkLists = PMList.LBRLists; 
               else 
                  checkLists = PMList.UORLists; 
            } 
         } 
         else 
         { 
            checkLists = PMList.AOSLists; 
         } 

         m_Lists = new PMList[checkLists.Length]; 

         for ( int i = 0; i < m_Lists.Length; ++i ) 
            m_Lists[i] = checkLists[i]; 

         for ( int i = 0; i < m_Lists.Length; ++i ) 
         { 
            if ( m_Lists[i].Map == mobile.Map ) 
            { 
               PMList temp = m_Lists[i]; 

               m_Lists[i] = m_Lists[0]; 
               m_Lists[0] = temp; 

               break; 
            } 
         } 

         AddPage( 0 ); 

         AddBackground( 0, 0, 380, 335, 5054 ); 

	AddButton( 10, 185, 4005, 4007, 2, GumpButtonType.Reply, 0 );
	AddHtml( 45, 185, 140, 25, @"Player City Menu", false, false );

         AddButton( 10, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 ); 
         AddHtmlLocalized( 45, 210, 140, 25, 1011036, false, false ); // OKAY 

         AddButton( 10, 235, 4005, 4007, 0, GumpButtonType.Reply, 0 ); 
         AddHtmlLocalized( 45, 235, 140, 25, 1011012, false, false ); // CANCEL 

         AddHtmlLocalized( 5, 5, 200, 20, 1012011, false, false ); // Pick your destination: 

         for ( int i = 0; i < checkLists.Length; ++i ) 
         { 
            AddButton( 10, 35 + (i * 25), 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf( m_Lists, checkLists[i] ) + 1 ); 
// ** BEGIN CHANGES FACETS ** 
//            AddHtmlLocalized( 30, 35 + (i * 25), 150, 20, checkLists[i].Number, false, false ); 
            AddHtml( 30, 35 + (i * 25), 150, 20, checkLists[i].Text, false, false ); 
// ** END CHANGES FACETS ** 
         } 

         for ( int i = 0; i < m_Lists.Length; ++i ) 
            RenderPage( i, Array.IndexOf( checkLists, m_Lists[i] ) ); 
      } 

      private void RenderPage( int index, int offset ) 
      { 
         PMList list = m_Lists[index]; 

         AddPage( index + 1 ); 

         AddButton( 10, 35 + (offset * 25), 2117, 2118, 0, GumpButtonType.Page, index + 1 ); 
// ** BEGIN CHANGES FACETS ** 
//         AddHtmlLocalized( 30, 35 + (offset * 25), 150, 20, list.SelNumber, false, false ); 
         AddHtml( 30, 35 + (offset * 25), 150, 20, list.SelText, false, false ); 
// ** END CHANGES FACETS ** 
         PMEntry[] entries = list.Entries; 

         for ( int i = 0; i < entries.Length; ++i ) 
         { 
            AddRadio( 200, 35 + (i * 25), 210, 211, false, (index * 100) + i ); 
// ** BEGIN CHANGES DESTINATIONS ** 
//            AddHtmlLocalized( 225, 35 + (i * 25), 150, 20, entries[i].Number, false, false ); 
            AddHtml( 225, 35 + (i * 25), 150, 20, entries[i].Text, false, false ); 
// ** END CHANGES DESTINATIONS ** 
         } 
      } 

      public override void OnResponse( NetState state, RelayInfo info ) 
      { 
         if ( info.ButtonID == 0 ) // Cancel 
            return; 
         else if ( m_Mobile.Deleted || m_Moongate.Deleted || m_Mobile.Map == null ) 
            return; 

	if ( info.ButtonID == 2 )
	{
		ArrayList a = new ArrayList();

		foreach ( Item i in World.Items.Values )
		{
			if ( i is CityManagementStone )
			{
				CityManagementStone s = (CityManagementStone)i;
						
				if ( s.HasMoongate == true && s.IsRegistered == true )
					a.Add( i );
			}
		}

		if ( a.Count == 0 )
		{
			m_Mobile.SendGump( new NoCitiesGump() );
		}
		else
		{
			m_Mobile.SendGump( new PCMoongateGump( m_Moongate, 0, null, null ) );
		}
	}

         int[] switches = info.Switches; 

         if ( switches.Length == 0 ) 
            return; 

         int switchID = switches[0]; 
         int listIndex = switchID / 100; 
         int listEntry = switchID % 100; 

         if ( listIndex < 0 || listIndex >= m_Lists.Length ) 
            return; 

         PMList list = m_Lists[listIndex]; 

         if ( listEntry < 0 || listEntry >= list.Entries.Length ) 
            return; 

         PMEntry entry = list.Entries[listEntry]; 

         if ( !m_Mobile.InRange( m_Moongate.GetWorldLocation(), 1 ) || m_Mobile.Map != m_Moongate.Map ) 
         { 
            m_Mobile.SendLocalizedMessage( 1019002 ); // You are too far away to use the gate. 
         } 
         else if ( m_Mobile.Player && m_Mobile.Kills >= 5 && list.Map != Map.Felucca ) 
         { 
            m_Mobile.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there. 
         } 
         else if ( m_Mobile.Criminal ) 
         { 
            m_Mobile.SendLocalizedMessage( 1005561, "", 0x22 ); // Your a criminal smart one.... 
         } 
         else if ( Server.Spells.SpellHelper.CheckCombat( m_Mobile ) ) 
         { 
            m_Mobile.SendLocalizedMessage( 1005564, "", 0x22 ); // Typical newbie, trying to run.... 
         } 
         else if ( m_Mobile.Map == list.Map && m_Mobile.InRange( entry.Location, 1 ) ) 
         { 
            m_Mobile.SendLocalizedMessage( 1019003 ); // Smooth, Your already there.... 
         } 
         else 
         { 
				CityManagementStone outgoingCity = null;
				Region currentRegion = Region.Find( m_Mobile.Location, m_Mobile.Map );

				if ( currentRegion != null )
				{
					if ( currentRegion is PlayerCityRegion )
					{
						PlayerCityRegion pcr = (PlayerCityRegion)currentRegion;

						outgoingCity = pcr.Stone;
					}
				}

				if ( outgoingCity != null && outgoingCity.TravelTax >= 1 )
				{
					m_Mobile.SendGump( new PCMoongateToll2Gump( m_Moongate, outgoingCity, entry.Location, list.Map ) );
				}
				else
				{
					BaseCreature.TeleportPets( m_Mobile, entry.Location, list.Map );
	
					m_Mobile.Combatant = null;
					m_Mobile.Warmode = false;
					m_Mobile.Hidden = true;

					m_Mobile.MoveToWorld( entry.Location, list.Map );

					Effects.PlaySound( entry.Location, list.Map, 0x1FE );
				}
         } 
      } 
   } 
}

Ronin
 

Greystar

Wanderer
RoninGT said:
LordHogFred
Yes i like that idea.. This system is cloned after SWG player gov system. They have the same thing. Remember its a beta i have alot more to add to it.

Also if anyone wants to submit any building designs. They are all in the form of addons I used Aryas Addon Gen to create them. I am always looking for new buildings. I plan in a future update to replace all the stock buildings with new ones the ones we have now are good but i want better :)

Ronin


If you want buildings I'd check some of the ones designed with UO Architect on Orbsydia. I used one of them in my redesign of Luna. and a pond cause it just looked nice and peacefull so it just had to be added. using UO Architect you can import and EXport buildings to, great program, although I also use Aryas Addon Gen for things to, was the original way I was moving things around before I realized I could do that with UOArchitect too.
 

Joeku

Lord
This looks awesome! I will be sure to keep this in mind when I get a larger player base (I have 3 players online avg now!)
 

PDakis

Wanderer
Your amazing, thats about sums it up properly ! I thank you for all your hard work and we will be testing this out on my small shard best as we can .
 
Top