QUOTE |
public virtual void Use( Mobile from ) { // ARTEGORDONMOD // block use of doors destroyed with the XmlSiege system if(XmlSiege.GetHits(this) == 0) return; if ( m_Locked && !m_Open && UseLocks() ) { |
QUOTE |
[CommandProperty( AccessLevel.GameMaster )] public bool Open { get { return m_Open; } set { // ARTEGORDONMOD // prevent doors with modified itemids through XmlSiege from being opened if(ItemID != m_OpenedID && ItemID != m_ClosedID) return; if ( m_Open != value ) { |
CODE |
using Server.Engines.XmlSpawner2; |
QUOTE |
public void Teleport( int xOffset, int yOffset, int zOffset ) { MultiComponentList mcl = Components; ArrayList toMove = new ArrayList(); IPooledEnumerable eable = this.Map.GetObjectsInBounds( new Rectangle2D( X + mcl.Min.X, Y + mcl.Min.Y, mcl.Width, mcl.Height ) ); foreach ( object o in eable ) { // ARTEGORDONMOD // deal with addons. Just move the addon, not the components. That gets taken care of // automatically when you move the addon itself. if ( o != this && !(o is TillerMan || o is Hold || o is Plank || o is AddonComponent) ) toMove.Add( o ); } eable.Free(); for ( int i = 0; i < toMove.Count; ++i ) { object o = toMove[i]; if ( o is Item ) { Item item = (Item)o; // ARTEGORDONMOD // deal with addons that would have invisible handles but you still // want them to be moved with the boat. if ( Contains( item ) && (item.Visible || item is BaseAddon) && item.Z >= Z ) item.Location = new Point3D( item.X + xOffset, item.Y + yOffset, item.Z + zOffset ); } else if ( o is Mobile ) { Mobile m = (Mobile)o; if ( Contains( m ) ) m.Location = new Point3D( m.X + xOffset, m.Y + yOffset, m.Z + zOffset ); } } Location = new Point3D( X + xOffset, Y + yOffset, Z + zOffset ); } |
QUOTE |
foreach ( object o in eable ) { if ( o is Item ) { Item item = (Item)o; // ARTEGORDONMOD // deal with addons that would have invisible handles but you still // want them to be moved with the boat. // Just move the addon, not the components. That gets taken care of // automatically when you move the addon itself. if (item != this && Contains(item) && (item.Visible || item is BaseAddon) && item.Z >= Z && !(item is TillerMan || item is Hold || item is Plank || item is AddonComponent)) toMove.Add( item ); // support rotation of siege weapons when turning boats if (item is BaseSiegeWeapon) { ((BaseSiegeWeapon)item).Facing = ((int)((BaseSiegeWeapon)item).Facing - ((int)old - (int)facing)/2); } } else if ( o is Mobile && Contains( (Mobile)o ) ) { toMove.Add( o ); ((Mobile)o).Direction = (Direction)((int)((Mobile)o).Direction - (int)old + (int)facing); } } |
QUOTE (Anvil @ April 06, 2006 09:47 pm) | ||
Question, in the main post you mention this:
How would one go about setting cannons and catapults destroyable for peranent descruction within their scripts so that when they're created this setting is already in place? Or are they setup like that now (didn't get that take from this comment). I'd prefer the objects used for fighting can be destroyed. Thanks. Anvil |
QUOTE |
public XmlSiege(int hitsmax, int resistfire, int resistphysical, int wood, int iron, int stone, int destroyeditemid) |
QUOTE |
[Constructable] public SiegeCatapult(int facing) { // addon the components for (int i = 0; i < CatapultNorth.Length; i++) { AddComponent(new SiegeComponent(0, Name), 0, 0, 0); } // assign the facing if (facing < 0) facing = 3; if (facing > 3) facing = 0; Facing = facing; // set the default props Name = "Siege Catapult"; Weight = 50; // make them siegable by default // XmlSiege( hitsmax, resistfire, resistphysical, wood, iron, stone) // call the XmlSiege constructor with the DestroyedItemID arg with a value of 0 // to have them deleted on destruction XmlAttach.AttachTo(this, new XmlSiege(100, 10, 10, 20, 30, 0, 0)); // and draggable XmlAttach.AttachTo(this, new XmlDrag()); // undo the temporary hue indicator that is set when the xmlsiege attachment is added Hue = 0; } |
CODE |
public BaseHouse( int multiID, Mobile owner, int MaxLockDown, int MaxSecure ) : base( multiID | 0x4000 ) { . . . // automatically add an xmlsiege attachment to this object XmlAttach.AttachTo(this, new XmlSiege()); } |
CODE |
using Server.Engines.XmlSpawner2; |
CODE |
// add a siege attachment with 500 hits, 60% fire resistance, 20% physical resistance XmlAttach.AttachTo(this, new XmlSiege(500,60,20)); |