From 3e5d6e18dbcd12b6086faaf920e186e945ab8e73 Mon Sep 17 00:00:00 2001 From: Catgat <145307970+Catgat@users.noreply.github.com> Date: Sun, 28 Sep 2025 17:54:33 +0000 Subject: [PATCH 1/2] Added two new server properties, "salvage_modifier" and "spell_duration_modifier". The salvage property is a multiplicative scaling of salvage output using an UST, with a minimum value of 1 item of salvage possible. The spell duration property is a multiplicative scaling of spell duration for spells cast by the player, affecting the same buffs as the Archmage's Endurance augmentation. --- .../ACE.Server/Entity/AddEnchantmentResult.cs | 28 ++++++++++++++----- Source/ACE.Server/Managers/PropertyManager.cs | 6 ++-- .../Managers/EnchantmentManager.cs | 25 +++++++++++++---- .../WorldObjects/Player_Crafting.cs | 7 ++++- 4 files changed, 51 insertions(+), 15 deletions(-) diff --git a/Source/ACE.Server/Entity/AddEnchantmentResult.cs b/Source/ACE.Server/Entity/AddEnchantmentResult.cs index ecfea9abea..eee0c108f5 100644 --- a/Source/ACE.Server/Entity/AddEnchantmentResult.cs +++ b/Source/ACE.Server/Entity/AddEnchantmentResult.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; - using ACE.Entity.Models; +using ACE.Server.Managers; using ACE.Server.WorldObjects; using ACE.Server.WorldObjects.Managers; +using System; +using System.Collections.Generic; +using System.Linq; namespace ACE.Server.Entity { @@ -95,8 +95,22 @@ public void BuildStack(List entries, Spell spell, // handle special case to prevent message: Pumpkin Shield casts Web of Defense on you, refreshing Aura of Defense var spellDuration = equip ? double.PositiveInfinity : spell.Duration; - if (!equip && caster is Player player && player.AugmentationIncreasedSpellDuration > 0 && !isWeaponSpell) - spellDuration *= 1.0f + player.AugmentationIncreasedSpellDuration * 0.2f; + + + + if (!equip && caster is Player player && !isWeaponSpell) + { + + var spellDurationModifier = Math.Max(PropertyManager.GetDouble("spell_duration_modifier").Item, 0); + var moddedSpellDuration = spellDuration * spellDurationModifier; + + spellDuration = Math.Max(moddedSpellDuration, 1); + + + if(player.AugmentationIncreasedSpellDuration > 0) + spellDuration *= 1.0f + player.AugmentationIncreasedSpellDuration * 0.2f; + + } var entryDuration = entry.Duration == -1 ? double.PositiveInfinity : entry.Duration; @@ -177,4 +191,4 @@ public void SetRefreshCaster(WorldObject caster) } } } -} +} \ No newline at end of file diff --git a/Source/ACE.Server/Managers/PropertyManager.cs b/Source/ACE.Server/Managers/PropertyManager.cs index bf8f547132..53a11ba9de 100644 --- a/Source/ACE.Server/Managers/PropertyManager.cs +++ b/Source/ACE.Server/Managers/PropertyManager.cs @@ -668,7 +668,9 @@ public static void LoadDefaultProperties() ("vitae_penalty", new Property(0.05, "the amount of vitae penalty a player gets per death")), ("vitae_penalty_max", new Property(0.40, "the maximum vitae penalty a player can have")), ("void_pvp_modifier", new Property(0.5, "Scales the amount of damage players take from Void Magic. Defaults to 0.5, as per retail. For earlier content where DRR isn't as readily available, this can be adjusted for balance.")), - ("xp_modifier", new Property(1.0, "scales the amount of xp received by players")) + ("xp_modifier", new Property(1.0, "scales the amount of xp received by players")), + ("salvage_modifier", new Property(1.0, "scales the amount of salvage recieved by players when using an Ust. Minimum value is 0, and minimum amount of salvage returned is 1.")), + ("spell_duration_modifier", new Property(1.0, "scales the duration of buffs cast by players, affects the same buffs as the Archmage's Endurance augmentation. Minimum value is 0, minimum duration for buffs is 1 second.")) ); public static readonly ReadOnlyDictionary> DefaultStringProperties = @@ -683,4 +685,4 @@ public static void LoadDefaultProperties() ("server_motd", new Property("", "Server message of the day")) ); } -} +} \ No newline at end of file diff --git a/Source/ACE.Server/WorldObjects/Managers/EnchantmentManager.cs b/Source/ACE.Server/WorldObjects/Managers/EnchantmentManager.cs index 6b1b61c4c5..a5a04b1c96 100644 --- a/Source/ACE.Server/WorldObjects/Managers/EnchantmentManager.cs +++ b/Source/ACE.Server/WorldObjects/Managers/EnchantmentManager.cs @@ -182,8 +182,15 @@ public virtual AddEnchantmentResult Add(Spell spell, WorldObject caster, WorldOb // should be update the StatModVal here? var duration = spell.Duration; - if (caster is Player player && player.AugmentationIncreasedSpellDuration > 0 && !isWeaponSpell && spell.DotDuration == 0) - duration *= 1.0f + player.AugmentationIncreasedSpellDuration * 0.2f; + if (caster is Player player && !isWeaponSpell && spell.DotDuration == 0) + { + var spellDurationModifier = Math.Max(PropertyManager.GetDouble("spell_duration_modifier").Item, 0); + var moddedDuration = duration * spellDurationModifier; + + duration = Math.Max(moddedDuration, 1); + if(player.AugmentationIncreasedSpellDuration > 0) + duration *= 1.0f + player.AugmentationIncreasedSpellDuration * 0.2f; + } var timeRemaining = refreshSpell.Duration + refreshSpell.StartTime; @@ -219,8 +226,16 @@ private PropertiesEnchantmentRegistry BuildEntry(Spell spell, WorldObject caster { entry.Duration = spell.Duration; - if (caster is Player player && player.AugmentationIncreasedSpellDuration > 0 && !isWeaponSpell && spell.DotDuration == 0) - entry.Duration *= 1.0f + player.AugmentationIncreasedSpellDuration * 0.2f; + if (caster is Player player && !isWeaponSpell && spell.DotDuration == 0) + { + var spellDurationModifier = Math.Max(PropertyManager.GetDouble("spell_duration_modifier").Item, 0); + var moddedDuration = entry.Duration * spellDurationModifier; + + entry.Duration = Math.Max(moddedDuration, 1); + + if(player.AugmentationIncreasedSpellDuration > 0) + entry.Duration *= 1.0f + player.AugmentationIncreasedSpellDuration * 0.2f; + } } else { @@ -1492,4 +1507,4 @@ public float GetDamagePerTick(PropertiesEnchantmentRegistry enchantment, double? return totalDamage / numTicks; } } -} +} \ No newline at end of file diff --git a/Source/ACE.Server/WorldObjects/Player_Crafting.cs b/Source/ACE.Server/WorldObjects/Player_Crafting.cs index 130f32f128..2ee722c185 100644 --- a/Source/ACE.Server/WorldObjects/Player_Crafting.cs +++ b/Source/ACE.Server/WorldObjects/Player_Crafting.cs @@ -324,6 +324,11 @@ public int GetStructure(WorldObject salvageItem, SalvageResults salvageResults, // choose the best one var addStructure = Math.Max(salvageAmount, tinkeringAmount); + // modify by salvage_modifier + var salvageModifier = Math.Max(PropertyManager.GetDouble("salvage_modifier").Item,0); + var moddedAddStructure = addStructure * salvageModifier; + addStructure = (int)Math.Max(Math.Round(moddedAddStructure),1); + var skill = salvageAmount > tinkeringAmount ? Skill.Salvaging : GetMaxSkill(TinkeringSkills).Skill; message = salvageResults.GetMessage(salvageItem.MaterialType ?? ACE.Entity.Enum.MaterialType.Unknown, skill); @@ -368,4 +373,4 @@ public WorldObject GetSalvageBag(MaterialType materialType, List sa return salvageBag; } } -} +} \ No newline at end of file From 7fb45ad25e0f2d2c5e9a072129aa09e6599b8213 Mon Sep 17 00:00:00 2001 From: Catgat <145307970+Catgat@users.noreply.github.com> Date: Sun, 28 Sep 2025 17:58:36 +0000 Subject: [PATCH 2/2] Fixing an unintended change to the using items at the top of the file. --- Source/ACE.Server/Entity/AddEnchantmentResult.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/ACE.Server/Entity/AddEnchantmentResult.cs b/Source/ACE.Server/Entity/AddEnchantmentResult.cs index eee0c108f5..dbcd51f7ba 100644 --- a/Source/ACE.Server/Entity/AddEnchantmentResult.cs +++ b/Source/ACE.Server/Entity/AddEnchantmentResult.cs @@ -1,10 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; + using ACE.Entity.Models; using ACE.Server.Managers; using ACE.Server.WorldObjects; using ACE.Server.WorldObjects.Managers; -using System; -using System.Collections.Generic; -using System.Linq; namespace ACE.Server.Entity {