Skip to content

Commit

Permalink
fix: diva song in guild hall
Browse files Browse the repository at this point in the history
closes #276
  • Loading branch information
DorielRivalet committed Feb 4, 2024
1 parent 4bc6ec8 commit ff1651b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions MHFZ_Overlay/Models/Addresses/AddressModelHGE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1887,4 +1887,7 @@ public AddressModelHGE(Mem m)
/// <inheritdoc/>
public override bool HalkPotEffectOn() => this.M.ReadByte("mhfo-hd.dll+DC6C524") > 0 ? true : false;

/// <inheritdoc/>
public override int DivaSongFromGuildStart() => this.M.ReadInt("mhfo-hd.dll+ED3EB24");

}
3 changes: 3 additions & 0 deletions MHFZ_Overlay/Models/Addresses/AddressModelNotHGE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1805,4 +1805,7 @@ public AddressModelNotHGE(Mem m)

/// <inheritdoc/>
public override bool HalkPotEffectOn() => this.M.ReadByte("mhfo.dll+5034964") > 0 ? true : false;

/// <inheritdoc/>
public override int DivaSongFromGuildStart() => this.M.ReadInt("mhfo.dll+6104384");
}
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Models/Addresses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For the addresses, check the respective files.

## IDs

- [Mappers](../Mappers)
- [Mappers](https://github.com/DorielRivalet/ezlion/tree/main/src/packages/csharp/EZlion/EZlion/Mapper)
- [Bitfields and Enumerations](../Structures)

### Sigil Skills
Expand Down
19 changes: 13 additions & 6 deletions MHFZ_Overlay/ViewModels/Windows/AddressModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ 21747 or

public abstract bool HalkPotEffectOn();

public abstract int DivaSongFromGuildStart();

/// <TODO>
/// [] Not Done
Expand Down Expand Up @@ -2590,12 +2591,14 @@ public bool DivaSongEnding
{
get
{
if (DivaSongStart() <= 0)
var divaSongStart = Math.Max(DivaSongStart(), DivaSongFromGuildStart());

if (divaSongStart <= 0)
{
return true;
}

var expiry = DivaSongStart() + (60 * 90);
var expiry = divaSongStart + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();

return secondsLeft <= 60*10;
Expand All @@ -2606,12 +2609,14 @@ public bool DivaSongEnded
{
get
{
if (DivaSongStart() <= 0)
var divaSongStart = Math.Max(DivaSongStart(), DivaSongFromGuildStart());

if (divaSongStart <= 0)
{
return true;
}

var expiry = DivaSongStart() + (60 * 90);
var expiry = divaSongStart + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();

return secondsLeft <= 0;
Expand Down Expand Up @@ -13112,12 +13117,14 @@ public string DivaSongTimeLeft
{
get
{
if (DivaSongStart() <= 0)
var divaSongStart = Math.Max(DivaSongStart(), DivaSongFromGuildStart());

if (divaSongStart <= 0)
{
return "0m";
}

var expiry = DivaSongStart() + (60 * 90);
var expiry = divaSongStart + (60 * 90);
double secondsLeft = expiry - ServerHeartbeat();

if (secondsLeft <= 0)
Expand Down

0 comments on commit ff1651b

Please sign in to comment.