Skip to content

Commit

Permalink
Merge pull request #518 from pacampbell/investigate_pawn_issues
Browse files Browse the repository at this point in the history
fix: Fix issue where pawn skills can't be previewed
  • Loading branch information
pacampbell authored Sep 1, 2024
2 parents 260373c + 97eae18 commit 68b4587
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override S2CPawnGetRegisteredPawnDataRes Handle(GameClient client, C2SPaw
break;
}

res.PawnInfo = pawn.AsCDataPawnInfo();
GameStructure.CDataPawnInfo(res.PawnInfo, pawn);

return res;
}
Expand Down
2 changes: 1 addition & 1 deletion Arrowgene.Ddon.Shared/Entity/Structure/CDataPawnInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CDataPawnInfo()
public byte ShareRange { get; set; }
public uint Likability { get; set; }
public byte[] TrainingStatus { get; set; }
public CData_772E80 Unk1 { get; set; }
public CData_772E80 Unk1 { get; set; } // Dragon abilities?
public List<CDataSpSkill> SpSkillList { get; set; }

public class Serializer : EntitySerializer<CDataPawnInfo>
Expand Down
15 changes: 15 additions & 0 deletions Arrowgene.Ddon.Shared/Model/Pawn.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using Arrowgene.Ddon.Shared.Entity.Structure;

namespace Arrowgene.Ddon.Shared.Model
Expand Down Expand Up @@ -73,13 +74,27 @@ public CDataPawnInfo AsCDataPawnInfo()
Version = 0,
MaxHp = StatusInfo.MaxHP,
MaxStamina = StatusInfo.MaxStamina,
JewelrySlotNum = JewelrySlotNum,
JobId = ActiveCharacterJobData.Job,
CharacterJobDataList = CharacterJobDataList,
CharacterEquipDataList = new List<CDataCharacterEquipData>() { new CDataCharacterEquipData { Equips = Equipment.AsCDataEquipItemInfo(EquipType.Performance) } },
CharacterEquipViewDataList = new List<CDataCharacterEquipData>() { new CDataCharacterEquipData { Equips = Equipment.AsCDataEquipItemInfo(EquipType.Visual) } },
CharacterEquipJobItemList = EquipmentTemplate.JobItemsAsCDataEquipJobItem(ActiveCharacterJobData.Job),
HideEquipHead = HideEquipHead,
HideEquipLantern = HideEquipLantern,
PawnType = PawnType,
ContextAbilityList = EquippedAbilitiesDictionary[ActiveCharacterJobData.Job]
.Select((ability, index) => ability?
.AsCDataContextAcquirementData((byte)(index + 1)))
.Where(ability => ability != null)
.ToList(),
ContextNormalSkillList = LearnedNormalSkills.Select(normalSkill => new CDataContextNormalSkillData(normalSkill)).ToList(),
ContextSkillList = EquippedCustomSkillsDictionary[ActiveCharacterJobData.Job]
.Select((skill, index) => skill?.AsCDataContextAcquirementData((byte)(index + 1)))
.Where(skill => skill != null)
.ToList(),
ExtendParam = ExtendedParams,
// TODO: Add rest of fileds so full structure can be populated here
};
}
}
Expand Down

0 comments on commit 68b4587

Please sign in to comment.