#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
8eae46895e
7512 changed files with 416187 additions and 0 deletions
174
Source/Items/BaseMulti.cs
Normal file
174
Source/Items/BaseMulti.cs
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
/***************************************************************************
|
||||
* BaseMulti.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BaseMulti : Item
|
||||
{
|
||||
[Constructable]
|
||||
public BaseMulti( int itemID ) : base( itemID )
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public BaseMulti( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public override int ItemID {
|
||||
get {
|
||||
return base.ItemID;
|
||||
}
|
||||
set {
|
||||
if ( base.ItemID != value ) {
|
||||
Map facet = ( this.Parent == null ? this.Map : null );
|
||||
|
||||
if ( facet != null ) {
|
||||
facet.OnLeave( this );
|
||||
}
|
||||
|
||||
base.ItemID = value;
|
||||
|
||||
if ( facet != null ) {
|
||||
facet.OnEnter( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete( "Replace with calls to OnLeave and OnEnter surrounding component invalidation.", true )]
|
||||
public virtual void RefreshComponents()
|
||||
{
|
||||
if ( this.Parent == null ) {
|
||||
Map facet = this.Map;
|
||||
|
||||
if ( facet != null ) {
|
||||
facet.OnLeave( this );
|
||||
facet.OnEnter( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
MultiComponentList mcl = this.Components;
|
||||
|
||||
if ( mcl.List.Length > 0 ) {
|
||||
int id = mcl.List[0].m_ItemID;
|
||||
|
||||
if ( id < 0x4000 )
|
||||
return 1020000 + id;
|
||||
else
|
||||
return 1078872 + id;
|
||||
}
|
||||
|
||||
return base.LabelNumber;
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetMaxUpdateRange()
|
||||
{
|
||||
return 22;
|
||||
}
|
||||
|
||||
public override int GetUpdateRange( Mobile m )
|
||||
{
|
||||
return 22;
|
||||
}
|
||||
|
||||
public virtual MultiComponentList Components
|
||||
{
|
||||
get
|
||||
{
|
||||
return MultiData.GetComponents( ItemID );
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Contains( Point2D p )
|
||||
{
|
||||
return Contains( p.m_X, p.m_Y );
|
||||
}
|
||||
|
||||
public virtual bool Contains( Point3D p )
|
||||
{
|
||||
return Contains( p.m_X, p.m_Y );
|
||||
}
|
||||
|
||||
public virtual bool Contains( IPoint3D p )
|
||||
{
|
||||
return Contains( p.X, p.Y );
|
||||
}
|
||||
|
||||
public virtual bool Contains( int x, int y )
|
||||
{
|
||||
MultiComponentList mcl = this.Components;
|
||||
|
||||
x -= this.X + mcl.Min.m_X;
|
||||
y -= this.Y + mcl.Min.m_Y;
|
||||
|
||||
return x >= 0
|
||||
&& x < mcl.Width
|
||||
&& y >= 0
|
||||
&& y < mcl.Height
|
||||
&& mcl.Tiles[x][y].Length > 0;
|
||||
}
|
||||
|
||||
public bool Contains( Mobile m )
|
||||
{
|
||||
if ( m.Map == this.Map )
|
||||
return Contains( m.X, m.Y );
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Contains( Item item )
|
||||
{
|
||||
if ( item.Map == this.Map )
|
||||
return Contains( item.X, item.Y );
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
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 ) {
|
||||
if ( ItemID >= 0x4000 ) {
|
||||
ItemID -= 0x4000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1826
Source/Items/Container.cs
Normal file
1826
Source/Items/Container.cs
Normal file
File diff suppressed because it is too large
Load diff
166
Source/Items/Containers.cs
Normal file
166
Source/Items/Containers.cs
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/***************************************************************************
|
||||
* Containers.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class InnBox : Container
|
||||
{
|
||||
private Mobile m_Owner;
|
||||
private bool m_Open;
|
||||
|
||||
public override int DefaultMaxWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsVirtualItem
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public InnBox( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public Mobile Owner
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Owner;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Opened
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Open;
|
||||
}
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
m_Open = true;
|
||||
|
||||
if ( m_Owner != null )
|
||||
{
|
||||
//m_Owner.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, String.Format( "Inn Chest has {0} items, {1} stones", TotalItems, TotalWeight ), m_Owner.NetState );
|
||||
m_Owner.Send( new EquipUpdate( this ) );
|
||||
DisplayTo( m_Owner );
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_Owner );
|
||||
writer.Write( (bool) m_Open );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_Open = reader.ReadBool();
|
||||
|
||||
if ( m_Owner == null )
|
||||
Delete();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( this.ItemID == 0xE41 )
|
||||
this.ItemID = 0xE7C;
|
||||
}
|
||||
|
||||
private static bool m_SendRemovePacket;
|
||||
|
||||
public static bool SendDeleteOnClose{ get{ return m_SendRemovePacket; } set{ m_SendRemovePacket = value; } }
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_Open = false;
|
||||
|
||||
if ( m_Owner != null && m_SendRemovePacket )
|
||||
m_Owner.Send( this.RemovePacket );
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
}
|
||||
|
||||
public override DeathMoveResult OnParentDeath( Mobile parent )
|
||||
{
|
||||
return DeathMoveResult.RemainEquiped;
|
||||
}
|
||||
|
||||
public InnBox( Mobile owner ) : base( 0x0E42 )
|
||||
{
|
||||
Layer = Layer.Inn;
|
||||
Movable = false;
|
||||
m_Owner = owner;
|
||||
}
|
||||
|
||||
public override bool IsAccessibleTo(Mobile check)
|
||||
{
|
||||
if ( ( check == m_Owner && m_Open ) || check.AccessLevel >= AccessLevel.GameMaster )
|
||||
return base.IsAccessibleTo (check);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
if ( ( from == m_Owner && m_Open ) || from.AccessLevel >= AccessLevel.GameMaster )
|
||||
return base.OnDragDrop( from, dropped );
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
if ( ( from == m_Owner && m_Open ) || from.AccessLevel >= AccessLevel.GameMaster )
|
||||
return base.OnDragDropInto (from, item, p);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
119
Source/Items/SecureTradeContainer.cs
Normal file
119
Source/Items/SecureTradeContainer.cs
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/***************************************************************************
|
||||
* SecureTradeContainer.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SecureTradeContainer : Container
|
||||
{
|
||||
private SecureTrade m_Trade;
|
||||
|
||||
public SecureTrade Trade
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Trade;
|
||||
}
|
||||
}
|
||||
|
||||
public SecureTradeContainer( SecureTrade trade ) : base( 0x1E5E )
|
||||
{
|
||||
m_Trade = trade;
|
||||
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public SecureTradeContainer( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
|
||||
{
|
||||
Mobile to;
|
||||
|
||||
if ( this.Trade.From.Container != this )
|
||||
to = this.Trade.From.Mobile;
|
||||
else
|
||||
to = this.Trade.To.Mobile;
|
||||
|
||||
return m.CheckTrade( to, item, this, message, checkItems, plusItems, plusWeight );
|
||||
}
|
||||
|
||||
public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
|
||||
{
|
||||
reject = LRReason.CannotLift;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool IsAccessibleTo( Mobile check )
|
||||
{
|
||||
if ( !IsChildOf( check ) )
|
||||
return false;
|
||||
|
||||
return base.IsAccessibleTo( check );
|
||||
}
|
||||
|
||||
public override void OnItemAdded( Item item )
|
||||
{
|
||||
ClearChecks();
|
||||
}
|
||||
|
||||
public override void OnItemRemoved( Item item )
|
||||
{
|
||||
ClearChecks();
|
||||
}
|
||||
|
||||
public override void OnSubItemAdded( Item item )
|
||||
{
|
||||
ClearChecks();
|
||||
}
|
||||
|
||||
public override void OnSubItemRemoved( Item item )
|
||||
{
|
||||
ClearChecks();
|
||||
}
|
||||
|
||||
public void ClearChecks()
|
||||
{
|
||||
if ( m_Trade != null )
|
||||
{
|
||||
m_Trade.From.Accepted = false;
|
||||
m_Trade.To.Accepted = false;
|
||||
m_Trade.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
177
Source/Items/VirtualHair.cs
Normal file
177
Source/Items/VirtualHair.cs
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
/***************************************************************************
|
||||
* VirtualHair.cs
|
||||
* -------------------
|
||||
* begin : May 1, 2002
|
||||
* copyright : (C) The RunUO Software Team
|
||||
* email : info@runuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public abstract class BaseHairInfo
|
||||
{
|
||||
private int m_ItemID;
|
||||
private int m_Hue;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int ItemID { get { return m_ItemID; } set { m_ItemID = value; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Hue { get { return m_Hue; } set { m_Hue = value; } }
|
||||
|
||||
protected BaseHairInfo( int itemid )
|
||||
: this( itemid, 0 )
|
||||
{
|
||||
}
|
||||
|
||||
protected BaseHairInfo( int itemid, int hue )
|
||||
{
|
||||
m_ItemID = itemid;
|
||||
m_Hue = hue;
|
||||
}
|
||||
|
||||
protected BaseHairInfo( GenericReader reader )
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_ItemID = reader.ReadInt();
|
||||
m_Hue = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( (int)0 ); //version
|
||||
writer.Write( (int)m_ItemID );
|
||||
writer.Write( (int)m_Hue );
|
||||
}
|
||||
}
|
||||
|
||||
public class HairInfo : BaseHairInfo
|
||||
{
|
||||
public HairInfo( int itemid )
|
||||
: base( itemid, 0 )
|
||||
{
|
||||
}
|
||||
|
||||
public HairInfo( int itemid, int hue )
|
||||
: base( itemid, hue )
|
||||
{
|
||||
}
|
||||
|
||||
public HairInfo( GenericReader reader )
|
||||
: base( reader )
|
||||
{
|
||||
}
|
||||
|
||||
public static int FakeSerial( Mobile parent )
|
||||
{
|
||||
return (0x7FFFFFFF - 0x400 - (parent.Serial * 4));
|
||||
}
|
||||
}
|
||||
|
||||
public class FacialHairInfo : BaseHairInfo
|
||||
{
|
||||
public FacialHairInfo( int itemid )
|
||||
: base( itemid, 0 )
|
||||
{
|
||||
}
|
||||
|
||||
public FacialHairInfo( int itemid, int hue )
|
||||
: base( itemid, hue )
|
||||
{
|
||||
}
|
||||
|
||||
public FacialHairInfo( GenericReader reader )
|
||||
: base( reader )
|
||||
{
|
||||
}
|
||||
|
||||
public static int FakeSerial( Mobile parent )
|
||||
{
|
||||
return (0x7FFFFFFF - 0x400 - 1 - (parent.Serial * 4));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class HairEquipUpdate : Packet
|
||||
{
|
||||
public HairEquipUpdate( Mobile parent )
|
||||
: base( 0x2E, 15 )
|
||||
{
|
||||
int hue = parent.HairHue;
|
||||
|
||||
if( parent.SolidHueOverride >= 0 )
|
||||
hue = parent.SolidHueOverride;
|
||||
|
||||
int hairSerial = HairInfo.FakeSerial( parent );
|
||||
|
||||
m_Stream.Write( (int)hairSerial );
|
||||
m_Stream.Write( (short)parent.HairItemID );
|
||||
m_Stream.Write( (byte)0 );
|
||||
m_Stream.Write( (byte)Layer.Hair );
|
||||
m_Stream.Write( (int)parent.Serial );
|
||||
m_Stream.Write( (short)hue );
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FacialHairEquipUpdate : Packet
|
||||
{
|
||||
public FacialHairEquipUpdate( Mobile parent )
|
||||
: base( 0x2E, 15 )
|
||||
{
|
||||
int hue = parent.FacialHairHue;
|
||||
|
||||
if( parent.SolidHueOverride >= 0 )
|
||||
hue = parent.SolidHueOverride;
|
||||
|
||||
int hairSerial = FacialHairInfo.FakeSerial( parent );
|
||||
|
||||
m_Stream.Write( (int)hairSerial );
|
||||
m_Stream.Write( (short)parent.FacialHairItemID );
|
||||
m_Stream.Write( (byte)0 );
|
||||
m_Stream.Write( (byte)Layer.FacialHair );
|
||||
m_Stream.Write( (int)parent.Serial );
|
||||
m_Stream.Write( (short)hue );
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class RemoveHair : Packet
|
||||
{
|
||||
public RemoveHair( Mobile parent )
|
||||
: base( 0x1D, 5 )
|
||||
{
|
||||
m_Stream.Write( (int)HairInfo.FakeSerial( parent ) );
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class RemoveFacialHair : Packet
|
||||
{
|
||||
public RemoveFacialHair( Mobile parent )
|
||||
: base( 0x1D, 5 )
|
||||
{
|
||||
m_Stream.Write( (int)FacialHairInfo.FakeSerial( parent ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue