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

@ -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; } }