This commit is contained in:
mark 2010-12-06 06:45:45 +00:00
parent 34d969712e
commit d444b9ba5c
70 changed files with 569 additions and 495 deletions

View file

@ -901,7 +901,7 @@ namespace Server.Commands
m_DeleteQueue.Enqueue( item );
}
}
else if ( (TileData.ItemTable[itemID & 0x3FFF].Flags & TileFlag.LightSource) != 0 )
else if ( (TileData.ItemTable[itemID & TileData.MaxItemValue].Flags & TileFlag.LightSource) != 0 )
{
eable = map.GetItemsInRange( new Point3D( x, y, z ), 0 );

View file

@ -898,7 +898,7 @@ namespace Server.Commands
m_DeleteQueue.Enqueue( item );
}
}
else if ( (TileData.ItemTable[itemID & 0x3FFF].Flags & TileFlag.LightSource) != 0 )
else if ( (TileData.ItemTable[itemID & TileData.MaxItemValue].Flags & TileFlag.LightSource) != 0 )
{
eable = map.GetItemsInRange( new Point3D( x, y, z ), 0 );

View file

@ -108,7 +108,7 @@ namespace Server.Commands
if ( item is BaseAddon && ((BaseAddon)item).Components.Count == 1 )
itemID = ((AddonComponent)(((BaseAddon)item).Components[0])).ItemID;
if ( itemID >= 0x4000 )
if ( itemID > TileData.MaxItemValue )
itemID = 1;
xml.WriteAttributeString( "gfx", XmlConvert.ToString( itemID ) );

View file

@ -210,13 +210,7 @@ namespace Server
if ( xOffset < 0 || xOffset >= 8 || yOffset < 0 || yOffset >= 8 )
continue;
StaticTile newTile = new StaticTile();
newTile.m_ID = (short)(item.ItemID & 0x3FFF);
newTile.m_X = (byte)xOffset;
newTile.m_Y = (byte)yOffset;
newTile.m_Z = (sbyte)item.Z;
newTile.m_Hue = (short)item.Hue;
StaticTile newTile = new StaticTile( (ushort)item.ItemID, (byte)xOffset, (byte)yOffset, (sbyte)item.Z, (short)item.Hue );
newTiles[newTileCount++] = newTile;
@ -241,22 +235,22 @@ namespace Server
{
StaticTile toWrite = oldTiles[i];
mulWriter.Write( (short) toWrite.m_ID );
mulWriter.Write( (byte) toWrite.m_X );
mulWriter.Write( (byte) toWrite.m_Y );
mulWriter.Write( (sbyte) toWrite.m_Z );
mulWriter.Write( (short) toWrite.m_Hue );
mulWriter.Write( (ushort) toWrite.ID );
mulWriter.Write( (byte) toWrite.X );
mulWriter.Write( (byte) toWrite.Y );
mulWriter.Write( (sbyte) toWrite.Z );
mulWriter.Write( (short) toWrite.Hue );
}
for ( int i = 0; i < newTileCount; ++i )
{
StaticTile toWrite = newTiles[i];
mulWriter.Write( (short) toWrite.m_ID );
mulWriter.Write( (byte) toWrite.m_X );
mulWriter.Write( (byte) toWrite.m_Y );
mulWriter.Write( (sbyte) toWrite.m_Z );
mulWriter.Write( (short) toWrite.m_Hue );
mulWriter.Write( (ushort) toWrite.ID );
mulWriter.Write( (byte) toWrite.X );
mulWriter.Write( (byte) toWrite.Y );
mulWriter.Write( (sbyte) toWrite.Z );
mulWriter.Write( (short) toWrite.Hue );
}
mulWriter.Flush();
@ -381,8 +375,8 @@ namespace Server
{
StaticTile oldTile = oldTiles[i];
int px = baseX + oldTile.m_X;
int py = baseY + oldTile.m_Y;
int px = baseX + oldTile.X;
int py = baseY + oldTile.Y;
if ( px < 0 || px >= xTileWidth || py < 0 || py >= yTileHeight )
{
@ -392,11 +386,11 @@ namespace Server
{
++totalUnfrozen;
Item item = new Static( oldTile.m_ID & 0x3FFF );
Item item = new Static( oldTile.ID );
item.Hue = oldTile.m_Hue;
item.Hue = oldTile.Hue;
item.MoveToWorld( new Point3D( px + xTileStart, py + yTileStart, oldTile.m_Z ), map );
item.MoveToWorld( new Point3D( px + xTileStart, py + yTileStart, oldTile.Z ), map );
}
}
@ -416,11 +410,11 @@ namespace Server
{
StaticTile toWrite = newTiles[i];
mulWriter.Write( (short) toWrite.m_ID );
mulWriter.Write( (byte) toWrite.m_X );
mulWriter.Write( (byte) toWrite.m_Y );
mulWriter.Write( (sbyte) toWrite.m_Z );
mulWriter.Write( (short) toWrite.m_Hue );
mulWriter.Write( (ushort) toWrite.ID );
mulWriter.Write( (byte) toWrite.X );
mulWriter.Write( (byte) toWrite.Y );
mulWriter.Write( (sbyte) toWrite.Z );
mulWriter.Write( (short) toWrite.Hue );
}
mulWriter.Flush();
@ -533,11 +527,9 @@ namespace Server
for ( int i = 0; i < count; ++i )
{
staTiles[i].m_ID = (short)(m_Buffer[index++] | (m_Buffer[index++] << 8));
staTiles[i].m_X = m_Buffer[index++];
staTiles[i].m_Y = m_Buffer[index++];
staTiles[i].m_Z = (sbyte)m_Buffer[index++];
staTiles[i].m_Hue = (short)(m_Buffer[index++] | (m_Buffer[index++] << 8));
staTiles[i].Set((ushort)(m_Buffer[index++] | (m_Buffer[index++] << 8)),
(byte)m_Buffer[index++], (byte)m_Buffer[index++], (sbyte)m_Buffer[index++],
(short)(m_Buffer[index++] | (m_Buffer[index++] << 8)));
}
}
}
@ -558,7 +550,7 @@ namespace Server
{
m_X = p.X;
m_Y = p.Y;
m_List = new List<Item>();
m_List = new List<Item>();
}
}

View file

@ -95,7 +95,7 @@ namespace Server.Engines.BulkOrders
int graphic = Utility.ToInt32( split[split.Length - 1] );
if ( type != null && graphic > 0 )
list.Add( new SmallBulkEntry( type, 1020000 + graphic, graphic ) );
list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) );
}
}
catch

View file

@ -420,12 +420,12 @@ namespace Server.Engines.Craft
int vx = from.X + x;
int vy = from.Y + y;
Tile[] tiles = map.Tiles.GetStaticTiles( vx, vy, true );
StaticTile[] tiles = map.Tiles.GetStaticTiles( vx, vy, true );
for ( int i = 0; i < tiles.Length; ++i )
{
int z = tiles[i].Z;
int id = tiles[i].ID & 0x3FFF;
int id = tiles[i].ID;
if ( (z + 16) > from.Z && (from.Z + 16) > z && Find( id, itemIDs ) )
return true;

View file

@ -92,11 +92,11 @@ namespace Server.Engines.Craft
{
for ( int y = -range; (!anvil || !forge) && y <= range; ++y )
{
Tile[] tiles = map.Tiles.GetStaticTiles( from.X+x, from.Y+y, true );
StaticTile[] tiles = map.Tiles.GetStaticTiles( from.X+x, from.Y+y, true );
for ( int i = 0; (!anvil || !forge) && i < tiles.Length; ++i )
{
int id = tiles[i].ID & 0x3FFF;
int id = tiles[i].ID;
bool isAnvil = ( id == 4015 || id == 4016 || id == 0x2DD5 || id == 0x2DD6 );
bool isForge = ( id == 4017 || (id >= 6522 && id <= 6569) || id == 0x2DD8 );

View file

@ -159,10 +159,14 @@ namespace Server.Engines.Craft
private void AddNecroSpell( int spell, int mana, double minSkill, Type type, params Type[] regs )
{
int index = AddCraft( type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf( regs[0] ), 1, 501627 ); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI.
int id = CraftItem.ItemIDOf( regs[0] );
for ( int i = 1; i < regs.Length; ++i )
AddRes( index, regs[i], 1020000 + CraftItem.ItemIDOf( regs[i] ), 1, 501627 );
int index = AddCraft( type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 501627 ); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI.
for ( int i = 1; i < regs.Length; ++i ) {
id = CraftItem.ItemIDOf( regs[i] );
AddRes( index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627 );
}
AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );

View file

@ -467,7 +467,7 @@ namespace Server.Engines.Harvest
{
LandTarget obj = (LandTarget)toHarvest;
tileID = obj.TileID & 0x3FFF;
tileID = obj.TileID;
map = from.Map;
loc = obj.Location;
}

View file

@ -387,7 +387,7 @@ namespace Server.Engines.Harvest
int tx = m.X - 10 + Utility.Random( 21 );
int ty = m.Y - 10 + Utility.Random( 21 );
Tile t = map.Tiles.GetLandTile( tx, ty );
LandTile t = map.Tiles.GetLandTile( tx, ty );
if ( t.Z == -5 && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, -5 ), map ) )
{

View file

@ -2,6 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Mobiles;
namespace Server.Movement
@ -30,12 +31,12 @@ namespace Server.Movement
{
}
private bool IsOk( bool ignoreDoors, bool ignoreSpellFields, int ourZ, int ourTop, Tile[] tiles, List<Item> items )
private bool IsOk( bool ignoreDoors, bool ignoreSpellFields, int ourZ, int ourTop, StaticTile[] tiles, List<Item> items )
{
for ( int i = 0; i < tiles.Length; ++i )
{
Tile check = tiles[i];
ItemData itemData = TileData.ItemTable[check.ID & 0x3FFF];
StaticTile check = tiles[i];
ItemData itemData = TileData.ItemTable[check.ID & TileData.MaxItemValue];
if ( (itemData.Flags & ImpassableSurface) != 0 ) // Impassable || Surface
{
@ -50,7 +51,7 @@ namespace Server.Movement
for ( int i = 0; i < items.Count; ++i )
{
Item item = items[i];
int itemID = item.ItemID & 0x3FFF;
int itemID = item.ItemID & TileData.MaxItemValue;
ItemData itemData = TileData.ItemTable[itemID];
TileFlag flags = itemData.Flags;
@ -85,15 +86,15 @@ namespace Server.Movement
{
newZ = 0;
Tile[] tiles = map.Tiles.GetStaticTiles( x, y, true );
Tile landTile = map.Tiles.GetLandTile( x, y );
StaticTile[] tiles = map.Tiles.GetStaticTiles( x, y, true );
LandTile landTile = map.Tiles.GetLandTile( x, y );
bool landBlocks = (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Impassable) != 0;
bool landBlocks = (TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Impassable) != 0;
bool considerLand = !landTile.Ignored;
if ( landBlocks && canSwim && (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Wet) != 0 ) //Impassable, Can Swim, and Is water. Don't block it.
if ( landBlocks && canSwim && (TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Wet) != 0 ) //Impassable, Can Swim, and Is water. Don't block it.
landBlocks = false;
else if ( cantWalk && (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Wet) == 0 ) //Can't walk and it's not water
else if ( cantWalk && (TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Wet) == 0 ) //Can't walk and it's not water
landBlocks = true;
int landZ = 0, landCenter = 0, landTop = 0;
@ -111,8 +112,8 @@ namespace Server.Movement
#region Tiles
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
ItemData itemData = TileData.ItemTable[tile.ID & 0x3FFF];
StaticTile tile = tiles[i];
ItemData itemData = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
TileFlag flags = itemData.Flags;
if ( (flags & ImpassableSurface) == TileFlag.Surface || (canSwim && (flags & TileFlag.Wet) != 0) ) // Surface && !Impassable
@ -319,13 +320,13 @@ namespace Server.Movement
if ( (item.ItemData.Flags & reqFlags) == 0 )
continue;
if ( sector == sectorStart && item.AtWorldPoint( xStart, yStart ) && item.ItemID < 0x4000 )
if ( sector == sectorStart && item.AtWorldPoint( xStart, yStart ) && item.ItemID <= TileData.MaxItemValue )
itemsStart.Add( item );
else if ( sector == sectorForward && item.AtWorldPoint( xForward, yForward ) && item.ItemID < 0x4000 )
else if ( sector == sectorForward && item.AtWorldPoint( xForward, yForward ) && item.ItemID <= TileData.MaxItemValue )
itemsForward.Add( item );
else if ( sector == sectorLeft && item.AtWorldPoint( xLeft, yLeft ) && item.ItemID < 0x4000 )
else if ( sector == sectorLeft && item.AtWorldPoint( xLeft, yLeft ) && item.ItemID <= TileData.MaxItemValue )
itemsLeft.Add( item );
else if ( sector == sectorRight && item.AtWorldPoint( xRight, yRight ) && item.ItemID < 0x4000 )
else if ( sector == sectorRight && item.AtWorldPoint( xRight, yRight ) && item.ItemID <= TileData.MaxItemValue )
itemsRight.Add( item );
}
}
@ -350,9 +351,9 @@ namespace Server.Movement
if ( (item.ItemData.Flags & reqFlags) == 0 )
continue;
if ( item.AtWorldPoint( xStart, yStart ) && item.ItemID < 0x4000 )
if ( item.AtWorldPoint( xStart, yStart ) && item.ItemID <= TileData.MaxItemValue )
itemsStart.Add( item );
else if ( item.AtWorldPoint( xForward, yForward ) && item.ItemID < 0x4000 )
else if ( item.AtWorldPoint( xForward, yForward ) && item.ItemID <= TileData.MaxItemValue )
itemsForward.Add( item );
}
}
@ -368,7 +369,7 @@ namespace Server.Movement
if ( (item.ItemData.Flags & reqFlags) == 0 )
continue;
if ( item.AtWorldPoint( xForward, yForward ) && item.ItemID < 0x4000 )
if ( item.AtWorldPoint( xForward, yForward ) && item.ItemID <= TileData.MaxItemValue )
itemsForward.Add( item );
}
@ -426,13 +427,13 @@ namespace Server.Movement
{
int xCheck = loc.X, yCheck = loc.Y;
Tile landTile = map.Tiles.GetLandTile( xCheck, yCheck );
LandTile landTile = map.Tiles.GetLandTile( xCheck, yCheck );
int landZ = 0, landCenter = 0, landTop = 0;
bool landBlocks = (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Impassable) != 0;
bool landBlocks = (TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Impassable) != 0;
if ( landBlocks && m.CanSwim && (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Wet) != 0 )
if ( landBlocks && m.CanSwim && (TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Wet) != 0 )
landBlocks = false;
else if ( m.CantWalk && (TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Wet) == 0 )
else if ( m.CantWalk && (TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Wet) == 0 )
landBlocks = true;
map.GetAverageZ( xCheck, yCheck, ref landZ, ref landCenter, ref landTop );
@ -453,12 +454,12 @@ namespace Server.Movement
isSet = true;
}
Tile[] staticTiles = map.Tiles.GetStaticTiles( xCheck, yCheck, true );
StaticTile[] staticTiles = map.Tiles.GetStaticTiles( xCheck, yCheck, true );
for ( int i = 0; i < staticTiles.Length; ++i )
{
Tile tile = staticTiles[i];
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
StaticTile tile = staticTiles[i];
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
int calcTop = (tile.Z + id.CalcHeight);

View file

@ -270,7 +270,7 @@ namespace Server.Items
if ( !from.Map.CanSpawnMobile( land.Location ) )
return null;
int tileID = land.TileID & 0x3FFF;
int tileID = land.TileID;
foreach ( TilesAndEffect taep in m_Table )
{

View file

@ -137,7 +137,7 @@ namespace Server.Engines.Plants
else if ( obj is StaticTarget )
tileID = (((StaticTarget)obj).ItemID & 0x3FFF) | 0x4000;
else if ( obj is LandTarget )
tileID = ((LandTarget)obj).TileID & 0x3FFF;
tileID = ((LandTarget)obj).TileID;
else
return false;

View file

@ -285,7 +285,7 @@ namespace Server.Engines.Plants
public int OffsetX { get { return m_OffsetX; } }
public int OffsetY { get { return m_OffsetY; } }
public PlantType PlantType { get { return m_PlantType; } }
public int Name { get { return 1020000 + m_ItemID; } }
public int Name { get { return m_ItemID < 0x4000 ? 1020000 + m_ItemID : 1078872 + m_ItemID; } }
public bool ContainsPlant { get { return m_ContainsPlant; } }
public bool Flowery { get { return m_Flowery; } }
public bool Crossable { get { return m_Crossable; } }

View file

@ -92,7 +92,7 @@ namespace Server.Engines.Quests.Collector
public int Figurine { get { return m_Figurine; } }
public Type Type { get { return m_Type; } }
public int Name { get { return 1020000 + m_Figurine; } }
public int Name { get { return m_Figurine < 0x4000 ? 1020000 + m_Figurine : 1078872 + m_Figurine; } }
public int X { get { return m_X; } }
public int Y { get { return m_Y; } }

View file

@ -246,7 +246,7 @@ namespace Server.Gumps
public object FindHouseName( BaseHouse house )
{
int multiID = house.ItemID & 0x3FFF;
int multiID = house.ItemID;
HousePlacementEntry[] entries;
entries = HousePlacementEntry.ClassicHouses;

View file

@ -172,12 +172,12 @@ namespace Server.Items
if ( map == null )
return false;
Tile[] tiles = map.Tiles.GetStaticTiles( x, y, true );
StaticTile[] tiles = map.Tiles.GetStaticTiles( x, y, true );
for ( int i = 0; i < tiles.Length; ++i )
{
Tile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & 0x3FFF];
StaticTile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & TileData.MaxItemValue];
if ( (id.Flags & TileFlag.Wall) != 0 && (z + 16) > t.Z && (t.Z + t.Height) > z )
return true;

View file

@ -288,7 +288,7 @@ namespace Server.Items
{
Item item = items[i];
if ( item.ItemID < 0x4000 && item.AtWorldPoint( x, y ) && !(item is BaseDoor) )
if ( !(item is BaseMulti) && item.AtWorldPoint( x, y ) && !(item is BaseDoor) )
{
ItemData id = item.ItemData;
bool surface = id.Surface;

View file

@ -94,10 +94,10 @@ namespace Server.Items
Point3D loc = new Point3D( p );
if ( p is StaticTarget )
loc.Z -= TileData.ItemTable[((StaticTarget)p).ItemID & 0x3FFF].CalcHeight; /* NOTE: OSI does not properly normalize Z positioning here.
* A side affect is that you can only place on floors (due to the CanFit call).
* That functionality may be desired. And so, it's included in this script.
*/
loc.Z -= TileData.ItemTable[((StaticTarget)p).ItemID].CalcHeight; /* NOTE: OSI does not properly normalize Z positioning here.
* A side affect is that you can only place on floors (due to the CanFit call).
* That functionality may be desired. And so, it's included in this script.
*/
if ( ValidatePlacement( from, loc ) )
EndPlace( from, (HolidayTreeType) state, loc );

View file

@ -75,9 +75,9 @@ namespace Server.Items
int itemID;
if ( targeted is Item )
itemID = ((Item)targeted).ItemID & 0x3FFF;
itemID = ((Item)targeted).ItemID;
else if ( targeted is StaticTarget )
itemID = ((StaticTarget)targeted).ItemID & 0x3FFF;
itemID = ((StaticTarget)targeted).ItemID;
else
return false;

View file

@ -164,7 +164,7 @@ namespace Server.Items
else
to = new Entity( Serial.Zero, new Point3D( p ), Map );
Effects.SendMovingEffect( from, to, ItemID & 0x3FFF, 7, 0, false, false, Hue, 0 );
Effects.SendMovingEffect( from, to, ItemID, 7, 0, false, false, Hue, 0 );
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( FirebombReposition_OnTick ), new object[]{ p, Map } );
Internalize();

View file

@ -243,14 +243,14 @@ namespace Server.Items
if ( map == null )
return int.MinValue;
Tile[] tiles = map.Tiles.GetStaticTiles( item.X, item.Y, true );
StaticTile[] tiles = map.Tiles.GetStaticTiles( item.X, item.Y, true );
int z = int.MinValue;
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
StaticTile tile = tiles[i];
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
int top = tile.Z; // Confirmed : no height checks here

View file

@ -5,11 +5,10 @@ namespace Server.Items
{
public class Static : Item
{
public Static() //Dupe-tastic!
: base( 0x80 )
{
Movable = false;
}
public Static() : base( 0x80 )
{
Movable = false;
}
[Constructable]
public Static( int itemID ) : base( itemID )
@ -58,7 +57,7 @@ namespace Server.Items
public override int LabelNumber{ get{ return m_LabelNumber; } }
[Constructable]
public LocalizedStatic( int itemID ) : this( itemID, 1020000 + itemID )
public LocalizedStatic( int itemID ) : this( itemID, itemID < 0x4000 ? 1020000 + itemID : 1078872 + itemID )
{
}

View file

@ -175,7 +175,7 @@ namespace Server.Items
if ( obj is Item )
itemID = ((Item)obj).ItemID;
else if ( obj is StaticTarget )
itemID = ((StaticTarget)obj).ItemID & 0x3FFF;
itemID = ((StaticTarget)obj).ItemID;
return ( itemID == 4017 || (itemID >= 6522 && itemID <= 6569) );
}

View file

@ -218,7 +218,7 @@ namespace Server.Items
int tx = p.X - 2 + Utility.Random( 5 );
int ty = p.Y - 2 + Utility.Random( 5 );
Tile t = map.Tiles.GetLandTile( tx, ty );
LandTile t = map.Tiles.GetLandTile( tx, ty );
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
{

View file

@ -210,7 +210,7 @@ namespace Server.Items
to = (Mobile)p;
}
Effects.SendMovingEffect( from, to, m_Potion.ItemID & 0x3FFF, 7, 0, false, false, m_Potion.Hue, 0 );
Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 );
if( m_Potion.Amount > 1 )
{

View file

@ -273,7 +273,7 @@ namespace Server.Items
return;
Point3D p3d = new Point3D( p );
ItemData id = TileData.ItemTable[ m_ItemID & 0x3FFF ];
ItemData id = TileData.ItemTable[ m_ItemID & TileData.MaxItemValue ];
if ( map.CanFit( p3d, id.Height ) )
{

View file

@ -288,7 +288,7 @@ namespace Server.Items
return;
Point3D p3d = new Point3D( p );
ItemData id = TileData.ItemTable[ m_ItemID & 0x3FFF ];
ItemData id = TileData.ItemTable[ m_ItemID & TileData.MaxItemValue ];
if ( map.CanFit( p3d, id.Height ) )
{

View file

@ -277,7 +277,7 @@ namespace Server.Items
return;
Point3D p3d = new Point3D( p );
ItemData id = TileData.ItemTable[ m_ItemID & 0x3FFF ];
ItemData id = TileData.ItemTable[ m_ItemID & TileData.MaxItemValue ];
if ( map.CanFit( p3d, id.Height ) )
{

View file

@ -392,8 +392,6 @@ namespace Server
public static bool IsFrame( int id, int[] list )
{
id &= 0x3FFF;
if ( id > list[list.Length - 1] )
return false;
@ -432,11 +430,11 @@ namespace Server
public static bool IsEastFrame( int x, int y, int z )
{
Tile[] tiles = m_Map.Tiles.GetStaticTiles( x, y );
StaticTile[] tiles = m_Map.Tiles.GetStaticTiles( x, y );
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
StaticTile tile = tiles[i];
if ( tile.Z == z && IsEastFrame( tile.ID ) )
return true;
@ -447,11 +445,11 @@ namespace Server
public static bool IsSouthFrame( int x, int y, int z )
{
Tile[] tiles = m_Map.Tiles.GetStaticTiles( x, y );
StaticTile[] tiles = m_Map.Tiles.GetStaticTiles( x, y );
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
StaticTile tile = tiles[i];
if ( tile.Z == z && IsSouthFrame( tile.ID ) )
return true;
@ -497,11 +495,11 @@ namespace Server
int vx = rx + region.X;
int vy = ry + region.Y;
Tile[] tiles = m_Map.Tiles.GetStaticTiles( vx, vy );
StaticTile[] tiles = m_Map.Tiles.GetStaticTiles( vx, vy );
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
StaticTile tile = tiles[i];
int id = tile.ID;
int z = tile.Z;

View file

@ -49,7 +49,7 @@ namespace Server
private static bool GetFloorZ( Map map, int x, int y, out int z )
{
Tile lt = map.Tiles.GetLandTile( x, y );
LandTile lt = map.Tiles.GetLandTile( x, y );
if ( IsFloor( lt.ID ) && map.CanFit( x, y, lt.Z, 16, false, false ) )
{
@ -57,12 +57,12 @@ namespace Server
return true;
}
Tile[] tiles = map.Tiles.GetStaticTiles( x, y );
StaticTile[] tiles = map.Tiles.GetStaticTiles( x, y );
for ( int i = 0; i < tiles.Length; ++i )
{
Tile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & 0x3FFF];
StaticTile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & TileData.MaxItemValue];
if ( IsStaticFloor( t.ID ) && map.CanFit( x, y, t.Z + (id.Surface ? id.CalcHeight : 0), 16, false, false ) )
{
@ -77,17 +77,17 @@ namespace Server
private static bool IsFloor( Map map, int x, int y, bool canFit )
{
Tile lt = map.Tiles.GetLandTile( x, y );
LandTile lt = map.Tiles.GetLandTile( x, y );
if ( IsFloor( lt.ID ) && (canFit||CanFit( map, x, y, lt.Z )) )
return true;
Tile[] tiles = map.Tiles.GetStaticTiles( x, y );
StaticTile[] tiles = map.Tiles.GetStaticTiles( x, y );
for ( int i = 0; i < tiles.Length; ++i )
{
Tile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & 0x3FFF];
StaticTile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & TileData.MaxItemValue];
if ( IsStaticFloor( t.ID ) && (canFit||CanFit( map, x, y, t.Z + (id.Surface ? id.CalcHeight : 0) )) )
return true;
@ -98,23 +98,19 @@ namespace Server
private static bool IsFloor( int itemID )
{
itemID &= 0x3FFF;
itemID &= TileData.MaxLandValue;
return ( itemID >= 0x406 && itemID <= 0x51A );
}
private static bool IsStaticFloor( int itemID )
{
itemID &= 0x3FFF;
return ( itemID >= 0x495 && itemID <= 0x514 )
|| ( itemID >= 0x519 && itemID <= 0x53A );
}
private static bool IsDisplayCase( int itemID )
{
itemID &= 0x3FFF;
return ( itemID >= 0xB00 && itemID <= 0xB02 )
|| ( itemID >= 0xB06 && itemID <= 0xB0A )
|| ( itemID >= 0xB0D && itemID <= 0xB17 );
@ -261,7 +257,7 @@ namespace Server
private static void CheckFloor( Map map, int x, int y )
{
Tile[] tiles = map.Tiles.GetStaticTiles( x, y );
StaticTile[] tiles = map.Tiles.GetStaticTiles( x, y );
for ( int i = 0; i < tiles.Length; ++i )
{
@ -371,7 +367,7 @@ namespace Server
private static ShopFlags ProcessDisplayedItem( int itemID )
{
itemID &= 0x3FFF;
itemID &= TileData.MaxItemValue;
ShopFlags res = ShopFlags.None;
@ -411,7 +407,7 @@ namespace Server
return res;
}
private static void ProcessDisplayCase( Map map, Tile[] tiles, int x, int y )
private static void ProcessDisplayCase( Map map, StaticTile[] tiles, int x, int y )
{
ShopFlags flags = ShopFlags.None;
@ -460,18 +456,18 @@ namespace Server
{
bool hasSurface = false;
Tile lt = map.Tiles.GetLandTile( x, y );
LandTile lt = map.Tiles.GetLandTile( x, y );
int lowZ = 0, avgZ = 0, topZ = 0;
map.GetAverageZ( x, y, ref lowZ, ref avgZ, ref topZ );
TileFlag landFlags = TileData.LandTable[lt.ID & 0x3FFF].Flags;
TileFlag landFlags = TileData.LandTable[lt.ID & TileData.MaxLandValue].Flags;
if ( (landFlags & TileFlag.Impassable) != 0 && topZ > z && (z + 16) > lowZ )
return false;
else if ( (landFlags & TileFlag.Impassable) == 0 && z == avgZ && !lt.Ignored )
hasSurface = true;
Tile[] staticTiles = map.Tiles.GetStaticTiles( x, y );
StaticTile[] staticTiles = map.Tiles.GetStaticTiles( x, y );
bool surface, impassable;
@ -480,7 +476,7 @@ namespace Server
if ( IsDisplayCase( staticTiles[i].ID ) )
continue;
ItemData id = TileData.ItemTable[staticTiles[i].ID & 0x3FFF];
ItemData id = TileData.ItemTable[staticTiles[i].ID & TileData.MaxItemValue];
surface = id.Surface;
impassable = id.Impassable;

View file

@ -256,7 +256,7 @@ namespace Server.Mobiles
m_Args = args;
if ( name == null )
m_Name = (1020000 + (itemID & 0x3FFF)).ToString();
m_Name = itemID < 0x4000 ? (1020000 + itemID).ToString() : (1078872 + itemID).ToString();
else
m_Name = name;
}

View file

@ -1052,12 +1052,12 @@ namespace Server.Multis
if ( this is HouseFoundation && y < (mcl.Height-1) && p.Z >= this.Z )
return true;
Tile[] tiles = mcl.Tiles[x][y];
StaticTile[] tiles = mcl.Tiles[x][y];
for ( int j = 0; j < tiles.Length; ++j )
{
Tile tile = tiles[j];
int id = tile.ID & 0x3FFF;
StaticTile tile = tiles[j];
int id = tile.ID & TileData.MaxItemValue;
ItemData data = TileData.ItemTable[id];
// Slanted roofs do not count; they overhang blocking south and east sides of the multi
@ -1095,7 +1095,7 @@ namespace Server.Multis
private static List<BaseHouse> m_AllHouses = new List<BaseHouse>();
public BaseHouse( int multiID, Mobile owner, int MaxLockDown, int MaxSecure ) : base( multiID | 0x4000 )
public BaseHouse( int multiID, Mobile owner, int MaxLockDown, int MaxSecure ) : base( multiID )
{
m_AllHouses.Add( this );

View file

@ -149,7 +149,7 @@ namespace Server.Multis
public static List<BaseBoat> Boats{ get{ return m_Instances; } }
public BaseBoat() : base( 0x4000 )
public BaseBoat() : base( 0x0 )
{
m_DecayTime = DateTime.Now + BoatDecayDelay;
@ -1184,8 +1184,8 @@ namespace Server.Multis
if ( newComponents.Tiles[x][y].Length == 0 || Contains( tx, ty ) )
continue;
Tile landTile = map.Tiles.GetLandTile( tx, ty );
Tile[] tiles = map.Tiles.GetStaticTiles( tx, ty, true );
LandTile landTile = map.Tiles.GetLandTile( tx, ty );
StaticTile[] tiles = map.Tiles.GetStaticTiles( tx, ty, true );
bool hasWater = false;
@ -1203,8 +1203,8 @@ namespace Server.Multis
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
bool isWater = ( tile.ID >= 0x5796 && tile.ID <= 0x57B2 );
StaticTile tile = tiles[i];
bool isWater = ( tile.ID >= 0x1796 && tile.ID <= 0x17B2 );
if ( tile.Z == p.Z && isWater )
hasWater = true;
@ -1221,7 +1221,7 @@ namespace Server.Multis
foreach ( Item item in eable )
{
if ( item.ItemID >= 0x4000 || item.Z < p.Z || !item.Visible )
if ( item is BaseMulti || item.Z < p.Z || !item.Visible )
continue;
int x = item.X - p.X + newComponents.Min.X;

View file

@ -25,7 +25,7 @@ namespace Server.Multis
if ( !Core.AOS )
LootType = LootType.Newbied;
m_MultiID = id & 0x3FFF;
m_MultiID = id;
m_Offset = offset;
}

View file

@ -26,7 +26,7 @@ namespace Server.Multis
Weight = 1.0;
LootType = LootType.Blessed;
m_MultiID = id & 0x3FFF;
m_MultiID = id;
m_Offset = offset;
m_ShipName = boat.ShipName;

View file

@ -6,10 +6,10 @@ namespace Server.Multis
{
public class LargeBoat : BaseBoat
{
public override int NorthID{ get{ return 0x4010; } }
public override int EastID{ get{ return 0x4011; } }
public override int SouthID{ get{ return 0x4012; } }
public override int WestID{ get{ return 0x4013; } }
public override int NorthID{ get{ return 0x10; } }
public override int EastID{ get{ return 0x11; } }
public override int SouthID{ get{ return 0x12; } }
public override int WestID{ get{ return 0x13; } }
public override int HoldDistance{ get{ return 5; } }
public override int TillerManDistance{ get{ return -5; } }
@ -51,7 +51,7 @@ namespace Server.Multis
public override BaseBoat Boat{ get{ return new LargeBoat(); } }
[Constructable]
public LargeBoatDeed() : base( 0x4010, new Point3D( 0, -1, 0 ) )
public LargeBoatDeed() : base( 0x10, new Point3D( 0, -1, 0 ) )
{
}
@ -78,7 +78,7 @@ namespace Server.Multis
{
public override BaseBoat Boat{ get{ return new LargeBoat(); } }
public LargeDockedBoat( BaseBoat boat ) : base( 0x4010, new Point3D( 0, -1, 0 ), boat )
public LargeDockedBoat( BaseBoat boat ) : base( 0x10, new Point3D( 0, -1, 0 ), boat )
{
}

View file

@ -6,10 +6,10 @@ namespace Server.Multis
{
public class LargeDragonBoat : BaseBoat
{
public override int NorthID{ get{ return 0x4014; } }
public override int EastID{ get{ return 0x4015; } }
public override int SouthID{ get{ return 0x4016; } }
public override int WestID{ get{ return 0x4017; } }
public override int NorthID{ get{ return 0x14; } }
public override int EastID{ get{ return 0x15; } }
public override int SouthID{ get{ return 0x16; } }
public override int WestID{ get{ return 0x17; } }
public override int HoldDistance{ get{ return 5; } }
public override int TillerManDistance{ get{ return -5; } }
@ -51,7 +51,7 @@ namespace Server.Multis
public override BaseBoat Boat{ get{ return new LargeDragonBoat(); } }
[Constructable]
public LargeDragonBoatDeed() : base( 0x4014, new Point3D( 0, -1, 0 ) )
public LargeDragonBoatDeed() : base( 0x14, new Point3D( 0, -1, 0 ) )
{
}
@ -78,7 +78,7 @@ namespace Server.Multis
{
public override BaseBoat Boat{ get{ return new LargeDragonBoat(); } }
public LargeDockedDragonBoat( BaseBoat boat ) : base( 0x4014, new Point3D( 0, -1, 0 ), boat )
public LargeDockedDragonBoat( BaseBoat boat ) : base( 0x14, new Point3D( 0, -1, 0 ), boat )
{
}

View file

@ -6,10 +6,10 @@ namespace Server.Multis
{
public class MediumBoat : BaseBoat
{
public override int NorthID{ get{ return 0x4008; } }
public override int EastID{ get{ return 0x4009; } }
public override int SouthID{ get{ return 0x400A; } }
public override int WestID{ get{ return 0x400B; } }
public override int NorthID{ get{ return 0x8; } }
public override int EastID{ get{ return 0x9; } }
public override int SouthID{ get{ return 0xA; } }
public override int WestID{ get{ return 0xB; } }
public override int HoldDistance{ get{ return 4; } }
public override int TillerManDistance{ get{ return -5; } }
@ -51,7 +51,7 @@ namespace Server.Multis
public override BaseBoat Boat{ get{ return new MediumBoat(); } }
[Constructable]
public MediumBoatDeed() : base( 0x4008, Point3D.Zero )
public MediumBoatDeed() : base( 0x8, Point3D.Zero )
{
}
@ -78,7 +78,7 @@ namespace Server.Multis
{
public override BaseBoat Boat{ get{ return new MediumBoat(); } }
public MediumDockedBoat( BaseBoat boat ) : base( 0x4008, Point3D.Zero, boat )
public MediumDockedBoat( BaseBoat boat ) : base( 0x8, Point3D.Zero, boat )
{
}

View file

@ -6,10 +6,10 @@ namespace Server.Multis
{
public class MediumDragonBoat : BaseBoat
{
public override int NorthID{ get{ return 0x400C; } }
public override int EastID{ get{ return 0x400D; } }
public override int SouthID{ get{ return 0x400E; } }
public override int WestID{ get{ return 0x400F; } }
public override int NorthID{ get{ return 0xC; } }
public override int EastID{ get{ return 0xD; } }
public override int SouthID{ get{ return 0xE; } }
public override int WestID{ get{ return 0xF; } }
public override int HoldDistance{ get{ return 4; } }
public override int TillerManDistance{ get{ return -5; } }
@ -51,7 +51,7 @@ namespace Server.Multis
public override BaseBoat Boat{ get{ return new MediumDragonBoat(); } }
[Constructable]
public MediumDragonBoatDeed() : base( 0x400C, Point3D.Zero )
public MediumDragonBoatDeed() : base( 0xC, Point3D.Zero )
{
}
@ -78,7 +78,7 @@ namespace Server.Multis
{
public override BaseBoat Boat{ get{ return new MediumDragonBoat(); } }
public MediumDockedDragonBoat( BaseBoat boat ) : base( 0x400C, Point3D.Zero, boat )
public MediumDockedDragonBoat( BaseBoat boat ) : base( 0xC, Point3D.Zero, boat )
{
}

View file

@ -6,10 +6,10 @@ namespace Server.Multis
{
public class SmallBoat : BaseBoat
{
public override int NorthID{ get{ return 0x4000; } }
public override int EastID{ get{ return 0x4001; } }
public override int SouthID{ get{ return 0x4002; } }
public override int WestID{ get{ return 0x4003; } }
public override int NorthID{ get{ return 0x0; } }
public override int EastID{ get{ return 0x1; } }
public override int SouthID{ get{ return 0x2; } }
public override int WestID{ get{ return 0x3; } }
public override int HoldDistance{ get{ return 4; } }
public override int TillerManDistance{ get{ return -4; } }
@ -51,7 +51,7 @@ namespace Server.Multis
public override BaseBoat Boat{ get{ return new SmallBoat(); } }
[Constructable]
public SmallBoatDeed() : base( 0x4000, Point3D.Zero )
public SmallBoatDeed() : base( 0x0, Point3D.Zero )
{
}
@ -78,7 +78,7 @@ namespace Server.Multis
{
public override BaseBoat Boat{ get{ return new SmallBoat(); } }
public SmallDockedBoat( BaseBoat boat ) : base( 0x4000, Point3D.Zero, boat )
public SmallDockedBoat( BaseBoat boat ) : base( 0x0, Point3D.Zero, boat )
{
}

View file

@ -6,10 +6,10 @@ namespace Server.Multis
{
public class SmallDragonBoat : BaseBoat
{
public override int NorthID{ get{ return 0x4004; } }
public override int EastID{ get{ return 0x4005; } }
public override int SouthID{ get{ return 0x4006; } }
public override int WestID{ get{ return 0x4007; } }
public override int NorthID{ get{ return 0x4; } }
public override int EastID{ get{ return 0x5; } }
public override int SouthID{ get{ return 0x6; } }
public override int WestID{ get{ return 0x7; } }
public override int HoldDistance{ get{ return 4; } }
public override int TillerManDistance{ get{ return -4; } }
@ -51,7 +51,7 @@ namespace Server.Multis
public override BaseBoat Boat{ get{ return new SmallDragonBoat(); } }
[Constructable]
public SmallDragonBoatDeed() : base( 0x4004, Point3D.Zero )
public SmallDragonBoatDeed() : base( 0x4, Point3D.Zero )
{
}
@ -78,7 +78,7 @@ namespace Server.Multis
{
public override BaseBoat Boat{ get{ return new SmallDragonBoat(); } }
public SmallDockedDragonBoat( BaseBoat boat ) : base( 0x4004, Point3D.Zero, boat )
public SmallDockedDragonBoat( BaseBoat boat ) : base( 0x4, Point3D.Zero, boat )
{
}

View file

@ -103,13 +103,15 @@ namespace Server.Misc
object surface = map.GetTopSurface( from.Location );
if ( surface is Tile )
{
int id = ((Tile)surface).ID;
if ( surface is LandTile ) {
int id = ((LandTile)surface).ID;
return (id >= 168 && id <= 171)
|| (id >= 310 && id <= 311)
|| (id >= 0x5796 && id <= 0x57B2);
|| (id >= 310 && id <= 311);
} else if ( surface is StaticTile ) {
int id = ((StaticTile)surface).ID;
return (id >= 0x1796 && id <= 0x17B2);
}
return false;

View file

@ -30,7 +30,7 @@ namespace Server.Multis
}
}
public BaseCamp( int multiID ) : base( multiID | 0x4000 )
public BaseCamp( int multiID ) : base( multiID )
{
m_Items = new List<Item>();
m_Mobiles = new List<Mobile>();
@ -40,16 +40,6 @@ namespace Server.Multis
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) );
}
public BaseCamp( int multiID, int mode ) : base( multiID | 0x4000*mode )
{
m_Items = new List<Item>();
m_Mobiles = new List<Mobile>();
m_DecayDelay = TimeSpan.FromMinutes(30.0);
RefreshDecay(true);
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) );
}
public void CheckAddComponents()
{
if ( Deleted )

View file

@ -12,7 +12,7 @@ namespace Server.Multis
private Mobile m_Prisoner;
[Constructable]
public BrigandCamp() : base( 0x10ee, 0 ) // dummy garbage at center
public BrigandCamp() : base( 0x10EE ) // dummy garbage at center
{
}

View file

@ -11,7 +11,7 @@ namespace Server.Multis
private Mobile m_Prisoner;
[Constructable]
public LizardmenCamp() : base( 0x10ee , 0 ) // dummy garbage at center
public LizardmenCamp() : base( 0x10EE ) // dummy garbage at center
{
}

View file

@ -11,7 +11,7 @@ namespace Server.Multis
private Mobile m_Prisoner;
[Constructable]
public OrcCamp() : base( 0x10ee, 0 ) // dummy garbage at center
public OrcCamp() : base( 0x10EE ) // dummy garbage at center
{
}

View file

@ -11,7 +11,7 @@ namespace Server.Multis
private Mobile m_Prisoner;
[Constructable]
public RatCamp() : base( 0x10ee, 0 ) // dummy garbage at center
public RatCamp() : base( 0x10EE ) // dummy garbage at center
{
}

View file

@ -75,7 +75,7 @@ namespace Server.Multis.Deeds
Weight = 1.0;
LootType = LootType.Newbied;
m_MultiID = id & 0x3FFF;
m_MultiID = id;
m_Offset = offset;
}

View file

@ -553,11 +553,11 @@ namespace Server.Multis
if( x >= 0 && x < mcl.Width && y >= 0 && y < mcl.Height )
{
Tile[] tiles = mcl.Tiles[x][y];
StaticTile[] tiles = mcl.Tiles[x][y];
for( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
StaticTile tile = tiles[i];
if( tile.Z == 7 && tile.Height == 20 )
return true;
@ -1061,11 +1061,11 @@ namespace Server.Multis
public static bool ValidPiece( int itemID, bool roof )
{
itemID &= 0x3FFF;
itemID &= TileData.MaxItemValue;
if ( !roof && ( TileData.ItemTable[itemID & 0x3FFF].Flags & TileFlag.Roof ) != 0 )
if ( !roof && ( TileData.ItemTable[itemID].Flags & TileFlag.Roof ) != 0 )
return false;
else if ( roof && ( TileData.ItemTable[itemID & 0x3FFF].Flags & TileFlag.Roof ) == 0 )
else if ( roof && ( TileData.ItemTable[itemID].Flags & TileFlag.Roof ) == 0 )
return false;
return Verification.IsItemValid( itemID );
@ -1141,11 +1141,11 @@ namespace Server.Multis
if( IsStairBlock( id ) )
{
Tile[] tiles = mcl.Tiles[ax][ay];
StaticTile[] tiles = mcl.Tiles[ax][ay];
for( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
StaticTile tile = tiles[i];
if( tile.Z == (z + 5) )
{
@ -1220,12 +1220,12 @@ namespace Server.Multis
if( ax >= 1 && ax < mcl.Width && ay >= 1 && ay < mcl.Height - 1 )
{
Tile[] tiles = mcl.Tiles[ax][ay];
StaticTile[] tiles = mcl.Tiles[ax][ay];
bool hasBaseFloor = false;
for( int j = 0; !hasBaseFloor && j < tiles.Length; ++j )
hasBaseFloor = (tiles[j].Z == 7 && (tiles[j].ID & 0x3FFF) != 1);
hasBaseFloor = (tiles[j].Z == 7 && tiles[j].ID != 1);
if( !hasBaseFloor )
mcl.Add( 0x31F4, x, y, 7 );
@ -1284,12 +1284,12 @@ namespace Server.Multis
// If needed, replace removed component with a dirt tile
if( ax >= 1 && ax < mcl.Width && ay >= 1 && ay < mcl.Height - 1 )
{
Tile[] tiles = mcl.Tiles[ax][ay];
StaticTile[] tiles = mcl.Tiles[ax][ay];
bool hasBaseFloor = false;
for( int i = 0; !hasBaseFloor && i < tiles.Length; ++i )
hasBaseFloor = (tiles[i].Z == 7 && (tiles[i].ID & 0x3FFF) != 1);
hasBaseFloor = (tiles[i].Z == 7 && tiles[i].ID != 1);
if( !hasBaseFloor )
{
@ -1641,7 +1641,7 @@ namespace Server.Multis
{
MultiTileEntry mte = list[i];
if( mte.m_OffsetX == x && mte.m_OffsetY == y && GetZLevel( mte.m_OffsetZ, context.Foundation ) == context.Level && (TileData.ItemTable[mte.m_ItemID & 0x3FFF].Flags & TileFlag.Roof) != 0 )
if( mte.m_OffsetX == x && mte.m_OffsetY == y && GetZLevel( mte.m_OffsetZ, context.Foundation ) == context.Level && (TileData.ItemTable[mte.m_ItemID & TileData.MaxItemValue].Flags & TileFlag.Roof) != 0 )
mcl.Remove( mte.m_ItemID, x, y, mte.m_OffsetZ );
}
@ -1669,7 +1669,7 @@ namespace Server.Multis
DesignState design = context.Foundation.DesignState;
MultiComponentList mcl = design.Components;
if( (TileData.ItemTable[itemID & 0x3FFF].Flags & TileFlag.Roof) == 0 )
if( (TileData.ItemTable[itemID & TileData.MaxItemValue].Flags & TileFlag.Roof) == 0 )
{
design.SendDetailedInfoTo( state );
return;
@ -1748,7 +1748,7 @@ namespace Server.Multis
for( int i = 0; i < length; ++i )
{
m_Fixtures[i].m_ItemID = reader.ReadShort();
m_Fixtures[i].m_ItemID = reader.ReadUShort();
m_Fixtures[i].m_OffsetX = reader.ReadShort();
m_Fixtures[i].m_OffsetY = reader.ReadShort();
m_Fixtures[i].m_OffsetZ = reader.ReadShort();
@ -1774,7 +1774,7 @@ namespace Server.Multis
{
MultiTileEntry ent = m_Fixtures[i];
writer.Write( (short)ent.m_ItemID );
writer.Write( (ushort)ent.m_ItemID );
writer.Write( (short)ent.m_OffsetX );
writer.Write( (short)ent.m_OffsetY );
writer.Write( (short)ent.m_OffsetZ );
@ -2229,7 +2229,7 @@ namespace Server.Multis
int x = mte.m_OffsetX - xMin;
int y = mte.m_OffsetY - yMin;
int z = mte.m_OffsetZ;
bool floor = (TileData.ItemTable[mte.m_ItemID & 0x3FFF].Height <= 0);
bool floor = (TileData.ItemTable[mte.m_ItemID & TileData.MaxItemValue].Height <= 0);
int plane, size;
switch( z )

View file

@ -97,7 +97,7 @@ namespace Server.Multis
int tileX = start.X + x;
int tileY = start.Y + y;
Tile[] addTiles = mcl.Tiles[x][y];
StaticTile[] addTiles = mcl.Tiles[x][y];
if ( addTiles.Length == 0 )
continue; // There are no tiles here, continue checking somewhere else
@ -117,10 +117,10 @@ namespace Server.Multis
return HousePlacementResult.BadRegion;
}
Tile landTile = map.Tiles.GetLandTile( tileX, tileY );
int landID = landTile.ID & 0x3FFF;
LandTile landTile = map.Tiles.GetLandTile( tileX, tileY );
int landID = landTile.ID & TileData.MaxLandValue;
Tile[] oldTiles = map.Tiles.GetStaticTiles( tileX, tileY, true );
StaticTile[] oldTiles = map.Tiles.GetStaticTiles( tileX, tileY, true );
Sector sector = map.GetSector( tileX, tileY );
@ -152,12 +152,12 @@ namespace Server.Multis
for ( int i = 0; i < addTiles.Length; ++i )
{
Tile addTile = addTiles[i];
StaticTile addTile = addTiles[i];
if ( addTile.ID == 0x4001 ) // Nodraw
if ( addTile.ID == 0x1 ) // Nodraw
continue;
TileFlag addTileFlags = TileData.ItemTable[addTile.ID & 0x3FFF].Flags;
TileFlag addTileFlags = TileData.ItemTable[addTile.ID & TileData.MaxItemValue].Flags;
bool isFoundation = ( addTile.Z == 0 && (addTileFlags & TileFlag.Wall) != 0 );
bool hasSurface = false;
@ -174,13 +174,13 @@ namespace Server.Multis
if ( addTileTop > landStartZ && landAvgZ > addTileZ )
return HousePlacementResult.BadLand; // Broke rule #2
if ( isFoundation && ((TileData.LandTable[landTile.ID & 0x3FFF].Flags & TileFlag.Impassable) == 0) && landAvgZ == center.Z )
if ( isFoundation && ((TileData.LandTable[landTile.ID & TileData.MaxLandValue].Flags & TileFlag.Impassable) == 0) && landAvgZ == center.Z )
hasSurface = true;
for ( int j = 0; j < oldTiles.Length; ++j )
{
Tile oldTile = oldTiles[j];
ItemData id = TileData.ItemTable[oldTile.ID & 0x3FFF];
StaticTile oldTile = oldTiles[j];
ItemData id = TileData.ItemTable[oldTile.ID & TileData.MaxItemValue];
if ( (id.Impassable || (id.Surface && (id.Flags & TileFlag.Background) == 0)) && addTileTop > oldTile.Z && (oldTile.Z + id.CalcHeight) > addTileZ )
return HousePlacementResult.BadStatic; // Broke rule #2
@ -251,14 +251,14 @@ namespace Server.Multis
if ( vx >= 0 && vx < mcl.Width && vy >= 0 && vy < mcl.Height )
{
Tile[] breakTiles = mcl.Tiles[vx][vy];
StaticTile[] breakTiles = mcl.Tiles[vx][vy];
bool shouldBreak = false;
for ( int i = 0; !shouldBreak && i < breakTiles.Length; ++i )
{
Tile breakTile = breakTiles[i];
StaticTile breakTile = breakTiles[i];
if ( breakTile.Height == 0 && breakTile.Z <= 8 && TileData.ItemTable[breakTile.ID & 0x3FFF].Surface )
if ( breakTile.Height == 0 && breakTile.Z <= 8 && TileData.ItemTable[breakTile.ID & TileData.MaxItemValue].Surface )
shouldBreak = true;
}
@ -280,8 +280,8 @@ namespace Server.Multis
{
Point2D borderPoint = borders[i];
Tile landTile = map.Tiles.GetLandTile( borderPoint.X, borderPoint.Y );
int landID = landTile.ID & 0x3FFF;
LandTile landTile = map.Tiles.GetLandTile( borderPoint.X, borderPoint.Y );
int landID = landTile.ID & TileData.MaxLandValue;
if ( (TileData.LandTable[landID].Flags & TileFlag.Impassable) != 0 )
return HousePlacementResult.BadLand;
@ -292,12 +292,12 @@ namespace Server.Multis
return HousePlacementResult.BadLand; // Broke rule #5
}
Tile[] tiles = map.Tiles.GetStaticTiles( borderPoint.X, borderPoint.Y, true );
StaticTile[] tiles = map.Tiles.GetStaticTiles( borderPoint.X, borderPoint.Y, true );
for ( int j = 0; j < tiles.Length; ++j )
{
Tile tile = tiles[j];
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
StaticTile tile = tiles[j];
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
if ( id.Impassable || (id.Surface && (id.Flags & TileFlag.Background) == 0 && (tile.Z + id.CalcHeight) > (center.Z + 2)) )
return HousePlacementResult.BadStatic; // Broke rule #1
@ -353,11 +353,11 @@ namespace Server.Multis
IPooledEnumerable eable = map.GetMultiTilesAt( yardPoint.X, yardPoint.Y );
foreach ( Tile[] tile in eable )
foreach ( StaticTile[] tile in eable )
{
for ( int j = 0; j < tile.Length; ++j )
{
if ( (TileData.ItemTable[tile[j].ID & 0x3FFF].Flags & (TileFlag.Impassable | TileFlag.Surface)) != 0 )
if ( (TileData.ItemTable[tile[j].ID & TileData.MaxItemValue].Flags & (TileFlag.Impassable | TileFlag.Surface)) != 0 )
{
eable.Free();
return HousePlacementResult.BadStatic; // Broke rule #3

View file

@ -32,7 +32,7 @@ namespace Server.Multis
public override HouseDeed GetDeed()
{
switch ( ItemID ^ 0x4000 )
switch ( ItemID )
{
case 0x64: return new StonePlasterHouseDeed();
case 0x66: return new FieldStoneHouseDeed();
@ -128,7 +128,7 @@ namespace Server.Multis
public override HouseDeed GetDeed()
{
switch( ItemID ^ 0x4000 )
switch( ItemID )
{
case 0x76: return new TwoStoryWoodPlasterHouseDeed();
case 0x78:
@ -554,7 +554,7 @@ namespace Server.Multis
public override HouseDeed GetDeed()
{
switch ( ItemID ^ 0x4000 )
switch ( ItemID )
{
case 0xA0: return new StoneWorkshopDeed();
case 0xA2:

View file

@ -11,7 +11,7 @@ namespace Server.Multis
private List<Item> m_Components;
private Timer m_Timer;
public PreviewHouse( int multiID ) : base( multiID | 0x4000 )
public PreviewHouse( int multiID ) : base( multiID )
{
m_Components = new List<Item>();
@ -123,7 +123,7 @@ namespace Server.Multis
}
}
Delete();
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( this.Delete ) );
}
private class DecayTimer : Timer

View file

@ -269,12 +269,12 @@ namespace Server.Regions
if ( x < 0 || y < 0 || x >= map.Width || y >= map.Height )
continue;
Tile lt = map.Tiles.GetLandTile( x, y );
LandTile lt = map.Tiles.GetLandTile( x, y );
int ltLowZ = 0, ltAvgZ = 0, ltTopZ = 0;
map.GetAverageZ( x, y, ref ltLowZ, ref ltAvgZ, ref ltTopZ );
TileFlag ltFlags = TileData.LandTable[lt.ID & 0x3FFF].Flags;
TileFlag ltFlags = TileData.LandTable[lt.ID & TileData.MaxLandValue].Flags;
bool ltImpassable = ( (ltFlags & TileFlag.Impassable) != 0 );
if ( !lt.Ignored && ltAvgZ >= minZ && ltAvgZ < maxZ )
@ -285,12 +285,12 @@ namespace Server.Regions
else if ( land && !ltImpassable )
m_SpawnBuffer1.Add( ltAvgZ );
Tile[] staticTiles = map.Tiles.GetStaticTiles( x, y, true );
StaticTile[] staticTiles = map.Tiles.GetStaticTiles( x, y, true );
for ( int j = 0; j < staticTiles.Length; j++ )
{
Tile tile = staticTiles[j];
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
StaticTile tile = staticTiles[j];
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
int tileZ = tile.Z + id.CalcHeight;
if ( tileZ >= minZ && tileZ < maxZ )
@ -309,7 +309,7 @@ namespace Server.Regions
{
Item item = sector.Items[j];
if ( item.ItemID < 0x4000 && item.AtWorldPoint( x, y ) )
if ( item.ItemID <= TileData.MaxItemValue && item.AtWorldPoint( x, y ) )
{
m_SpawnBuffer2.Add( item );
@ -411,8 +411,8 @@ namespace Server.Regions
for ( int j = 0; j < staticTiles.Length; j++ )
{
Tile tile = staticTiles[j];
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
StaticTile tile = staticTiles[j];
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
if ( ( id.Surface || id.Impassable ) && tile.Z + id.CalcHeight > z && tile.Z < top )
{

View file

@ -270,7 +270,7 @@ namespace Server.Regions
protected override void Init()
{
m_Height = TileData.ItemTable[m_ItemID & 0x3FFF].Height;
m_Height = TileData.ItemTable[m_ItemID & TileData.MaxItemValue].Height;
}
protected override Item CreateItem()

View file

@ -195,7 +195,7 @@ namespace Server.Spells
int z = t.Z;
if( (t.Flags & TileFlag.Surface) == 0 )
z -= TileData.ItemTable[t.ItemID & 0x3FFF].CalcHeight;
z -= TileData.ItemTable[t.ItemID & TileData.MaxItemValue].CalcHeight;
p = new Point3D( t.X, t.Y, z );
}

View file

@ -66,19 +66,18 @@ namespace Server.Spells.Spellweaving
private static bool IsValidLocation( Point3D location, Map map )
{
Tile lt = map.Tiles.GetLandTile( location.X, location.Y ); // Land Tiles
LandTile lt = map.Tiles.GetLandTile( location.X, location.Y ); // Land Tiles
if( IsValidTile( lt.ID ) && lt.Z == location.Z )
return true;
Tile[] tiles = map.Tiles.GetStaticTiles( location.X, location.Y ); // Static Tiles
StaticTile[] tiles = map.Tiles.GetStaticTiles( location.X, location.Y ); // Static Tiles
for( int i = 0; i < tiles.Length; ++i )
{
Tile t = tiles[i];
ItemData id = TileData.ItemTable[t.ID & 0x3FFF];
StaticTile t = tiles[i];
int tand = t.ID & 0x3FFF;
int tand = t.ID;
if( t.Z != location.Z )
continue;