Skip to content

Commit

Permalink
Remove weird debug messages in Lifter and Toughness RAs
Browse files Browse the repository at this point in the history
  • Loading branch information
bm01 committed Aug 19, 2024
1 parent bf02dc1 commit 0232345
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 59 deletions.
68 changes: 29 additions & 39 deletions GameServer/realmabilities_atlasOF/handlers/AtlasOF_LifterAbility.cs
Original file line number Diff line number Diff line change
@@ -1,60 +1,50 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DOL.Database;
using DOL.GS.Effects;
using DOL.GS.PacketHandler;
using DOL.Language;

namespace DOL.GS.RealmAbilities
{
/// <summary>
/// Lifter : 20% additional maximum carrying capacity per level.
/// </summary>
public class AtlasOF_LifterAbility : RAPropertyEnhancer
/// <summary>
/// Lifter : 20% additional maximum carrying capacity per level.
/// </summary>
public class AtlasOF_LifterAbility : RAPropertyEnhancer
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected override string ValueUnit => "%";

// TODO: Chek if this should be changed to eProperty.Strength
public AtlasOF_LifterAbility(DbAbility dba, int level) : base(dba, level, eProperty.Undefined) { }

protected override string ValueUnit { get { return "%"; } }
public AtlasOF_LifterAbility(DbAbility dba, int level) : base(dba, level, eProperty.Undefined) { }

public override int CostForUpgrade(int level) { return AtlasRAHelpers.GetCommonUpgradeCostFor5LevelsRA(level); }
public override int CostForUpgrade(int level)
{
return AtlasRAHelpers.GetCommonUpgradeCostFor5LevelsRA(level);
}

public override int GetAmountForLevel(int level)
{
if (level < 1) return 0;

return level * 20;
}
public override int GetAmountForLevel(int level)
{
return level < 1 ? 0 : level * 20;
}

public override void Activate(GameLiving living, bool sendUpdates)
{
base.Activate(living, sendUpdates);

// force UI to refresh encumberence value
if (living is GamePlayer player) { log.Warn("INSIDE Activate"); player.Out.SendEncumberance(); }
base.Activate(living, sendUpdates);

}
if (living is GamePlayer player)
player.Out.SendEncumberance();
}

public override void Deactivate(GameLiving living, bool sendUpdates)
public override void Deactivate(GameLiving living, bool sendUpdates)
{
base.Deactivate(living, sendUpdates);
base.Deactivate(living, sendUpdates);

// force UI to refresh encumberence value
if (living is GamePlayer player) { log.Warn("INSIDE Deactivate"); player.Out.SendEncumberance(); }
}
if (living is GamePlayer player)
player.Out.SendEncumberance();
}

public override void OnLevelChange(int oldLevel, int newLevel = 0)
{
base.OnLevelChange(oldLevel, newLevel);

// force UI to refresh encumberence value
if (base.m_activeLiving is GamePlayer player) { log.Warn("INSIDE OnLevelChange"); player.Out.SendEncumberance(); }
{
base.OnLevelChange(oldLevel, newLevel);

}

if (m_activeLiving is GamePlayer player)
player.Out.SendEncumberance();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using DOL.Database;
using DOL.GS.Effects;
using DOL.GS.PacketHandler;
using DOL.Language;

namespace DOL.GS.RealmAbilities
{
Expand All @@ -13,32 +7,23 @@ namespace DOL.GS.RealmAbilities
/// </summary>
public class AtlasOF_ToughnessAbility : RAPropertyEnhancer
{

private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

public AtlasOF_ToughnessAbility(DbAbility dba, int level) : base(dba, level, eProperty.MaxHealth) { }

public override int CostForUpgrade(int level) { return AtlasRAHelpers.GetCommonUpgradeCostFor5LevelsRA(level); }

public override int GetAmountForLevel(int level) { return AtlasRAHelpers.GetPropertyEnhancer3AmountForLevel(level); }

public override void Activate(GameLiving living, bool sendUpdates)
public override int CostForUpgrade(int level)
{
log.Warn("INSIDE Activate");
base.Activate(living, sendUpdates);
return AtlasRAHelpers.GetCommonUpgradeCostFor5LevelsRA(level);
}

public override void Deactivate(GameLiving living, bool sendUpdates)
public override int GetAmountForLevel(int level)
{
log.Warn("INSIDE Deactivate");
base.Deactivate(living, sendUpdates);
return AtlasRAHelpers.GetPropertyEnhancer3AmountForLevel(level);
}

public override void OnLevelChange(int oldLevel, int newLevel = 0)
{
log.Warn("INSIDE onLevelChange");
SendUpdates(this.m_activeLiving);
base.OnLevelChange(oldLevel, newLevel);
SendUpdates(m_activeLiving);
}
}
}

0 comments on commit 0232345

Please sign in to comment.