Skip to content

Commit

Permalink
fix: alternative quest monster id
Browse files Browse the repository at this point in the history
closes #297
  • Loading branch information
DorielRivalet committed Feb 19, 2024
1 parent c02aec6 commit 681b762
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 97 deletions.
4 changes: 2 additions & 2 deletions MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,12 @@ public AddressModelHGE(Mem m)
public override int CaravanScore() => this.M.ReadInt("mhfo-hd.dll+ED8F764");

/// <inheritdoc/>
public override int CaravanMonster1ID() => this.M.ReadByte("mhfo-hd.dll+2AFA834");
public override int AlternativeQuestMonster1ID() => this.M.ReadByte("mhfo-hd.dll+2AFA834");

// unsure

/// <inheritdoc/>
public override int CaravanMonster2ID() => this.M.ReadByte("mhfo-hd.dll+1C41D12");
public override int AlternativeQuestMonster2ID() => this.M.ReadByte("mhfo-hd.dll+1C41D12");

/// <inheritdoc/>
public override int BlademasterWeaponID() => this.M.Read2Byte("mhfo-hd.dll+DC6BB52");
Expand Down
4 changes: 2 additions & 2 deletions MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,12 @@ public AddressModelNotHGE(Mem m)
public override int CaravanScore() => this.M.ReadInt("mhfo.dll+6154FC4");

/// <inheritdoc/>
public override int CaravanMonster1ID() => this.M.ReadByte("mhfo.dll+28C2C84");
public override int AlternativeQuestMonster1ID() => this.M.ReadByte("mhfo.dll+28C2C84");

// unsure

/// <inheritdoc/>
public override int CaravanMonster2ID() => this.M.ReadByte("mhfo.dll+28C2C8C");
public override int AlternativeQuestMonster2ID() => this.M.ReadByte("mhfo.dll+28C2C8C");

/// <inheritdoc/>
public override int BlademasterWeaponID() => this.M.Read2Byte("mhfo.dll+5033F92");
Expand Down
4 changes: 4 additions & 0 deletions MHFZ_Overlay/Models/Constant/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public static class Messages

public const string MonsterImageNotLoaded = @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/none.png";

public const string MonsterImageBaseLinkGitHub = @"https://raw.githubusercontent.com/DorielRivalet/mhfz-overlay/main/img/monster/";

public const string MonsterImageBaseLinkApp = @"pack://application:,,,/MHFZ_Overlay;component/Assets/Icons/png/monster/";

public const string SecretAchievement = "???";

public const string UnknownMonsterIcon = "https://i.imgur.com/3pQEtzw.png";
Expand Down
419 changes: 404 additions & 15 deletions MHFZ_Overlay/Services/DatabaseService.cs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions MHFZ_Overlay/Services/DiscordService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ public void UpdateDiscordRPC(DataLoader dataLoader)
break;
case 21731: // 1st district dure
case 21749: // sky corridor version
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5} | Slain: {6} | Encounters: {7}", ViewModels.Windows.AddressModel.GetQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), string.Empty, dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.FirstDistrictDuremudiraSlays(), dataLoader.Model.FirstDistrictDuremudiraEncounters());
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5} | Slain: {6} | Encounters: {7}", ViewModels.Windows.AddressModel.GetDiscordQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), string.Empty, dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.FirstDistrictDuremudiraSlays(), dataLoader.Model.FirstDistrictDuremudiraEncounters());
PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "...");
break;
case 21746: // 2nd district dure
case 21750: // sky corridor version
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5} | Slain: {6} | Encounters: {7}", ViewModels.Windows.AddressModel.GetQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), string.Empty, dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.SecondDistrictDuremudiraSlays(), dataLoader.Model.SecondDistrictDuremudiraEncounters());
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5} | Slain: {6} | Encounters: {7}", ViewModels.Windows.AddressModel.GetDiscordQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), string.Empty, dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.SecondDistrictDuremudiraSlays(), dataLoader.Model.SecondDistrictDuremudiraEncounters());
PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "...");
break;
case 62105: // raviente quests
Expand Down Expand Up @@ -279,20 +279,20 @@ public void UpdateDiscordRPC(DataLoader dataLoader)
case 55605:
case 55606:
case 55607:
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}{6} | True Raw: {7} (Max {8}) | Hits: {9}", ViewModels.Windows.AddressModel.GetQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), string.Empty, dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetStarGrade(), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.ATK, dataLoader.Model.HighestAtk, dataLoader.Model.HitCountInt());
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}{6} | True Raw: {7} (Max {8}) | Hits: {9}", ViewModels.Windows.AddressModel.GetDiscordQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), string.Empty, dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetStarGrade(), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.ATK, dataLoader.Model.HighestAtk, dataLoader.Model.HitCountInt());
PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "...");

break;
default:
if ((dataLoader.Model.ObjectiveType() == 0x0 || dataLoader.Model.ObjectiveType() == 0x02 || dataLoader.Model.ObjectiveType() == 0x1002 || dataLoader.Model.ObjectiveType() == 0x10) && dataLoader.Model.QuestID() != 23527 && dataLoader.Model.QuestID() != 23628 && dataLoader.Model.QuestID() != 21731 && dataLoader.Model.QuestID() != 21749 && dataLoader.Model.QuestID() != 21746 && dataLoader.Model.QuestID() != 21750)
{
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}{6} | True Raw: {7} (Max {8}) | Hits: {9}", ViewModels.Windows.AddressModel.GetQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), dataLoader.Model.GetObjective1CurrentQuantity(), dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetStarGrade(), ViewModels.Windows.AddressModel.GetObjective1Name(dataLoader.Model.Objective1ID()), dataLoader.Model.ATK, dataLoader.Model.HighestAtk, dataLoader.Model.HitCountInt());
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}{6} | True Raw: {7} (Max {8}) | Hits: {9}", ViewModels.Windows.AddressModel.GetDiscordQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), dataLoader.Model.GetObjective1CurrentQuantity(), dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), dataLoader.Model.GetStarGrade(), ViewModels.Windows.AddressModel.GetObjective1Name(dataLoader.Model.Objective1ID()), dataLoader.Model.ATK, dataLoader.Model.HighestAtk, dataLoader.Model.HitCountInt());
PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "...");
}
else
{
var questToggleMonsterMode = ShowDiscordQuestNames() ? string.Empty : GetQuestToggleMode(dataLoader.Model.QuestToggleMonsterMode()).TrimStart();
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}{6} | True Raw: {7} (Max {8}) | Hits: {9}", ViewModels.Windows.AddressModel.GetQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), questToggleMonsterMode, dataLoader.Model.GetStarGrade(), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.ATK, dataLoader.Model.HighestAtk, dataLoader.Model.HitCountInt());
stateString = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}{5}{6} | True Raw: {7} (Max {8}) | Hits: {9}", ViewModels.Windows.AddressModel.GetDiscordQuestNameFromID(dataLoader.Model.QuestID()), ViewModels.Windows.AddressModel.GetObjectiveNameFromID(dataLoader.Model.ObjectiveType()), dataLoader.Model.GetObjective1Quantity(), dataLoader.Model.GetRankNameFromID(dataLoader.Model.RankBand()), questToggleMonsterMode, dataLoader.Model.GetStarGrade(), dataLoader.Model.GetRealMonsterName(), dataLoader.Model.ATK, dataLoader.Model.HighestAtk, dataLoader.Model.HitCountInt());
PresenceTemplate.State = stateString.Length <= MaxDiscordRPCStringLength ? stateString : string.Concat(stateString.AsSpan(0, MaxDiscordRPCStringLength - 3), "...");
}

Expand Down
Loading

0 comments on commit 681b762

Please sign in to comment.