adverserath
Page
Re: [TESTING] wraith form
testing complete?
testing complete?
RegisterMap( 0, [COLOR="Red"]0[/COLOR], 0, 7168, 4096, 4, "Felucca", MapRules.FeluccaRules );
RegisterMap( 0, [COLOR="Red"]1[/COLOR], 0, 7168, 4096, 4, "Felucca", MapRules.FeluccaRules );
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;
}
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 );
}
}
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;
}
}
>>>>>>>>>> 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....
>>>>>>>>>> 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 ......{..
adverserath;704551 said:but when the felucca map is changed to the trammel map the script works as it is supposed to.
* 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
*/