public override void AddComponents() { IronGate gate = new IronGate( DoorFacing.EastCCW ); m_Gate = gate; gate.KeyValue = Key.RandomValue(); gate.Locked = true; AddItem( gate, -2, 1, 0 ); MetalChest chest = new MetalChest(); chest.ItemID = 0xE7C; chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) ); chest.LiftOverride = true; TreasureMapChest.FillOld( chest, 2 ); AddItem( chest, 4, 4, 0 ); AddMobile( new Ratman(), 15, 0, -2, 0 ); AddMobile( new Ratman(), 15, 0, 1, 0 ); AddMobile( new RatmanMage(), 15, 0, -1, 0 ); AddMobile( new RatmanArcher(), 15, 0, 0, 0 ); m_Prisoner = new BaseEscort(); m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 ); AddMobile( m_Prisoner, 2, -2, 0, 0 ); }
public override void AddComponents() { BaseCreature bc; IronGate gate = new IronGate(DoorFacing.EastCCW); m_Gate = gate; gate.KeyValue = Key.RandomValue(); gate.Locked = true; AddItem(gate, -2, 1, 0); AddCampChests(gate); AddMobile(new Deathknight(), 15, 0, -2, 0); AddMobile(new KhaldunZealot(), 15, 0, 1, 0); AddMobile(new KhaldunSummoner(), 15, 0, -1, 0); switch (Utility.Random(2)) { case 0: m_Prisoner = new Noble(); break; case 1: m_Prisoner = new SeekerOfAdventure(); break; } bc = (BaseCreature)m_Prisoner; bc.IsPrisoner = true; bc.CantWalk = true; m_Prisoner.YellHue = Utility.RandomList(0x57, 0x67, 0x77, 0x87, 0x117); AddMobile(m_Prisoner, 2, -2, 0, 0); }
public override void AddComponents() { IronGate gate = new IronGate( DoorFacing.EastCCW ); m_Gate = gate; gate.KeyValue = Key.RandomValue(); gate.Locked = true; AddItem( gate, -2, 1, 0 ); MetalChest chest = new MetalChest(); chest.ItemID = 0xE7C; chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) ); TreasureMapChest.Fill( chest, 2 ); AddItem( chest, 4, 4, 0 ); AddMobile( new Gnoll(), 15, 0, -2, 0 ); AddMobile( new Gnoll(), 15, 0, 1, 0 ); AddMobile( new Gnoll(), 15, 0, -1, 0 ); AddMobile( new Gnoll(), 15, 0, 0, 0 ); switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; case 1: m_Prisoner = new SeekerOfAdventure(); break; } m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 ); AddMobile( m_Prisoner, 2, -2, 0, 0 ); }
public virtual bool Install( Mobile m, BaseDoor door, out string message ) { if( door.CanInstallTrap(m) ) { if( door.HasTrap() && this.TrapType == door.TrapType && door.DoorTrap.Refillable ) { door.DoorTrap.Recharge(this.InitialUses); message = "A trap of the same type was already installed on this door, so you refill its ammunition."; return true; } if (door.AttachTrap(BaseDoorTrap.CreateTrapByType(_trapType, _owner, _initialUses))) { message = "You successfully install the trap."; return true; } if (door.HasTrap() && this.TrapType != door.TrapType) { message = "This door already appears to be trapped."; return false; } } message = "You fail to install the trap."; return false; }
public InternalTimer( BaseDoor door, int sound ) : base( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ) ) { m_Door = door; m_Sound = sound; count = 0; Priority = TimerPriority.TwoFiftyMS; }
/// <summary> /// Adds a [trapped] label to a trapped item at <code>PerkLevel.First</code> /// </summary> public bool LabelTrappedDoor(BaseDoor door) { if (Level < PerkLevel.First) return false; if (door.TrapType != DoorTrapType.None) return true; return false; }
public int GetKnockFor( BaseDoor door ) { if( door is MetalDoor || door is IronGate || door is IronGateShort || door is BarredMetalDoor || door is BarredMetalDoor2 || door is MetalDoor2 || door is PortcullisNS || door is PortcullisEW ) return 320; else if( door is LightWoodGate || door is DarkWoodGate || door is DarkWoodDoor || door is MediumWoodDoor || door is LightWoodDoor ) return 938; else if( door is StrongWoodDoor ) return 328; else return 292; }
public AdvancedSwitch( string direction, bool onoff ) { switch( direction.ToLower() ) { default: case "left": { ItemID = 0x108F; if( onoff ) { m_OffItemId = 0x108F; m_OnItemId = 0x1090; m_HasOnItemId = true; } else { m_OnItemId = -1; m_HasOnItemId = false; } break; } case "right": { ItemID = 0x1091; if (onoff) { m_OffItemId = 0x1091; m_OnItemId = 0x1092; m_HasOnItemId = true; } else { m_OnItemId = -1; m_HasOnItemId = false; } break; } } Movable = false; m_HasOnItemId = false; m_LinkedDoor = null; m_Message = null; m_HasMessage = false; m_HasLinkedDoor = false; m_SayOverhead = false; }
public YardSecurityGump( Mobile from, BaseDoor gate ) : base( 50, 50 ) { m_Gate = gate; m_From = from; this.Closable=true; this.Disposable=true; this.Dragable=true; this.Resizable=false; this.AddPage(0); this.AddBackground(0, 0, 200, 100, 9250); this.AddLabel(58, 13, 0, @"SET ACCESS"); this.AddButton(131, 38, 1150, 1152, (int)Buttons.Unlock, GumpButtonType.Reply, 0); this.AddButton(40, 38, 1153, 1155, (int)Buttons.Lock, GumpButtonType.Reply, 0); this.AddLabel(38, 58, 0, @"Lock"); this.AddLabel(123, 58, 0, @"Unlock"); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_Prisoner = reader.ReadMobile(); m_Gate = reader.ReadItem() as BaseDoor; break; } } }
public override void AddComponents() { m_Gate = new IronGate(DoorFacing.EastCCW) { KeyValue = Key.RandomValue(), Locked = true }; AddItem(m_Gate, -2, 1, 0); m_Chest = new MetalChest { ItemID = 0xE7C, LiftOverride = true }; m_Chest.DropItem(new Key(KeyType.Iron, m_Gate.KeyValue)); AddItem(m_Chest, 4, 4, 0); AddMobile(new Lizardman(), 15, 0, -2, 0); AddMobile(new Lizardman(), 15, 0, -2, 0); AddMobile(new Lizardman(), 15, 0, -2, 0); AddMobile(new LizardWarrior(), 15, 0, 1, 0); AddMobile(new LizardMage(), 15, 0, -1, 0); AddMobile(new LizardMage(), 15, 0, -1, 0); AddMobile(new LizardArcher(), 15, 0, 0, 0); AddMobile(new LizardArcher(), 15, 0, 0, 0); switch (Utility.Random(2)) { case 0: m_Prisoner = new Noble(); break; case 1: m_Prisoner = new SeekerOfAdventure(); break; } m_Prisoner.YellHue = Utility.RandomList(0x57, 0x67, 0x77, 0x87, 0x117); AddMobile(m_Prisoner, 2, -2, 0, 0); }
public override void AddComponents() { IronGate gate = new IronGate( DoorFacing.EastCCW ); m_Gate = gate; gate.KeyValue = Key.RandomValue(); gate.Locked = true; AddItem( gate, -2, 1, 0 ); MetalChest chest = new MetalChest(); chest.Movable = false; chest.ItemID = 0xE7C; // metal chest facing East chest.DropItem( new Key( KeyType.Rusty, gate.KeyValue ) ); LootPack.Average.Generate( chest ); AddItem( chest, 4, 4, 0 ); AddMobile( new Orc(), 15, 0, -2, 0 ); AddMobile( new Orc(), 15, 0, 1, 0 ); AddMobile( new Orc(), 15, 0, 1, 0 ); AddMobile( new Orc(), 15, 0, 1, 0 ); AddMobile( new Orc(), 15, 0, 1, 0 ); AddMobile( new OrcishMage(), 15, 0, -1, 0 ); AddMobile( new OrcCaptain(), 15, 0, -1, 0 ); if ( Utility.RandomBool() ) AddMobile( new OrcishLord(), 15, 0, 0, 0 ); switch ( Utility.Random( 8 ) ) { default:m_Prisoner = new Noble(); break; case 0: m_Prisoner = new SeekerOfAdventure(); break; case 1: m_Prisoner = new Messenger(); break; case 2: m_Prisoner = new Peasant(); break; case 3: m_Prisoner = new BrideGroom(); break; } m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 ); AddMobile( m_Prisoner, 2, -2, 0, 0 ); }
public override void AddComponents() { BaseCreature bc; IronGate gate = new IronGate( DoorFacing.EastCCW ); m_Gate = gate; gate.KeyValue = Key.RandomValue(); gate.Locked = true; AddItem( gate, -2, 1, 0 ); MetalChest chest = new MetalChest(); chest.ItemID = 0xE7C; chest.LiftOverride = true; chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) ); /*TreasureMapChest.Fill( chest, 2 );*/ AddItem( chest, 4, 4, 1 ); AddMobile( new Orc(), 15, 0, -2, 0 ); AddMobile( new Orc(), 15, 0, 1, 0 ); AddMobile( new OrcishMage(), 15, 0, -1, 0 ); AddMobile( new OrcCaptain(), 15, 0, 0, 0 ); switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; case 1: m_Prisoner = new SeekerOfAdventure(); break; } bc = (BaseCreature)m_Prisoner; bc.IsPrisoner = true; m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 ); AddMobile( m_Prisoner, 2, -2, 0, 0 ); }
public IronGate(DoorFacing facing) : base(0x824 + (2 * (int)facing), 0x825 + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing)) { }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch( version ) { case 0: { m_HasMessage = reader.ReadBool(); if( m_HasMessage ) m_Message = reader.ReadString(); m_HasLinkedDoor = reader.ReadBool(); if( m_HasLinkedDoor ) m_LinkedDoor = (BaseDoor)reader.ReadItem(); m_HasOnItemId = reader.ReadBool(); if( m_HasOnItemId ) m_OnItemId = reader.ReadInt(); m_OffItemId = reader.ReadInt(); m_SayOverhead = reader.ReadBool(); break; } } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { m_CustomClosedID = reader.ReadInt(); m_CustomOpenedID = reader.ReadInt(); m_Facing = (DoorFacing)reader.ReadInt(); m_KeyValue = reader.ReadUInt(); m_Open = reader.ReadBool(); m_Locked = reader.ReadBool(); m_OpenedID = reader.ReadInt(); m_ClosedID = reader.ReadInt(); m_OpenedSound = reader.ReadInt(); m_ClosedSound = reader.ReadInt(); m_Offset = reader.ReadPoint3D(); m_Link = reader.ReadItem() as BaseDoor; m_Timer = new InternalTimer( this ); if ( m_Open ) m_Timer.Start(); break; // NO FALLTHROUGH } case 0: { m_KeyValue = reader.ReadUInt(); m_Open = reader.ReadBool(); m_Locked = reader.ReadBool(); m_OpenedID = reader.ReadInt(); m_ClosedID = reader.ReadInt(); m_OpenedSound = reader.ReadInt(); m_ClosedSound = reader.ReadInt(); m_Offset = reader.ReadPoint3D(); m_Link = reader.ReadItem() as BaseDoor; m_Timer = new InternalTimer( this ); if ( m_Open ) m_Timer.Start(); // bring ver 0 up to ver 1 for (int i = 0; i < 8; i++) { if (m_Offset == m_Offsets[i]) { m_OpenedID -= 2 * i; m_ClosedID -= 2 * i; m_CustomClosedID = -1; m_CustomOpenedID = -1; m_Offset = Point3D.Zero; m_Facing = (DoorFacing)i; break; } } if (m_Offset != Point3D.Zero) { m_Facing = DoorFacing.EastCCW; m_CustomOpenedID = m_OpenedID; m_CustomClosedID = m_ClosedID; } break; } } }
public MetalHouseDoor(DoorFacing facing) : base(facing, 0x675 + (2 * (int)facing), 0x676 + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing)) { }
public AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house) { if (Deleted) { return(AddonFitResult.Blocked); } foreach (AddonContainerComponent c in m_Components) { Point3D p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z); if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, (c.Z == 0))) { return(AddonFitResult.Blocked); } if (!BaseAddon.CheckHouse(from, p3D, map, c.ItemData.Height, ref house)) { return(AddonFitResult.NotInHouse); } if (c.NeedsWall) { Point3D wall = c.WallPosition; if (!BaseAddon.IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map)) { return(AddonFitResult.NoWall); } } } Point3D p3 = new Point3D(p.X, p.Y, p.Z); if (!map.CanFit(p3.X, p3.Y, p3.Z, ItemData.Height, false, true, (Z == 0))) { return(AddonFitResult.Blocked); } if (!BaseAddon.CheckHouse(@from, p3, map, ItemData.Height, ref house)) { return(AddonFitResult.NotInHouse); } if (NeedsWall) { Point3D wall = WallPosition; if (!BaseAddon.IsWall(p3.X + wall.X, p3.Y + wall.Y, p3.Z + wall.Z, map)) { return(AddonFitResult.NoWall); } } if (house != null) { List <Item> doors = house.Doors; for (int i = 0; i < doors.Count; ++i) { BaseDoor door = doors[i] as BaseDoor; if (door == null) { continue; } if (door != null && door.Open) { return(AddonFitResult.DoorsNotClosed); } Point3D doorLoc = door.GetWorldLocation(); int doorHeight = door.ItemData.CalcHeight; foreach (AddonContainerComponent c in m_Components) { Point3D addonLoc = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z); int addonHeight = c.ItemData.CalcHeight; if (Utility.InRange(doorLoc, addonLoc, 1) && (addonLoc.Z == doorLoc.Z || ((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z))) { return(AddonFitResult.DoorTooClose); } } Point3D addonLo = new Point3D(p.X, p.Y, p.Z); int addonHeigh = ItemData.CalcHeight; if (Utility.InRange(doorLoc, addonLo, 1) && (addonLo.Z == doorLoc.Z || ((addonLo.Z + addonHeigh) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLo.Z))) { return(AddonFitResult.DoorTooClose); } } } return(AddonFitResult.Valid); }
public GenericHouseDoor(DoorFacing facing, int baseItemID, int openedSound, int closedSound, bool autoAdjust) : base(facing, baseItemID + (autoAdjust ? (2 * (int)facing) : 0), baseItemID + 1 + (autoAdjust ? (2 * (int)facing) : 0), openedSound, closedSound, BaseDoor.GetOffset(facing)) { }
public RefundEntry( Mobile from, BaseDoor gate, int price) : base( 6104, 9 ) { m_From = from; m_Gate = gate; value = price; }
public DarkWoodDoor(DoorFacing facing) : base(0x6A5 + (2 * (int)facing), 0x6A6 + (2 * (int)facing), 0xEA, 0xF1, BaseDoor.GetOffset(facing)) { }
public IronGateShort(DoorFacing facing) : base(0x84c + (2 * (int)facing), 0x84d + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing)) { }
public RattanDoor(DoorFacing facing) : base(0x695 + (2 * (int)facing), 0x696 + (2 * (int)facing), 0xEB, 0xF2, BaseDoor.GetOffset(facing)) { }
public BarredMetalDoor2(DoorFacing facing) : base(0x1FED + (2 * (int)facing), 0x1FEE + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing)) { }
public BarredMetalDoor(DoorFacing facing) : base(0x685 + (2 * (int)facing), 0x686 + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing)) { }
public DarkWoodGate(DoorFacing facing) : base(0x866 + (2 * (int)facing), 0x867 + (2 * (int)facing), 0xEB, 0xF2, BaseDoor.GetOffset(facing)) { }
public override void AddComponents() { IronGate gate = new IronGate( DoorFacing.EastCCW ); m_Gate = gate; gate.KeyValue = Key.RandomValue(); gate.Locked = true; AddItem( gate, -2, 1, 0 ); AddCampChests(); switch (Utility.Random(4)) { case 0: { AddMobile(new Orc(), 15, 0, -2, 0); AddMobile(new OrcishMage(), 15, 0, 1, 0); AddMobile(new OrcishLord(), 15, 0, -2, 0); AddMobile(new OrcCaptain(), 15, 0, 1, 0); AddMobile(new Orc(), 15, 0, -1, 0); AddMobile(new OrcChopper(), 15, 0, -2, 0); }break; case 1: { AddMobile(new Ratman(), 15, 0, -2, 0); AddMobile(new Ratman(), 15, 0, 1, 0); AddMobile(new RatmanMage(), 15, 0, -2, 0); AddMobile(new Ratman(), 15, 0, 1, 0); AddMobile(new RatmanArcher(), 15, 0, -1, 0); AddMobile(new Ratman(), 15, 0, -2, 0); } break; case 2: { AddMobile(new Lizardman(), 15, 0, -2, 0); AddMobile(new Lizardman(), 15, 0, 1, 0); AddMobile(new Lizardman(), 15, 0, -2, 0); AddMobile(new Lizardman(), 15, 0, 1, 0); AddMobile(new Lizardman(), 15, 0, -1, 0); AddMobile(new Lizardman(), 15, 0, -2, 0); } break; case 3: { AddMobile(new Brigand(), 15, 0, -2, 0); AddMobile(new Brigand(), 15, 0, 1, 0); AddMobile(new Brigand(), 15, 0, -2, 0); AddMobile(new Brigand(), 15, 0, 1, 0); AddMobile(new Brigand(), 15, 0, -1, 0); AddMobile(new Brigand(), 15, 0, -2, 0); } break; } switch ( Utility.Random( 2 ) ) { case 0: m_Prisoner = new Noble(); break; case 1: m_Prisoner = new SeekerOfAdventure(); break; } m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 ); AddMobile( m_Prisoner, 2, -2, 0, 0 ); }
public virtual AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house, ref BaseGalleon boat) { if (this.Deleted) { return(AddonFitResult.Blocked); } foreach (AddonComponent c in this.m_Components) { Point3D p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z); if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, (c.Z == 0))) { return(AddonFitResult.Blocked); } else if (!CheckHouse(from, p3D, map, c.ItemData.Height, ref house) && !CheckBoat(from, p3D, map, ref boat)) { return(AddonFitResult.NotInHouse); } if (c.NeedsWall) { Point3D wall = c.WallPosition; if (!IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map)) { return(AddonFitResult.NoWall); } } } if (house != null) { if (RestrictToClassicHouses && house is HouseFoundation) { return(AddonFitResult.BadHouse); } ArrayList doors = house.Doors; for (int i = 0; i < doors.Count; ++i) { BaseDoor door = doors[i] as BaseDoor; Point3D doorLoc = door.GetWorldLocation(); int doorHeight = door.ItemData.CalcHeight; foreach (AddonComponent c in this.m_Components) { Point3D addonLoc = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z); int addonHeight = c.ItemData.CalcHeight; if (Utility.InRange(doorLoc, addonLoc, 1) && (addonLoc.Z == doorLoc.Z || ((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z))) { return(AddonFitResult.DoorTooClose); } } } } return(AddonFitResult.Valid); }
public MediumWoodDoor(DoorFacing facing) : base(0x6B5 + (2 * (int)facing), 0x6B6 + (2 * (int)facing), 0xEA, 0xF1, BaseDoor.GetOffset(facing)) { }
public InternalTimer( BaseDoor door ) : base(TimeSpan.FromSeconds( 20.0 ), TimeSpan.FromSeconds( 10.0 )) { Priority = TimerPriority.OneSecond; m_Door = door; }
public MetalDoor2(DoorFacing facing) : base(0x6C5 + (2 * (int)facing), 0x6C6 + (2 * (int)facing), 0xEC, 0xF3, BaseDoor.GetOffset(facing)) { }
public void AddDoor( BaseDoor door, int xoff, int yoff, int zoff ) { door.MoveToWorld( new Point3D( xoff+this.X, yoff+this.Y, zoff+this.Z ), this.Map ); m_Doors.Add( door ); }
public LightWoodDoor(DoorFacing facing) : base(0x6D5 + (2 * (int)facing), 0x6D6 + (2 * (int)facing), 0xEA, 0xF1, BaseDoor.GetOffset(facing)) { }
public DoorKnockEntry( BaseDoor door ) : base(1063493, 1) { m_Door = door; }
public StrongWoodDoor(DoorFacing facing) : base(0x6E5 + (2 * (int)facing), 0x6E6 + (2 * (int)facing), 0xEA, 0xF1, BaseDoor.GetOffset(facing)) { }
public LightWoodGate(DoorFacing facing) : base(0x839 + (2 * (int)facing), 0x83A + (2 * (int)facing), 0xEB, 0xF2, BaseDoor.GetOffset(facing)) { }
public GargishTraditionalDoor(DoorFacing facing) : base(0x409B + GetIdOffset(facing), 0x409C + GetIdOffset(facing), 0xEA, 0xF1, BaseDoor.GetOffset(facing)) { }
protected void ConvertDoor( BaseDoor door ) { if ( !Owned ) return; if ( door is Server.Gumps.ISecurable ) { Console.WriteLine("Convert Door 1"); door.Locked = false; c_House.Doors.Add( door ); return; } door.Open = false; GenericHouseDoor newdoor = new GenericHouseDoor( (DoorFacing)0, door.ClosedID, door.OpenedSound, door.ClosedSound ); newdoor.Offset = door.Offset; newdoor.ClosedID = door.ClosedID; newdoor.OpenedID = door.OpenedID; newdoor.Location = door.Location; newdoor.Map = door.Map; door.Delete(); foreach( Item inneritem in newdoor.GetItemsInRange( 1 ) ) if ( inneritem is BaseDoor && inneritem != newdoor && inneritem.Z == newdoor.Z ) { ((BaseDoor)inneritem).Link = newdoor; newdoor.Link = (BaseDoor)inneritem; } Console.WriteLine("Convert Door 2"); c_House.Doors.Add(newdoor); }
public GargishProgressiveDoor(DoorFacing facing) : base(0x41CF + GetIdOffset(facing), 0x41D0 + GetIdOffset(facing), 0xEA, 0xF1, BaseDoor.GetOffset(facing)) { }
public override void OnDoubleClick( Mobile from ) { if( m_HasLinkedDoor ) { if( m_LinkedDoor == null || m_LinkedDoor.Deleted ) { m_HasLinkedDoor = false; m_LinkedDoor = null; return; } if( from.InRange( GetWorldLocation(), 5 ) && from.InLOS(this) ) { if( m_HasMessage ) if( m_SayOverhead ) PublicOverheadMessage( MessageType.Regular, 0, false, m_Message ); else from.PrivateOverheadMessage( MessageType.Regular, 0, false, m_Message, from.NetState ); if( m_HasOnItemId ) ItemID = ( ItemID == m_OnItemId ) ? m_OffItemId : m_OnItemId; m_LinkedDoor.Open = !m_LinkedDoor.Open; } else from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } }
public virtual void Use(Mobile from) { if (m_Locked && !m_Open && UseLocks()) { if (from.AccessLevel >= AccessLevel.GameMaster) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502502); // That is locked, but you open it with your godly powers. //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers. } else if (Key.ContainsKey(from.Backpack, this.KeyValue)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501282); // You quickly unlock, open, and relock the door } else if (IsInside(from)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501280); // That is locked, but is usable from the inside. } else { if (Hue == 0x44E && Map == Map.Malas) // doom door into healer room in doom { this.SendLocalizedMessageTo(from, 1060014); // Only the dead may pass. } else { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502503); // That is locked. } return; } } if (m_Open && !IsFreeToClose()) { return; } if (m_Open) { OnClosed(from); } else { OnOpened(from); } if (UseChainedFunctionality) { bool open = !m_Open; ArrayList list = GetChain(); for (int i = 0; i < list.Count; ++i) { ((BaseDoor)list[i]).Open = open; } } else { Open = !m_Open; BaseDoor link = this.Link; if (m_Open && link != null && !link.Open) { link.Open = true; } } }
public virtual AddonFitResult CouldFit(IPoint3D p, Map map, Mobile from, ref BaseHouse house) { if (Deleted) { return(AddonFitResult.Blocked); } foreach (AddonComponent c in m_Components) { Point3D p3D = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z); if (!map.CanFit(p3D.X, p3D.Y, p3D.Z, Math.Max(1, c.ItemData.Height), false, true, (c.Z == 0), true)) { return(AddonFitResult.Blocked); } if (!CheckHouse(from, p3D, map, c.ItemData.Height, ref house)) { return(AddonFitResult.NotInHouse); } if (from != null) { var fromHouse = BaseHouse.FindHouseAt(from.Location, map, 16); if (fromHouse == null || house != fromHouse) { return(AddonFitResult.OwnerNotInHouse); } } if (c.NeedsWall) { Point3D wall = c.WallPosition; if (!IsWall(p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map)) { return(AddonFitResult.NoWall); } } if (house != null) { bool frontStairs; if (house.IsStairArea(p, out frontStairs)) { if (frontStairs) { return(AddonFitResult.FoundationStairs); } else { return(AddonFitResult.InternalStairs); } } } } if (house != null) { List <Item> doors = house.Doors; for (int i = 0; i < doors.Count; ++i) { BaseDoor door = doors[i] as BaseDoor; Point3D doorLoc = door.GetWorldLocation(); int doorHeight = door.ItemData.CalcHeight; foreach (AddonComponent c in m_Components) { Point3D addonLoc = new Point3D(p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z); int addonHeight = c.ItemData.CalcHeight; if (Utility.InRange(doorLoc, addonLoc, 1) && (addonLoc.Z == doorLoc.Z || ((addonLoc.Z + addonHeight) > doorLoc.Z && (doorLoc.Z + doorHeight) > addonLoc.Z))) { return(AddonFitResult.DoorTooClose); } } } } return(AddonFitResult.Valid); }
public InternalTimer(BaseDoor door, TimeSpan dureeFermeture) : base(dureeFermeture, TimeSpan.FromSeconds(10.0)) { Priority = TimerPriority.OneSecond; m_Door = door; }
public InternalEntry(int entrynumber, Mobile from, BaseDoor door, int message, int range) : base(message, range) { m_From = from; m_Door = door; m_Entry = entrynumber; }
public GenericHouseDoor(DoorFacing facing, int baseItemID, int openedSound, int closedSound) : base(facing, baseItemID + (2 * (int)facing), baseItemID + 1 + (2 * (int)facing), openedSound, closedSound, BaseDoor.GetOffset(facing)) { }
public YardSecurityEntry( Mobile from, BaseDoor gate) : base( 6203, 9 ) { m_From = from; m_Gate = gate; }
public void RemoveDoor(BaseDoor door) { if (m_Doors != null && m_Doors.Contains(door)) m_Doors.Remove(door); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_KeyValue = reader.ReadUInt(); m_Open = reader.ReadBool(); m_Locked = reader.ReadBool(); m_OpenedID = reader.ReadInt(); m_ClosedID = reader.ReadInt(); m_OpenedSound = reader.ReadInt(); m_ClosedSound = reader.ReadInt(); m_Offset = reader.ReadPoint3D(); m_Link = reader.ReadItem() as BaseDoor; m_Timer = new InternalTimer( this ); if ( m_Open ) m_Timer.Start(); break; } } }
public InternalTimer( BaseDoor door ) : base(TimeSpan.FromSeconds( 20.0 ), TimeSpan.FromSeconds( 10.0 )) { m_Door = door; }
protected void ConvertDoor(BaseDoor door) { if (!Owned) { return; } if (door is ISecurable) { door.Locked = false; c_House.Doors.Add(door); return; } door.Open = false; var newdoor = new GenericHouseDoor(0, door.ClosedID, door.OpenedSound, door.ClosedSound) { Offset = door.Offset, ClosedID = door.ClosedID, OpenedID = door.OpenedID, Location = door.Location, Map = door.Map }; door.Delete(); foreach ( Item inneritem in newdoor.GetItemsInRange(1) .Where(inneritem => inneritem is BaseDoor && inneritem != newdoor && inneritem.Z == newdoor.Z)) { ((BaseDoor) inneritem).Link = newdoor; newdoor.Link = (BaseDoor) inneritem; } c_House.Doors.Add(newdoor); }
public BaseDoorTrap( GenericReader reader ) { int version = reader.ReadInt(); _owner = reader.ReadMobile(); _type = (DoorTrapType)reader.ReadInt(); _active = reader.ReadBool(); _refillable = reader.ReadBool(); _uses = reader.ReadInt(); _door = (BaseDoor)reader.ReadItem(); }
public CraftableStoneHouseDoor(DoorType type, DoorFacing facing) : base(facing, 0x324 + (2 * (int)facing), 0x325 + (2 * (int)facing), 0xED, 0xF4, BaseDoor.GetOffset(facing)) { this.Type = type; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadEncodedInt(); m_Game = reader.ReadItem() as CTFGame; m_Stone = reader.ReadItem() as GameJoinStone; int count = reader.ReadEncodedInt(); m_Times = new TimeSpan[count]; for ( int i = 0; i < count; i++ ) m_Times[i] = reader.ReadTimeSpan(); bool active = reader.ReadBool(); m_Duration = reader.ReadTimeSpan(); m_Doors = reader.ReadItem() as BaseDoor; m_CTFJoinMessage = reader.ReadString(); m_CTFStartMessage = reader.ReadString(); m_CTFMessageHue = reader.ReadInt(); Activate( active ); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { m_RegionBounds = reader.ReadRect2D(); m_Traps = reader.ReadStrongItemList<BaseTrap>(); goto case 0; } case 0: { if ( version < 1 ) { m_Traps = new List<BaseTrap>(); m_RegionBounds = new Rectangle2D( X - 40, Y - 40, 80, 80 ); } m_Creatures = reader.ReadStrongMobileList(); m_TypeName = reader.ReadString(); m_Door = reader.ReadItem<BaseDoor>(); ; m_Addon = reader.ReadItem<BaseAddon>(); ; m_Sequence = reader.ReadItem<GauntletSpawner>(); State = (GauntletSpawnerState)reader.ReadInt(); break; } } }
public InternalTimer(BaseDoor door) : base(TimeSpan.FromSeconds(10.0)) { Priority = TimerPriority.OneSecond; m_Door = door; }