public ActorItem ResolveActorFromBytes(byte[] source, bool isCurrentUser = false, ActorItem existingActorItem = null) { this._foundStatuses.Clear(); ActorItem entry = existingActorItem ?? new ActorItem(); int defaultBaseOffset = this._memoryHandler.Structures.ActorItem.DefaultBaseOffset; int defaultStatOffset = this._memoryHandler.Structures.ActorItem.DefaultStatOffset; int defaultStatusEffectOffset = this._memoryHandler.Structures.ActorItem.DefaultStatusEffectOffset; try { entry.MapTerritory = 0; entry.MapIndex = 0; entry.MapID = 0; entry.TargetID = 0; entry.Name = this._memoryHandler.GetStringFromBytes(source, this._memoryHandler.Structures.ActorItem.Name); entry.ID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.ID); entry.UUID = string.IsNullOrEmpty(entry.UUID) ? Guid.NewGuid().ToString() : entry.UUID; entry.NPCID1 = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.NPCID1); entry.NPCID2 = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.NPCID2); entry.OwnerID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.OwnerID); entry.TypeID = source[this._memoryHandler.Structures.ActorItem.Type]; entry.Type = (Actor.Type)entry.TypeID; entry.TargetTypeID = source[this._memoryHandler.Structures.ActorItem.TargetType]; entry.TargetType = (Actor.TargetType)entry.TargetTypeID; entry.GatheringStatus = source[this._memoryHandler.Structures.ActorItem.GatheringStatus]; entry.Distance = source[this._memoryHandler.Structures.ActorItem.Distance]; entry.X = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.X + defaultBaseOffset); entry.Z = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.Z + defaultBaseOffset); entry.Y = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.Y + defaultBaseOffset); entry.Heading = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.Heading + defaultBaseOffset); entry.HitBoxRadius = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.HitBoxRadius + defaultBaseOffset); entry.Fate = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.Fate + defaultBaseOffset); // ?? entry.TargetFlags = source[this._memoryHandler.Structures.ActorItem.TargetFlags]; // ?? entry.GatheringInvisible = source[this._memoryHandler.Structures.ActorItem.GatheringInvisible]; // ?? entry.ModelID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.ModelID); entry.ActionStatusID = source[this._memoryHandler.Structures.ActorItem.ActionStatus]; entry.ActionStatus = (Actor.ActionStatus)entry.ActionStatusID; // 0x17D - 0 = Green name, 4 = non-agro (yellow name) entry.IsGM = SharlayanBitConverter.TryToBoolean(source, this._memoryHandler.Structures.ActorItem.IsGM); // ? entry.IconID = source[this._memoryHandler.Structures.ActorItem.Icon]; entry.Icon = (Actor.Icon)entry.IconID; entry.StatusID = source[this._memoryHandler.Structures.ActorItem.Status]; entry.Status = (Actor.Status)entry.StatusID; entry.ClaimedByID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.ClaimedByID); uint targetID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.TargetID); uint pcTargetID = targetID; entry.JobID = source[this._memoryHandler.Structures.ActorItem.Job + defaultStatOffset]; entry.Job = (Actor.Job)entry.JobID; entry.Level = source[this._memoryHandler.Structures.ActorItem.Level + defaultStatOffset]; entry.GrandCompany = source[this._memoryHandler.Structures.ActorItem.GrandCompany + defaultStatOffset]; entry.GrandCompanyRank = source[this._memoryHandler.Structures.ActorItem.GrandCompanyRank + defaultStatOffset]; entry.Title = source[this._memoryHandler.Structures.ActorItem.Title + defaultStatOffset]; entry.HPCurrent = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.ActorItem.HPCurrent + defaultStatOffset); entry.HPMax = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.ActorItem.HPMax + defaultStatOffset); entry.MPCurrent = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.ActorItem.MPCurrent + defaultStatOffset); entry.MPMax = 10000; entry.GPCurrent = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.ActorItem.GPCurrent + defaultStatOffset); entry.GPMax = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.ActorItem.GPMax + defaultStatOffset); entry.CPCurrent = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.ActorItem.CPCurrent + defaultStatOffset); entry.CPMax = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.ActorItem.CPMax + defaultStatOffset); // entry.Race = source[0x2578]; // ?? // entry.Sex = (Actor.Sex) source[0x2579]; //? entry.AgroFlags = source[this._memoryHandler.Structures.ActorItem.AgroFlags]; entry.CombatFlags = source[this._memoryHandler.Structures.ActorItem.CombatFlags]; entry.DifficultyRank = source[this._memoryHandler.Structures.ActorItem.DifficultyRank]; entry.CastingID = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.ActorItem.CastingID); // 0x2C94); entry.CastingTargetID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.ActorItem.CastingTargetID); // 0x2CA0); entry.CastingProgress = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.CastingProgress); // 0x2CC4); entry.CastingTime = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.ActorItem.CastingTime); // 0x2DA8); entry.Coordinate = new Coordinate(entry.X, entry.Z, entry.Y); if (targetID > 0) { entry.TargetID = (int)targetID; } else { if (pcTargetID > 0) { entry.TargetID = (int)pcTargetID; } } if (entry.CastingTargetID == 3758096384) { entry.CastingTargetID = 0; } entry.MapIndex = 0; int limit = 60; switch (entry.Type) { case Actor.Type.PC: limit = 30; break; } int statusSize = this._memoryHandler.Structures.StatusItem.SourceSize; byte[] statusesMap = this._memoryHandler.BufferPool.Rent(statusSize * limit); byte[] statusMap = this._memoryHandler.BufferPool.Rent(statusSize); try { Buffer.BlockCopy(source, defaultStatusEffectOffset, statusesMap, 0, limit * statusSize); for (int i = 0; i < limit; i++) { bool isNewStatus = false; Buffer.BlockCopy(statusesMap, i * statusSize, statusMap, 0, statusSize); short statusID = SharlayanBitConverter.TryToInt16(statusMap, this._memoryHandler.Structures.StatusItem.StatusID); uint casterID = SharlayanBitConverter.TryToUInt32(statusMap, this._memoryHandler.Structures.StatusItem.CasterID); StatusItem statusEntry = entry.StatusItems.FirstOrDefault(x => x.CasterID == casterID && x.StatusID == statusID); if (statusEntry == null) { statusEntry = new StatusItem(); isNewStatus = true; } statusEntry.TargetEntity = entry; statusEntry.TargetName = entry.Name; statusEntry.StatusID = statusID; statusEntry.Stacks = statusMap[this._memoryHandler.Structures.StatusItem.Stacks]; statusEntry.Duration = SharlayanBitConverter.TryToSingle(statusMap, this._memoryHandler.Structures.StatusItem.Duration); statusEntry.CasterID = casterID; try { ActorItem pc = this._pcWorkerDelegate.GetActorItem(statusEntry.CasterID); ActorItem npc = this._npcWorkerDelegate.GetActorItem(statusEntry.CasterID); ActorItem monster = this._monsterWorkerDelegate.GetActorItem(statusEntry.CasterID); statusEntry.SourceEntity = (pc ?? npc) ?? monster; } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } try { Models.XIVDatabase.StatusItem statusInfo = StatusEffectLookup.GetStatusInfo((uint)statusEntry.StatusID); if (statusInfo != null) { statusEntry.IsCompanyAction = statusInfo.CompanyAction; string statusKey = statusInfo.Name.English; switch (this._memoryHandler.Configuration.GameLanguage) { case GameLanguage.French: statusKey = statusInfo.Name.French; break; case GameLanguage.Japanese: statusKey = statusInfo.Name.Japanese; break; case GameLanguage.German: statusKey = statusInfo.Name.German; break; case GameLanguage.Chinese: statusKey = statusInfo.Name.Chinese; break; case GameLanguage.Korean: statusKey = statusInfo.Name.Korean; break; } statusEntry.StatusName = statusKey; } } catch (Exception) { statusEntry.StatusName = Constants.UNKNOWN_LOCALIZED_NAME; } if (statusEntry.IsValid()) { if (isNewStatus) { entry.StatusItems.Add(statusEntry); } this._foundStatuses.Add(statusEntry); } } } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } finally { this._memoryHandler.BufferPool.Return(statusesMap); this._memoryHandler.BufferPool.Return(statusMap); } entry.StatusItems.RemoveAll(x => !this._foundStatuses.Contains(x)); // handle empty names if (string.IsNullOrEmpty(entry.Name)) { if (entry.Type == Actor.Type.EventObject) { entry.Name = $"{nameof(entry.EventObjectTypeID)}: {entry.EventObjectTypeID}"; } else { entry.Name = $"{nameof(entry.TypeID)}: {entry.TypeID}"; } } } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } this.CleanXPValue(ref entry); if (isCurrentUser) { this._pcWorkerDelegate.CurrentUser = entry; } return(entry); }
public PartyMember ResolvePartyMemberFromBytes(byte[] source, ActorItem actorItem = null) { this._foundStatuses.Clear(); if (actorItem != null) { PartyMember memberFromActorItem = new PartyMember { X = actorItem.X, Y = actorItem.Y, Z = actorItem.Z, Coordinate = actorItem.Coordinate, ID = actorItem.ID, UUID = actorItem.UUID, Name = actorItem.Name, Job = actorItem.Job, Level = actorItem.Level, HPCurrent = actorItem.HPCurrent, HPMax = actorItem.HPMax, MPCurrent = actorItem.MPCurrent, HitBoxRadius = actorItem.HitBoxRadius, }; memberFromActorItem.StatusItems.AddRange(actorItem.StatusItems); this.CleanXPValue(ref memberFromActorItem); return(memberFromActorItem); } int defaultStatusEffectOffset = this._memoryHandler.Structures.PartyMember.DefaultStatusEffectOffset; PartyMember entry = new PartyMember(); try { const int limit = 15; int statusSize = this._memoryHandler.Structures.StatusItem.SourceSize; byte[] statusesMap = this._memoryHandler.BufferPool.Rent(statusSize * limit); byte[] statusMap = this._memoryHandler.BufferPool.Rent(statusSize); try { entry.X = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.PartyMember.X); entry.Z = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.PartyMember.Z); entry.Y = SharlayanBitConverter.TryToSingle(source, this._memoryHandler.Structures.PartyMember.Y); entry.Coordinate = new Coordinate(entry.X, entry.Z, entry.Z); entry.ID = SharlayanBitConverter.TryToUInt32(source, this._memoryHandler.Structures.PartyMember.ID); entry.UUID = Guid.NewGuid().ToString(); entry.Name = this._memoryHandler.GetStringFromBytes(source, this._memoryHandler.Structures.PartyMember.Name); entry.JobID = source[this._memoryHandler.Structures.PartyMember.Job]; entry.Job = (Actor.Job)entry.JobID; entry.HitBoxRadius = 0.5f; entry.Level = source[this._memoryHandler.Structures.PartyMember.Level]; entry.HPCurrent = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PartyMember.HPCurrent); entry.HPMax = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PartyMember.HPMax); entry.MPCurrent = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PartyMember.MPCurrent); Buffer.BlockCopy(source, defaultStatusEffectOffset, statusesMap, 0, limit * statusSize); for (int i = 0; i < limit; i++) { bool isNewStatus = false; Buffer.BlockCopy(statusesMap, i * statusSize, statusMap, 0, statusSize); short statusID = SharlayanBitConverter.TryToInt16(statusMap, this._memoryHandler.Structures.StatusItem.StatusID); uint casterID = SharlayanBitConverter.TryToUInt32(statusMap, this._memoryHandler.Structures.StatusItem.CasterID); StatusItem statusEntry = entry.StatusItems.FirstOrDefault(x => x.CasterID == casterID && x.StatusID == statusID); if (statusEntry == null) { statusEntry = new StatusItem(); isNewStatus = true; } statusEntry.TargetEntity = null; statusEntry.TargetName = entry.Name; statusEntry.StatusID = statusID; statusEntry.Stacks = statusMap[this._memoryHandler.Structures.StatusItem.Stacks]; statusEntry.Duration = SharlayanBitConverter.TryToSingle(statusMap, this._memoryHandler.Structures.StatusItem.Duration); statusEntry.CasterID = casterID; this._foundStatuses.Add(statusEntry); try { ActorItem pc = this._pcWorkerDelegate.GetActorItem(statusEntry.CasterID); ActorItem npc = this._npcWorkerDelegate.GetActorItem(statusEntry.CasterID); ActorItem monster = this._monsterWorkerDelegate.GetActorItem(statusEntry.CasterID); statusEntry.SourceEntity = (pc ?? npc) ?? monster; } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } try { if (statusEntry.StatusID > 0) { Models.XIVDatabase.StatusItem statusInfo = StatusEffectLookup.GetStatusInfo((uint)statusEntry.StatusID); statusEntry.IsCompanyAction = statusInfo.CompanyAction; string statusKey = statusInfo.Name.English; switch (this._memoryHandler.Configuration.GameLanguage) { case GameLanguage.French: statusKey = statusInfo.Name.French; break; case GameLanguage.Japanese: statusKey = statusInfo.Name.Japanese; break; case GameLanguage.German: statusKey = statusInfo.Name.German; break; case GameLanguage.Chinese: statusKey = statusInfo.Name.Chinese; break; case GameLanguage.Korean: statusKey = statusInfo.Name.Korean; break; } statusEntry.StatusName = statusKey; } } catch (Exception) { statusEntry.StatusName = Constants.UNKNOWN_LOCALIZED_NAME; } if (statusEntry.IsValid()) { if (isNewStatus) { entry.StatusItems.Add(statusEntry); } this._foundStatuses.Add(statusEntry); } } } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } finally { this._memoryHandler.BufferPool.Return(statusesMap); this._memoryHandler.BufferPool.Return(statusMap); } entry.StatusItems.RemoveAll(x => !this._foundStatuses.Contains(x)); } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } this.CleanXPValue(ref entry); return(entry); }
public PlayerInfo ResolvePlayerFromBytes(byte[] source) { PlayerInfo entry = new PlayerInfo(); try { switch (this._memoryHandler.Configuration.GameLanguage) { default: entry.JobID = source[this._memoryHandler.Structures.PlayerInfo.JobID]; entry.Job = (Actor.Job)entry.JobID; #region Job Levels entry.PGL = source[this._memoryHandler.Structures.PlayerInfo.PGL]; entry.GLD = source[this._memoryHandler.Structures.PlayerInfo.GLD]; entry.MRD = source[this._memoryHandler.Structures.PlayerInfo.MRD]; entry.ARC = source[this._memoryHandler.Structures.PlayerInfo.ARC]; entry.LNC = source[this._memoryHandler.Structures.PlayerInfo.LNC]; entry.THM = source[this._memoryHandler.Structures.PlayerInfo.THM]; entry.CNJ = source[this._memoryHandler.Structures.PlayerInfo.CNJ]; entry.CPT = source[this._memoryHandler.Structures.PlayerInfo.CPT]; entry.BSM = source[this._memoryHandler.Structures.PlayerInfo.BSM]; entry.ARM = source[this._memoryHandler.Structures.PlayerInfo.ARM]; entry.GSM = source[this._memoryHandler.Structures.PlayerInfo.GSM]; entry.LTW = source[this._memoryHandler.Structures.PlayerInfo.LTW]; entry.WVR = source[this._memoryHandler.Structures.PlayerInfo.WVR]; entry.ALC = source[this._memoryHandler.Structures.PlayerInfo.ALC]; entry.CUL = source[this._memoryHandler.Structures.PlayerInfo.CUL]; entry.MIN = source[this._memoryHandler.Structures.PlayerInfo.MIN]; entry.BTN = source[this._memoryHandler.Structures.PlayerInfo.BTN]; entry.FSH = source[this._memoryHandler.Structures.PlayerInfo.FSH]; entry.ACN = source[this._memoryHandler.Structures.PlayerInfo.ACN]; entry.ROG = source[this._memoryHandler.Structures.PlayerInfo.ROG]; entry.MCH = source[this._memoryHandler.Structures.PlayerInfo.MCH]; entry.DRK = source[this._memoryHandler.Structures.PlayerInfo.DRK]; entry.AST = source[this._memoryHandler.Structures.PlayerInfo.AST]; entry.SAM = source[this._memoryHandler.Structures.PlayerInfo.SAM]; entry.RDM = source[this._memoryHandler.Structures.PlayerInfo.RDM]; entry.BLU = source[this._memoryHandler.Structures.PlayerInfo.BLU]; entry.DNC = source[this._memoryHandler.Structures.PlayerInfo.DNC]; entry.GNB = source[this._memoryHandler.Structures.PlayerInfo.GNB]; #endregion #region Current Experience entry.PGL_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.PGL_CurrentEXP); entry.GLD_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.GLD_CurrentEXP); entry.MRD_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.MRD_CurrentEXP); entry.ARC_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.ARC_CurrentEXP); entry.LNC_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.LNC_CurrentEXP); entry.THM_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.THM_CurrentEXP); entry.CNJ_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.CNJ_CurrentEXP); entry.CPT_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.CPT_CurrentEXP); entry.BSM_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.BSM_CurrentEXP); entry.ARM_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.ARM_CurrentEXP); entry.GSM_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.GSM_CurrentEXP); entry.LTW_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.LTW_CurrentEXP); entry.WVR_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.WVR_CurrentEXP); entry.ALC_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.ALC_CurrentEXP); entry.CUL_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.CUL_CurrentEXP); entry.MIN_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.MIN_CurrentEXP); entry.BTN_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.BTN_CurrentEXP); entry.FSH_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.FSH_CurrentEXP); entry.ACN_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.ACN_CurrentEXP); entry.ROG_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.ROG_CurrentEXP); entry.MCH_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.MCH_CurrentEXP); entry.DRK_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.DRK_CurrentEXP); entry.AST_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.AST_CurrentEXP); entry.SAM_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.SAM_CurrentEXP); entry.RDM_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.RDM_CurrentEXP); entry.BLU_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.BLU_CurrentEXP); entry.DNC_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.DNC_CurrentEXP); entry.GNB_CurrentEXP = SharlayanBitConverter.TryToInt32(source, this._memoryHandler.Structures.PlayerInfo.GNB_CurrentEXP); #endregion #region Base Stats entry.BaseStrength = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BaseStrength); entry.BaseDexterity = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BaseDexterity); entry.BaseVitality = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BaseVitality); entry.BaseIntelligence = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BaseIntelligence); entry.BaseMind = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BaseMind); entry.BasePiety = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BasePiety); entry.BaseSubstat = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BaseSubstat); #endregion #region Base Stats (base+gear+bonus) entry.Strength = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Strength); entry.Dexterity = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Dexterity); entry.Vitality = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Vitality); entry.Intelligence = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Intelligence); entry.Mind = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Mind); entry.Piety = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Piety); #endregion #region Basic Info entry.HPMax = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.HPMax); entry.GPMax = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.GPMax); entry.CPMax = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.CPMax); #endregion #region Offensive Properties entry.DirectHit = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.DirectHit); entry.CriticalHitRate = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.CriticalHitRate); entry.Determination = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Determination); #endregion #region Defensive Properties entry.Tenacity = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Tenacity); entry.Defense = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Defense); entry.MagicDefense = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.MagicDefense); #endregion #region Phyiscal Properties entry.AttackPower = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.AttackPower); entry.SkillSpeed = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.SkillSpeed); #endregion #region Mental Properties entry.SpellSpeed = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.SpellSpeed); entry.AttackMagicPotency = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.AttackMagicPotency); entry.HealingMagicPotency = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.HealingMagicPotency); #endregion #region Elemental Resistances entry.FireResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.FireResistance); entry.IceResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.IceResistance); entry.WindResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.WindResistance); entry.EarthResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.EarthResistance); entry.LightningResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.LightningResistance); entry.WaterResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.WaterResistance); #endregion #region Physical Resistances entry.SlashingResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.SlashingResistance); entry.PiercingResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.PiercingResistance); entry.BluntResistance = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.BluntResistance); #endregion #region Crafting entry.Craftmanship = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Craftmanship); entry.Control = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Control); #endregion #region Gathering entry.Gathering = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Gathering); entry.Perception = SharlayanBitConverter.TryToInt16(source, this._memoryHandler.Structures.PlayerInfo.Perception); #endregion break; } } catch (Exception ex) { this._memoryHandler.RaiseException(Logger, ex); } return(entry); }