Chessboard corrections

http://www.uodemise.com/forum/showthread.php?t=154224&page=2

Stealth has the wrong hiding requirement
http://www.uodemise.com/forum/showthread.php?t=155728

Players should be able to discord their own pet regardless of facet/guild, or lack thereof
http://www.uodemise.com/forum/showthread.php?t=148376

Disposition of released/gone wild pets' pack inventory
http://www.uodemise.com/forum/showthread.php?t=146385

Flagging mechanics regarding invisibility
http://www.uodemise.com/forum/showthread.php?t=137631
This commit is contained in:
xavier 2010-09-25 17:55:44 +00:00
parent cd2462621f
commit f90c09ef55
7 changed files with 115 additions and 19 deletions

View file

@ -152,6 +152,74 @@ namespace Server.Items
}
}
public class CreatureBackpack : Backpack //Used on BaseCreature
{
[Constructable]
public CreatureBackpack( string name )
{
Name = name;
Layer = Layer.Backpack;
Hue = 5;
Weight = 3.0;
}
public override void AddNameProperty( ObjectPropertyList list )
{
if ( Name != null )
list.Add( 1075257, Name ); // Contents of ~1_PETNAME~'s pack.
else
base.AddNameProperty( list );
}
public override void OnItemRemoved( Item item )
{
if ( Items.Count == 0 )
this.Delete();
base.OnItemRemoved( item );
}
public override bool OnDragLift( Mobile from )
{
if ( from.AccessLevel > AccessLevel.Player )
return true;
from.SendLocalizedMessage( 500169 ); // You cannot pick that up.
return false;
}
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
return false;
}
public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
{
return false;
}
public CreatureBackpack( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if ( version == 0 )
Weight = 13.0;
}
}
public class StrongBackpack : Backpack //Used on Pack animals
{
[Constructable]

View file

@ -16,38 +16,38 @@ namespace Server.Items
{
for ( int i = 0; i < 8; i++ )
{
CreatePiece( new PieceBlackPawn( this ), ( 25 * i ) + 43, 42 );
CreatePiece( new PieceWhitePawn( this ), ( 25 * i ) + 43, 167 );
CreatePiece( new PieceBlackPawn( this ), 67, ( 25 * i ) + 17 );
CreatePiece( new PieceWhitePawn( this ), 192, ( 25 * i ) + 17 );
}
// Rook
CreatePiece( new PieceBlackRook( this ), 42, 5 );
CreatePiece( new PieceBlackRook( this ), 216, 5 );
CreatePiece( new PieceBlackRook( this ), 42, 180 );
CreatePiece( new PieceWhiteRook( this ), 42, 180 );
CreatePiece( new PieceWhiteRook( this ), 216, 5 );
CreatePiece( new PieceWhiteRook( this ), 216, 180 );
// Knight
CreatePiece( new PieceBlackKnight( this ), 66, 7 );
CreatePiece( new PieceBlackKnight( this ), 190, 7 );
CreatePiece( new PieceBlackKnight( this ), 42, 30 );
CreatePiece( new PieceBlackKnight( this ), 42, 155 );
CreatePiece( new PieceWhiteKnight( this ), 66, 182 );
CreatePiece( new PieceWhiteKnight( this ), 190, 182 );
CreatePiece( new PieceWhiteKnight( this ), 216, 30 );
CreatePiece( new PieceWhiteKnight( this ), 216, 155 );
// Bishop
CreatePiece( new PieceBlackBishop( this ), 94, 7 );
CreatePiece( new PieceBlackBishop( this ), 168, 7 );
CreatePiece( new PieceBlackBishop( this ), 42, 55 );
CreatePiece( new PieceBlackBishop( this ), 42, 130 );
CreatePiece( new PieceWhiteBishop( this ), 94, 182 );
CreatePiece( new PieceWhiteBishop( this ), 168, 182 );
CreatePiece( new PieceWhiteBishop( this ), 216, 55 );
CreatePiece( new PieceWhiteBishop( this ), 216, 130 );
// Queen
CreatePiece( new PieceBlackQueen( this ), 142, 5 );
CreatePiece( new PieceWhiteQueen( this ), 142, 180 );
CreatePiece( new PieceBlackQueen( this ), 42, 105 );
CreatePiece( new PieceWhiteQueen( this ), 216, 105 );
// King
CreatePiece( new PieceBlackKing( this ), 117, 5 );
CreatePiece( new PieceWhiteKing( this ), 117, 180 );
CreatePiece( new PieceBlackKing( this ), 42, 80 );
CreatePiece( new PieceWhiteKing( this ), 216, 80 );
}
public Chessboard( Serial serial ) : base( serial )

View file

@ -1558,6 +1558,7 @@ namespace Server.Mobiles
m_Mobile.Delete();
m_Mobile.BeginDeleteTimer();
m_Mobile.DropBackpack();
return true;
}

View file

@ -5,6 +5,7 @@ using Server;
using Server.Regions;
using Server.Targeting;
using Server.Network;
using Server.Multis;
using Server.Spells;
using Server.Misc;
using Server.Items;
@ -3675,6 +3676,29 @@ namespace Server.Mobiles
PackWeapon( minLevel, maxLevel, weaponChance );
}
public virtual void DropBackpack()
{
if ( Backpack != null )
{
if( Backpack.Items.Count > 0 )
{
Backpack b = new CreatureBackpack( Name );
List<Item> list = new List<Item>( Backpack.Items );
foreach ( Item item in list )
{
b.DropItem( item );
}
BaseHouse house = BaseHouse.FindHouseAt( this );
if ( house != null )
b.MoveToWorld( house.BanLocation, house.Map );
else
b.MoveToWorld( Location, Map );
}
}
}
protected bool m_Spawning;
protected int m_KillersLuck;
@ -5278,6 +5302,7 @@ namespace Server.Mobiles
c.ControlTarget = null;
//c.ControlOrder = OrderType.Release;
c.AIObject.DoOrderRelease(); // this will prevent no release of creatures left alone with AI disabled (and consequent bug of Followers)
c.DropBackpack();
}
// added code to handle removing of wild creatures in house regions

View file

@ -144,7 +144,7 @@ namespace Server.SkillHandlers
{
private BaseInstrument m_Instrument;
public DiscordanceTarget( Mobile from, BaseInstrument inst ) : base( BaseInstrument.GetBardRange( from, SkillName.Discordance ), false, TargetFlags.Harmful )
public DiscordanceTarget( Mobile from, BaseInstrument inst ) : base( BaseInstrument.GetBardRange( from, SkillName.Discordance ), false, TargetFlags.None )
{
m_Instrument = inst;
}
@ -162,7 +162,7 @@ namespace Server.SkillHandlers
{
Mobile targ = (Mobile)target;
if ( targ == from || (targ is BaseCreature && ( ((BaseCreature)targ).BardImmune || !from.CanBeHarmful( targ, false ) )) )
if ( targ == from || (targ is BaseCreature && ( ((BaseCreature)targ).BardImmune || !from.CanBeHarmful( targ, false ) ) && ((BaseCreature)targ).ControlMaster != from) )
{
from.SendLocalizedMessage( 1049535 ); // A song of discord would have no effect on that.
}

View file

@ -61,7 +61,7 @@ namespace Server.SkillHandlers
{
m.SendLocalizedMessage( 502725 ); // You must hide first
}
else if ( m.Skills[SkillName.Hiding].Base < ((Core.SE) ? 50.0 : 80.0) )
else if ( m.Skills[SkillName.Hiding].Base < ((Core.ML) ? 30.0 : (Core.SE) ? 50.0 : 80.0) )
{
m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding.
m.RevealingAction();

View file

@ -45,6 +45,7 @@ namespace Server.Spells.Sixth
m.PlaySound( 0x3C4 );
m.Hidden = true;
m.Combatant = null;
m.Warmode = false;
RemoveTimer( m );
@ -94,6 +95,7 @@ namespace Server.Spells.Sixth
protected override void OnTick()
{
if ( !m_Mobile.Hidden )
m_Mobile.RevealingAction();
RemoveTimer( m_Mobile );
}