Skip to content

Commit

Permalink
Decode a bunch of MyRoom- and Mandragora-related packets.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sehkah committed Sep 1, 2024
1 parent 260373c commit 5d95816
Show file tree
Hide file tree
Showing 57 changed files with 3,528 additions and 457 deletions.
3 changes: 3 additions & 0 deletions Arrowgene.Ddon.GameServer/DdonGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,11 @@ private void LoadPacketHandler()
AddHandler(new OrbDevoteGetPawnReleaseOrbElementListHandler(this));
AddHandler(new OrbDevoteReleasePawnOrbElementHandler(this));

AddHandler(new PartnerPawnSetHandler(this));
AddHandler(new PartnerPawnPawnLikabilityReleasedRewardListGetHandler(this));
AddHandler(new PartnerPawnPawnLikabilityRewardListGetHandler(this));
AddHandler(new PartnerPawnPawnLikabilityRewardGetHandler(this));

AddHandler(new PartyMemberSetValueHandler(this));
AddHandler(new PartyPartyBreakupHandler(this));
AddHandler(new PartyPartyChangeLeaderHandler(this));
Expand Down
1,281 changes: 1,281 additions & 0 deletions Arrowgene.Ddon.GameServer/Dump/InGameDump.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Arrowgene.Ddon.GameServer/GameStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static void CDataPawnInfo(CDataPawnInfo cDataPawnInfo, Pawn pawn)
cDataPawnInfo.Version = 0;
cDataPawnInfo.Name = pawn.Name;
cDataPawnInfo.EditInfo = pawn.EditInfo;
cDataPawnInfo.State = 0; // TODO: ?
cDataPawnInfo.State = pawn.State;
cDataPawnInfo.MaxHp = pawn.StatusInfo.MaxHP;
cDataPawnInfo.MaxStamina = pawn.StatusInfo.MaxStamina;
cDataPawnInfo.JobId = pawn.Job;
Expand Down Expand Up @@ -159,7 +159,7 @@ public static void CDataPawnInfo(CDataPawnInfo cDataPawnInfo, Pawn pawn)
cDataPawnInfo.ShareRange = 1;
cDataPawnInfo.Likability = 2;
cDataPawnInfo.TrainingStatus = pawn.TrainingStatus.GetValueOrDefault(pawn.Job, new byte[64]);
cDataPawnInfo.Unk1 = new CData_772E80() {Unk0 = 0x7530, Unk1 = 0x3, Unk2 = 0x3, Unk3 = 0x1, Unk4 = 0x3};
cDataPawnInfo.PawnTrainingProfile = new CDataPawnTrainingProfile() {TrainingExp = 1422, DialogCount = 1, DialogCountMax = 3, AttackFrequencyAndDistance = 5, TrainingLv = 5};
cDataPawnInfo.SpSkillList = pawn.SpSkills.GetValueOrDefault(pawn.Job, new List<CDataSpSkill>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public override void Handle(GameClient client, StructurePacket<C2SCharacterDecid
new CDataCharacterReleaseElement(ContentsRelease.DressEquipment),
new CDataCharacterReleaseElement(ContentsRelease.FeryanaWildernessWorldQuests),
new CDataCharacterReleaseElement(ContentsRelease.LestaniaNews),
// new CDataCharacterReleaseElement(ContentsRelease.MandragoraBreeding),
new CDataCharacterReleaseElement(ContentsRelease.MandragoraBreeding),
new CDataCharacterReleaseElement(ContentsRelease.JobTrainingLog),
new CDataCharacterReleaseElement(ContentsRelease.YourRoomsTerrace),
new CDataCharacterReleaseElement(ContentsRelease.DragonForceAugmentation),
Expand All @@ -80,14 +80,14 @@ public override void Handle(GameClient client, StructurePacket<C2SCharacterDecid
new CDataCharacterReleaseElement(ContentsRelease.ExtremeMission1),
new CDataCharacterReleaseElement(ContentsRelease.ChangeVocations),
new CDataCharacterReleaseElement(ContentsRelease.ExtremeMission2),
// new CDataCharacterReleaseElement(ContentsRelease.CreateandJoinClans),
new CDataCharacterReleaseElement(ContentsRelease.CreateandJoinClans),
new CDataCharacterReleaseElement(ContentsRelease.ExtremeMission3),
new CDataCharacterReleaseElement(ContentsRelease.MainMenu),
new CDataCharacterReleaseElement(ContentsRelease.AppraisalExchangeofDragonArmor),
new CDataCharacterReleaseElement(ContentsRelease.MyrmidonsPledge),
new CDataCharacterReleaseElement(ContentsRelease.AdventureBroker), // This was called "PartyMenu" or "冒険仲介係"
new CDataCharacterReleaseElement(ContentsRelease.MatchingProfile),
// new CDataCharacterReleaseElement(ContentsRelease.QuickParty),
new CDataCharacterReleaseElement(ContentsRelease.QuickParty),
new CDataCharacterReleaseElement(ContentsRelease.OrbEnemy),
new CDataCharacterReleaseElement(ContentsRelease.WarSkillAugmentation),
new CDataCharacterReleaseElement(ContentsRelease.FighterWarSkillAugmentation),
Expand Down
18 changes: 18 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/CraftGetCraftProductHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
using Arrowgene.Ddon.Shared.Entity.Structure;
Expand Down Expand Up @@ -34,6 +35,23 @@ public override C2SCraftGetCraftProductRes Handle(GameClient client, C2SCraftGet

Server.Database.DeletePawnCraftProgress(client.Character.CharacterId, request.CraftMainPawnID);

client.Character.Pawns.First(p => p.PawnId == request.CraftMainPawnID).State = PawnState.None;
Pawn supportPawn1 = client.Character.Pawns.FirstOrDefault(p => p.PawnId == craftProgress.CraftSupportPawnId1, null);
if (supportPawn1 != null)
{
supportPawn1.State = PawnState.None;
}
Pawn supportPawn2 = client.Character.Pawns.FirstOrDefault(p => p.PawnId == craftProgress.CraftSupportPawnId2, null);
if (supportPawn2 != null)
{
supportPawn2.State = PawnState.None;
}
Pawn supportPawn3 = client.Character.Pawns.FirstOrDefault(p => p.PawnId == craftProgress.CraftSupportPawnId3, null);
if (supportPawn3 != null)
{
supportPawn3.State = PawnState.None;
}

return craftGetCraftProductRes;
}
}
Expand Down
4 changes: 4 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/CraftStartCraftHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ public override S2CCraftStartCraftRes Handle(GameClient client, C2SCraftStartCra
}

Server.Database.InsertPawnCraftProgress(craftProgress);
foreach (Pawn pawn in pawns)
{
pawn.State = PawnState.Craft;
}

// Subtract craft price
CDataUpdateWalletPoint updateWalletPoint = Server.WalletManager.RemoveFromWallet(client.Character, WalletType.Gold,
Expand Down
237 changes: 227 additions & 10 deletions Arrowgene.Ddon.GameServer/Handler/MandragoraGetMyMandragoraHandler.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,244 @@
using Arrowgene.Buffers;
using Arrowgene.Ddon.GameServer.Dump;
using System.Collections.Generic;
using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Ddon.Shared.Network;
using Arrowgene.Logging;
using Arrowgene.Ddon.Shared.Entity.PacketStructure;
using Arrowgene.Ddon.Shared.Entity.Structure;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class MandragoraGetMyMandragoraHandler : StructurePacketHandler<GameClient, C2SMandragoraGetMyMandragoraReq>
public class MandragoraGetMyMandragoraHandler : GameRequestPacketHandler<C2SMandragoraGetMyMandragoraReq, S2CMandragoraGetMyMandragoraRes>
{
private static readonly ServerLogger Logger = LogProvider.Logger<ServerLogger>(typeof(MandragoraGetMyMandragoraHandler));

public MandragoraGetMyMandragoraHandler(DdonGameServer server) : base(server)
{
}

public override void Handle(GameClient client, StructurePacket<C2SMandragoraGetMyMandragoraReq> req)
public override S2CMandragoraGetMyMandragoraRes Handle(GameClient client, C2SMandragoraGetMyMandragoraReq request)
{
S2CMandragoraGetMyMandragoraRes res = new S2CMandragoraGetMyMandragoraRes();
res.MandragoraReq = req.Structure;
res.MyRoomCsv = Server.AssetRepository.MyRoomAsset;
client.Send(res);

res.MandragoraFurnitureItemList = new List<CDataMyMandragoraFurnitureItem>
{
new()
{
MandragoraId = 1,
FurnitureItemId = 17370
},
new()
{
MandragoraId = 2,
FurnitureItemId = 17371
},
new()
{
MandragoraId = 3,
FurnitureItemId = 17372
}
};

res.MandragoraList = new List<CDataMyMandragora>
{
new CDataMyMandragora()
{
Unk0 = 1,
Unk1 = 1,
MandragoraId = 1,
MandragoraName = "Scoperta",
Unk4 = 0,
Unk5 = 0,
Unk6 = 1,
Unk7 = new CDataMyMandragoraUnk1Unk7
{
Unk0 = 1,
Unk1 = 0,
Unk2 = new List<CDataMyMandragoraUnk1Unk7Unk2>(),
Unk3 = 0
}
},
new CDataMyMandragora
{
Unk0 = 1,
Unk1 = 1,
MandragoraId = 2,
MandragoraName = "Creazione",
Unk4 = 0,
Unk5 = 0,
Unk6 = 5,
Unk7 = new CDataMyMandragoraUnk1Unk7
{
Unk0 = 2,
Unk1 = 0,
Unk2 = new List<CDataMyMandragoraUnk1Unk7Unk2>(),
Unk3 = 0
}
},
new CDataMyMandragora
{
Unk0 = 0,
Unk1 = 0,
MandragoraId = 3,
MandragoraName = "Strano",
Unk4 = 0,
Unk5 = 0,
Unk6 = 4,
Unk7 = new CDataMyMandragoraUnk1Unk7
{
Unk0 = 3,
Unk1 = 0,
Unk2 = new List<CDataMyMandragoraUnk1Unk7Unk2>(),
Unk3 = 0
}
}
};

res.MandragoraCraftCategoriesMaybe = new List<CDataMyMandragoraCraftCategory>
{
new CDataMyMandragoraCraftCategory
{
CategoryId = 1,
CategoryName = "Dungeon Tickets"
},
new CDataMyMandragoraCraftCategory
{
CategoryId = 2,
CategoryName = "Materials"
}
};

res.Unk3 = new List<CDataMyMandragoraUnk3>
{
new CDataMyMandragoraUnk3
{
Unk0 = 5,
Unk1 = 1
}
};

res.MandragoraFertilizerItemList = new List<CDataMyMandragoraFertilizerItem>
{
new CDataMyMandragoraFertilizerItem
{
ItemId = 17959,
ItemNum = 1
}
};

res.MandragoraCultivationMaterialMaxMaybe = 20;

res.MandragoraBreedTypeList = new List<CDataMyMandragoraBreedType>
{
new CDataMyMandragoraBreedType
{
BreedId = 1,
BreedName = "ノーマル種",
DiscoveredBreedNumMaybe = 1
},
new CDataMyMandragoraBreedType
{
BreedId = 2,
BreedName = "チリ種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 4,
BreedName = "アルビノ種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 6,
BreedName = "チャコ種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 9,
BreedName = "ベジ種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 3,
BreedName = "鎧亜種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 5,
BreedName = "衣亜種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 7,
BreedName = "花亜種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 8,
BreedName = "蛮亜種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 11,
BreedName = "巻亜種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 10,
BreedName = "鉢亜種",
DiscoveredBreedNumMaybe = 0
},
new CDataMyMandragoraBreedType
{
BreedId = 99,
BreedName = "特別種",
DiscoveredBreedNumMaybe = 0
}
};

res.RarityLevelList = new List<CDataMyMandragoraRarityLevel>
{
new CDataMyMandragoraRarityLevel
{
RarityId = 1,
Rarity = "Limited Rare"
},
new CDataMyMandragoraRarityLevel
{
RarityId = 2,
Rarity = "Common"
},
new CDataMyMandragoraRarityLevel
{
RarityId = 3,
Rarity = "Uncommon"
},
new CDataMyMandragoraRarityLevel
{
RarityId = 4,
Rarity = "Rare"
},
new CDataMyMandragoraRarityLevel
{
RarityId = 5,
Rarity = "Mystic Rare"
}
};

res.FreeMandragoraIdListMaybe = new List<CDataCommonU8>
{
new CDataCommonU8(1),
new CDataCommonU8(2),
new CDataCommonU8(3)
};

return res;
}
}
}
Loading

0 comments on commit 5d95816

Please sign in to comment.