Skip to content

Commit

Permalink
Rename ...RateCalculator to ...AmountCalculator and related serve…
Browse files Browse the repository at this point in the history
…r properties

Avoids confusion since rate is generally used for intervals.
Update your server properties if you weren't using default values.
  • Loading branch information
bm01 committed Jul 27, 2024
1 parent 1d2491b commit 835f77e
Show file tree
Hide file tree
Showing 22 changed files with 259 additions and 259 deletions.
2 changes: 1 addition & 1 deletion GameServer/ECS-Effects/SprintECSEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public override void OnStartEffect()
{
if (OwnerPlayer != null)
{
int regen = OwnerPlayer.GetModified(eProperty.EnduranceRegenerationRate);
int regen = OwnerPlayer.GetModified(eProperty.EnduranceRegenerationAmount);
var enduranceChant = OwnerPlayer.GetModified(eProperty.FatigueConsumption);
var cost = -5 + regen;

Expand Down
2 changes: 1 addition & 1 deletion GameServer/ECS-Effects/StatBuffECSEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected static void ApplyBonus(GameLiving owner, eBuffBonusCategory BonusCat,
else
tblBonusCat[(int)Property] -= effectiveValue;

if (Property == eProperty.EnduranceRegenerationRate && tblBonusCat[(int)Property] <= 0)
if (Property == eProperty.EnduranceRegenerationAmount && tblBonusCat[(int)Property] <= 0)
tblBonusCat[(int)Property] = 0;
}

Expand Down
6 changes: 3 additions & 3 deletions GameServer/ECS-Services/EffectService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,13 @@ public static List<eProperty> GetPropertiesFromEffect(eEffect e)
list.Add(eProperty.Resist_Slash);
return list;
case eEffect.HealthRegenBuff:
list.Add(eProperty.HealthRegenerationRate);
list.Add(eProperty.HealthRegenerationAmount);
return list;
case eEffect.PowerRegenBuff:
list.Add(eProperty.PowerRegenerationRate);
list.Add(eProperty.PowerRegenerationAmount);
return list;
case eEffect.EnduranceRegenBuff:
list.Add(eProperty.EnduranceRegenerationRate);
list.Add(eProperty.EnduranceRegenerationAmount);
return list;
case eEffect.MeleeHasteBuff:
case eEffect.MeleeHasteDebuff:
Expand Down
6 changes: 3 additions & 3 deletions GameServer/Enums/eProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ public enum eProperty : byte
MaxConcentration = 147,
ArmorFactor = 148,
ArmorAbsorption = 149,
HealthRegenerationRate = 150,
PowerRegenerationRate = 151,
EnduranceRegenerationRate = 152,
HealthRegenerationAmount = 150,
PowerRegenerationAmount = 151,
EnduranceRegenerationAmount = 152,
SpellRange = 153,
ArcheryRange = 154,
MeleeSpeed = 155,
Expand Down
8 changes: 4 additions & 4 deletions GameServer/gameobjects/GameLiving.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ public virtual void StopEnduranceRegeneration()
protected virtual int HealthRegenerationTimerCallback(ECSGameTimer callingTimer)
{
if (Health < MaxHealth)
ChangeHealth(this, eHealthChangeType.Regenerate, GetModified(eProperty.HealthRegenerationRate));
ChangeHealth(this, eHealthChangeType.Regenerate, GetModified(eProperty.HealthRegenerationAmount));

bool atMaxHealth = Health >= MaxHealth;

Expand All @@ -2933,7 +2933,7 @@ protected virtual int HealthRegenerationTimerCallback(ECSGameTimer callingTimer)
if (atMaxHealth)
DamageRvRMemory = 0;
else
DamageRvRMemory -= Math.Max(GetModified(eProperty.HealthRegenerationRate), 0);
DamageRvRMemory -= Math.Max(GetModified(eProperty.HealthRegenerationAmount), 0);
}
}

Expand Down Expand Up @@ -2973,7 +2973,7 @@ protected virtual int PowerRegenerationTimerCallback(ECSGameTimer selfRegenerati
stackingBonus = p.PowerRegenStackingBonus;

if (Mana < MaxMana)
ChangeMana(this, eManaChangeType.Regenerate, GetModified(eProperty.PowerRegenerationRate) + stackingBonus);
ChangeMana(this, eManaChangeType.Regenerate, GetModified(eProperty.PowerRegenerationAmount) + stackingBonus);

if (Mana >= MaxMana)
return 0;
Expand Down Expand Up @@ -3008,7 +3008,7 @@ protected virtual int EnduranceRegenerationTimerCallback(ECSGameTimer selfRegene
{
if (Endurance < MaxEndurance)
{
int regen = GetModified(eProperty.EnduranceRegenerationRate);
int regen = GetModified(eProperty.EnduranceRegenerationAmount);

if (regen > 0)
ChangeEndurance(this, eEnduranceChangeType.Regenerate, regen);
Expand Down
6 changes: 3 additions & 3 deletions GameServer/gameobjects/GamePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ public override void StopEnduranceRegeneration()
protected override int HealthRegenerationTimerCallback(ECSGameTimer callingTimer)
{
if (Health < MaxHealth)
ChangeHealth(this, eHealthChangeType.Regenerate, GetModified(eProperty.HealthRegenerationRate));
ChangeHealth(this, eHealthChangeType.Regenerate, GetModified(eProperty.HealthRegenerationAmount));

bool atMaxHealth = Health >= MaxHealth;

Expand All @@ -2561,7 +2561,7 @@ protected override int HealthRegenerationTimerCallback(ECSGameTimer callingTimer
if (atMaxHealth)
DamageRvRMemory = 0;
else
DamageRvRMemory -= Math.Max(GetModified(eProperty.HealthRegenerationRate), 0);
DamageRvRMemory -= Math.Max(GetModified(eProperty.HealthRegenerationAmount), 0);
}

if (atMaxHealth)
Expand Down Expand Up @@ -2604,7 +2604,7 @@ protected override int EnduranceRegenerationTimerCallback(ECSGameTimer selfRegen

if (Endurance < MaxEndurance || sprinting)
{
int regen = GetModified(eProperty.EnduranceRegenerationRate);
int regen = GetModified(eProperty.EnduranceRegenerationAmount);
int endChant = GetModified(eProperty.FatigueConsumption);
ECSGameEffect charge = EffectListService.GetEffectOnTarget(this, eEffect.Charge);
int longWind = 5;
Expand Down
6 changes: 3 additions & 3 deletions GameServer/gameutils/SkillBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1748,11 +1748,11 @@ private static void RegisterPropertyNames()
m_propertyNames.Add(eProperty.ArmorAbsorption, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
"SkillBase.RegisterPropertyNames.BonusToArmorAbsorption"));

m_propertyNames.Add(eProperty.HealthRegenerationRate, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
m_propertyNames.Add(eProperty.HealthRegenerationAmount, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
"SkillBase.RegisterPropertyNames.HealthRegeneration"));
m_propertyNames.Add(eProperty.PowerRegenerationRate, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
m_propertyNames.Add(eProperty.PowerRegenerationAmount, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
"SkillBase.RegisterPropertyNames.PowerRegeneration"));
m_propertyNames.Add(eProperty.EnduranceRegenerationRate, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
m_propertyNames.Add(eProperty.EnduranceRegenerationAmount, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
"SkillBase.RegisterPropertyNames.EnduranceRegeneration"));
m_propertyNames.Add(eProperty.SpellRange, LanguageMgr.GetTranslation(ServerProperties.Properties.DB_LANGUAGE,
"SkillBase.RegisterPropertyNames.SpellRange"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
using DOL.GS.RealmAbilities;

namespace DOL.GS.PropertyCalc
{
/// <summary>
/// The health regen rate calculator
///
/// BuffBonusCategory1 is used for all buffs
/// BuffBonusCategory2 is used for all debuffs (positive values expected here)
/// BuffBonusCategory3 unused
/// BuffBonusCategory4 unused
/// BuffBonusMultCategory1 unused
/// </summary>
[PropertyCalculator(eProperty.EnduranceRegenerationRate)]
public class EnduranceRegenerationRateCalculator : PropertyCalculator
{
public EnduranceRegenerationRateCalculator() { }

public override int CalcValue(GameLiving living, eProperty property)
{
GamePlayer player = living as GamePlayer;
int debuff = living.SpecBuffBonusCategory[(int) property];

if (debuff < 0)
debuff = -debuff;

// Buffs allow to regenerate endurance even in combat and while moving.
double regenBuff = living.BaseBuffBonusCategory[(int) property] + living.ItemBonus[(int) property];
double regen = regenBuff;

if (regen == 0 && player != null)
regen++;

AtlasOF_RAEndRegenEnhancer raTireless = living.GetAbility<AtlasOF_RAEndRegenEnhancer>();

if (raTireless != null)
regen++;

/* Patch 1.87 - COMBAT AND REGENERATION CHANGES
- The bonus to regeneration while standing out of combat has been greatly increased. The amount of ticks
a player receives while standing has been doubled and it will now match the bonus to regeneration while sitting.
Players will no longer need to sit to regenerate faster.
- Fatigue now regenerates at the standing rate while moving.
*/

if (!living.InCombat)
{
if (player != null && !player.IsSprinting)
regen += 4;
}
else
{
regen -= 3;

if (regen <= 0)
regen = 0.1;

if (regenBuff > 0)
regen = regenBuff;

if (player != null && raTireless != null)
regen++;
}

regen -= debuff;

if (regen < 0)
regen = 0;
else
regen *= ServerProperties.Properties.ENDURANCE_REGEN_RATE;

double decimals = regen - (int) regen;

// Compensate for int rounding.
if (Util.ChanceDouble(decimals))
regen += 1;

return (int) regen;
}
}
}
using DOL.GS.RealmAbilities;

namespace DOL.GS.PropertyCalc
{
/// <summary>
/// The health regen rate calculator
///
/// BuffBonusCategory1 is used for all buffs
/// BuffBonusCategory2 is used for all debuffs (positive values expected here)
/// BuffBonusCategory3 unused
/// BuffBonusCategory4 unused
/// BuffBonusMultCategory1 unused
/// </summary>
[PropertyCalculator(eProperty.EnduranceRegenerationAmount)]
public class EnduranceRegenerationAmountCalculator : PropertyCalculator
{
public EnduranceRegenerationAmountCalculator() { }

public override int CalcValue(GameLiving living, eProperty property)
{
GamePlayer player = living as GamePlayer;
int debuff = living.SpecBuffBonusCategory[(int) property];

if (debuff < 0)
debuff = -debuff;

// Buffs allow to regenerate endurance even in combat and while moving.
double regenBuff = living.BaseBuffBonusCategory[(int) property] + living.ItemBonus[(int) property];
double regen = regenBuff;

if (regen == 0 && player != null)
regen++;

AtlasOF_RAEndRegenEnhancer raTireless = living.GetAbility<AtlasOF_RAEndRegenEnhancer>();

if (raTireless != null)
regen++;

/* Patch 1.87 - COMBAT AND REGENERATION CHANGES
- The bonus to regeneration while standing out of combat has been greatly increased. The amount of ticks
a player receives while standing has been doubled and it will now match the bonus to regeneration while sitting.
Players will no longer need to sit to regenerate faster.
- Fatigue now regenerates at the standing rate while moving.
*/

if (!living.InCombat)
{
if (player != null && !player.IsSprinting)
regen += 4;
}
else
{
regen -= 3;

if (regen <= 0)
regen = 0.1;

if (regenBuff > 0)
regen = regenBuff;

if (player != null && raTireless != null)
regen++;
}

regen -= debuff;

if (regen < 0)
regen = 0;
else
regen *= ServerProperties.Properties.ENDURANCE_REGEN_AMOUNT_MODIFIER;

double decimals = regen - (int) regen;

// Compensate for int rounding.
if (Util.ChanceDouble(decimals))
regen += 1;

return (int) regen;
}
}
}
Loading

0 comments on commit 835f77e

Please sign in to comment.