protected void ConvertDoor(BaseDoor door, uint k) { if (!Owned) { return; } if (door is Server.Gumps.ISecurable) { Console.WriteLine("Convert Door 1"); door.Locked = false; c_House.Doors.Add(door); door.KeyValue = k; m_HouseKeyVal = k; return; } door.Open = false; GenericHouseDoor newdoor = new GenericHouseDoor(0, door.ClosedID, door.OpenedSound, door.ClosedSound); newdoor.Offset = door.Offset; newdoor.ClosedID = door.ClosedID; newdoor.OpenedID = door.OpenedID; newdoor.Location = door.Location; newdoor.Hue = door.Hue; newdoor.GuildID = door.GuildID; newdoor.Map = door.Map; door.Delete(); /* Don't link doors * 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); }
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); }
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); }
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 static void AddDoorEx(this BaseHouse house, int doorType, int x, int y, int z, uint keyValue) { GenericHouseDoor ghd = null; var ds = (Doorswing)doorType; switch (ds) { case Doorswing.MetalSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1653, 0xEC, 0xF3); break; case Doorswing.MetalSouthEast: ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1653, 0xEC, 0xF3); break; case Doorswing.MetalEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1653, 0xEC, 0xF3); break; case Doorswing.MetalEastNorth: ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1653, 0xEC, 0xF3); break; //-- case Doorswing.WeaveSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1685, 0x69E, 0xF2); break; case Doorswing.WeaveSouthEast: ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1685, 0x69E, 0xF2); break; case Doorswing.WeaveEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1685, 0x69E, 0xF2); break; case Doorswing.WeaveEastNorth: ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1685, 0x69E, 0xF2); break; //-- case Doorswing.DarkSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1701, 0xEA, 0xF1); break; case Doorswing.DarkSouthEast: ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1701, 0xEA, 0xF1); break; case Doorswing.DarkEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1701, 0xEA, 0xF1); break; case Doorswing.DarkEastNorth: ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1701, 0xEA, 0xF1); break; //-- case Doorswing.LightSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1749, 0xEA, 0xF1); break; case Doorswing.LightSouthEast: ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1749, 0xEA, 0xF1); break; case Doorswing.LightEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1749, 0xEA, 0xF1); break; case Doorswing.LightEastNorth: ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1749, 0xEA, 0xF1); break; //-- case Doorswing.WMSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1765, 0xEA, 0xF1); break; case Doorswing.WMSouthEast: ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1765, 0xEA, 0xF1); break; case Doorswing.WMEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1765, 0xEA, 0xF1); break; case Doorswing.WMEastNorth: ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1765, 0xEA, 0xF1); break; } ghd.KeyValue = keyValue; house.AddDoor(ghd, x, y, z); }
public static void AddDoorsEx(this BaseHouse house, int doorType, int x, int y, int z, uint keyValue) { GenericHouseDoor ghd = null; GenericHouseDoor ghd2 = null; bool east = false; bool rev = false; var ds = (Doorswing)doorType; switch (ds) { case Doorswing.MetalSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1653, 0xEC, 0xF3); ghd2 = new GenericHouseDoor(DoorFacing.EastCCW, 1653, 0xEC, 0xF3); break; case Doorswing.MetalEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1653, 0xEC, 0xF3); ghd2 = new GenericHouseDoor(DoorFacing.NorthCCW, 1653, 0xEC, 0xF3); east = true; rev = true; break; //-- case Doorswing.WeaveSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1685, 0x69E, 0xF2); ghd2 = new GenericHouseDoor(DoorFacing.EastCCW, 1685, 0x69E, 0xF2); break; case Doorswing.WeaveEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1685, 0x69E, 0xF2); ghd2 = new GenericHouseDoor(DoorFacing.NorthCCW, 1685, 0x69E, 0xF2); east = true; rev = true; break; //-- case Doorswing.DarkSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1701, 0xEA, 0xF1); ghd2 = new GenericHouseDoor(DoorFacing.EastCCW, 1701, 0xEA, 0xF1); break; case Doorswing.DarkEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1701, 0xEA, 0xF1); ghd2 = new GenericHouseDoor(DoorFacing.NorthCCW, 1701, 0xEA, 0xF1); east = true; rev = true; break; //-- case Doorswing.LightSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1749, 0xEA, 0xF1); ghd2 = new GenericHouseDoor(DoorFacing.EastCCW, 1749, 0xEA, 0xF1); break; case Doorswing.LightEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1749, 0xEA, 0xF1); ghd2 = new GenericHouseDoor(DoorFacing.NorthCCW, 1749, 0xEA, 0xF1); east = true; rev = true; break; //-- case Doorswing.WMSouthWest: ghd = new GenericHouseDoor(DoorFacing.WestCW, 1765, 0xEA, 0xF1); ghd2 = new GenericHouseDoor(DoorFacing.EastCCW, 1765, 0xEA, 0xF1); break; case Doorswing.WMEastSouth: ghd = new GenericHouseDoor(DoorFacing.SouthCW, 1765, 0xEA, 0xF1); ghd2 = new GenericHouseDoor(DoorFacing.NorthCCW, 1765, 0xEA, 0xF1); east = true; rev = true; break; case Doorswing.MetalSouthEast: ghd2 = new GenericHouseDoor(DoorFacing.WestCW, 1653, 0xEC, 0xF3); ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1653, 0xEC, 0xF3); rev = true; break; case Doorswing.MetalEastNorth: ghd2 = new GenericHouseDoor(DoorFacing.SouthCW, 1653, 0xEC, 0xF3); ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1653, 0xEC, 0xF3); east = true; break; case Doorswing.WeaveSouthEast: ghd2 = new GenericHouseDoor(DoorFacing.WestCW, 1685, 0x69E, 0xF2); ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1685, 0x69E, 0xF2); rev = true; break; case Doorswing.WeaveEastNorth: ghd2 = new GenericHouseDoor(DoorFacing.SouthCW, 1685, 0x69E, 0xF2); ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1685, 0x69E, 0xF2); east = true; break; case Doorswing.DarkSouthEast: ghd2 = new GenericHouseDoor(DoorFacing.WestCW, 1701, 0xEA, 0xF1); ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1701, 0xEA, 0xF1); rev = true; break; case Doorswing.DarkEastNorth: ghd2 = new GenericHouseDoor(DoorFacing.SouthCW, 1701, 0xEA, 0xF1); ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1701, 0xEA, 0xF1); east = true; break; case Doorswing.LightSouthEast: ghd2 = new GenericHouseDoor(DoorFacing.WestCW, 1749, 0xEA, 0xF1); ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1749, 0xEA, 0xF1); rev = true; break; case Doorswing.LightEastNorth: ghd2 = new GenericHouseDoor(DoorFacing.SouthCW, 1749, 0xEA, 0xF1); ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1749, 0xEA, 0xF1); east = true; break; case Doorswing.WMSouthEast: ghd2 = new GenericHouseDoor(DoorFacing.WestCW, 1765, 0xEA, 0xF1); ghd = new GenericHouseDoor(DoorFacing.EastCCW, 1765, 0xEA, 0xF1); rev = true; break; case Doorswing.WMEastNorth: ghd2 = new GenericHouseDoor(DoorFacing.SouthCW, 1765, 0xEA, 0xF1); ghd = new GenericHouseDoor(DoorFacing.NorthCCW, 1765, 0xEA, 0xF1); east = true; break; } ghd.Link = ghd2; ghd2.Link = ghd; ghd.KeyValue = keyValue; ghd2.KeyValue = keyValue; house.AddDoor(ghd, x, y, z); var ox = x + (!east ? (rev ? -1 : 1) : 0); var oy = y + (east ? (rev ? -1 : 1) : 0); house.AddDoor(ghd2, ox, oy, z); }