public bool Destroy() { if (this == null || this.Deleted) { return(false); } if (OnBeforeDestroyed()) { if (m_Child != null && !m_Child.Deleted && !m_Child.Alive) { Rubble rubble = new Rubble(m_DestroyedID, this.Name); if (rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal) { rubble.MoveToWorld(this.Location, this.Map); } OnDestroyed(); if (m_Child != null) { m_Child.Delete(); } Delete(); return(true); } else { Rubble rubble = new Rubble(m_DestroyedID, this.Name); //Static rubble = new Static(m_DestroyedID); if (rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal) { rubble.MoveToWorld(this.Location, this.Map); } OnDestroyed(); Delete(); return(true); } } return(false); }
public bool Destroy( ) { if( this == null || this.Deleted ) return false; if( OnBeforeDestroyed( ) ) { if( m_Child != null && !m_Child.Deleted && !m_Child.Alive ) { Rubble rubble = new Rubble( m_DestroyedID, this.Name ); if( rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal ) { rubble.MoveToWorld( this.Location, this.Map ); } WoodenBox lootbox = new WoodenBox( ); lootbox.Name = this.Name + " Loot Box"; OnDestroyed( lootbox ); if( lootbox != null && !lootbox.Deleted ) { if( DropsLoot ) lootbox.MoveToWorld( new Point3D( this.X, this.Y, this.Z ), this.Map ); else lootbox.Delete( ); } if( m_Child != null ) m_Child.Delete( ); Delete( ); return true; } else { Static rubble = new Static( m_DestroyedID ); if( rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal ) rubble.MoveToWorld( this.Location, this.Map ); WoodenBox lootbox = new WoodenBox( ); lootbox.Name = this.Name + " Loot Box"; OnDestroyed( lootbox ); if( lootbox != null && !lootbox.Deleted ) { if( DropsLoot ) lootbox.MoveToWorld( new Point3D( this.X, this.Y, this.Z ), this.Map ); else lootbox.Delete( ); } Delete( ); return true; } } return false; }
public bool Destroy() { if (this == null || this.Deleted) return false; if (OnBeforeDestroyed()) { if (m_Child != null && !m_Child.Deleted && !m_Child.Alive) { Rubble rubble = new Rubble(m_DestroyedID, this.Name); if (rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal) { rubble.MoveToWorld(this.Location, this.Map); } OnDestroyed(); if (m_Child != null) m_Child.Delete(); Delete(); return true; } else { Rubble rubble = new Rubble(m_DestroyedID, this.Name); //Static rubble = new Static(m_DestroyedID); if (rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal) rubble.MoveToWorld(this.Location, this.Map); OnDestroyed(); Delete(); return true; } } return false; }
public bool Destroy( ) { if (this == null || this.Deleted) { return(false); } if (OnBeforeDestroyed( )) { if (m_Child != null && !m_Child.Deleted && !m_Child.Alive) { Rubble rubble = new Rubble(m_DestroyedID, this.Name); if (rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal) { rubble.MoveToWorld(this.Location, this.Map); } WoodenBox lootbox = new WoodenBox( ); lootbox.Name = this.Name + " Loot Box"; OnDestroyed(lootbox); if (lootbox != null && !lootbox.Deleted) { if (DropsLoot) { lootbox.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map); } else { lootbox.Delete( ); } } if (m_Child != null) { m_Child.Delete( ); } Delete( ); return(true); } else { Static rubble = new Static(m_DestroyedID); if (rubble != null && !rubble.Deleted && this.Map != null && this.Map != Map.Internal) { rubble.MoveToWorld(this.Location, this.Map); } WoodenBox lootbox = new WoodenBox( ); lootbox.Name = this.Name + " Loot Box"; OnDestroyed(lootbox); if (lootbox != null && !lootbox.Deleted) { if (DropsLoot) { lootbox.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map); } else { lootbox.Delete( ); } } Delete( ); return(true); } } return(false); }