diff --git a/ItemEditor.sln b/ItemEditor.sln index 12d7033..2413304 100644 --- a/ItemEditor.sln +++ b/ItemEditor.sln @@ -16,6 +16,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginTwo", "Source\PluginT EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginInterface", "Source\PluginInterface\PluginInterface.csproj", "{CEF21172-258C-4D0D-B024-ED7EF99612A2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginZero", "Source\PluginZero\PluginZero.csproj", "{A6AC9F32-8478-4543-8772-0AD590E94140}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -86,8 +88,23 @@ Global {CEF21172-258C-4D0D-B024-ED7EF99612A2}.Release|x64.Build.0 = Release|x64 {CEF21172-258C-4D0D-B024-ED7EF99612A2}.Release|x86.ActiveCfg = Release|x86 {CEF21172-258C-4D0D-B024-ED7EF99612A2}.Release|x86.Build.0 = Release|x86 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A6AC9F32-8478-4543-8772-0AD590E94140}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6AC9F32-8478-4543-8772-0AD590E94140}.Debug|x64.ActiveCfg = Debug|x64 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Debug|x64.Build.0 = Debug|x64 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Debug|x86.ActiveCfg = Debug|x86 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Debug|x86.Build.0 = Debug|x86 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A6AC9F32-8478-4543-8772-0AD590E94140}.Release|Any CPU.Build.0 = Release|Any CPU + {A6AC9F32-8478-4543-8772-0AD590E94140}.Release|x64.ActiveCfg = Release|x64 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Release|x64.Build.0 = Release|x64 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Release|x86.ActiveCfg = Release|x86 + {A6AC9F32-8478-4543-8772-0AD590E94140}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C55FD5F8-D261-4324-9C5B-B9C8E1256302} + EndGlobalSection EndGlobal diff --git a/README.md b/README.md index 08ae68d..c6fb439 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,12 @@ ItemEditor is a program used to edit the OTB data files. Supported versions: ---- -* 8.00 - 10.77 +* 7.40 - 10.77 Download ---- -[ItemEditor 0.4](https://github.com/ottools/ItemEditor/releases/tag/v0.4) +[ItemEditor 0.43](https://github.com/danilopucci/ItemEditor/releases/download/v0.4.3/ItemEditor_v0432.zip) Compiling ---- diff --git a/Source/MainForm.cs b/Source/MainForm.cs index 841071b..27465dc 100644 --- a/Source/MainForm.cs +++ b/Source/MainForm.cs @@ -350,7 +350,20 @@ public void CreateEmptyOTB(string filePath, SupportedClient client, bool isTempo item.ID = 100; ServerItemList items = new ServerItemList(); - items.MajorVersion = 3; + + if (client.Version >= 740 && client.Version <= 792) + { + items.MajorVersion = 1; + } + else if (client.Version >= 800 && client.Version <= 811) + { + items.MajorVersion = 2; + } + else + { + items.MajorVersion = 3; + } + items.MinorVersion = client.OtbVersion; items.BuildNumber = 1; items.ClientVersion = client.Version; @@ -794,13 +807,14 @@ private ServerItem CopyItem(ServerItem item) private bool LoadClient(Plugin plugin, uint otbVersion) { - SupportedClient client = plugin.Instance.SupportedClients.Find( + List clientList = plugin.Instance.SupportedClients.FindAll( delegate(SupportedClient sc) { return sc.OtbVersion == otbVersion; }); - if (client == null) + + if (clientList.Count == 0) { MessageBox.Show("The selected plugin does not support this version."); return false; @@ -809,16 +823,27 @@ private bool LoadClient(Plugin plugin, uint otbVersion) uint datSignature = (uint)Properties.Settings.Default["DatSignature"]; uint sprSignature = (uint)Properties.Settings.Default["SprSignature"]; - if (client.DatSignature != datSignature || client.SprSignature != sprSignature) + if (datSignature == 0 || sprSignature == 0) { - string message; - if (datSignature == 0 || sprSignature == 0) + MessageBox.Show("No client is selected. Please navigate to the client folder."); + return false; + } + + SupportedClient client = null; + + foreach (SupportedClient clientObject in clientList) + { + if (clientObject.DatSignature == datSignature && clientObject.SprSignature == sprSignature) { - message = "No client is selected. Please navigate to the client folder."; + client = clientObject; } - else + } + + if (client == null) + { + string message; { - message = string.Format("The selected client is not compatible with this OTB(version {0}). Please navigate to the folder of a compatible client {1}.", client.OtbVersion, client.Version); + message = string.Format("The selected client is not compatible with this OTB(version {0}). Please navigate to the folder of a compatible client.", otbVersion); } MessageBox.Show(message); @@ -856,7 +881,7 @@ private bool LoadClient(Plugin plugin, uint otbVersion) return false; } - Trace.WriteLine(string.Format("OTB version {0}.", otbVersion)); + Trace.WriteLine(string.Format("OTB version {0}. Tibia client version {1}", otbVersion, client.Version)); bool result; diff --git a/Source/PluginInterface/OTLib/OTB/OtbWriter.cs b/Source/PluginInterface/OTLib/OTB/OtbWriter.cs index d088826..33211d6 100644 --- a/Source/PluginInterface/OTLib/OTB/OtbWriter.cs +++ b/Source/PluginInterface/OTLib/OTB/OtbWriter.cs @@ -78,7 +78,7 @@ public bool Write(string path) vi.MajorVersion = this.Items.MajorVersion; vi.MinorVersion = this.Items.MinorVersion; - vi.BuildNumber = this.Items.BuildNumber; + vi.BuildNumber = this.Items.BuildNumber + 1; vi.CSDVersion = string.Format("OTB {0}.{1}.{2}-{3}.{4}", vi.MajorVersion, vi.MinorVersion, vi.BuildNumber, this.Items.ClientVersion / 100, this.Items.ClientVersion % 100); MemoryStream ms = new MemoryStream(); diff --git a/Source/PluginInterface/Properties/AssemblyInfo.cs b/Source/PluginInterface/Properties/AssemblyInfo.cs index 43f4139..67c1f6e 100644 --- a/Source/PluginInterface/Properties/AssemblyInfo.cs +++ b/Source/PluginInterface/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyVersion("0.4.4.0")] +[assembly: AssemblyFileVersion("0.4.4.0")] diff --git a/Source/PluginOne/Plugin.cs b/Source/PluginOne/Plugin.cs index 0f8e904..bdd401f 100644 --- a/Source/PluginOne/Plugin.cs +++ b/Source/PluginOne/Plugin.cs @@ -1,4 +1,4 @@ -#region Licence +#region Licence /** * Copyright © 2014-2019 OTTools * diff --git a/Source/PluginOne/PluginOne.xml b/Source/PluginOne/PluginOne.xml index 624c6b0..2c145b4 100644 --- a/Source/PluginOne/PluginOne.xml +++ b/Source/PluginOne/PluginOne.xml @@ -1,5 +1,8 @@ + + + diff --git a/Source/PluginOne/Properties/AssemblyInfo.cs b/Source/PluginOne/Properties/AssemblyInfo.cs index 37a2104..a3c7b27 100644 --- a/Source/PluginOne/Properties/AssemblyInfo.cs +++ b/Source/PluginOne/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyVersion("0.4.4.0")] +[assembly: AssemblyFileVersion("0.4.4.0")] diff --git a/Source/PluginThree/Properties/AssemblyInfo.cs b/Source/PluginThree/Properties/AssemblyInfo.cs index ea65dac..e4ab26d 100644 --- a/Source/PluginThree/Properties/AssemblyInfo.cs +++ b/Source/PluginThree/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyVersion("0.4.4.0")] +[assembly: AssemblyFileVersion("0.4.4.0")] diff --git a/Source/PluginTwo/Properties/AssemblyInfo.cs b/Source/PluginTwo/Properties/AssemblyInfo.cs index 8a77fb3..99db262 100644 --- a/Source/PluginTwo/Properties/AssemblyInfo.cs +++ b/Source/PluginTwo/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyVersion("0.4.4.0")] +[assembly: AssemblyFileVersion("0.4.4.0")] diff --git a/Source/PluginZero/Plugin.cs b/Source/PluginZero/Plugin.cs new file mode 100644 index 0000000..f1bd978 --- /dev/null +++ b/Source/PluginZero/Plugin.cs @@ -0,0 +1,648 @@ +#region Licence +/** +* Copyright © 2014-2019 OTTools +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#endregion + +#region Using Statements +using ItemEditor; +using OTLib.Server.Items; +using PluginInterface; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +#endregion + +namespace PluginZero +{ + internal enum ItemFlag : byte + { + Ground = 0x00, + GroundBorder = 0x01, + OnBottom = 0x02, + OnTop = 0x03, + Container = 0x04, + Stackable = 0x05, + ForceUse = 0x06, + MultiUse = 0x07, + Writable = 0x08, + WritableOnce = 0x09, + FluidContainer = 0x0A, + Fluid = 0x0B, + IsUnpassable = 0x0C, + IsUnmoveable = 0x0D, + BlockMissiles = 0x0E, + BlockPathfinder = 0x0F, + Pickupable = 0x10, + Hangable = 0x11, + IsVertical = 0x12, + IsHorizontal = 0x13, + Rotatable = 0x14, + HasLight = 0x15, + DontHide = 0x16, + FloorChange = 0x17, + HasOffset = 0x18, + HasElevation = 0x19, + Lying = 0x1A, + AnimateAlways = 0x1B, + Minimap = 0x1C, + LensHelp = 0x1D, + FullGround = 0x1E, + + LastFlag = 0xFF + } + + public class Plugin : IPlugin + { + #region Private Properties + + private Dictionary sprites; + private ushort itemCount; + + #endregion + + #region Constructor + + public Plugin() + { + this.Settings = new Settings(); + this.sprites = new Dictionary(); + this.Items = new ClientItems(); + this.SupportedClients = new List(); + } + + #endregion + + #region Public Properties + + // internal implementation + public Settings Settings { get; private set; } + + // IPlugin implementation + public IPluginHost Host { get; set; } + + public List SupportedClients { get; private set; } + + public ClientItems Items { get; set; } + + public ushort MinItemId { get { return 100; } } + + public ushort MaxItemId { get { return this.itemCount; } } + + public bool Loaded { get; private set; } + + #endregion + + #region Public Methods + + public bool LoadClient(SupportedClient client, bool extended, bool frameDurations, bool transparency, string datFullPath, string sprFullPath) + { + if (this.Loaded) + { + this.Dispose(); + } + + if (!LoadDat(datFullPath, client, extended, frameDurations)) + { + Trace.WriteLine("Failed to load dat."); + return false; + } + + if (!LoadSprites(sprFullPath, client, extended, transparency)) + { + Trace.WriteLine("Failed to load spr."); + return false; + } + + this.Loaded = true; + return true; + } + + public void Initialize() + { + this.Settings.Load("PluginZero.xml"); + this.SupportedClients = Settings.GetSupportedClientList(); + } + + public SupportedClient GetClientBySignatures(uint datSignature, uint sprSignature) + { + foreach (SupportedClient client in this.SupportedClients) + { + if (client.DatSignature == datSignature && client.SprSignature == sprSignature) + { + return client; + } + } + + return null; + } + + public ClientItem GetClientItem(ushort id) + { + if (this.Loaded && id >= 100 && id <= this.itemCount) + { + return this.Items[id]; + } + + return null; + } + + public void Dispose() + { + if (this.Loaded) + { + this.sprites.Clear(); + this.Items.Clear(); + this.itemCount = 0; + this.Loaded = false; + } + } + + public bool LoadSprites(string filename, SupportedClient client, bool extended, bool transparency) + { + return Sprite.LoadSprites(filename, ref sprites, client, extended, transparency); + } + + public bool LoadDat(string filename, SupportedClient client, bool extended, bool frameDurations) + { + using (FileStream fileStream = new FileStream(filename, FileMode.Open)) + { + BinaryReader reader = new BinaryReader(fileStream); + uint datSignature = reader.ReadUInt32(); + if (client.DatSignature != datSignature) + { + string message = "PluginZero: Bad dat signature. Expected signature is {0:X} and loaded signature is {1:X}."; + Trace.WriteLine(String.Format(message, client.DatSignature, datSignature)); + return false; + } + + // get max id + this.itemCount = reader.ReadUInt16(); + reader.ReadUInt16(); // skipping outfits count + reader.ReadUInt16(); // skipping effects count + reader.ReadUInt16(); // skipping missiles count + + ushort id = 100; + while (id <= this.itemCount) + { + ClientItem item = new ClientItem(); + item.ID = id; + this.Items[id] = item; + + // read the options until we find 0xff + ItemFlag flag; + do + { + flag = (ItemFlag)reader.ReadByte(); + flag = convertItemFlag(client.Version, flag); + + if (client.Version >= 740 && client.Version <= 750) + { + if (!readAndSetAttribute_740_750(reader, item, flag)) + { + Trace.WriteLine(String.Format("PluginZero: Error while parsing, unknown flag 0x{0:X} at id {1}.", flag, id)); + } + } + else if (client.Version >= 755 && client.Version <= 772) + { + if (!readAndSetAttribute_755_772(reader, item, flag)) + { + Trace.WriteLine(String.Format("PluginZero: Error while parsing, unknown flag 0x{0:X} at id {1}.", flag, id)); + } + } + else + { + Trace.WriteLine(String.Format("PluginZero: Error while parsing, not supported client version {1}.", client.Version)); + } + + } while (flag != ItemFlag.LastFlag); + + + item.Width = reader.ReadByte(); + item.Height = reader.ReadByte(); + + if ((item.Width > 1) || (item.Height > 1)) + { + reader.BaseStream.Position++; + } + + item.Layers = reader.ReadByte(); + item.PatternX = reader.ReadByte(); + item.PatternY = reader.ReadByte(); + + if (client.Version >= 755) + item.PatternZ = reader.ReadByte(); + else + item.PatternZ = 1; + + item.Frames = reader.ReadByte(); + item.IsAnimation = item.Frames > 1; + item.NumSprites = (uint)item.Width * item.Height * item.Layers * item.PatternX * item.PatternY * item.PatternZ * item.Frames; + + // Read the sprite ids + for (UInt32 i = 0; i < item.NumSprites; ++i) + { + UInt16 spriteId = reader.ReadUInt16(); + Sprite sprite; + if (!sprites.TryGetValue(spriteId, out sprite)) + { + sprite = new Sprite(); + sprite.ID = spriteId; + sprites[spriteId] = sprite; + } + + item.SpriteList.Add(sprite); + } + + ++id; + + + } + } + + return true; + } + + private ItemFlag convertItemFlag(uint clientVersion, ItemFlag flag) + { + ItemFlag resultFlag = flag; + + if (clientVersion >= 740 && clientVersion <= 750) + { + /* + * - In 7.4-7.5 attribute "Ground Border" did not exist, so attributes 1-15 have to be adjusted. + * - Several other changes in the format. + * - "Multi Use" and "Force Use" are swapped + */ + if (Convert.ToInt32(flag) > 0 && Convert.ToInt32(flag) <= 15) + { + resultFlag = flag + 1; + } + else if (Convert.ToInt32(flag) == 16) + { + resultFlag = ItemFlag.HasLight; + } + else if (Convert.ToInt32(flag) == 17) + { + resultFlag = ItemFlag.FloorChange; + } + else if (Convert.ToInt32(flag) == 18) + { + resultFlag = ItemFlag.FullGround; + } + else if (Convert.ToInt32(flag) == 19) + { + resultFlag = ItemFlag.HasElevation; + } + else if (Convert.ToInt32(flag) == 20) + { + resultFlag = ItemFlag.HasOffset; + } + else if (Convert.ToInt32(flag) == 22) + { + resultFlag = ItemFlag.Minimap; + } + else if (Convert.ToInt32(flag) == 23) + { + resultFlag = ItemFlag.Rotatable; + } + else if (Convert.ToInt32(flag) == 24) + { + resultFlag = ItemFlag.Lying; + } + else if (Convert.ToInt32(flag) == 25) + { + resultFlag = ItemFlag.Hangable; + } + else if (Convert.ToInt32(flag) == 26) + { + resultFlag = ItemFlag.IsHorizontal; + } + else if (Convert.ToInt32(flag) == 27) + { + resultFlag = ItemFlag.IsVertical; + } + else if (Convert.ToInt32(flag) == 28) + { + resultFlag = ItemFlag.AnimateAlways; + } + else if (flag == ItemFlag.MultiUse) + { + resultFlag = ItemFlag.ForceUse; + } + else if (flag == ItemFlag.ForceUse) + { + resultFlag = ItemFlag.MultiUse; + } + + } + return resultFlag; + } + + private bool readAndSetAttribute_740_750(BinaryReader reader, ClientItem item, ItemFlag flag) + { + + switch (flag) + { + case ItemFlag.Ground: + item.GroundSpeed = reader.ReadUInt16(); + item.Type = ServerItemType.Ground; + break; + + case ItemFlag.OnBottom: + item.HasStackOrder = true; + item.StackOrder = TileStackOrder.Bottom; + break; + + + case ItemFlag.OnTop: + item.HasStackOrder = true; + item.StackOrder = TileStackOrder.Top; + break; + + case ItemFlag.Container: + item.Type = ServerItemType.Container; + break; + + case ItemFlag.Stackable: + item.Stackable = true; + break; + + case ItemFlag.MultiUse: + item.MultiUse = true; + break; + + case ItemFlag.ForceUse: + item.ForceUse = true; + break; + + case ItemFlag.Writable: + item.Readable = true; + item.MaxReadWriteChars = reader.ReadUInt16(); + break; + + case ItemFlag.WritableOnce: + item.Readable = true; + item.MaxReadChars = reader.ReadUInt16(); + break; + + case ItemFlag.FluidContainer: + item.Type = ServerItemType.Fluid; + break; + + case ItemFlag.Fluid: + item.Type = ServerItemType.Splash; + break; + + case ItemFlag.IsUnpassable: + item.Unpassable = true; + break; + + case ItemFlag.IsUnmoveable: + item.Movable = false; + break; + + case ItemFlag.BlockMissiles: + item.BlockMissiles = true; + break; + + case ItemFlag.BlockPathfinder: + item.BlockPathfinder = true; + break; + + case ItemFlag.Pickupable: + item.Pickupable = true; + break; + + case ItemFlag.HasLight: + item.LightLevel = reader.ReadUInt16(); + item.LightColor = reader.ReadUInt16(); + break; + + case ItemFlag.FloorChange: + break; + + case ItemFlag.FullGround: + item.FullGround = true; + break; + + case ItemFlag.HasElevation: + item.HasElevation = true; + reader.ReadUInt16(); // Height + break; + + case ItemFlag.HasOffset: + break; + + case ItemFlag.Minimap: + item.MinimapColor = reader.ReadUInt16(); + break; + + case ItemFlag.Rotatable: + item.Rotatable = true; + break; + + case ItemFlag.Lying: + break; + + case ItemFlag.Hangable: + item.Hangable = true; + break; + + case ItemFlag.IsVertical: + item.HookSouth = true; + break; + + case ItemFlag.IsHorizontal: + item.HookEast = true; + break; + + case ItemFlag.AnimateAlways: + break; + + case ItemFlag.LensHelp: + ushort opt = reader.ReadUInt16(); + if (opt == 1112) + { + item.Readable = true; + } + break; + + case ItemFlag.LastFlag: + break; + + default: + return false; + } + + return true; + } + + + private bool readAndSetAttribute_755_772(BinaryReader reader, ClientItem item, ItemFlag flag) { + + switch (flag) + { + case ItemFlag.Ground: + item.GroundSpeed = reader.ReadUInt16(); + item.Type = ServerItemType.Ground; + break; + + + case ItemFlag.GroundBorder: + item.HasStackOrder = true; + item.StackOrder = TileStackOrder.Border; + + break; + + case ItemFlag.OnBottom: + item.HasStackOrder = true; + item.StackOrder = TileStackOrder.Bottom; + break; + + + case ItemFlag.OnTop: + item.HasStackOrder = true; + item.StackOrder = TileStackOrder.Top; + break; + + case ItemFlag.Container: + item.Type = ServerItemType.Container; + break; + + case ItemFlag.Stackable: + item.Stackable = true; + break; + + case ItemFlag.MultiUse: + item.MultiUse = true; + break; + + case ItemFlag.ForceUse: + item.ForceUse = true; + break; + + case ItemFlag.Writable: + item.Readable = true; + item.MaxReadWriteChars = reader.ReadUInt16(); + break; + + case ItemFlag.WritableOnce: + item.Readable = true; + item.MaxReadChars = reader.ReadUInt16(); + break; + + case ItemFlag.FluidContainer: + item.Type = ServerItemType.Fluid; + break; + + case ItemFlag.Fluid: + item.Type = ServerItemType.Splash; + break; + + case ItemFlag.IsUnpassable: + item.Unpassable = true; + break; + + case ItemFlag.IsUnmoveable: + item.Movable = false; + break; + + case ItemFlag.BlockMissiles: + item.BlockMissiles = true; + break; + + case ItemFlag.BlockPathfinder: + item.BlockPathfinder = true; + break; + + case ItemFlag.Pickupable: + item.Pickupable = true; + break; + + case ItemFlag.Hangable: + item.Hangable = true; + break; + + case ItemFlag.IsVertical: + item.HookEast = true; + break; + + case ItemFlag.IsHorizontal: + item.HookSouth = true; + break; + + case ItemFlag.Rotatable: + item.Rotatable = true; + break; + + case ItemFlag.HasLight: + item.LightLevel = reader.ReadUInt16(); + item.LightColor = reader.ReadUInt16(); + break; + + case ItemFlag.DontHide: + break; + + case ItemFlag.FloorChange: + break; + + case ItemFlag.HasOffset: + reader.ReadUInt16(); // OffsetX + reader.ReadUInt16(); // OffsetY + break; + + case ItemFlag.HasElevation: + item.HasElevation = true; + reader.ReadUInt16(); // Height + break; + + case ItemFlag.Lying: + break; + + case ItemFlag.AnimateAlways: + break; + + case ItemFlag.Minimap: + item.MinimapColor = reader.ReadUInt16(); + break; + + case ItemFlag.LensHelp: + ushort opt = reader.ReadUInt16(); + if (opt == 1112) + { + item.Readable = true; + } + break; + + case ItemFlag.FullGround: + break; + + case ItemFlag.LastFlag: + break; + + default: + return false; + } + + return true; + } + + #endregion + } +} \ No newline at end of file diff --git a/Source/PluginZero/PluginZero.csproj b/Source/PluginZero/PluginZero.csproj new file mode 100644 index 0000000..dc63350 --- /dev/null +++ b/Source/PluginZero/PluginZero.csproj @@ -0,0 +1,102 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {A6AC9F32-8478-4543-8772-0AD590E94140} + Library + Properties + PluginZero + PluginZero + v4.5.2 + 512 + + + + + true + full + false + ..\bin\Debug\Plugins\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + ..\bin\Release\Plugins\ + TRACE + prompt + 4 + false + + + x86 + ..\bin\x86\Debug\Plugins\ + false + DEBUG;TRACE + false + + + x86 + ..\bin\x86\Release\Plugins\ + true + TRACE + false + + + true + ..\bin\x64\Debug\Plugins\ + + x64 + + MinimumRecommendedRules.ruleset + TRACE;DEBUG + false + + + ..\bin\x64\Release\Plugins\ + + true + + x64 + + MinimumRecommendedRules.ruleset + TRACE + false + + + + + + + + + + + + + + {CEF21172-258C-4D0D-B024-ED7EF99612A2} + PluginInterface + False + + + + + PreserveNewest + + + + + diff --git a/Source/PluginZero/PluginZero.xml b/Source/PluginZero/PluginZero.xml new file mode 100644 index 0000000..fe95444 --- /dev/null +++ b/Source/PluginZero/PluginZero.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Source/PluginZero/Properties/AssemblyInfo.cs b/Source/PluginZero/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5259570 --- /dev/null +++ b/Source/PluginZero/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PluginZero")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PluginZero")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a6ac9f32-8478-4543-8772-0ad590e94140")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.4.3.3")] +[assembly: AssemblyFileVersion("0.4.3.3")] diff --git a/Source/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs index e109f21..464ee20 100644 --- a/Source/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.4.3.0")] -[assembly: AssemblyFileVersion("0.4.3.0")] +[assembly: AssemblyVersion("0.4.4.0")] +[assembly: AssemblyFileVersion("0.4.4.0")]