This commit is contained in:
Lucca Faria Ferri 2023-09-13 04:27:03 +02:00
parent 31d75a8e0d
commit 0774b48501
2 changed files with 7 additions and 25 deletions

View File

@ -23,42 +23,25 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values) foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values)
{ {
GameBalance data = asset.Data as GameBalance; GameBalance data = asset.Data as GameBalance;
if (data != null && data.Type == BalanceType.AffixList) if (data is not { Type: BalanceType.AffixList }) continue;
foreach (AffixTable affixDefinition in data.Affixes.Where(affixDefinition => affixDefinition.Hash == AffixGbid))
{ {
foreach (var affixDefinition in data.Affixes) return affixDefinition;
{
if (affixDefinition.Hash == AffixGbid) return affixDefinition;
}
} }
} }
return null; return null;
} }
} }
public int Price public int Price => (Definition == null ? 0 : Definition.Cost);
{
get
{
return (Definition == null ? 0 : Definition.Cost);
}
}
public int ItemLevel public int ItemLevel => (Definition == null ? 0 : Definition.AffixLevel);
{
get
{
return (Definition == null ? 0 : Definition.AffixLevel);
}
}
public float Score = 0f; public float Score = 0f;
public int Rating public int Rating
{ {
get get => (int)(Price * (1 + Score));
{
return (int)(Price * (1 + Score));
}
set { } set { }
} }
@ -69,7 +52,7 @@ namespace DiIiS_NA.GameServer.GSSystem.ItemsSystem
public override String ToString() public override String ToString()
{ {
return String.Format("{0}", AffixGbid); return AffixGbid.ToString();
} }
public static Affix Parse(String affixString) public static Affix Parse(String affixString)

View File

@ -453,7 +453,6 @@ namespace DiIiS_NA
} }
[DllImport("kernel32.dll", ExactSpelling = true)] [DllImport("kernel32.dll", ExactSpelling = true)]
static extern IntPtr GetConsoleWindow(); static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]