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!

Public Gates

its a great sysem, and everything has been said by A li N
but what you need to do [PGControl and place the stone. then walk into the gate,. and a gump will come up. i hope that helps.

also i would like any help making the gumpball. please read above/
 

A_Li_N

Knight
WonderlandADnc said:
its a great sysem, and everything has been said by A li N
but what you need to do [PGControl and place the stone. then walk into the gate,. and a gump will come up. i hope that helps.

also i would like any help making the gumpball. please read above/
For the gumpball, you need to simply change the itemid of one of the gates in-game. The gate is sent to the gump, so making it any other class would not work (as the code is right now). I guess this might work...I didn't test it, but you can :)

Code:
using System;
using System.Collections;
using Server.Misc;
using Server.Mobiles;
using Server.Gumps;
using Server.Items;

namespace Server.PG
{
	public class GumpBall : PublicGate
	{
		[Constructable]
		public GumpBall() : base()
		{
			ItemID = 0x1870;
			Movable = false;
			Name = "Gump Ball";
			Light = LightType.Circle300;
		}

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

		public bool UseGate( Mobile m )
		{
			if( !PGSystem.Running )
			{
				m.SendMessage( "The Public Gate System is not active.  Please page a GM for assistance." );
				return false;
			}

			if ( m.Criminal )
			{
				m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
				return false;
			}
			else if ( Server.Spells.SpellHelper.CheckCombat( m ) )
			{
				m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
				return false;
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
				return false;
			}
			else
			{
				int page = 0;
				bool found = false;
				for( int i = 0; i < PGSystem.Entries.Count && !found; i++ )
				{
					PGCategory PGC = (PGCategory)PGSystem.Entries[i];
					if( PGC != null && PGC.Locations != null && PGC.Locations.Count > 0 &&
					    (PGC.GetFlag( EntryFlag.StaffOnly ) && m.AccessLevel > AccessLevel.Player) ||
					    (!PGC.GetFlag( EntryFlag.StaffOnly ) && ((!PGC.GetFlag( EntryFlag.Reds ) && m.Kills < 5) || PGC.GetFlag( EntryFlag.Reds ))) ||
					    (m.AccessLevel > AccessLevel.Player) )
					{
						for( int j = 0; j < PGC.Locations.Count && !found; j++ )
						{
							PGLocation PGL = (PGLocation)PGC.Locations[j];
							if( PGL != null && (PGL.GetFlag( EntryFlag.StaffOnly ) && m.AccessLevel > AccessLevel.Player) ||
							    (!PGL.GetFlag( EntryFlag.StaffOnly) && ((!PGL.GetFlag( EntryFlag.Reds ) && m.Kills < 5) || PGL.GetFlag( EntryFlag.Reds ))) ||
							    (m.AccessLevel > AccessLevel.Player) )
							{
								if( PGL.Location == this.Location && PGL.Map == this.Map )
								{
									page = i;
									found = true;
								}
							}
						}
					}
				}

				m.CloseGump( typeof( PGGump ) );
				m.SendGump( new PGGump( m, page, (PublicGate)this ) );

				if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
					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();
		}
	}
}


Deaths Awakener said:
hey how do i activate the moongates whenever i click or walk in it says like the gate is not activated please page a gm for assistance:mad:
Yes, like WonderlandADnc said. You need to activate the system first. Type [InitPublicGates 'true/false'. True will generate the default locations into the system.
 
ok thanks. i just tryed the script, but i get an error.
thanks again.

Code:
- Warning: Scripts\Customs\fortowns\A_Li_N's Public Gates 1.0.2\Items\GumpBall.
cs: CS0108: (line 25, column 15) The keyword new is required on 'Server.PG.GumpB
all.UseGate(Server.Mobile)' because it hides inherited member 'Server.PG.PublicG
ate.UseGate(Server.Mobile)'
 

A_Li_N

Knight
WonderlandADnc said:
ok thanks. i just tryed the script, but i get an error.
thanks again.

Code:
- Warning: Scripts\Customs\fortowns\A_Li_N's Public Gates 1.0.2\Items\GumpBall.
cs: CS0108: (line 25, column 15) The keyword new is required on 'Server.PG.GumpB
all.UseGate(Server.Mobile)' because it hides inherited member 'Server.PG.PublicG
ate.UseGate(Server.Mobile)'
In that case, it would require you to change the PublicGate.cs and I'm not going to do that, since that would require another release :)
If you wanted to, you could put 'virtual' in front of the 'bool' in PublicGate.cs's UseGate
public virtual bool UseGate

Then in the GumpBall.cs, you would do public override bool UseGate. Try those things and if they don't work, I'd simply just change the ItemID in-game...[set ItemID 0x1870
 
thanks wonder I was having trouble with the stone and i was trying to double click the stone then remove it and walk in gate I should have been smarter lol:D

By the way A_LI_N you make great scripts yours are my favorite out of everyones
 
Hi there all. i love this script so much i wanted to say a thanks for making it. and post this as a think you. it would be cool if A_Li_N wants to use it. and others.
what it is, that i wanted the gump that sets the gates up, without adding a gate everywhere. so i had help with the maker. to make it work.
thanks again.

and im sorry A for the name. lol


:) :)

View attachment 9253
 

Attachments

  • A_Li_N's Public Gates 1.0.4.zip
    12 KB · Views: 22

A_Li_N

Knight
LordHogFred said:
Is it possible for you to make a version that supports RoninGTs player run towns?

Thanks :),
I havn't installed that system and therefore do not know any specifics about it. But I don't see why it wouldn't be compatible. The system is completely custom.

If you know of something that isn't compatible or something specific you would want to see added/changed, please say so and I'll look into it.
 

LordHogFred

Knight
A_Li_N said:
I havn't installed that system and therefore do not know any specifics about it. But I don't see why it wouldn't be compatible. The system is completely custom.

If you know of something that isn't compatible or something specific you would want to see added/changed, please say so and I'll look into it.

Ah ok, it's just he has an option on the public gate to teleport to the player cities that have moongates.
Also how about adding charges on to the moongate, this way you could have a quick escape from the bottom of a dungeon but at the cost of 5000 gold or so. Or maybe random moongates so you can have multiple destinations set to an option that will take you to one of X different locations.
 

A_Li_N

Knight
LordHogFred said:
Ah ok, it's just he has an option on the public gate to teleport to the player cities that have moongates.
This can be done 'easily'... I might take a look at his system and see if the event of a player town 'purchasing' a moongate can be easily converted into a 'add gate to system'. Shouldn't be too much trouble there.
LordHogFred said:
Also how about adding charges on to the moongate, this way you could have a quick escape from the bottom of a dungeon but at the cost of 5000 gold or so.
This would be something 'new'. Probably a new item that could be used only in dungeons. I could probably make this modification when I update this system to use the Central Memory I've made. Then I would be able to add an option to allow a person to assign a favorite location that can be used as such. I'll keep this in mind when I start the update.
LordHogFred said:
Or maybe random moongates so you can have multiple destinations set to an option that will take you to one of X different locations.
This is an interesting option...I'll keep this in mind as well for the update and see how I can get it to work.

This update won't come for a while, still working on the Complete Spell System (update of the All Spells)
 

hieddie

Wanderer
Sorry to sound like such a Newbie?

I think that I am having a problem with where the scripts go, and that is why this wonderful script is not working?

Then again it is really early in the morning..... tee hee

If you could tell me where the files go so that they would work, that would be great!!

Can't wait to use it!

Eddie
 

A_Li_N

Knight
hieddie said:
I think that I am having a problem with where the scripts go, and that is why this wonderful script is not working?

Then again it is really early in the morning..... tee hee

If you could tell me where the files go so that they would work, that would be great!!

Can't wait to use it!

Eddie
Put them anywhere in your scripts folder.
 

A_Li_N

Knight
orpheus said:
if you had a dynamic travel book to go along with this, it would be the best system ever. :p
Possible, yes...best system, no :)
I'll keep that in mind for the next release. Thanks for the idea!
 

hieddie

Wanderer
Thanks....

I tried to put them in the scripts/misc and the other files in there respective folders and it did not work. I restarted the server and went to the public moon gate and did not have the options that you described. Once again I guess I sound like a newbie.. *smiles*

Eddie
 

A_Li_N

Knight
It's all custom, so there shouldn't be any 'putting them in their respective places' :) When you get in-game, do [initpublicgates to place the center stone. Then add a gate.
 
Top