Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void Onslaught()
- {
- var valids = new List<string>()
- {
- "m30_00_00_00.msb.dcx",
- "m30_01_00_00.msb.dcx",
- "m31_00_00_00.msb.dcx",
- "m32_00_00_00.msb.dcx",
- "m33_00_00_00.msb.dcx",
- "m34_01_00_00.msb.dcx",
- "m35_00_00_00.msb.dcx",
- "m37_00_00_00.msb.dcx",
- "m38_00_00_00.msb.dcx",
- "m39_00_00_00.msb.dcx",
- "m40_00_00_00.msb.dcx",
- "m41_00_00_00.msb.dcx",
- "m45_00_00_00.msb.dcx",
- "m50_00_00_00.msb.dcx",
- "m51_00_00_00.msb.dcx",
- "m51_01_00_00.msb.dcx",
- };
- string p = ds3 + @"\map\mapstudio";
- string o = @"D:\Programs\Dark Souls\Dark Souls 3\Onslaught";
- foreach (string file in Directory.GetFiles(p, "*.msb.dcx"))
- {
- if (!valids.Contains(Path.GetFileName(file)))
- continue;
- if (!File.Exists(file + ".bak"))
- File.Copy(file, file + ".bak");
- Directory.CreateDirectory($"{o}\\Vanilla\\map\\mapstudio");
- File.Copy(file + ".bak", $"{o}\\Vanilla\\map\\mapstudio\\{Path.GetFileName(file)}", true);
- }
- for (int clones = 1; clones < 5; clones++)
- {
- Parallel.ForEach(Directory.GetFiles(p, "*.msb.dcx"), (file) =>
- {
- if (!valids.Contains(Path.GetFileName(file)))
- return;
- MSB3 msb = MSB3.Read(file + ".bak");
- var guys = new List<MSB3.Part.Enemy>();
- foreach (var guy in msb.Parts.Enemies)
- {
- if (
- // Weird stuff
- guy.ModelName != "c0100"
- // Talkable dummy like bonfire
- && guy.ModelName != "c1000"
- // Pontiff's Shade
- //&& guy.NPCParamID != 514010
- // Lothric + Lorian
- && guy.NPCParamID != 525001
- // King of the Storm
- //&& guy.ModelName != "c5030"
- // Unused Demon Prince
- && guy.NPCParamID != 502000
- // Demon Prince attack
- && guy.ModelName != "c5021"
- // Also Demon Prince attack
- && guy.ModelName != "c5022"
- // Gael 2
- //&& guy.ModelName != "c6200"
- )
- {
- for (int i = 0; i < clones; i++)
- {
- var newGuy = new MSB3.Part.Enemy(guy);
- newGuy.Name += $"_x{i}";
- newGuy.ID = msb.Parts.Enemies.Count + guys.Count;
- newGuy.EventEntityID = -1;
- newGuy.TalkID = 0;
- guys.Add(newGuy);
- }
- }
- }
- msb.Parts.Enemies.AddRange(guys);
- foreach (var col in msb.Parts.Collisions)
- col.DisableBonfireEntityID = -1;
- string dir = $"{o}\\{clones + 1}x Enemies\\map\\mapstudio";
- Directory.CreateDirectory(dir);
- msb.Write($"{dir}\\{Path.GetFileName(file)}");
- });
- }
- BND4 bnd = SFUtil.DecryptDS3Regulation(ds3Reg + ".bak");
- foreach (BND4.File file in bnd.Files)
- {
- if (Path.GetFileName(file.Name) == "NpcThinkParam.param")
- {
- PARAM64 param = PARAM64.Read(file.Bytes);
- PARAM64.Layout layout = PARAM64.Layout.ReadXMLFile("Layouts\\" + param.ID + ".xml");
- param.SetLayout(layout);
- foreach (var row in param.Rows)
- row["teamAttackEffectivity"].Value = (byte)0;
- file.Bytes = param.Write();
- }
- }
- SFUtil.EncryptDS3Regulation(o + "\\Impolite Enemies\\Data0.bdt", bnd);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement