Skip to content

Commit

Permalink
Auto heal on lord is based on % of max health
Browse files Browse the repository at this point in the history
Auto heal not activated for lord below level 15
  • Loading branch information
DigitalBox98 committed May 28, 2022
1 parent b862cbe commit c69136a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
31 changes: 14 additions & 17 deletions GameServer/ai/brain/Guards/Lord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,23 @@ public LordBrain() : base()

public override void Think()
{
if (GS.ServerProperties.Properties.KEEP_LORD_HEAL_ITSELF == true)
{
if (Body != null && Body.Spells.Count == 0)
// Add auto heal for lord above level 15
if (Body != null && Body.Spells.Count == 0 && Body.Level>=15)
{
switch (Body.Realm)
{
switch (Body.Realm)
{
case eRealm.None:
case eRealm.Albion:
Body.Spells.Add(GuardSpellDB.AlbLordHealSpell);
break;
case eRealm.Midgard:
Body.Spells.Add(GuardSpellDB.MidLordHealSpell);
break;
case eRealm.Hibernia:
Body.Spells.Add(GuardSpellDB.HibLordHealSpell);
break;
}
case eRealm.None:
case eRealm.Albion:
Body.Spells.Add(GuardSpellDB.AlbLordHealSpell);
break;
case eRealm.Midgard:
Body.Spells.Add(GuardSpellDB.MidLordHealSpell);
break;
case eRealm.Hibernia:
Body.Spells.Add(GuardSpellDB.HibLordHealSpell);
break;
}
}

base.Think();
}

Expand Down
2 changes: 1 addition & 1 deletion GameServer/keeps/Gameobjects/Guards/GameKeepGuard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ private static DBSpell LordBaseHealSpell
DBSpell spell = BaseHealSpell;
spell.CastTime = 2;
spell.Target = "Self";
spell.Value = 225;
spell.Value = -2.5; // 2.5% of caster health instead of constant value
if (GameServer.Instance.Configuration.ServerType != eGameServerType.GST_PvE)
spell.Uninterruptible = true;
return spell;
Expand Down
7 changes: 0 additions & 7 deletions GameServer/serverproperty/ServerProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1479,13 +1479,6 @@ public static void InitProperties()
#endregion

#region KEEPS

/// <summary>
/// Possibility for the Keep Lord to heal itself
/// </summary>
[ServerProperty("keeps", "keep_lord_heal_itself", "Possibility for the Keep Lord to heal itself", true)]
public static bool KEEP_LORD_HEAL_ITSELF;

/// <summary>
/// Number of seconds between allowed LOS checks for keep guards
/// </summary>
Expand Down

0 comments on commit c69136a

Please sign in to comment.