完善
This commit is contained in:
parent
7e1040d4a9
commit
5bc99543a3
@ -13,9 +13,16 @@ namespace MHFQuestToMH2Dos
|
||||
const int cMax_MonsterID = 0x49;
|
||||
const int cMax_ItemID = 0x031D;
|
||||
|
||||
const int cMax_GuTi = 0x14;
|
||||
const int cMax_GuTi = 0xA;
|
||||
const int cMax_QuestStar = 8;
|
||||
|
||||
const int cModify_QuestID = 0xEA74;
|
||||
|
||||
/// <summary>
|
||||
/// 道具ID超出最大限制时,修改为【不可燃烧的废物】
|
||||
/// </summary>
|
||||
const int cModify_OutOfItemID = 0x00AE;
|
||||
|
||||
/// <summary>
|
||||
/// Dos中无意义数据
|
||||
/// </summary>
|
||||
@ -279,7 +286,7 @@ namespace MHFQuestToMH2Dos
|
||||
//整个长度
|
||||
int QuestContenAllLenght = QuestQuestMsgPtr_CurrIndex - _QuestNametPtr;
|
||||
|
||||
Log.HexInfo(_QuestContentPtr, "确定【文本组】结束位置{0},整个长度{1}", _QuestNametPtr, QuestContenAllLenght);
|
||||
Log.HexInfo(QuestQuestMsgPtr_CurrIndex, "确定【文本组】结束位置{0},整个长度{1}", _QuestNametPtr, QuestContenAllLenght);
|
||||
|
||||
Log.HexInfo(_QuestNametPtr, "取出【任务文本】原始数据");
|
||||
//取出原始数据
|
||||
@ -366,7 +373,16 @@ namespace MHFQuestToMH2Dos
|
||||
|
||||
//任务星
|
||||
int _QuestStart = HexHelper.bytesToInt(target, cQuestInfo_Star_Lenght, _QuestInfoPtr + cQuestInfo_Star_Offset);
|
||||
|
||||
if (_QuestStart > cMax_QuestStar)
|
||||
{
|
||||
Log.HexWar(_QuestInfoPtr + cQuestInfo_Star_Offset, "任务星级超出限制 ->{0},修正为2Dos星最大值{1}", _QuestStart, cMax_QuestStar);
|
||||
HexHelper.ModifyIntHexToBytes(target, cMax_QuestStar, _QuestInfoPtr + cQuestInfo_Star_Offset, cQuestInfo_Star_Lenght);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.HexColor(ConsoleColor.Magenta, _QuestInfoPtr + cQuestInfo_Star_Offset, "任务星级->{0}", _QuestStart);
|
||||
}
|
||||
|
||||
int _QuestTargetMapID = HexHelper.bytesToInt(target, cQuestInfo_TargetMapID_Lenght, _QuestInfoPtr + cQuestInfo_TargetMap_Offset);
|
||||
if (_QuestTargetMapID > cMax_MapID)
|
||||
@ -380,6 +396,11 @@ namespace MHFQuestToMH2Dos
|
||||
|
||||
uint _QuestID = HexHelper.bytesToUInt(target, cQuestInfo_QuestID_Lenght, _QuestInfoPtr + cQuestInfo_QuestID_Offset);
|
||||
Log.HexTips(_QuestInfoPtr + cQuestInfo_QuestID_Offset, "任务编号【{0}】", _QuestID);
|
||||
if (_QuestID < 60000)
|
||||
{
|
||||
HexHelper.ModifyIntHexToBytes(target, cModify_QuestID, _QuestInfoPtr + cQuestInfo_QuestID_Offset, cQuestInfo_QuestID_Lenght);
|
||||
Log.HexTips(_QuestInfoPtr + cQuestInfo_QuestID_Offset, "任务编号【{0}】小于60000,修正为【{1}】,使其可下载", _QuestID, cModify_QuestID);
|
||||
}
|
||||
|
||||
//从前4字节取出指针 定位任务信息位置
|
||||
int _QuestContentPtr = HexHelper.bytesToInt(target, 4, _QuestInfoPtr + 36);
|
||||
@ -395,8 +416,8 @@ namespace MHFQuestToMH2Dos
|
||||
|
||||
if (_GuTiValue > cMax_GuTi)
|
||||
{
|
||||
|
||||
Log.HexColor(ConsoleColor.Blue, 0x48, "固体值 ->{0}", _GuTiValue);
|
||||
Log.HexWar(0x48, "固体值超出限制 ->{0},修正为2Dos最大值{1}", _GuTiValue, cMax_GuTi);
|
||||
HexHelper.ModifyIntHexToBytes(target, cMax_GuTi, 0x48, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -497,9 +518,11 @@ namespace MHFQuestToMH2Dos
|
||||
int ItemID = HexHelper.bytesToInt(target, 2, CurrPtr + 0x02);//道具ID
|
||||
int count = HexHelper.bytesToInt(target, 2, CurrPtr + 0x04);//数量
|
||||
|
||||
//判断道具ID是否超限
|
||||
if (ItemID > cMax_ItemID)
|
||||
{
|
||||
Log.HexWar(CurrPtr, "第{0}个报酬道具,ID->{1}道具ID超出最大可能{2},属于MHF道具【" + MHHelper.Get2MHFItemName(ItemID) + "】", setCount, ItemID, cMax_ItemID);
|
||||
Log.HexWar(CurrPtr, "第{0}个报酬道具,ID->{1}道具ID超出最大可能{2},属于MHF道具【" + MHHelper.Get2MHFItemName(ItemID) + "】,将其修正为【不可燃烧的废物】ID->{3}", setCount, ItemID, cMax_ItemID, cModify_OutOfItemID);
|
||||
HexHelper.ModifyIntHexToBytes(target, cModify_OutOfItemID, CurrPtr + 0x02, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -507,7 +530,6 @@ namespace MHFQuestToMH2Dos
|
||||
Log.HexColor(ConsoleColor.Green,CurrPtr,"第{0}个报酬道具,道具ID->{1} 【"+ MHHelper.Get2DosItemName(ItemID) + "】 概率->{2} 数量->{3}", setCount, ItemID, Pr, count);
|
||||
}
|
||||
|
||||
//TODO 判断道具ID是否超限
|
||||
CurrPtr += 0x06;//前推游标
|
||||
}
|
||||
}
|
||||
@ -552,11 +574,9 @@ namespace MHFQuestToMH2Dos
|
||||
//报酬组类型
|
||||
int _BOSSID = HexHelper.bytesToInt(target, 0x04, CurrPtr);
|
||||
|
||||
|
||||
|
||||
if (_BOSSID > cMax_MonsterID)
|
||||
{
|
||||
Log.HexWar(CurrPtr, "第{0}个BOSS,ID->{1} 大于了 最大ID{2} 属于MHF怪物", BOSSIndex, _BOSSID, cMax_MonsterID);
|
||||
Log.HexWar(CurrPtr, "第{0}个BOSS,ID->{1} 大于了 最大ID{2} 属于MHF怪物,该任务无法使用", BOSSIndex, _BOSSID, cMax_MonsterID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
19
Program.cs
19
Program.cs
@ -8,10 +8,14 @@ namespace MHFQuestToMH2Dos
|
||||
|
||||
const string InDir = "Input";
|
||||
const string OutDir = "Out";
|
||||
const string Ver = "0.2.1";
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.Title = "MHFQuestToMH2Dos By 皓月云 axibug.com";
|
||||
string title = $"MHFQuestToMH2Dos Ver.{Ver} By 皓月云 axibug.com";
|
||||
Console.Title = title;
|
||||
Console.WriteLine(title);
|
||||
|
||||
if (!Directory.Exists(loc + InDir))
|
||||
{
|
||||
Console.WriteLine("Input文件不存在");
|
||||
@ -30,6 +34,12 @@ namespace MHFQuestToMH2Dos
|
||||
|
||||
|
||||
string[] files = FileHelper.GetDirFile(loc + InDir);
|
||||
Console.WriteLine($"共{files.Length}个文件,是否处理? (y/n)");
|
||||
|
||||
|
||||
string yn = Console.ReadLine();
|
||||
if (yn.ToLower() != "y")
|
||||
return;
|
||||
|
||||
int index= 0;
|
||||
int errcount = 0;
|
||||
@ -37,24 +47,25 @@ namespace MHFQuestToMH2Dos
|
||||
{
|
||||
string FileName = files[i].Substring(files[i].LastIndexOf("\\"));
|
||||
|
||||
Console.WriteLine($">>>>>>>>>>>>>>开始处理{FileName}<<<<<<<<<<<<<<<<<<<");
|
||||
if (!FileName.ToLower().Contains(".mib") && !FileName.ToLower().Contains(".bin"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
index++;
|
||||
|
||||
Console.WriteLine($">>>>>>>>>>>>>>开始处理 第{index}个文件 {FileName}<<<<<<<<<<<<<<<<<<<");
|
||||
FileHelper.LoadFile(files[i], out byte[] data);
|
||||
if (ModifyQuest.ModifyQuset(data, out byte[] targetdata))
|
||||
{
|
||||
string newfileName = FileName + "_fix";
|
||||
string outstring = loc + OutDir + "\\" + newfileName;
|
||||
FileHelper.SaveFile(outstring, targetdata);
|
||||
Console.WriteLine($">>>>>>>>>>>>>>成功已处理 第{index}个:{outstring}");
|
||||
Console.WriteLine($">>>>>>>>>>>>>>成功处理 第{index}个:{outstring}");
|
||||
}
|
||||
else
|
||||
{
|
||||
errcount++;
|
||||
Console.WriteLine($">>>>>>>>>>>>>>处理失败 第{index}个:{files[i]}");
|
||||
Console.WriteLine($">>>>>>>>>>>>>>处理失败 第{index}个: 输出到{files[i]}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,12 @@ PS:本工具先需要将ReFrontier将MHF任务解密;
|
||||
|
||||
创建Input文件夹,放置用于转换的MHF任务文件(放入已解密的MHF任务文件)
|
||||
|
||||
(Input 文件夹内仅处理包含.mib 、.bin 的文件)
|
||||
|
||||
创建Out文件夹,用于输出文件
|
||||
|
||||
(输出文件会在末尾加"_fix")
|
||||
|
||||
### 一些特殊处理 ###
|
||||
|
||||
若发现属于仅MHF有道具,2Dos的道具。如报酬道具,(比如浮岳龙,报酬的神龙苔)将替换为【不可燃烧的废物】。
|
||||
@ -32,6 +36,8 @@ PS:本工具先需要将ReFrontier将MHF任务解密;
|
||||
|
||||
若怪物ID、地图ID等超出最大范围,会提示。并不建议使用。
|
||||
|
||||
任务ID,我暂时都改为600020(0xEA74),使其可以走活动任务下载逻辑,否则ID会过小,会读取镜像内本地任务文件。
|
||||
|
||||
|
||||
### 目前已知不完善的地方 ###
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user