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!

Flying Gryphon RUNUO 2.0 SVN 156

Tru

Knight
Actually what Ive been considering is trying to figure out how to make it so if you hit the top of the map it moves you to the bottom (so continuing up) same with left to right. Itd be cool to have the world so it seemed round.
Although I'm currently working on Seige Updates and its taking what little time I have.
 

Crowley62

Sorceror
I had some computer issues and had to format a couple of times so i just grabbed an old server from another HD. I will get a copy of real server today. Will make testing easier. LOL
By the way players can fly to every part of the map including black areas, green acres, the jail lol
 

Tru

Knight
Crowley62;691496 said:
I had some computer issues and had to format a couple of times so i just grabbed an old server from another HD. I will get a copy of real server today. Will make testing easier. LOL
By the way players can fly to every part of the map including black areas, green acres, the jail lol

Have you read any other responses in this post? I've posted an example twice now of how to stop people from going into dungeons and green acres.
 

Fixxxer

Sorceror
I added the code you provided for trammel and it works pretty good, people can not fly in those areas unless they start outside the area and fly into it. I also tried to make it the same for ilsh and malas, however nothing works on that, they can fly anywhere still.

Code:
public static bool checkmap( Mobile m )
		{
      
                	if ( m.Map == Map.Trammel && m.Z >= 100 || m.X <= 1 || m.Y <= 1 || m.X >= 5090 || m.Y 

>= 4085)
			return true;

			return false;
	
                	if ( m.Map == Map.Malas && m.Z >= -10 || m.X <= 525 || m.Y <= 10 || m.X >= 2500 || 

m.Y >= 2020)
			return true;

                        return false;
                	
                	if ( m.Map == Map.Ilshenar && m.Z >= 100 || m.X <= 200 || m.Y <= 150 || m.X >= 1900 

|| m.Y >= 1450)
			return true;

                        return false;

                        			
		}
 

Rocko Wang

Wanderer
Fixxxer, it should be like this
Code:
public static bool checkmap( Mobile m )
		{
      
                	if ( m.Map == Map.Trammel && m.Z >= 100 || m.X <= 1 || m.Y <= 1 || m.X >= 5090 || m.Y 

>= 4085)
			return true;
                	else if ( m.Map == Map.Malas && m.Z >= -10 || m.X <= 525 || m.Y <= 10 || m.X >= 2500 || 

m.Y >= 2020)
			return true;
                	else if ( m.Map == Map.Ilshenar && m.Z >= 100 || m.X <= 200 || m.Y <= 150 || m.X >= 1900 

|| m.Y >= 1450)
			return true;

                        return false;

                        			
		}
 

Tru

Knight
Fixxxer;691520 said:
I added the code you provided for trammel and it works pretty good, people can not fly in those areas unless they start outside the area and fly into it. I also tried to make it the same for ilsh and malas, however nothing works on that, they can fly anywhere still.

Code:
public static bool checkmap( Mobile m )
		{
      
                	if ( m.Map == Map.Trammel && m.Z >= 100 || m.X <= 1 || m.Y <= 1 || m.X >= 5090 || m.Y 

>= 4085)
			return true;

			return false;
	
                	if ( m.Map == Map.Malas && m.Z >= -10 || m.X <= 525 || m.Y <= 10 || m.X >= 2500 || 

m.Y >= 2020)
			return true;

                        return false;
                	
                	if ( m.Map == Map.Ilshenar && m.Z >= 100 || m.X <= 200 || m.Y <= 150 || m.X >= 1900 

|| m.Y >= 1450)
			return true;

                        return false;

                        			
		}

You may actually want to set it a touch before you want it to trigger as I think sometimes by the time it triggers you already end up in that area. ie
Code:
if ( m.Map == Map.Trammel && m.Z >= 96 || m.X <= 3 || m.Y <= 3 || m.X >= 5090 || m.Y >= 4082)

Thats where my idea about moving the player to the bottom when going up etc comes in.
 

Fixxxer

Sorceror
I keep getting disconnected now from a exceeded gump cap, ill try to go up and its in an area where i should be able to go up but it wont and then about 3 minutes later I get disconnected from the server with the message on the console saying, Exceeded Gump Cap, Disconnecting...

Where I was is in Trammel at 2504, 4024, 3. It will not let me fly at this point.


Code:
public static bool checkmap( Mobile m )
		{
      
    if ( m.Map == Map.Trammel && m.Z >= 96 || m.X <= 3 || m.Y <= 3 || m.X >= 5090 || m.Y >= 4082)
			return true;

    else if ( m.Map == Map.Malas && m.Z >= -12 || m.X <= 525 || m.Y <= 10 || m.X >= 2500 || m.Y >= 2020)
			return true;

    else if ( m.Map == Map.Ilshenar && m.Z >= 96 || m.X <= 200 || m.Y <= 150 || m.X >= 1900 || m.Y >= 1450)
			return true;

                        return false;

                        			
		}
 

xxx007xxx

Sorceror
madron;691485 said:
@XXX
I did not like the way the raising and lowering worked after I tried your fix. so I am still working on a smoother landing and take off for this. It just seemed more choppy to me.

To make it real it should adjust z when you move.

z should raise,lower with a swith in the gump.

when you move in a direction it check if raise or lower switch is switched.
 

Fixxxer

Sorceror
This is what I got so far and it seems to work just find for limiting the flying anywhere. I added what I have if anyone wants to use it, oh and Im using RunUO 1.0 just so ya know.

However if I am in an area that is no flying and I click the up button in the gump a few minutes later I get disconnected, if I click the down button before I get disconnected then I wont be disconnected. Its something about the gump keeps sending out the same message over and over until it says in the console: Exceeded Gump Cap, Disconnecting... Any help with this part would be great, its the only part stopping me from adding it to my server.

Code:
public static bool checkmap( Mobile m )
		{
      
    if ( m.Map == Map.Trammel && m.Z >= 96 || m.X <= 3 || m.Y <= 3 || m.X >= 5090 || m.Y >= 4082)
                        {
			return true;
                        }

    else if ( m.Map == Map.Malas && m.Z >= -12 || m.X <= 525 || m.Y <= 10 || m.X >= 2500 || m.Y >= 2020)
                        {
			return true;
                        }

    else if ( m.Region is Regions.DungeonRegion )
         {
         return true;
         }

         return false;
                     			
		}
 
I been tinkering with the flying script for a while trying to get the vampire flying useable and not exploitable haven't had much luck yet.

Fixxxer with that last fix, that is the mount check for the gump? If you mount you get the gump if your on the main map not a dungeon region? Has there been a fix yet for if you are already flying? What about using world warp if you get to the edge of the map is there a way to teleport you to the other side of the world instead of hitting an invisible wall (or allowing them to fly right into the dungeons as it is defalt).

I belive since it increases the players x or y +1 (or -1) each tick, the check needs for if they will be moving Into a dugenon needs to be there. But Like I said i haven't had alot of luck fixing that.
 

Fixxxer

Sorceror
Ive worked on it for a bit and the best that I could come up with was if you are trying to start flying in those areas then it would not let you, but if you fly into those areas then it will keep flying until you stop. I havent got anywhere else with it.
 

Tru

Knight
Ok I have this fixed..I didnt want to put the fix here because this is really just a renamed version of someone elses script, but every other version is in the archive section so I don't really have a choice. With that said.

This is working Gryhpon Gump (I actually dont even use the Gryphon version):

Code:
using System;
using Server;
using Server.Items;
using Server.Multis;
using Server.Network;
using Server.Mobiles;
using Server.ContextMenus;
using System.Collections;
using Server.Misc;


namespace Server.Gumps
{
	public class Gryphongump : Gump
	{
		private Mobile m_Owner;
		public Mobile Owner{ get{ return m_Owner; } set{ m_Owner = value; } }

		public Gryphongump(Mobile owner, int page) : base( 20, 20 )
		{
			owner.CloseGump( typeof( Gryphongump ) );

			int gumpX = 0; int gumpY = 0;

			m_Owner = owner;

			Closable = false;
			Disposable = false;
			Dragable = true;
			Resizable = false;

			AddPage( 0 );

			AddPage( 1 ); 

			gumpX = 10; gumpY = 10;
			AddImage( gumpX, gumpY, 0x1392 );

                        if ( page != 1 ) 
		        {
			gumpX = 87; gumpY = 40;
			AddButton( gumpX, gumpY, 0x1194, 0x1194, 1, GumpButtonType.Reply, 0);
                        }                        
                        if ( page != 2 ) 
		        {
			gumpX = 118; gumpY = 53;
			AddButton( gumpX, gumpY, 0x1195, 0x1195, 2, GumpButtonType.Reply, 0);
                        } 
                        if ( page != 3 ) 
		        {
			gumpX = 131; gumpY = 86;
			AddButton( gumpX, gumpY, 0x1196, 0x1196, 3, GumpButtonType.Reply, 0);
                        }
                        if ( page != 4 ) 
		        {
			gumpX = 114; gumpY = 117;
			AddButton( gumpX, gumpY, 0x1197, 0x1197, 4, GumpButtonType.Reply, 0);
                        }
                        if ( page != 5 ) 
		        {
			gumpX = 86; gumpY = 131;
			AddButton( gumpX, gumpY, 0x1198, 0x1198, 5, GumpButtonType.Reply, 0);
                        }
                        if ( page != 6 ) 
		        {
			gumpX = 54; gumpY = 119;
			AddButton( gumpX, gumpY, 0x1199, 0x1199, 6, GumpButtonType.Reply, 0);
                        }
                        if ( page != 7 ) 
		        {
			gumpX = 41; gumpY = 86;
			AddButton( gumpX, gumpY, 0x119A, 0x119A, 7, GumpButtonType.Reply, 0);
                        }
                        if ( page != 8 ) 
		        {
			gumpX = 54; gumpY = 52;
			AddButton( gumpX, gumpY, 0x119B, 0x119B, 8, GumpButtonType.Reply, 0);
                        }
                        if ( page != 9 ) 
		        {
			gumpX = 101; gumpY = 89;
			AddButton( gumpX, gumpY, 0x26AC, 0x26AE, 9, GumpButtonType.Reply, 0);
                        }
                        if ( page != 10 )
		        {
			gumpX = 102; gumpY = 112;
			AddButton( gumpX, gumpY, 0x26B2, 0x26B4, 10, GumpButtonType.Reply, 0);
                        }


                        if ( page == 1) 
		        {
			gumpX = 87; gumpY = 40;
			AddButton( gumpX, gumpY, 0x1194, 0x1194, 11, GumpButtonType.Reply, 0);

			gumpX = 87; gumpY = 40;
			AddImage( gumpX, gumpY, 0x1194, 69 );
                        }
                        else if ( page == 2 )              
		        {
			gumpX = 118; gumpY = 53;
			AddButton( gumpX, gumpY, 0x1195, 0x1195, 12, GumpButtonType.Reply, 0);

			gumpX = 118; gumpY = 53;
			AddImage( gumpX, gumpY, 0x1195, 69 );
                        }
                        else if ( page == 3 )             
		        {
			gumpX = 131; gumpY = 86;
			AddButton( gumpX, gumpY, 0x1196, 0x1196, 13, GumpButtonType.Reply, 0);

			gumpX = 131; gumpY = 86;
			AddImage( gumpX, gumpY, 0x1196, 69 );
                        }
                        else if ( page == 4 )              
		        {
			gumpX = 114; gumpY = 117;
			AddButton( gumpX, gumpY, 0x1197, 0x1197, 14, GumpButtonType.Reply, 0);

			gumpX = 114; gumpY = 117;
			AddImage( gumpX, gumpY, 0x1197, 69 );
                        }
                        else if ( page == 5 )             
		        {
			gumpX = 86; gumpY = 131;
			AddButton( gumpX, gumpY, 0x1198, 0x1198, 15, GumpButtonType.Reply, 0);

			gumpX = 86; gumpY = 131;
			AddImage( gumpX, gumpY, 0x1198, 69 );
                        }
                        else if ( page == 6 )             
		        {
			gumpX = 54; gumpY = 119;
			AddButton( gumpX, gumpY, 0x1199, 0x1199, 16, GumpButtonType.Reply, 0);

			gumpX = 54; gumpY = 119;
			AddImage( gumpX, gumpY, 0x1199, 69 );
                        }
                        else if ( page == 7 )             
		        {
			gumpX = 41; gumpY = 86;
			AddButton( gumpX, gumpY, 0x119A, 0x119A, 17, GumpButtonType.Reply, 0);

			gumpX = 41; gumpY = 86;
			AddImage( gumpX, gumpY, 0x119A, 69 );
                        }
                        else if ( page == 8 )             
		        {
			gumpX = 54; gumpY = 52;
			AddButton( gumpX, gumpY, 0x119B, 0x119B, 18, GumpButtonType.Reply, 0);

			gumpX = 54; gumpY = 52;
			AddImage( gumpX, gumpY, 0x119B, 69 );
                        }
                        else if ( page == 9 )            
		        {
			gumpX = 101; gumpY = 89;
			AddButton( gumpX, gumpY, 0x26AC, 0x26AE, 19, GumpButtonType.Reply, 0);

			gumpX = 101; gumpY = 89;
			AddImage( gumpX, gumpY, 0x26AC, 69 );
                        }
                        else if ( page == 10 )           
		        {
			gumpX = 102; gumpY = 112;
			AddButton( gumpX, gumpY, 0x26B2, 0x26B4, 20, GumpButtonType.Reply, 0);

			gumpX = 102; gumpY = 112;
			AddImage( gumpX, gumpY, 0x26B2, 69 );
                        }

		}

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

	                PlayerMobile pm = (PlayerMobile)from;

			Tile landTile = pm.Map.Tiles.GetLandTile(pm.X, pm.Y );

                      	bool location = ( landTile.Z <= ( pm.Z -6 )  );

                      	if (location )
                      	animateflying(from);

			switch( info.ButtonID )
			{
                          	case 0:
				break;

                                case 1:
                                from.Direction = Direction.Up;
                                from.SendGump(new Gryphongump( from , 1) );
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 1 );  
                               	pm.m_Flyingtimer.Start();                          
				break;

				case 2:
                                from.Direction = Direction.North;
                                from.SendGump(new Gryphongump( from , 2) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 2 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 3:
                                from.Direction = Direction.Right;
                                from.SendGump(new Gryphongump( from , 3) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 3 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 4:
                                from.Direction = Direction.East;
                                from.SendGump(new Gryphongump( from , 4) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 4 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 5:
                                from.Direction = Direction.Down;
                                from.SendGump(new Gryphongump( from , 5) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 5 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 6:
                                from.Direction = Direction.South;
                                from.SendGump(new Gryphongump( from , 6) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 6 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 7:
                                from.Direction = Direction.Left;
                                from.SendGump(new Gryphongump( from , 7) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 7 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 8:
                                from.Direction = Direction.West;
                                from.SendGump(new Gryphongump( from , 8) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 8 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 9:
                                from.SendGump(new Gryphongump( from , 9) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 9 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 10:
                                from.SendGump(new Gryphongump( from , 10) );                           
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 10 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 11:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        }
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 12:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 13:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 14:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 15:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 16:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 17:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 18:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 19:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 20:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;
	                }
		}

		public static void animateflying( Mobile m )
		{
               		m.PlaySound( 0x2D0 );
			m.Animate( 24, 5, 1, true, false, 0 );
		}

		public static bool checkmap1( Mobile m )
		{
                        if ( m.Map == Map.Felucca && m.X >= 5089 )
			return true;
                        if ( m.Map == Map.Felucca && m.Y >= 4084)
			return true;

			return false;
		}

                public static bool checkmap( Mobile m )
		{
                	if ( m.Map == Map.Malas && m.Z >= 0 )
			return true;

                	if ( m.Map == Map.Felucca && m.Z >= 99 )
			return true;
                        if ( m.Map == Map.Felucca && m.X <= 1 )
			return true;
                        if ( m.Map == Map.Felucca && m.Y <= 1 )
			return true;
                	if ( m.Map == Map.Ilshenar && m.Z >= 99 )
			return true;
                        if ( m.Map == Map.Ilshenar && m.X <= 1 )
			return true;
                        if ( m.Map == Map.Ilshenar && m.Y <= 1 )
			return true;

			return false;
		}

		private class Flyingtimer : Timer 
                { 
                	private PlayerMobile m_Mobile; 
                	private int d;
			private int anim = 0;

                	public Flyingtimer( PlayerMobile m, int seq ) : base( TimeSpan.FromSeconds( 0.2 ) )
                	{
                		m_Mobile = m;
                		d = seq;
                	} 

                	protected override void OnTick() 
                	{
				bool location1 = false;               
                		bool location2 = false;  

				if ( !m_Mobile.Alive || m_Mobile.NetState == null || !( m_Mobile.Mount is Gryphon ) )
                		{
					m_Mobile.Animate( 23, 5, 1, true, false, 0 );
                			Stop();
                		}
                 		else if (d == 0)
                 		{
				Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

				if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           	location1 = true;

                             		if ( location1 )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 
                             			Stop();
                             		}
                             		else
                             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}
						Start();
                 			}
				}           
                 		else if (d == 1) 
                 		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X - 1 ), ( m_Mobile.Y - 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X -= 1;
                             			m_Mobile.Y -= 1;

						Start(); 
                             		}
				}
                		else if ( d == 2) 
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y - 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}

					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                            	 		m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.Y -= 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 3)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X + 1 ), ( m_Mobile.Y - 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
					
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X += 1;
                             			m_Mobile.Y -= 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 4)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X + 1 ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}

					if ( location1 || checkmap1( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 5)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X + 1 ), ( m_Mobile.Y + 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                          	 		location2 = true;
                           		}

					if ( location1 || checkmap1( m_Mobile ) )
		             		{
                            	 		m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}
	
						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X += 1;
                             			m_Mobile.Y += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 6)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y + 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
				
					if ( location1 || checkmap1( m_Mobile ) )
		             		{
                            		 	m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.Y += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 7)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X - 1 ), ( m_Mobile.Y + 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
				
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X -= 1;
                             			m_Mobile.Y += 1;
                             			Start(); 
                             		} 
                		}
                		else if ( d == 8)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X - 1 ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}

                             		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
					
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                            	 		m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X -= 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 9) 
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z +5 ) )
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z +5 )  )
                           		location1 = true;

					if ( location1 || checkmap( m_Mobile ) )
		             		{
                            			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 
                             			Start();
                             		}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}	
		
						m_Mobile.Direction |= Direction.Running;
						m_Mobile.Z += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 10) 
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -6 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -6 )  )
                           		location1 = true;

					if ( location1 )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 
		             			m_Mobile.Animate( 23, 5, 1, true, false, 0 );
                             			Stop();
                             		}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
	 					m_Mobile.Z -= 1;
                             			Start(); 
                             		}
                		}
                		else
                		{
                		Stop();
                		} 
			} 
		} 
	}
}

The checkmap was only done once and that was on Raising. I actually had to add another map check as it wouldnt use the same one for both ends of the map.

Only thing Ive found now is if you goto the end of the limits it wont let you turn and go the other way directly, you have to go back at least 1 square.
 

Fixxxer

Sorceror
That one seems to work the best out of everything I have tried, thanks.

Just wondering if anyone else is having the same problem as I am, if you are in an area where you cant fly and you click the up arrow in about 4 minutes the client disconnects from the server? Oh forgot to add that if you click the arrow and your gryphon doesnt move at all if it flaps its wings and then stops then it doesnt do it. Just wondering and what would cause it to keep sending the gump over and over to get disconnected.

The error reads 'exceeded the max gump limit, disconnecting...'
 

Johabius

Knight
Anarthurius;694481 said:
I can't get this to work. It gives me loads of errors when i just paste it into my script folder.
Copying and pasting your errors wrapped in code tags might help narrow down where your errors are coming from. But looking at the top post, I'm guessing that you didn't make the needed modifications to your playermobile.
 

madron

Wanderer
Tru;694256 said:
Ok I have this fixed..I didnt want to put the fix here because this is really just a renamed version of someone elses script, but every other version is in the archive section so I don't really have a choice. With that said.

This is working Gryhpon Gump (I actually dont even use the Gryphon version):

Code:
using System;
using Server;
using Server.Items;
using Server.Multis;
using Server.Network;
using Server.Mobiles;
using Server.ContextMenus;
using System.Collections;
using Server.Misc;


namespace Server.Gumps
{
	public class Gryphongump : Gump
	{
		private Mobile m_Owner;
		public Mobile Owner{ get{ return m_Owner; } set{ m_Owner = value; } }

		public Gryphongump(Mobile owner, int page) : base( 20, 20 )
		{
			owner.CloseGump( typeof( Gryphongump ) );

			int gumpX = 0; int gumpY = 0;

			m_Owner = owner;

			Closable = false;
			Disposable = false;
			Dragable = true;
			Resizable = false;

			AddPage( 0 );

			AddPage( 1 ); 

			gumpX = 10; gumpY = 10;
			AddImage( gumpX, gumpY, 0x1392 );

                        if ( page != 1 ) 
		        {
			gumpX = 87; gumpY = 40;
			AddButton( gumpX, gumpY, 0x1194, 0x1194, 1, GumpButtonType.Reply, 0);
                        }                        
                        if ( page != 2 ) 
		        {
			gumpX = 118; gumpY = 53;
			AddButton( gumpX, gumpY, 0x1195, 0x1195, 2, GumpButtonType.Reply, 0);
                        } 
                        if ( page != 3 ) 
		        {
			gumpX = 131; gumpY = 86;
			AddButton( gumpX, gumpY, 0x1196, 0x1196, 3, GumpButtonType.Reply, 0);
                        }
                        if ( page != 4 ) 
		        {
			gumpX = 114; gumpY = 117;
			AddButton( gumpX, gumpY, 0x1197, 0x1197, 4, GumpButtonType.Reply, 0);
                        }
                        if ( page != 5 ) 
		        {
			gumpX = 86; gumpY = 131;
			AddButton( gumpX, gumpY, 0x1198, 0x1198, 5, GumpButtonType.Reply, 0);
                        }
                        if ( page != 6 ) 
		        {
			gumpX = 54; gumpY = 119;
			AddButton( gumpX, gumpY, 0x1199, 0x1199, 6, GumpButtonType.Reply, 0);
                        }
                        if ( page != 7 ) 
		        {
			gumpX = 41; gumpY = 86;
			AddButton( gumpX, gumpY, 0x119A, 0x119A, 7, GumpButtonType.Reply, 0);
                        }
                        if ( page != 8 ) 
		        {
			gumpX = 54; gumpY = 52;
			AddButton( gumpX, gumpY, 0x119B, 0x119B, 8, GumpButtonType.Reply, 0);
                        }
                        if ( page != 9 ) 
		        {
			gumpX = 101; gumpY = 89;
			AddButton( gumpX, gumpY, 0x26AC, 0x26AE, 9, GumpButtonType.Reply, 0);
                        }
                        if ( page != 10 )
		        {
			gumpX = 102; gumpY = 112;
			AddButton( gumpX, gumpY, 0x26B2, 0x26B4, 10, GumpButtonType.Reply, 0);
                        }


                        if ( page == 1) 
		        {
			gumpX = 87; gumpY = 40;
			AddButton( gumpX, gumpY, 0x1194, 0x1194, 11, GumpButtonType.Reply, 0);

			gumpX = 87; gumpY = 40;
			AddImage( gumpX, gumpY, 0x1194, 69 );
                        }
                        else if ( page == 2 )              
		        {
			gumpX = 118; gumpY = 53;
			AddButton( gumpX, gumpY, 0x1195, 0x1195, 12, GumpButtonType.Reply, 0);

			gumpX = 118; gumpY = 53;
			AddImage( gumpX, gumpY, 0x1195, 69 );
                        }
                        else if ( page == 3 )             
		        {
			gumpX = 131; gumpY = 86;
			AddButton( gumpX, gumpY, 0x1196, 0x1196, 13, GumpButtonType.Reply, 0);

			gumpX = 131; gumpY = 86;
			AddImage( gumpX, gumpY, 0x1196, 69 );
                        }
                        else if ( page == 4 )              
		        {
			gumpX = 114; gumpY = 117;
			AddButton( gumpX, gumpY, 0x1197, 0x1197, 14, GumpButtonType.Reply, 0);

			gumpX = 114; gumpY = 117;
			AddImage( gumpX, gumpY, 0x1197, 69 );
                        }
                        else if ( page == 5 )             
		        {
			gumpX = 86; gumpY = 131;
			AddButton( gumpX, gumpY, 0x1198, 0x1198, 15, GumpButtonType.Reply, 0);

			gumpX = 86; gumpY = 131;
			AddImage( gumpX, gumpY, 0x1198, 69 );
                        }
                        else if ( page == 6 )             
		        {
			gumpX = 54; gumpY = 119;
			AddButton( gumpX, gumpY, 0x1199, 0x1199, 16, GumpButtonType.Reply, 0);

			gumpX = 54; gumpY = 119;
			AddImage( gumpX, gumpY, 0x1199, 69 );
                        }
                        else if ( page == 7 )             
		        {
			gumpX = 41; gumpY = 86;
			AddButton( gumpX, gumpY, 0x119A, 0x119A, 17, GumpButtonType.Reply, 0);

			gumpX = 41; gumpY = 86;
			AddImage( gumpX, gumpY, 0x119A, 69 );
                        }
                        else if ( page == 8 )             
		        {
			gumpX = 54; gumpY = 52;
			AddButton( gumpX, gumpY, 0x119B, 0x119B, 18, GumpButtonType.Reply, 0);

			gumpX = 54; gumpY = 52;
			AddImage( gumpX, gumpY, 0x119B, 69 );
                        }
                        else if ( page == 9 )            
		        {
			gumpX = 101; gumpY = 89;
			AddButton( gumpX, gumpY, 0x26AC, 0x26AE, 19, GumpButtonType.Reply, 0);

			gumpX = 101; gumpY = 89;
			AddImage( gumpX, gumpY, 0x26AC, 69 );
                        }
                        else if ( page == 10 )           
		        {
			gumpX = 102; gumpY = 112;
			AddButton( gumpX, gumpY, 0x26B2, 0x26B4, 20, GumpButtonType.Reply, 0);

			gumpX = 102; gumpY = 112;
			AddImage( gumpX, gumpY, 0x26B2, 69 );
                        }

		}

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

	                PlayerMobile pm = (PlayerMobile)from;

			Tile landTile = pm.Map.Tiles.GetLandTile(pm.X, pm.Y );

                      	bool location = ( landTile.Z <= ( pm.Z -6 )  );

                      	if (location )
                      	animateflying(from);

			switch( info.ButtonID )
			{
                          	case 0:
				break;

                                case 1:
                                from.Direction = Direction.Up;
                                from.SendGump(new Gryphongump( from , 1) );
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 1 );  
                               	pm.m_Flyingtimer.Start();                          
				break;

				case 2:
                                from.Direction = Direction.North;
                                from.SendGump(new Gryphongump( from , 2) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 2 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 3:
                                from.Direction = Direction.Right;
                                from.SendGump(new Gryphongump( from , 3) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 3 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 4:
                                from.Direction = Direction.East;
                                from.SendGump(new Gryphongump( from , 4) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 4 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 5:
                                from.Direction = Direction.Down;
                                from.SendGump(new Gryphongump( from , 5) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 5 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 6:
                                from.Direction = Direction.South;
                                from.SendGump(new Gryphongump( from , 6) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 6 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 7:
                                from.Direction = Direction.Left;
                                from.SendGump(new Gryphongump( from , 7) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 7 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 8:
                                from.Direction = Direction.West;
                                from.SendGump(new Gryphongump( from , 8) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 8 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 9:
                                from.SendGump(new Gryphongump( from , 9) ); 
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 9 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 10:
                                from.SendGump(new Gryphongump( from , 10) );                           
 			       	if ( pm.m_Flyingtimer != null )
                               	pm.m_Flyingtimer.Stop();
                               	pm.m_Flyingtimer = new Flyingtimer( pm, 10 );  
                               	pm.m_Flyingtimer.Start();     
				break;

				case 11:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        }
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 12:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 13:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 14:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 15:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 16:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 17:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 18:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 19:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;

				case 20:
			        if ( pm.m_Flyingtimer != null )
                                pm.m_Flyingtimer.Stop();
                                if ( location )
			        {
                                	pm.m_Flyingtimer = new Flyingtimer( pm, 0 );
                                	pm.m_Flyingtimer.Start();
	                        } 
                                else
                                pm.m_Flyingtimer = null;
                                from.SendGump(new Gryphongump( from , 0) );  
				break;
	                }
		}

		public static void animateflying( Mobile m )
		{
               		m.PlaySound( 0x2D0 );
			m.Animate( 24, 5, 1, true, false, 0 );
		}

		public static bool checkmap1( Mobile m )
		{
                        if ( m.Map == Map.Felucca && m.X >= 5089 )
			return true;
                        if ( m.Map == Map.Felucca && m.Y >= 4084)
			return true;

			return false;
		}

                public static bool checkmap( Mobile m )
		{
                	if ( m.Map == Map.Malas && m.Z >= 0 )
			return true;

                	if ( m.Map == Map.Felucca && m.Z >= 99 )
			return true;
                        if ( m.Map == Map.Felucca && m.X <= 1 )
			return true;
                        if ( m.Map == Map.Felucca && m.Y <= 1 )
			return true;
                	if ( m.Map == Map.Ilshenar && m.Z >= 99 )
			return true;
                        if ( m.Map == Map.Ilshenar && m.X <= 1 )
			return true;
                        if ( m.Map == Map.Ilshenar && m.Y <= 1 )
			return true;

			return false;
		}

		private class Flyingtimer : Timer 
                { 
                	private PlayerMobile m_Mobile; 
                	private int d;
			private int anim = 0;

                	public Flyingtimer( PlayerMobile m, int seq ) : base( TimeSpan.FromSeconds( 0.2 ) )
                	{
                		m_Mobile = m;
                		d = seq;
                	} 

                	protected override void OnTick() 
                	{
				bool location1 = false;               
                		bool location2 = false;  

				if ( !m_Mobile.Alive || m_Mobile.NetState == null || !( m_Mobile.Mount is Gryphon ) )
                		{
					m_Mobile.Animate( 23, 5, 1, true, false, 0 );
                			Stop();
                		}
                 		else if (d == 0)
                 		{
				Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

				if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           	location1 = true;

                             		if ( location1 )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 
                             			Stop();
                             		}
                             		else
                             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}
						Start();
                 			}
				}           
                 		else if (d == 1) 
                 		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X - 1 ), ( m_Mobile.Y - 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X -= 1;
                             			m_Mobile.Y -= 1;

						Start(); 
                             		}
				}
                		else if ( d == 2) 
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y - 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}

					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                            	 		m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.Y -= 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 3)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X + 1 ), ( m_Mobile.Y - 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
					
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X += 1;
                             			m_Mobile.Y -= 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 4)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X + 1 ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}

					if ( location1 || checkmap1( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 5)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X + 1 ), ( m_Mobile.Y + 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                          	 		location2 = true;
                           		}

					if ( location1 || checkmap1( m_Mobile ) )
		             		{
                            	 		m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}
	
						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X += 1;
                             			m_Mobile.Y += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 6)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y + 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
				
					if ( location1 || checkmap1( m_Mobile ) )
		             		{
                            		 	m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.Y += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 7)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X - 1 ), ( m_Mobile.Y + 1 ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
				
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X -= 1;
                             			m_Mobile.Y += 1;
                             			Start(); 
                             		} 
                		}
                		else if ( d == 8)
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X - 1 ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -5 ))
                           			location1 = true;
                           		}

                             		if ( landTile.Z >= ( m_Mobile.Z -5 )  )
                           		{
                           			location1 = true;
                           			location2 = true;
                           		}
					
					if ( location1 || checkmap( m_Mobile ) )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                            	 		m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 

                             			if (location2)
                             			Stop();
                             			else
                             			{
                             				d = 0;
                             				Start();
                             			}
					}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
						m_Mobile.X -= 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 9) 
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z +5 ) )
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z +5 )  )
                           		location1 = true;

					if ( location1 || checkmap( m_Mobile ) )
		             		{
                            			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 
                             			Start();
                             		}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                				anim -= 1;
                				}	
		
						m_Mobile.Direction |= Direction.Running;
						m_Mobile.Z += 1;
                             			Start(); 
                             		}
                		}
                		else if ( d == 10) 
                		{
                      			Tile[] tiles = m_Mobile.Map.Tiles.GetStaticTiles( ( m_Mobile.X ), ( m_Mobile.Y ), true );
		      			Tile landTile = m_Mobile.Map.Tiles.GetLandTile( m_Mobile.X, m_Mobile.Y );

					for ( int i = 0; i < tiles.Length; ++i )
		           		{
		           			Tile tile = tiles[i];
                           			if ( tile.Z >= ( m_Mobile.Z -6 ))
                           			location1 = true;
                           		}
                             
                           		if ( landTile.Z >= ( m_Mobile.Z -6 )  )
                           		location1 = true;

					if ( location1 )
		             		{
                             			m_Mobile.CloseGump( typeof( Gryphongump ) );
                             			m_Mobile.SendGump(new Gryphongump( m_Mobile , 0) ); 
		             			m_Mobile.Animate( 23, 5, 1, true, false, 0 );
                             			Stop();
                             		}
                             		else
		             		{
						if ( anim <= 0)
                				{
                					animateflying(m_Mobile);
                					anim = 2;
                				}
                				else
                				{
                					anim -= 1;
                				}

						m_Mobile.Direction |= Direction.Running;
	 					m_Mobile.Z -= 1;
                             			Start(); 
                             		}
                		}
                		else
                		{
                		Stop();
                		} 
			} 
		} 
	}
}

The checkmap was only done once and that was on Raising. I actually had to add another map check as it wouldnt use the same one for both ends of the map.

Only thing Ive found now is if you goto the end of the limits it wont let you turn and go the other way directly, you have to go back at least 1 square.

Thank you for doing this Tru. I have not had time to finish this as I am going in for surgery, rescheduled twice so far. I appreciate everyones help on this :), and to the original author for this script.

Thanks again
 

Nemercry

Wanderer
Thanks a lot for this script.
I Used this script as a basic for my world flytravelsystem.
And my system works.

Now you can fly in my world like in WoW, thats fucking awesome!
Thanks alot!

GReetz Nemris
 

Tru

Knight
Nemercry;705371 said:
Thanks a lot for this script.
I Used this script as a basic for my world flytravelsystem.
And my system works.

Now you can fly in my world like in WoW, thats fucking awesome!
Thanks alot!

GReetz Nemris

How about sharing your system......
 

Rosey1

Wanderer
well i added this but how high are you supposed to be able to move? I can't get off the ground.

Just confused a little bit
 
Top