Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ItemEditor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----
Expand Down
45 changes: 35 additions & 10 deletions Source/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -794,13 +807,14 @@ private ServerItem CopyItem(ServerItem item)

private bool LoadClient(Plugin plugin, uint otbVersion)
{
SupportedClient client = plugin.Instance.SupportedClients.Find(
List<SupportedClient> 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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion Source/PluginInterface/OTLib/OTB/OtbWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginInterface/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 1 addition & 1 deletion Source/PluginOne/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region Licence
#region Licence
/**
* Copyright © 2014-2019 OTTools <https://github.com/ottools/ItemEditor/>
*
Expand Down
3 changes: 3 additions & 0 deletions Source/PluginOne/PluginOne.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<settings>
<clients>
<client version="780" description="Client 7.80" otbversion="4" datsignature="44CE4743" sprsignature="44CE4206"/>
<client version="790" description="Client 7.90" otbversion="5" datsignature="457D854E" sprsignature="457957C8"/>
<client version="792" description="Client 7.92" otbversion="5" datsignature="459E7B73" sprsignature="45880FE8"/>
<client version="800" description="Client 8.00" otbversion="7" datsignature="467FD7E6" sprsignature="467F9E74"/>
<client version="810" description="Client 8.10" otbversion="8" datsignature="475D3747" sprsignature="475D0B01"/>
<client version="811" description="Client 8.11" otbversion="9" datsignature="47F60E37" sprsignature="47EBB9B2"/>
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginOne/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
4 changes: 2 additions & 2 deletions Source/PluginThree/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
4 changes: 2 additions & 2 deletions Source/PluginTwo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Loading