public YardSecurityEntry(Mobile from, YardGate gate) : base(6203, 9) { m_From = from; m_Gate = gate; }
public static void Generate(Rectangle2D region) { for (int rx = 0; rx < region.Width; ++rx) { for (int ry = 0; ry < region.Height; ++ry) { int vx = rx + region.X; int vy = ry + region.Y; Tile[] tiles = m_Map.Tiles.GetStaticTiles(vx, vy); for (int i = 0; i < tiles.Length; ++i) { Tile tile = tiles[i]; int id = tile.ID; int z = tile.Z; if (IsWestFrame(id)) { if (IsEastFrame(vx + 2, vy, z)) { AddDoor(vx + 1, vy, z, DoorFacing.WestCW); } else if (IsEastFrame(vx + 3, vy, z)) { BaseDoor first = AddDoor(vx + 1, vy, z, DoorFacing.WestCW); BaseDoor second = AddDoor(vx + 2, vy, z, DoorFacing.EastCCW); if (first != null && second != null) { first.Link = second; second.Link = first; } else { if (first != null) { first.Delete(); } if (second != null) { second.Delete(); } } } } else if (IsNorthFrame(id)) { if (IsSouthFrame(vx, vy + 2, z)) { AddDoor(vx, vy + 1, z, DoorFacing.SouthCW); } else if (IsSouthFrame(vx, vy + 3, z)) { BaseDoor first = AddDoor(vx, vy + 1, z, DoorFacing.NorthCCW); BaseDoor second = AddDoor(vx, vy + 2, z, DoorFacing.SouthCW); if (first != null && second != null) { first.Link = second; second.Link = first; } else { if (first != null) { first.Delete(); } if (second != null) { second.Delete(); } } } } } } } }
private static bool FindItem(int x, int y, int z, Map map, Item srcItem) { int itemID = srcItem.ItemID; bool res = false; IPooledEnumerable eable; if (srcItem is BaseDoor) { eable = map.GetItemsInRange(new Point3D(x, y, z), 1); foreach (Item item in eable) { if (!(item is BaseDoor)) { continue; } BaseDoor bd = (BaseDoor)item; Point3D p; int bdItemID; if (bd.Open) { p = new Point3D(bd.X - bd.Offset.X, bd.Y - bd.Offset.Y, bd.Z - bd.Offset.Z); bdItemID = bd.ClosedID; } else { p = bd.Location; bdItemID = bd.ItemID; } if (p.X != x || p.Y != y) { continue; } if (item.Z == z && bdItemID == itemID) { res = true; } else if (Math.Abs(item.Z - z) < 8) { m_DeleteQueue.Enqueue(item); } } } else if ((TileData.ItemTable[itemID & TileData.MaxItemValue].Flags & TileFlag.LightSource) != 0) { eable = map.GetItemsInRange(new Point3D(x, y, z), 0); LightType lt = srcItem.Light; string srcName = srcItem.ItemData.Name; foreach (Item item in eable) { if (item.Z == z) { if (item.ItemID == itemID) { if (item.Light != lt) { m_DeleteQueue.Enqueue(item); } else { res = true; } } else if ((item.ItemData.Flags & TileFlag.LightSource) != 0 && item.ItemData.Name == srcName) { m_DeleteQueue.Enqueue(item); } } } } else if (srcItem is Teleporter || srcItem is FillableContainer || srcItem is BaseBook) { eable = map.GetItemsInRange(new Point3D(x, y, z), 0); Type type = srcItem.GetType(); foreach (Item item in eable) { if (item.Z == z && item.ItemID == itemID) { if (item.GetType() != type) { m_DeleteQueue.Enqueue(item); } else { res = true; } } } } else { eable = map.GetItemsInRange(new Point3D(x, y, z), 0); foreach (Item item in eable) { if (item.Z == z && item.ItemID == itemID) { eable.Free(); return(true); } } } eable.Free(); while (m_DeleteQueue.Count > 0) { ((Item)m_DeleteQueue.Dequeue()).Delete(); } return(res); }
public static void GenGauntlet_OnCommand(CommandEventArgs e) { /* Begin healer room */ CreatePricedHealer(5000, 387, 400); CreateTeleporter(390, 407, 394, 405); BaseDoor healerDoor = CreateDoorSet(393, 404, true, 0x44E); healerDoor.Locked = true; healerDoor.KeyValue = Key.RandomValue(); if (healerDoor.Link != null) { healerDoor.Link.Locked = true; healerDoor.Link.KeyValue = Key.RandomValue(); } /* End healer room */ /* Begin supply room */ CreateMorphItem(433, 371, 0x29F, 0x116, 3, 0x44E); CreateMorphItem(433, 372, 0x29F, 0x115, 3, 0x44E); CreateVarietyDealer(492, 369); for (int x = 434; x <= 478; ++x) { for (int y = 371; y <= 372; ++y) { Static item = new Static(0x524); item.Hue = 1; item.MoveToWorld(new Point3D(x, y, -1), Map.Malas); } } /* End supply room */ /* Begin gauntlet cycle */ CreateTeleporter(471, 428, 474, 428); CreateTeleporter(462, 494, 462, 498); CreateTeleporter(403, 502, 399, 506); CreateTeleporter(357, 476, 356, 480); CreateTeleporter(361, 433, 357, 434); GauntletSpawner sp1 = CreateSpawner("DarknightCreeper", 491, 456, 473, 432, 417, 426, true, 473, 412, 39, 60); GauntletSpawner sp2 = CreateSpawner("FleshRenderer", 482, 520, 468, 496, 426, 422, false, 448, 496, 56, 48); GauntletSpawner sp3 = CreateSpawner("Impaler", 406, 538, 408, 504, 432, 430, false, 376, 504, 64, 48); GauntletSpawner sp4 = CreateSpawner("ShadowKnight", 335, 512, 360, 478, 424, 439, false, 300, 478, 72, 64); GauntletSpawner sp5 = CreateSpawner("AbysmalHorror", 326, 433, 360, 429, 416, 435, true, 300, 408, 60, 56); GauntletSpawner sp6 = CreateSpawner("DemonKnight", 423, 430, 0, 0, 423, 430, true, 392, 392, 72, 96); sp1.Sequence = sp2; sp2.Sequence = sp3; sp3.Sequence = sp4; sp4.Sequence = sp5; sp5.Sequence = sp6; sp6.Sequence = sp1; sp1.State = GauntletSpawnerState.InProgress; /* End gauntlet cycle */ /* Begin exit gate */ ConfirmationMoongate gate = new ConfirmationMoongate(); gate.Dispellable = false; gate.Target = new Point3D(2350, 1270, -85); gate.TargetMap = Map.Malas; gate.GumpWidth = 420; gate.GumpHeight = 280; gate.MessageColor = 0x7F00; gate.MessageNumber = 1062109; // You are about to exit Dungeon Doom. Do you wish to continue? gate.TitleColor = 0x7800; gate.TitleNumber = 1062108; // Please verify... gate.Hue = 0x44E; gate.MoveToWorld(new Point3D(433, 326, 4), Map.Malas); /* End exit gate */ }
public virtual bool CanOpenDoor(BaseDoor door) { return(door != null && !door.Deleted); }
public virtual bool CanCloseDoor(BaseDoor door) { return(door != null && !door.Deleted && door.CanClose()); }
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)) { }
private Item GetFixtureItem(int dItemID) { int itemID = (dItemID & 0x3FFF); if (itemID >= 0x181D && itemID < 0x1829) { //Ignore teleporters! //HouseTeleporter tp = new HouseTeleporter(itemID); //AddFixture(tp, mte); } else { BaseDoor door = null; if (itemID >= 0x675 && itemID < 0x6F5) { int type = (itemID - 0x675) / 16; DoorFacing facing = (DoorFacing)(((itemID - 0x675) / 2) % 8); switch (type) { case 0: door = new GenericHouseDoor(facing, 0x675, 0xEC, 0xF3); break; case 1: door = new GenericHouseDoor(facing, 0x685, 0xEC, 0xF3); break; case 2: door = new GenericHouseDoor(facing, 0x695, 0xEB, 0xF2); break; case 3: door = new GenericHouseDoor(facing, 0x6A5, 0xEA, 0xF1); break; case 4: door = new GenericHouseDoor(facing, 0x6B5, 0xEA, 0xF1); break; case 5: door = new GenericHouseDoor(facing, 0x6C5, 0xEC, 0xF3); break; case 6: door = new GenericHouseDoor(facing, 0x6D5, 0xEA, 0xF1); break; case 7: door = new GenericHouseDoor(facing, 0x6E5, 0xEA, 0xF1); break; } } else if (itemID >= 0x314 && itemID < 0x364) { int type = (itemID - 0x314) / 16; DoorFacing facing = (DoorFacing)(((itemID - 0x314) / 2) % 8); switch (type) { case 0: door = new GenericHouseDoor(facing, 0x314, 0xED, 0xF4); break; case 1: door = new GenericHouseDoor(facing, 0x324, 0xED, 0xF4); break; case 2: door = new GenericHouseDoor(facing, 0x334, 0xED, 0xF4); break; case 3: door = new GenericHouseDoor(facing, 0x344, 0xED, 0xF4); break; case 4: door = new GenericHouseDoor(facing, 0x354, 0xED, 0xF4); break; } } else if (itemID >= 0x824 && itemID < 0x834) { DoorFacing facing = (DoorFacing)(((itemID - 0x824) / 2) % 8); door = new GenericHouseDoor(facing, 0x824, 0xEC, 0xF3); } else if (itemID >= 0x839 && itemID < 0x849) { DoorFacing facing = (DoorFacing)(((itemID - 0x839) / 2) % 8); door = new GenericHouseDoor(facing, 0x839, 0xEB, 0xF2); } else if (itemID >= 0x84C && itemID < 0x85C) { DoorFacing facing = (DoorFacing)(((itemID - 0x84C) / 2) % 8); door = new GenericHouseDoor(facing, 0x84C, 0xEC, 0xF3); } else if (itemID >= 0x866 && itemID < 0x876) { DoorFacing facing = (DoorFacing)(((itemID - 0x866) / 2) % 8); door = new GenericHouseDoor(facing, 0x866, 0xEB, 0xF2); } else if (itemID >= 0xE8 && itemID < 0xF8) { DoorFacing facing = (DoorFacing)(((itemID - 0xE8) / 2) % 8); door = new GenericHouseDoor(facing, 0xE8, 0xED, 0xF4); } else if (itemID >= 0x1FED && itemID < 0x1FFD) { DoorFacing facing = (DoorFacing)(((itemID - 0x1FED) / 2) % 8); door = new GenericHouseDoor(facing, 0x1FED, 0xEC, 0xF3); } if (door != null) { return(door); } } return(null); } //end of GetFixtureItem
public DoorKnockEntry(BaseDoor door) : base(1063493, 1) { m_Door = door; }
public SecretStoneDoor2(DoorFacing facing) : base(0x324 + (2 * (int)facing), 0x325 + (2 * (int)facing), 0xED, 0xF4, BaseDoor.GetOffset(facing)) { }
public LightWoodGate(DoorFacing facing) : base(0x839 + (2 * (int)facing), 0x83A + (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(), 0, -2, 0); AddMobile(new OrcishMage(), 0, 1, 0); AddMobile(new OrcishLord(), 0, -2, 0); AddMobile(new OrcCaptain(), 0, 1, 0); AddMobile(new Orc(), 0, -1, 0); AddMobile(new OrcChopper(), 0, -2, 0); } break; case 1: { AddMobile(new Ratman(), 0, -2, 0); AddMobile(new Ratman(), 0, 1, 0); AddMobile(new RatmanMage(), 0, -2, 0); AddMobile(new Ratman(), 0, 1, 0); AddMobile(new RatmanArcher(), 0, -1, 0); AddMobile(new Ratman(), 0, -2, 0); } break; case 2: { AddMobile(new Lizardman(), 0, -2, 0); AddMobile(new Lizardman(), 0, 1, 0); AddMobile(new Lizardman(), 0, -2, 0); AddMobile(new Lizardman(), 0, 1, 0); AddMobile(new Lizardman(), 0, -1, 0); AddMobile(new Lizardman(), 0, -2, 0); } break; case 3: { AddMobile(new Brigand(), 0, -2, 0); AddMobile(new Brigand(), 0, 1, 0); AddMobile(new Brigand(), 0, -2, 0); AddMobile(new Brigand(), 0, 1, 0); AddMobile(new Brigand(), 0, -1, 0); AddMobile(new Brigand(), 0, -2, 0); } break; } switch (Utility.Random(2)) { case 0: Prisoner = new Noble(); break; case 1: Prisoner = new SeekerOfAdventure(); break; } Prisoner.IsPrisoner = true; Prisoner.CantWalk = true; Prisoner.YellHue = Utility.RandomList(0x57, 0x67, 0x77, 0x87, 0x117); AddMobile(Prisoner, -2, 0, 0); }
public InternalTimer(BaseDoor door) : base(TimeSpan.FromSeconds(20.0), TimeSpan.FromSeconds(10.0)) { m_Door = door; }