Skip to content

Commit

Permalink
Merge pull request #23 from Icehunter/2.4-fixes
Browse files Browse the repository at this point in the history
2.4 fixes
  • Loading branch information
Icehunter committed Oct 30, 2014
2 parents 23185c6 + 0cb7218 commit a502fc0
Show file tree
Hide file tree
Showing 33 changed files with 2,107 additions and 1,777 deletions.
16 changes: 11 additions & 5 deletions FFXIVAPP.Client/FFXIVAPP.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
<Reference Include="FFXIVAPP.Localization">
<HintPath>..\..\ffxivapp-resources\FFXIVAPP.Localization.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack">
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ffxivapp-aio\packages\HtmlAgilityPack.1.4.9\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=0.12.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand All @@ -90,10 +91,11 @@
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\ffxivapp-aio\packages\Newtonsoft.Json.6.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net45\NLog.dll</HintPath>
<Reference Include="NLog, Version=3.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ffxivapp-aio\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
Expand Down Expand Up @@ -134,6 +136,7 @@
<Compile Include="Delegates\MonsterWorkerDelegate.cs" />
<Compile Include="Delegates\NPCWorkerDelegate.cs" />
<Compile Include="Delegates\PCWorkerDelegate.cs" />
<Compile Include="Helpers\PlayerEntityHelper.cs" />
<Compile Include="Helpers\ActorEntityHelper.cs" />
<Compile Include="Helpers\AppContextHelper.cs" />
<Compile Include="Helpers\MessageBoxHelper.cs" />
Expand Down Expand Up @@ -309,6 +312,9 @@
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
Expand Down
28 changes: 14 additions & 14 deletions FFXIVAPP.Client/Helpers/ActorEntityHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@ public static ActorEntity ResolveActorFromBytes(byte[] source)
entry.ClaimedByID = BitConverter.ToUInt32(source, 0x1A0);
var targetID = BitConverter.ToUInt32(source, 0x1A8);
var pcTargetID = BitConverter.ToUInt32(source, 0xAA8);
entry.Job = (Actor.Job) source[0x1790];
entry.Level = source[0x1791];
entry.GrandCompany = source[0x1793];
entry.GrandCompanyRank = source[0x1794];
entry.Title = source[0x1796];
entry.HPCurrent = BitConverter.ToInt32(source, 0x1798);
entry.HPMax = BitConverter.ToInt32(source, 0x179C);
entry.MPCurrent = BitConverter.ToInt32(source, 0x17A0);
entry.MPMax = BitConverter.ToInt32(source, 0x17A4);
entry.TPCurrent = BitConverter.ToInt16(source, 0x17A8);
entry.Job = (Actor.Job) source[0x17C0];
entry.Level = source[0x17C1];
entry.GrandCompany = source[0x17C3];
entry.GrandCompanyRank = source[0x17C4];
entry.Title = source[0x17C6];
entry.HPCurrent = BitConverter.ToInt32(source, 0x17C8);
entry.HPMax = BitConverter.ToInt32(source, 0x17CC);
entry.MPCurrent = BitConverter.ToInt32(source, 0x17D0);
entry.MPMax = BitConverter.ToInt32(source, 0x17D4);
entry.TPCurrent = BitConverter.ToInt16(source, 0x17D8);
entry.TPMax = 1000;
entry.GPCurrent = BitConverter.ToInt16(source, 0x17AA);
entry.GPMax = BitConverter.ToInt16(source, 0x17AC);
entry.CPCurrent = BitConverter.ToInt16(source, 0x17AE);
entry.CPMax = BitConverter.ToInt16(source, 0x18B0);
entry.GPCurrent = BitConverter.ToInt16(source, 0x17DA);
entry.GPMax = BitConverter.ToInt16(source, 0x17DC);
entry.CPCurrent = BitConverter.ToInt16(source, 0x17DE);
entry.CPMax = BitConverter.ToInt16(source, 0x17E0);
entry.Race = source[0x2808]; // ??
entry.Sex = (Actor.Sex) source[0x2809]; //?
entry.IsCasting = BitConverter.ToBoolean(source, 0x2C90);
Expand Down
220 changes: 220 additions & 0 deletions FFXIVAPP.Client/Helpers/PlayerEntityHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
// FFXIVAPP.Client
// PlayerEntityHelper.cs
//
// Copyright © 2007 - 2014 Ryan Wilson - All Rights Reserved
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of SyndicatedLife nor the names of its contributors may
// be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

using System;
using FFXIVAPP.Client.Memory;
using FFXIVAPP.Common.Core.Memory;
using FFXIVAPP.Common.Core.Memory.Enums;

namespace FFXIVAPP.Client.Helpers
{
public static class PlayerEntityHelper
{
public static PlayerEntity ResolvePlayerFromBytes(byte[] source)
{
var entry = new PlayerEntity();
try
{
entry.Name = MemoryHandler.Instance.GetStringFromBytes(source, 1);

entry.JobID = source[0x64];
entry.Job = (Actor.Job) entry.JobID;

#region Job Levels

entry.GLD = source[0x66];
entry.PGL = source[0x68];
entry.MRD = source[0x6A];
entry.LNC = source[0x6C];
entry.ARC = source[0x6E];
entry.CNJ = source[0x70];
entry.THM = source[0x72];

entry.CPT = source[0x74];
entry.BSM = source[0x76];
entry.ARM = source[0x78];
entry.GSM = source[0x7A];
entry.LTW = source[0x7C];
entry.WVR = source[0x7E];
entry.ALC = source[0x80];
entry.CUL = source[0x82];

entry.MIN = source[0x84];
entry.BTN = source[0x86];
entry.FSH = source[0x88];

entry.ACN = source[0x8A];
entry.ROG = source[0x8C];

#endregion

#region Current Experience

entry.GLD_CurrentEXP = BitConverter.ToInt32(source, 0x94);
entry.PGL_CurrentEXP = BitConverter.ToInt32(source, 0x98);
entry.MRD_CurrentEXP = BitConverter.ToInt32(source, 0x9C);
entry.LNC_CurrentEXP = BitConverter.ToInt32(source, 0xA0);
entry.ARC_CurrentEXP = BitConverter.ToInt32(source, 0xA4);
entry.CNJ_CurrentEXP = BitConverter.ToInt32(source, 0xA8);
entry.THM_CurrentEXP = BitConverter.ToInt32(source, 0xAC);

entry.CPT_CurrentEXP = BitConverter.ToInt32(source, 0xB0);
entry.BSM_CurrentEXP = BitConverter.ToInt32(source, 0xB4);
entry.ARM_CurrentEXP = BitConverter.ToInt32(source, 0xB8);
entry.GSM_CurrentEXP = BitConverter.ToInt32(source, 0xBC);
entry.LTW_CurrentEXP = BitConverter.ToInt32(source, 0xC0);
entry.WVR_CurrentEXP = BitConverter.ToInt32(source, 0xC4);
entry.ALC_CurrentEXP = BitConverter.ToInt32(source, 0xC8);
entry.CUL_CurrentEXP = BitConverter.ToInt32(source, 0xCC);

entry.MIN_CurrentEXP = BitConverter.ToInt32(source, 0xD0);
entry.BTN_CurrentEXP = BitConverter.ToInt32(source, 0xD4);
entry.FSH_CurrentEXP = BitConverter.ToInt32(source, 0xD8);

entry.ACN_CurrentEXP = BitConverter.ToInt32(source, 0xDC);
entry.ROG_CurrentEXP = BitConverter.ToInt32(source, 0xE0);

#endregion

#region Base Stats

entry.BaseStrength = BitConverter.ToInt16(source, 0xFC);
entry.BaseDexterity = BitConverter.ToInt16(source, 0x100);
entry.BaseVitality = BitConverter.ToInt16(source, 0x104);
entry.BaseIntelligence = BitConverter.ToInt16(source, 0x108);
entry.BaseMind = BitConverter.ToInt16(source, 0x10C);
entry.BasePiety = BitConverter.ToInt16(source, 0x110);

#endregion

#region Base Stats (base+gear+bonus)

entry.Strength = BitConverter.ToInt16(source, 0x118);
entry.Dexterity = BitConverter.ToInt16(source, 0x11C);
entry.Vitality = BitConverter.ToInt16(source, 0x120);
entry.Intelligence = BitConverter.ToInt16(source, 0x124);
entry.Mind = BitConverter.ToInt16(source, 0x128);
entry.Piety = BitConverter.ToInt16(source, 0x12C);

#endregion

#region Basic Info

entry.HPMax = BitConverter.ToInt16(source, 0x130);
entry.MPMax = BitConverter.ToInt16(source, 0x134);
entry.TPMax = BitConverter.ToInt16(source, 0x138);
entry.GPMax = BitConverter.ToInt16(source, 0x13C);
entry.CPMax = BitConverter.ToInt16(source, 0x140);

#endregion

#region Offensive Properties

entry.Accuracy = BitConverter.ToInt16(source, 0x16C);
entry.CriticalHitRate = BitConverter.ToInt16(source, 0x180);
entry.Determination = BitConverter.ToInt16(source, 0x1C4);

#endregion

#region Defensive Properties

entry.Parry = BitConverter.ToInt16(source, 0x160);
entry.Defense = BitConverter.ToInt16(source, 0x168);
entry.MagicDefense = BitConverter.ToInt16(source, 0x174);

#endregion

#region Phyiscal Properties

entry.AttackPower = BitConverter.ToInt16(source, 0x164);
entry.SkillSpeed = BitConverter.ToInt16(source, 0x1C8);

#endregion

#region Mental Properties

entry.SpellSpeed = BitConverter.ToInt16(source, 0x170);
entry.AttackMagicPotency = BitConverter.ToInt16(source, 0x198);
entry.HealingMagicPotency = BitConverter.ToInt16(source, 0x19C);

#endregion

#region Status Resistances

//entry.SlowResistance = BitConverter.ToInt16(source, 0x1C8);
//entry.SilenceResistance = BitConverter.ToInt16(source, 0x1CC);
//entry.BindResistance = BitConverter.ToInt16(source, 0x1D0);
//entry.PoisionResistance = BitConverter.ToInt16(source, 0x1D4);
//entry.StunResistance = BitConverter.ToInt16(source, 0x1D8);
//entry.SleepResistance = BitConverter.ToInt16(source, 0x1DC);
//entry.BindResistance = BitConverter.ToInt16(source, 0x1E0);
//entry.HeavyResistance = BitConverter.ToInt16(source, 0x1E4);

#endregion

#region Elemental Resistances

entry.FireResistance = BitConverter.ToInt16(source, 0x1A8);
entry.IceResistance = BitConverter.ToInt16(source, 0x1AC);
entry.WindResistance = BitConverter.ToInt16(source, 0x1B0);
entry.EarthResistance = BitConverter.ToInt16(source, 0x1B4);
entry.LightningResistance = BitConverter.ToInt16(source, 0x1B8);
entry.WaterResistance = BitConverter.ToInt16(source, 0x1BC);

#endregion

#region Physical Resistances

entry.SlashingResistance = BitConverter.ToInt16(source, 0x188);
entry.PiercingResistance = BitConverter.ToInt16(source, 0x18C);
entry.BluntResistance = BitConverter.ToInt16(source, 0x190);

#endregion

#region Crafting

entry.Craftmanship = BitConverter.ToInt16(source, 0x22C);
entry.Control = BitConverter.ToInt16(source, 0x230);

#endregion

#region Gathering

entry.Gathering = BitConverter.ToInt16(source, 0x234);
entry.Perception = BitConverter.ToInt16(source, 0x238);

#endregion
}
catch (Exception ex)
{
}
return entry;
}
}
}
31 changes: 8 additions & 23 deletions FFXIVAPP.Client/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,21 +532,6 @@ public static void CheckUpdates()
// {
// var key = feature["Hash"].ToString();
// var enabled = (bool) feature["Enabled"];
// switch (key)
// {
// case "E9FA3917-ACEB-47AE-88CC-58AB014058F5":
// XIVDBViewModel.Instance.MonsterUploadEnabled = enabled;
// break;
// case "6D2DB102-B1AE-4249-9E73-4ABC7B1947BC":
// XIVDBViewModel.Instance.NPCUploadEnabled = enabled;
// break;
// case "D95ADD76-7DA7-4692-AD00-DB12F2853908":
// XIVDBViewModel.Instance.KillUploadEnabled = enabled;
// break;
// case "6A50A13B-BA83-45D7-862F-F110049E7E78":
// XIVDBViewModel.Instance.LootUploadEnabled = enabled;
// break;
// }
// }
//}
//catch (Exception ex)
Expand Down Expand Up @@ -619,31 +604,31 @@ public static void SetSignatures()
{
Key = "GAMEMAIN",
Value = "47616D654D61696E000000",
Offset = 1176
Offset = 1248
});
AppViewModel.Instance.Signatures.Add(new Signature
{
Key = "CHARMAP",
Value = "??FFFFFF000000??000000??DB0FC93FDB0F49416F1283????FFFFFF",
Offset = 792
Value = "00000000DB0FC93FDB0F49416F1283????FFFFFF000000??000000??DB0FC93FDB0F49416F1283????FFFFFF",
Offset = 872
});
AppViewModel.Instance.Signatures.Add(new Signature
{
Key = "NPCMAP",
Value = "3E000000????????4000000001000000000000000001000000",
Offset = 2732
Offset = 2716
});
AppViewModel.Instance.Signatures.Add(new Signature
{
Key = "ACTORMAP",
Value = "3E000000????????4000000001000000000000000001000000",
Offset = 1332
Offset = 1316
});
AppViewModel.Instance.Signatures.Add(new Signature
{
Key = "PARTYMAP",
Value = "DB0F49416F1283??FFFFFFFF0000000000000000DB0FC93FDB0F49416F1283??00",
Offset = 56
Offset = 52
});
AppViewModel.Instance.Signatures.Add(new Signature
{
Expand All @@ -660,8 +645,8 @@ public static void SetSignatures()
AppViewModel.Instance.Signatures.Add(new Signature
{
Key = "TARGET",
Value = "40??00000000000000000000000000000000000000000000000000000000????0000????000000000000DB0FC93FDB0F49416F1283??FFFFFFFF",
Offset = 206
Value = "DB0FC93FDB0F49416F1283????FFFFFFDB0FC940920A063F",
Offset = 172
});
AppViewModel.Instance.Signatures.Add(new Signature
{
Expand Down

0 comments on commit a502fc0

Please sign in to comment.