Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions Source/ACE.Server/Entity/AddEnchantmentResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;

using ACE.Entity.Models;
using ACE.Server.Managers;
using ACE.Server.WorldObjects;
using ACE.Server.WorldObjects.Managers;

Expand Down Expand Up @@ -95,8 +96,22 @@ public void BuildStack(List<PropertiesEnchantmentRegistry> 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;

Expand Down Expand Up @@ -177,4 +192,4 @@ public void SetRefreshCaster(WorldObject caster)
}
}
}
}
}
6 changes: 4 additions & 2 deletions Source/ACE.Server/Managers/PropertyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,9 @@ public static void LoadDefaultProperties()
("vitae_penalty", new Property<double>(0.05, "the amount of vitae penalty a player gets per death")),
("vitae_penalty_max", new Property<double>(0.40, "the maximum vitae penalty a player can have")),
("void_pvp_modifier", new Property<double>(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<double>(1.0, "scales the amount of xp received by players"))
("xp_modifier", new Property<double>(1.0, "scales the amount of xp received by players")),
("salvage_modifier", new Property<double>(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<double>(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<string, Property<string>> DefaultStringProperties =
Expand All @@ -683,4 +685,4 @@ public static void LoadDefaultProperties()
("server_motd", new Property<string>("", "Server message of the day"))
);
}
}
}
25 changes: 20 additions & 5 deletions Source/ACE.Server/WorldObjects/Managers/EnchantmentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -1492,4 +1507,4 @@ public float GetDamagePerTick(PropertiesEnchantmentRegistry enchantment, double?
return totalDamage / numTicks;
}
}
}
}
7 changes: 6 additions & 1 deletion Source/ACE.Server/WorldObjects/Player_Crafting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -368,4 +373,4 @@ public WorldObject GetSalvageBag(MaterialType materialType, List<WorldObject> sa
return salvageBag;
}
}
}
}