UOGamers 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!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[SVN] wraith form

Status
Not open for further replies.

Erica

Knight
Re: [READY] wraith form

This patch has a bug thought if you change this 0 to a 1 .

Code:
RegisterMap( 0, [COLOR="Red"]0[/COLOR], 0, 7168, 4096, 4, "Felucca",		MapRules.FeluccaRules );

It will take the bridge out from despise the one where barracoon champ is at and you will see the champ creatures walking on the water like if the bridge was there but bridge is gone cause you changed 0 to a 1.

Code:
RegisterMap( 0, [COLOR="Red"]1[/COLOR], 0, 7168, 4096, 4, "Felucca",		MapRules.FeluccaRules );
 
Re: [IN DEVELOPMENT] wraith form

going out on a guess here id say this fix is impossible. i dont think it is anything to do with the code.
 
Re: [IN DEVELOPMENT] wraith form

is there a coder for this anymore? apparently it is down to the map, not server coding. I couldnt see anything that said movement is not allowed if dex is not full. Closest thing is in the weight coding.
 

minworm

Wanderer
Re: [IN DEVELOPMENT] wraith form

Do not know whether changes here. . . .

ai\baseai.cs

Code:
public virtual MoveResult DoMoveImpl( Direction d )
		{
			if( m_Mobile.Deleted || m_Mobile.Frozen || m_Mobile.Paralyzed || (m_Mobile.Spell != null && m_Mobile.Spell.IsCasting) || m_Mobile.DisallowAllMoves )
				return MoveResult.BadState;
			else if( !CheckMove() )
				return MoveResult.BadState;

			// This makes them always move one step, never any direction changes
			m_Mobile.Direction = d;

			TimeSpan delay = TimeSpan.FromSeconds( TransformMoveDelay( m_Mobile.CurrentSpeed ) );

			m_NextMove += delay;

			if( m_NextMove < DateTime.Now )
				m_NextMove = DateTime.Now;

			m_Mobile.Pushing = false;

			MoveImpl.IgnoreMovableImpassables = (m_Mobile.CanMoveOverObstacles && !m_Mobile.CanDestroyObstacles);

			if( (m_Mobile.Direction & Direction.Mask) != (d & Direction.Mask) )
			{
				bool v = m_Mobile.Move( d );

				MoveImpl.IgnoreMovableImpassables = false;
				return (v ? MoveResult.Success : MoveResult.Blocked);
			}
			else if( !m_Mobile.Move( d ) )
			{
				bool wasPushing = m_Mobile.Pushing;

				bool blocked = true;

				bool canOpenDoors = m_Mobile.CanOpenDoors;
				bool canDestroyObstacles = m_Mobile.CanDestroyObstacles;

				if( canOpenDoors || canDestroyObstacles )
				{
					m_Mobile.DebugSay( "My movement was blocked, I will try to clear some obstacles." );

					Map map = m_Mobile.Map;

					if( map != null )
					{
						int x = m_Mobile.X, y = m_Mobile.Y;
						Movement.Movement.Offset( d, ref x, ref y );

						int destroyables = 0;

						IPooledEnumerable eable = map.GetItemsInRange( new Point3D( x, y, m_Mobile.Location.Z ), 1 );

						foreach( Item item in eable )
						{
							if( canOpenDoors && item is BaseDoor && (item.Z + item.ItemData.Height) > m_Mobile.Z && (m_Mobile.Z + 16) > item.Z )
							{
								if( item.X != x || item.Y != y )
									continue;

								BaseDoor door = (BaseDoor)item;

								if( !door.Locked || !door.UseLocks() )
									m_Obstacles.Enqueue( door );

								if( !canDestroyObstacles )
									break;
							}
							else if( canDestroyObstacles && item.Movable && item.ItemData.Impassable && (item.Z + item.ItemData.Height) > m_Mobile.Z && (m_Mobile.Z + 16) > item.Z )
							{
								if( !m_Mobile.InRange( item.GetWorldLocation(), 1 ) )
									continue;

								m_Obstacles.Enqueue( item );
								++destroyables;
							}
						}

						eable.Free();

						if( destroyables > 0 )
							Effects.PlaySound( new Point3D( x, y, m_Mobile.Z ), m_Mobile.Map, 0x3B3 );

						if( m_Obstacles.Count > 0 )
							blocked = false; // retry movement

						while( m_Obstacles.Count > 0 )
						{
							Item item = (Item)m_Obstacles.Dequeue();

							if( item is BaseDoor )
							{
								m_Mobile.DebugSay( "Little do they expect, I've learned how to open doors. Didn't they read the script??" );
								m_Mobile.DebugSay( "*twist*" );

								((BaseDoor)item).Use( m_Mobile );
							}
							else
							{
								m_Mobile.DebugSay( "Ugabooga. I'm so big and tough I can destroy it: {0}", item.GetType().Name );

								if( item is Container )
								{
									Container cont = (Container)item;

									for( int i = 0; i < cont.Items.Count; ++i )
									{
										Item check = cont.Items[i];

										if( check.Movable && check.ItemData.Impassable && (item.Z + check.ItemData.Height) > m_Mobile.Z )
											m_Obstacles.Enqueue( check );
									}

									cont.Destroy();
								}
								else
								{
									item.Delete();
								}
							}
						}

						if( !blocked )
							blocked = !m_Mobile.Move( d );
					}
				}

				if( blocked )
				{
					int offset = (Utility.RandomDouble() >= 0.6 ? 1 : -1);

					for( int i = 0; i < 2; ++i )
					{
						m_Mobile.TurnInternal( offset );

						if( m_Mobile.Move( m_Mobile.Direction ) )
						{
							MoveImpl.IgnoreMovableImpassables = false;
							return MoveResult.SuccessAutoTurn;
						}
					}

					MoveImpl.IgnoreMovableImpassables = false;
					return (wasPushing ? MoveResult.BadState : MoveResult.Blocked);
				}
				else
				{
					MoveImpl.IgnoreMovableImpassables = false;
					return MoveResult.Success;
				}
			}

			MoveImpl.IgnoreMovableImpassables = false;
			return MoveResult.Success;
		}
 
Re: [IN DEVELOPMENT] wraith form

baseai does not affect this. I have just changed that to move success and still nothing. The code seems to be perfect when the map is changed to trammel with felucca rules, however, when ever the felucca map is loaded the map seems to bypass the rules of the server and not let the movement when dex is less than full. I dont think this is fixable in the script, i think it might be down to editting the server files, or even editting the map :S
 
Re: [IN DEVELOPMENT] wraith form

Bumping this one...

or MapID enums are screwed out (but seems not)
or something wasn't handled somewhere.

A thing I have done is to spam debug messages here and there. To be exact:

this on PlayerMobile.cs (scripts)
Code:
        public override bool CheckShove( Mobile shoved )
        {
            if( TransformationSpellHelper.UnderTransformation( this, typeof( WraithFormSpell ) ) )
            {
                SendMessage ("DEBUG: true due to wraith form");
                return true;
            }
            else
                {
                SendMessage ("DEBUG: NOT wraithform. Checking core rules...");
                return base.CheckShove( shoved );
                }
        }
and this on Mobile.cs (server)
Code:
        public virtual bool CheckShove( Mobile shoved )
        {
            [COLOR=Red]if( (m_Map.Rules & MapRules.FreeMovement) == 0 )[/COLOR]
            {
                if( !shoved.Alive || !Alive || shoved.IsDeadBondedPet || IsDeadBondedPet )
                    return true;
                else if( shoved.m_Hidden && shoved.m_AccessLevel > AccessLevel.Player )
                    return true;

                if( !m_Pushing )
                {
                    m_Pushing = true;

                    int number;

                    if( this.AccessLevel > AccessLevel.Player )
                    {
                        number = shoved.m_Hidden ? 1019041 : 1019040;
                    }
                    else
                    {
                        if( Stam == StamMax )
                        {
                            number = shoved.m_Hidden ? 1019043 : 1019042;
                            Stam -= 10;

                            RevealingAction();
                        }
                        else
                        {
                        SendMessage ("DEBUG: Returned FALSE due to lack of stamina");
                            return false;
                        }
                    }
I have highlighted in red a part I have tried to remove before, but the bug persisted. Hence, the issue is not there.

A nice thing I have found is:
when you are in Fel, wraith form and max stamina, you pass and have the proper debug message.
When your stamina isn't full, I expected the other message... instead I GOT NO MESSAGE. (before you ask, I have recompiled the server :p)
I suspect, then, there is another part of code somewhere that interferes with this one.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] wraith form

It may be the packets being sent/recieved, but that's only a guess. Awhile back I tried debug messages in every possible movement code I could think of, server and script side. I found a point where what should have been checked wasn't being checked at all on felucca with less than full stamina. It would simply... stop. I can't remember where that was though, it wasn't in the
CheckShove functions though as it would never even reach those functions! :confused:
 
Re: [IN DEVELOPMENT] wraith form

packets? Let's see... :)

I have put a char in wraith form at 2 tile distance from another char. Let's start the packet logging! (it's made on RunUO)

Sorry for not using SpyUO but still keys for 7.0.4.0 are not available, so I used Razor Packet Logger. I'll add in red etchings about packet description.

This is when I moved the wraith guy on the other character, after 2 tiles:
Code:
>>>>>>>>>> Logging started 16/12/2009 22.19.39 <<<<<<<<<<


22.19.41.4375: Client -> Server 0xBF (Length: 6)[COLOR=Red]  Both: general info packet (not important...)[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   BF 00 06 00 24 32                                  ....$2


22.19.42.4375: Server -> Client 0xA1 (Length: 9) [COLOR=Red]Server: update current health (bleah...)[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A1 00 00 00 4F 00 19 00  0F                        ....O....


22.19.44.4687: Client -> Server 0x02 (Length: 7) [B][COLOR=Red]Client: move request[/COLOR][/B]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   02 00 10 00 00 00 00                               .......


22.19.44.4687: Server -> Client 0x22 (Length: 3) [COLOR=Red][B]both: Char Move ACK / Resynch Request[/B][/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   22 10 01                                           "..


22.19.44.9687: Client -> Server 0xBF (Length: 6) [COLOR=Red]Both: general info packet (not important...)[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   BF 00 06 00 24 3C                                  ....$<

[COLOR=Blue][I][B]HERE WE ARE IMPACTING! (and we just move on the other guy)[/B][/I][/COLOR]

22.19.45.1718: Client -> Server 0x02 (Length: 7) [B][COLOR=Red]Client: move request[/COLOR][/B]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   02 00 11 00 00 00 00                               .......


22.19.45.1875: Server -> Client 0x22 (Length: 3) [COLOR=Red][B]both: Char Move ACK / Resynch Request[/B][/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   22 11 01                                           "..


22.19.45.8125: Server -> Client 0xA1 (Length: 9) [COLOR=Red]Server: update current health[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A1 00 00 00 4F 00 19 00  0F                        ....O....
Not really much... Let's see instead the case the wraith guy starts by low stamina and does the same as before. For a mistake of mine he's 3 tiles away, 2 + the tile where the other character is.
At the second tile, I clicked to move the wraith guy on the other man 3 times, without result. This is the log:

Code:
>>>>>>>>>> Logging started 16/12/2009 22.20.45 <<<<<<<<<<


22.20.46.0781: Server -> Client 0xA3 (Length: 9) [COLOR=Red]Server: update current stamina (of course, it's the regeneration...)[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A3 00 00 01 9A 00 7B 00  04                        ......{..


22.20.46.5937: Server -> Client 0xA1 (Length: 9) [COLOR=Red]Server: update current health[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A1 00 00 00 4F 00 19 00  13                        ....O....


22.20.47.5781: Client -> Server 0x02 (Length: 7) [B][COLOR=Red]Client: Move Request[/COLOR][/B]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   02 00 17 00 00 00 00                               .......


22.20.47.5937: Server -> Client 0x22 (Length: 3) [COLOR=Red][B]both: Char Move ACK / Resynch Request[/B] (so it said OK to the move... first tile)[/COLOR] 
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   22 17 01                                           "..


22.20.48.2187: Client -> Server 0x02 (Length: 7) [B][COLOR=Red]Client: Move Request[/COLOR][/B]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   02 00 18 00 00 00 00                               .......


22.20.48.2343: Server -> Client 0xA3 (Length: 9) [COLOR=Red]Server: update current stamina[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A3 00 00 01 9A 00 7B 00  02                        ......{..


22.20.48.2343: Server -> Client 0x22 (Length: 3) [COLOR=Red][B]both: Char Move ACK / Resynch Request[/B] (it said OK to the second tile. We are 1 tile distant from the other guy)[/COLOR] 
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   22 18 01                                           "..


22.20.48.6406: Server -> Client 0xA3 (Length: 9) [COLOR=Red]Stamina[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A3 00 00 01 9A 00 7B 00  01                        ......{..


22.20.48.6406: Server -> Client 0xA3 (Length: 9) [COLOR=Red]Stamina[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A3 00 00 01 9A 00 7B 00  02                        ......{..


22.20.49.8281: Client -> Server 0xBF (Length: 6) [COLOR=Red]Generic packet[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   BF 00 06 00 24 4B                                  ....$K


22.20.49.9531: Server -> Client 0xA1 (Length: 9) [COLOR=Red]Health...[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A1 00 00 00 4F 00 19 00  14                        ....O....


22.20.51.2031: Server -> Client 0xA3 (Length: 9) [COLOR=Red]Stamina[/COLOR]
        0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
       -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
0000   A3 00 00 01 9A 00 7B 00  03                        ......{..
So nothing is sent. But, if it's because something in scripts/core is returning return false, or because there is an issue with packets, try to guess... :/

You know what could help us? A stack dump with the server in debug mode.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] wraith form

Thanks osd. I'll have another look at the movement eventually and try to find where it was stopping again.
 
Re: [IN DEVELOPMENT] wraith form

to beat this dead horse again:

it's not a thing related to wraith form itself: the same issue happens when you are mounted on an ethereal.
 
Re: [IN DEVELOPMENT] wraith form

but when the felucca map is changed to the trammel map the script works as it is supposed to. Im thinking it is something to do with the movement code, but a statement about the map. I also cant find the section which says you can only pass through enemies with full stamina. Core mod maybe?
 
Re: [IN DEVELOPMENT] wraith form

adverserath;704551 said:
but when the felucca map is changed to the trammel map the script works as it is supposed to.

Of course... in Trammel you can walk on people! Have you already checked to do "that" change and walk on creatures without etheral/wraithform ?

Something is letting the code going on proper checks only if Stam = StamMax. That's the issue to discover... either in the core if necessary.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] wraith form

Move or anything associated with move (as far as I've researched) is never called in Felucca when stamina is below max. I tried debug messages everywhere I could think of relating to movement and once your stamina is below 0 it's just never called if you attempt to move over another mobile (any mobile, player or AI). I could not find any references as to what actually calls Mobile Move or PlayerMobile Move so what "returns false" and prevents it from being called I have no idea.

As for the MapID changing...
Code:
* Defined:
* RegisterMap( <index>, <mapID>, <fileIndex>, <width>, <height>, <season>, <name>, <rules> );
*  - <index> : An unreserved unique index for this map
*  - <mapID> : An identification number used in client communications. For any visible maps, this value must be from 0-3
*  - <fileIndex> : A file identification number. For any visible maps, this value must be 0, 2, 3, or 4
*  - <width>, <height> : Size of the map (in tiles)
 *  - <name> : Reference name for the map, used in props gump, get/set commands, region loading, etc
*  - <rules> : Rules and restrictions associated with the map. See documentation for details
*/

If you set the MapID to 1, then the client is sent the Trammel map when in Felucca. You might be unable to walk to or move in certain areas because it's using the Felucca map server side. You can see this much more clearly if you used 2 for Ilshenar and teleported to one of the dungeons. You wouldn't be able to move at all since technically you are actually on water in the Felucca map.

Changing the Felucca MapRules to FreeMovement does nothing either. Removing the stamina checks does nothing, well except that you don't lose stamina when walking over someone. This one really has me stumped... And I bet a fix for this turns out to be something really stupidly simple too.
 
Re: [IN DEVELOPMENT] wraith form

i noticed all of this too. Did you look through all of the server folder too? i searched for all of the references of stamina and other variables in notepad++, and couldnt see a thing.
 

Copern

Sorceror
Re: [IN DEVELOPMENT] wraith form

The only reference to stamina for movement I could see was in CheckShove. Remember the packet log Daed posted? The client simply refuses to send any movement request packets when your stamina is below max and you're trying to walk over another mobile (in Felucca anyway). On OSI it's the same behavior unless you are in Wraith form. When you are, it happily sends and receives the movement packets no matter what your stamina is. As to what we are missing I'm not too sure.
 

psz

Administrator
Re: [IN DEVELOPMENT] wraith form

You're missing OSI's packet differentiating Wraith Form from Normal mode

(Think GM and Ghost BodyValues vs Normal Live Player)

Just because RunUO's Wraith Form *APPEARS* to work normally in most cases, doesn't mean it's 100% accurate to the packets OSI sends ;->
 
Status
Not open for further replies.
Top