Skip to content

Commit

Permalink
- implement AugmentationResistanceNether
Browse files Browse the repository at this point in the history
- add levels 276-300, with 1 credit per level
  • Loading branch information
Yonneh0 committed Jan 25, 2025
1 parent a5b85ea commit 03287d4
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 11 deletions.
Empty file added LocalMods.cs
Empty file.
27 changes: 16 additions & 11 deletions Source/ACE.DatLoader/FileTypes/XpTable.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using ACE.Entity.Enum;
using System.Collections.Generic;
using System.IO;

namespace ACE.DatLoader.FileTypes
{
namespace ACE.DatLoader.FileTypes {
/// <summary>
/// Reads and stores the XP Tables from the client_portal.dat (file 0x0E000018).
/// </summary>
[DatFileType(DatFileType.XpTable)]
public class XpTable : FileType
{
public class XpTable : FileType {
internal const uint FILE_ID = 0x0E000018;

public List<uint> AttributeXpList { get; } = new List<uint>();
Expand All @@ -26,17 +25,16 @@ public class XpTable : FileType
/// </summary>
public List<uint> CharacterLevelSkillCreditList { get; } = new List<uint>();

public override void Unpack(BinaryReader reader)
{
public override void Unpack(BinaryReader reader) {
Id = reader.ReadUInt32();

// The counts for each "Table" are at the top of the file.
int attributeCount = reader.ReadInt32();
int vitalCount = reader.ReadInt32();
int trainedSkillCount = reader.ReadInt32();
int specializedSkillCount = reader.ReadInt32();
int attributeCount = reader.ReadInt32();
int vitalCount = reader.ReadInt32();
int trainedSkillCount = reader.ReadInt32();
int specializedSkillCount = reader.ReadInt32();

uint levelCount = reader.ReadUInt32();
uint levelCount = reader.ReadUInt32();

for (int i = 0; i <= attributeCount; i++)
AttributeXpList.Add(reader.ReadUInt32());
Expand All @@ -55,6 +53,13 @@ public override void Unpack(BinaryReader reader)

for (int i = 0; i <= levelCount; i++)
CharacterLevelSkillCreditList.Add(reader.ReadUInt32());
Inject_ExtraLevels();
}

void Inject_ExtraLevels() {
CharacterLevelXPList.AddRange(new List<ulong>() { 198058069818, 218655824925, 301355811677, 633396258490, 1966538652443, 3319678182306, 4693114805116, 7460589600079, 14420788709410, 35405789024045, 56705564343399, 78324836292543, 121887669270068, 231448194208545, 561773176898053, 897053034327904, 1237362089619200, 1923084836031170, 3647677543257260, 8847324555543940, 14124966273014900, 19481772616248000, 30275737397862500, 57422558823623200, 139270225422292000 });
CharacterLevelSkillCreditList.AddRange(new List<uint>() { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
}

}
}
3 changes: 3 additions & 0 deletions Source/ACE.Entity/Enum/AugmentationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ public enum AugmentationType
/// Infused Void Magic - foci for void magic
/// </summary>
FociVoid = 42,


ResistNether = 43,
}

public static class AugTypeHelper
Expand Down
1 change: 1 addition & 0 deletions Source/ACE.Entity/Enum/Properties/PropertyFloat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public enum PropertyFloat : ushort
CriticalMultiplier = 136,
[AssessmentProperty]
ManaStoneDestroyChance = 137,
[AssessmentProperty]
SlayerDamageBonus = 138,
AllegianceInfoSpamTimestamp = 139,
AllegianceInfoSpamRate = 140,
Expand Down
1 change: 1 addition & 0 deletions Source/ACE.Entity/Enum/Properties/PropertyInt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ public enum PropertyInt : ushort
AlternateRacialSkills = 325,
[SendOnLogin]
AugmentationJackOfAllTrades = 326,
[SendOnLogin]
AugmentationResistanceNether = 327,
[SendOnLogin]
AugmentationInfusedVoidMagic = 328,
Expand Down
1 change: 1 addition & 0 deletions Source/ACE.Server/WorldObjects/AugmentationDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public bool VerifyRequirements(Player player)
{ AugmentationType.DamageResist, PropertyInt.AugmentationDamageReduction },
{ AugmentationType.AllStats, PropertyInt.AugmentationJackOfAllTrades },
{ AugmentationType.FociVoid, PropertyInt.AugmentationInfusedVoidMagic },
{ AugmentationType.ResistNether, PropertyInt.AugmentationResistanceNether },
};
}
}
12 changes: 12 additions & 0 deletions Source/ACE.Server/WorldObjects/Player_Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,15 @@ public int AugmentationResistanceLightning
set { if (value == 0) RemoveProperty(PropertyInt.AugmentationResistanceLightning); else SetProperty(PropertyInt.AugmentationResistanceLightning, value); }
}

/// <summary>
/// Enhancement of the Yonneh
/// Grants the player 10% extra resistance to nether damage. You may only have 2 resistance augmentations in effect at any time.
/// </summary>
public int AugmentationResistanceNether {
get => GetProperty(PropertyInt.AugmentationResistanceNether) ?? 0;
set { if (value == 0) RemoveProperty(PropertyInt.AugmentationResistanceNether); else SetProperty(PropertyInt.AugmentationResistanceNether, value); }
}

/// <summary>
/// The number of resistance augs that have been applied (max 2)
/// </summary>
Expand Down Expand Up @@ -1363,6 +1372,9 @@ public int GetAugmentationResistance(DamageType damageType)

case DamageType.Electric:
return AugmentationResistanceLightning;

case DamageType.Nether:
return AugmentationResistanceNether;
}
return 0;
}
Expand Down

0 comments on commit 03287d4

Please sign in to comment.