Uncontrolled BaseCreatures don't path around mobiles
http://jira.runuo.com/browse/RUNUO-106 Animal Taming range and system message fixes http://jira.runuo.com/browse/RUNUO-107 Uncontrolled BaseCreatures don't walk over hidden staff http://jira.runuo.com/browse/RUNUO-108 Typo in AdminGump http://jira.runuo.com/browse/RUNUO-109 Guildstone deeds lose the guild name during server restarts http://jira.runuo.com/browse/RUNUO-110 In-game accessible LastMoveTime property on PlayerMobiles http://jira.runuo.com/browse/RUNUO-111
This commit is contained in:
parent
91537da9b2
commit
2a21388f39
8 changed files with 174 additions and 31 deletions
|
|
@ -146,11 +146,14 @@ namespace Server.PathAlgorithms.FastAStar
|
|||
MoveImpl.IgnoreMovableImpassables = bc.CanMoveOverObstacles;
|
||||
}
|
||||
|
||||
MoveImpl.Goal = goal;
|
||||
|
||||
int[] vals = m_Successors;
|
||||
int count = GetSuccessors( bestNode, m, map );
|
||||
|
||||
MoveImpl.AlwaysIgnoreDoors = false;
|
||||
MoveImpl.IgnoreMovableImpassables = false;
|
||||
MoveImpl.Goal = Point3D.Zero;
|
||||
|
||||
if ( count == 0 )
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -17,10 +17,12 @@ namespace Server.Movement
|
|||
private static bool m_AlwaysIgnoreDoors;
|
||||
private static bool m_IgnoreMovableImpassables;
|
||||
private static bool m_IgnoreSpellFields;
|
||||
private static Point3D m_Goal;
|
||||
|
||||
public static bool AlwaysIgnoreDoors{ get{ return m_AlwaysIgnoreDoors; } set{ m_AlwaysIgnoreDoors = value; } }
|
||||
public static bool IgnoreMovableImpassables{ get{ return m_IgnoreMovableImpassables; } set{ m_IgnoreMovableImpassables = value; } }
|
||||
public static bool IgnoreSpellFields{ get{ return m_IgnoreSpellFields; } set{ m_IgnoreSpellFields = value; } }
|
||||
public static Point3D Goal{ get{ return m_Goal; } set{ m_Goal = value; } }
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
|
|
@ -79,10 +81,16 @@ namespace Server.Movement
|
|||
new List<Item>(), new List<Item>(),
|
||||
new List<Item>(), new List<Item>(),
|
||||
};
|
||||
|
||||
|
||||
private List<Mobile>[] m_MobPools = new List<Mobile>[3]
|
||||
{
|
||||
new List<Mobile>(), new List<Mobile>(),
|
||||
new List<Mobile>(),
|
||||
};
|
||||
|
||||
private List<Sector> m_Sectors = new List<Sector>();
|
||||
|
||||
private bool Check( Map map, Mobile m, List<Item> items, int x, int y, int startTop, int startZ, bool canSwim, bool cantWalk, out int newZ )
|
||||
private bool Check( Map map, Mobile m, List<Item> items, List<Mobile> mobiles, int x, int y, int startTop, int startZ, bool canSwim, bool cantWalk, out int newZ )
|
||||
{
|
||||
newZ = 0;
|
||||
|
||||
|
|
@ -215,7 +223,6 @@ namespace Server.Movement
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if ( considerLand && !landBlocks && stepTop >= landZ )
|
||||
|
|
@ -244,9 +251,27 @@ namespace Server.Movement
|
|||
}
|
||||
}
|
||||
|
||||
#region Mobiles
|
||||
if ( moveIsOk )
|
||||
{
|
||||
for ( int i = 0; moveIsOk && i < mobiles.Count; ++i )
|
||||
{
|
||||
Mobile mob = mobiles[i];
|
||||
|
||||
if ( mob != m && ( mob.Z + 15 ) > newZ && ( newZ + 15 ) > mob.Z && !CanMoveOver( m, mob ) )
|
||||
moveIsOk = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
return moveIsOk;
|
||||
}
|
||||
|
||||
private bool CanMoveOver( Mobile m, Mobile t )
|
||||
{
|
||||
return ( !t.Alive || !m.Alive || t.IsDeadBondedPet || m.IsDeadBondedPet ) || ( t.Hidden && t.AccessLevel > AccessLevel.Player );
|
||||
}
|
||||
|
||||
public bool CheckMovement( Mobile m, Map map, Point3D loc, Direction d, out int newZ )
|
||||
{
|
||||
if ( map == null || map == Map.Internal )
|
||||
|
|
@ -286,6 +311,12 @@ namespace Server.Movement
|
|||
if ( m.CanSwim )
|
||||
reqFlags |= TileFlag.Wet;
|
||||
|
||||
List<Mobile> mobsForward = m_MobPools[0];
|
||||
List<Mobile> mobsLeft = m_MobPools[1];
|
||||
List<Mobile> mobsRight = m_MobPools[2];
|
||||
|
||||
bool checkMobs = ( m is BaseCreature && !((BaseCreature)m).Controlled && ( xForward != m_Goal.X || yForward != m_Goal.Y ) );
|
||||
|
||||
if ( checkDiagonals )
|
||||
{
|
||||
Sector sectorStart = map.GetSector( xStart, yStart );
|
||||
|
|
@ -329,6 +360,21 @@ namespace Server.Movement
|
|||
else if ( sector == sectorRight && item.AtWorldPoint( xRight, yRight ) && !(item is BaseMulti) && item.ItemID <= TileData.MaxItemValue )
|
||||
itemsRight.Add( item );
|
||||
}
|
||||
|
||||
if ( checkMobs )
|
||||
{
|
||||
for ( int j = 0; j < sector.Mobiles.Count; ++j )
|
||||
{
|
||||
Mobile mob = sector.Mobiles[j];
|
||||
|
||||
if ( sector == sectorForward && mob.X == xForward && mob.Y == yForward )
|
||||
mobsForward.Add( mob );
|
||||
else if ( sector == sectorLeft && mob.X == xLeft && mob.Y == yLeft )
|
||||
mobsLeft.Add( mob );
|
||||
else if ( sector == sectorRight && mob.X == xRight && mob.Y == yRight )
|
||||
mobsRight.Add( mob );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Sectors.Count > 0 )
|
||||
|
|
@ -387,31 +433,48 @@ namespace Server.Movement
|
|||
itemsStart.Add( item );
|
||||
}
|
||||
}
|
||||
|
||||
if ( checkMobs )
|
||||
{
|
||||
for ( int i = 0; i < sectorForward.Mobiles.Count; ++i )
|
||||
{
|
||||
Mobile mob = sectorForward.Mobiles[i];
|
||||
|
||||
if ( mob.X == xForward && mob.Y == yForward )
|
||||
mobsForward.Add( mob );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GetStartZ( m, map, loc, itemsStart, out startZ, out startTop );
|
||||
|
||||
bool moveIsOk = Check( map, m, itemsForward, xForward, yForward, startTop, startZ, m.CanSwim, m.CantWalk, out newZ );
|
||||
bool moveIsOk = Check( map, m, itemsForward, mobsForward, xForward, yForward, startTop, startZ, m.CanSwim, m.CantWalk, out newZ );
|
||||
|
||||
if ( moveIsOk && checkDiagonals )
|
||||
{
|
||||
int hold;
|
||||
|
||||
if ( m.Player && m.AccessLevel < AccessLevel.GameMaster ) {
|
||||
if ( !Check( map, m, itemsLeft, xLeft, yLeft, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) || !Check( map, m, itemsRight, xRight, yRight, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) )
|
||||
if ( !Check( map, m, itemsLeft, mobsLeft, xLeft, yLeft, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) || !Check( map, m, itemsRight, mobsRight, xRight, yRight, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) )
|
||||
moveIsOk = false;
|
||||
} else {
|
||||
if ( !Check( map, m, itemsLeft, xLeft, yLeft, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) && !Check( map, m, itemsRight, xRight, yRight, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) )
|
||||
if ( !Check( map, m, itemsLeft, mobsLeft, xLeft, yLeft, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) && !Check( map, m, itemsRight, mobsRight, xRight, yRight, startTop, startZ, m.CanSwim, m.CantWalk, out hold ) )
|
||||
moveIsOk = false;
|
||||
}
|
||||
}
|
||||
|
||||
for ( int i = 0; i < (checkDiagonals ? 4 : 2); ++i )
|
||||
{
|
||||
if ( m_Pools[i].Count > 0 )
|
||||
if ( m_Pools[i].Count != 0 )
|
||||
m_Pools[i].Clear();
|
||||
}
|
||||
|
||||
for ( int i = 0; i < (checkDiagonals ? 3 : 1); ++i )
|
||||
{
|
||||
if ( m_MobPools[i].Count != 0 )
|
||||
m_MobPools[i].Clear();
|
||||
}
|
||||
|
||||
if ( !moveIsOk )
|
||||
newZ = startZ;
|
||||
|
||||
|
|
|
|||
|
|
@ -163,6 +163,8 @@ namespace Server.PathAlgorithms.SlowAStar
|
|||
MoveImpl.IgnoreMovableImpassables = bc.CanMoveOverObstacles;
|
||||
}
|
||||
|
||||
MoveImpl.Goal = goal;
|
||||
|
||||
for ( int i = 0; i < 8; ++i )
|
||||
{
|
||||
switch ( i )
|
||||
|
|
@ -188,6 +190,7 @@ namespace Server.PathAlgorithms.SlowAStar
|
|||
|
||||
MoveImpl.AlwaysIgnoreDoors = false;
|
||||
MoveImpl.IgnoreMovableImpassables = false;
|
||||
MoveImpl.Goal = Point3D.Zero;
|
||||
|
||||
if ( sucCount == 0 || ++depth > MaxDepth )
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1204,7 +1204,7 @@ namespace Server.Gumps
|
|||
|
||||
AddButtonLabeled( 20, 150, GetButtonID( 6, 3 ), "Remove" );
|
||||
|
||||
AddHtml( 10, 175, 400, 20, Color( Center( "Potentially Effected Accounts" ), LabelColor32 ), false, false );
|
||||
AddHtml( 10, 175, 400, 20, Color( Center( "Potentially Affected Accounts" ), LabelColor32 ), false, false );
|
||||
|
||||
if ( m_List == null )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,21 @@ namespace Server.Items
|
|||
private string m_GuildName;
|
||||
private string m_GuildAbbrev;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string GuildName
|
||||
{
|
||||
get { return m_GuildName; }
|
||||
set { m_GuildName = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string GuildAbbrev
|
||||
{
|
||||
get { return m_GuildAbbrev; }
|
||||
set { m_GuildAbbrev = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Guild Guild
|
||||
{
|
||||
get
|
||||
|
|
@ -97,12 +112,6 @@ namespace Server.Items
|
|||
if( Guild.NewGuildSystem && ItemID == 0xED4 )
|
||||
ItemID = 0xED6;
|
||||
|
||||
if( m_Guild != null )
|
||||
{
|
||||
m_GuildName = m_Guild.Name;
|
||||
m_GuildAbbrev = m_Guild.Abbreviation;
|
||||
}
|
||||
|
||||
if( version <= 2 )
|
||||
m_BeforeChangeover = true;
|
||||
|
||||
|
|
@ -142,7 +151,7 @@ namespace Server.Items
|
|||
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( name ), Utility.FixHtml( abbr ) ) );
|
||||
}
|
||||
else
|
||||
else if( m_GuildName != null && m_GuildAbbrev != null )
|
||||
{
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( m_GuildName ), Utility.FixHtml( m_GuildAbbrev ) ) );
|
||||
}
|
||||
|
|
@ -152,14 +161,19 @@ namespace Server.Items
|
|||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
string name;
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
|
||||
if( m_Guild == null )
|
||||
name = "(unfounded)";
|
||||
else if( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
if( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
this.LabelTo( from, name );
|
||||
this.LabelTo( from, name );
|
||||
}
|
||||
else if( m_GuildName != null )
|
||||
{
|
||||
this.LabelTo( from, m_GuildName );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -267,7 +281,39 @@ namespace Server.Items
|
|||
private string m_GuildName;
|
||||
private string m_GuildAbbrev;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string GuildName
|
||||
{
|
||||
get { return m_GuildName; }
|
||||
set { m_GuildName = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string GuildAbbrev
|
||||
{
|
||||
get { return m_GuildAbbrev; }
|
||||
set { m_GuildAbbrev = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Guild Guild
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Guild;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GuildstoneDeed() : this( null, null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GuildstoneDeed( string guildName, string abbrev ) : this( null, guildName, abbrev )
|
||||
{
|
||||
}
|
||||
|
||||
public GuildstoneDeed( Guild g, string guildName, string abbrev ) : base( 0x14F0 )
|
||||
{
|
||||
m_Guild = g;
|
||||
|
|
@ -285,7 +331,18 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 ); // version
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
m_GuildName = m_Guild.Name;
|
||||
m_GuildAbbrev = m_Guild.Abbreviation;
|
||||
}
|
||||
|
||||
writer.Write( (int)1 ); // version
|
||||
|
||||
writer.Write( m_GuildName );
|
||||
writer.Write( m_GuildAbbrev );
|
||||
|
||||
writer.Write( m_Guild );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -293,8 +350,20 @@ namespace Server.Items
|
|||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_GuildName = reader.ReadString();
|
||||
m_GuildAbbrev = reader.ReadString();
|
||||
|
||||
m_Guild = reader.ReadGuild() as Guild;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
|
|
@ -314,7 +383,7 @@ namespace Server.Items
|
|||
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( name ), Utility.FixHtml( abbr ) ) );
|
||||
}
|
||||
else
|
||||
else if( m_GuildName != null && m_GuildAbbrev != null )
|
||||
{
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( m_GuildName ), Utility.FixHtml( m_GuildAbbrev ) ) );
|
||||
}
|
||||
|
|
@ -374,6 +443,5 @@ namespace Server.Items
|
|||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3147,7 +3147,7 @@ namespace Server.Mobiles
|
|||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( m is BaseCreature && !((BaseCreature)m).Controlled )
|
||||
return ( !Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet ) || ( Hidden && m.AccessLevel > AccessLevel.Player );
|
||||
return ( !Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet ) || ( Hidden && AccessLevel > AccessLevel.Player );
|
||||
|
||||
return base.OnMoveOver( m );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,6 +248,12 @@ namespace Server.Mobiles
|
|||
set{ m_LastOnline = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime LastMoved
|
||||
{
|
||||
get{ return LastMoveTime; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public TimeSpan NpcGuildGameTime
|
||||
{
|
||||
|
|
@ -1982,7 +1988,7 @@ namespace Server.Mobiles
|
|||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( m is BaseCreature && !((BaseCreature)m).Controlled )
|
||||
return ( !Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet ) || ( Hidden && m.AccessLevel > AccessLevel.Player );
|
||||
return ( !Alive || !m.Alive || IsDeadBondedPet || m.IsDeadBondedPet ) || ( Hidden && AccessLevel > AccessLevel.Player );
|
||||
|
||||
return base.OnMoveOver( m );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
private bool m_SetSkillTime = true;
|
||||
|
||||
public InternalTarget() : base ( 2, false, TargetFlags.None )
|
||||
public InternalTarget() : base ( Core.AOS ? 3 : 2, false, TargetFlags.None )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
creature.BardEndTime = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
creature.BardPacified = false;
|
||||
|
||||
creature.Move( creature.Direction );
|
||||
|
|
@ -262,7 +262,7 @@ namespace Server.SkillHandlers
|
|||
DamageEntry de = m_Creature.FindMostRecentDamageEntry( false );
|
||||
bool alreadyOwned = m_Creature.Owners.Contains( m_Tamer );
|
||||
|
||||
if ( !m_Tamer.InRange( m_Creature, 6 ) )
|
||||
if ( !m_Tamer.InRange( m_Creature, Core.AOS ? 7 : 6 ) )
|
||||
{
|
||||
m_BeingTamed.Remove( m_Creature );
|
||||
m_Tamer.NextSkillTime = DateTime.Now;
|
||||
|
|
@ -280,7 +280,7 @@ namespace Server.SkillHandlers
|
|||
{
|
||||
m_BeingTamed.Remove( m_Creature );
|
||||
m_Tamer.NextSkillTime = DateTime.Now;
|
||||
m_Creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049654, m_Tamer.NetState ); // You do not have a clear path to the animal you are taming, and must cease your attempt.
|
||||
m_Tamer.SendLocalizedMessage( 1049654 ); // You do not have a clear path to the animal you are taming, and must cease your attempt.
|
||||
Stop();
|
||||
}
|
||||
else if ( !m_Creature.Tamable )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue