Skip to content

Commit

Permalink
Added attribute revamp feature option
Browse files Browse the repository at this point in the history
  • Loading branch information
exectails committed Aug 6, 2023
1 parent 359f2d3 commit 4fed628
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 40 deletions.
3 changes: 3 additions & 0 deletions system/db/features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@

// Lowers ability costs
{ name: "AbilityCostRevamp", enabled: true },

// Simplifies attribute bonuses
{ name: "AttributeBonusRevamp", enabled: true },
]},

// Miscellaneous changes that don't belong to a specific update or are yet
Expand Down
121 changes: 81 additions & 40 deletions system/scripts/core/calc_combat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using Melia.Shared.Data.Database;
using Melia.Shared.Tos.Const;
using Melia.Zone;
using Melia.Zone.Scripting;
using Melia.Zone.Skills;
using Melia.Zone.Skills.Combat;
Expand Down Expand Up @@ -178,49 +179,89 @@ public float SCR_AttributeMultiplier(ICombatEntity attacker, ICombatEntity targe
var attackerAttr = skill.Data.Attribute;
var targetAttr = target.Attribute;

if (attackerAttr == SkillAttribute.Fire)
if (!Feature.IsEnabled("AttributeBonusRevamp"))
{
if (targetAttr == AttributeType.Fire) return 0.75f;
if (targetAttr == AttributeType.Earth) return 1.5f;
if (attackerAttr == SkillAttribute.Fire)
{
if (targetAttr == AttributeType.Fire) return 0.75f;
if (targetAttr == AttributeType.Earth) return 1.5f;
}
else if (attackerAttr == SkillAttribute.Ice)
{
if (targetAttr == AttributeType.Fire) return 1.5f;
if (targetAttr == AttributeType.Ice) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Lightning)
{
if (targetAttr == AttributeType.Ice) return 1.5f;
if (targetAttr == AttributeType.Lightning) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Earth)
{
if (targetAttr == AttributeType.Lightning) return 1.5f;
if (targetAttr == AttributeType.Earth) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Poison)
{
if (targetAttr == AttributeType.Fire) return 1.125f;
if (targetAttr == AttributeType.Ice) return 1.125f;
if (targetAttr == AttributeType.Lightning) return 1.125f;
if (targetAttr == AttributeType.Earth) return 1.125f;
if (targetAttr == AttributeType.Poison) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Holy)
{
if (targetAttr == AttributeType.Holy) return 0.75f;
if (targetAttr == AttributeType.Dark) return 1.5f;
}
else if (attackerAttr == SkillAttribute.Dark)
{
if (targetAttr == AttributeType.Holy) return 1.5f;
if (targetAttr == AttributeType.Dark) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Soul)
{
if (targetAttr == AttributeType.Holy) return 1.25f;
if (targetAttr == AttributeType.Dark) return 1.25f;
if (targetAttr == AttributeType.Soul) return 1.5f;
}
}
else if (attackerAttr == SkillAttribute.Ice)
{
if (targetAttr == AttributeType.Fire) return 1.5f;
if (targetAttr == AttributeType.Ice) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Lightning)
{
if (targetAttr == AttributeType.Ice) return 1.5f;
if (targetAttr == AttributeType.Lightning) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Earth)
{
if (targetAttr == AttributeType.Lightning) return 1.5f;
if (targetAttr == AttributeType.Earth) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Poison)
{
if (targetAttr == AttributeType.Fire) return 1.125f;
if (targetAttr == AttributeType.Ice) return 1.125f;
if (targetAttr == AttributeType.Lightning) return 1.125f;
if (targetAttr == AttributeType.Earth) return 1.125f;
if (targetAttr == AttributeType.Poison) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Holy)
{
if (targetAttr == AttributeType.Holy) return 0.75f;
if (targetAttr == AttributeType.Dark) return 1.5f;
}
else if (attackerAttr == SkillAttribute.Dark)
{
if (targetAttr == AttributeType.Holy) return 1.5f;
if (targetAttr == AttributeType.Dark) return 0.75f;
}
else if (attackerAttr == SkillAttribute.Soul)
else
{
if (targetAttr == AttributeType.Holy) return 1.25f;
if (targetAttr == AttributeType.Dark) return 1.25f;
if (targetAttr == AttributeType.Soul) return 1.5f;
if (attackerAttr == SkillAttribute.Fire)
{
if (targetAttr == AttributeType.Fire) return 0.5f;
if (targetAttr == AttributeType.Earth) return 1.5f;
}
else if (attackerAttr == SkillAttribute.Ice)
{
if (targetAttr == AttributeType.Fire) return 1.5f;
if (targetAttr == AttributeType.Ice) return 0.5f;
}
else if (attackerAttr == SkillAttribute.Lightning)
{
if (targetAttr == AttributeType.Ice) return 2f;
if (targetAttr == AttributeType.Lightning) return 0.5f;
if (targetAttr == AttributeType.Earth) return 0.5f;
}
else if (attackerAttr == SkillAttribute.Earth)
{
if (targetAttr == AttributeType.Lightning) return 1.5f;
if (targetAttr == AttributeType.Earth) return 0.5f;
}
else if (attackerAttr == SkillAttribute.Poison)
{
if (targetAttr == AttributeType.Earth) return 1.5f;
if (targetAttr == AttributeType.Poison) return 0.5f;
}
else if (attackerAttr == SkillAttribute.Holy)
{
if (targetAttr == AttributeType.Dark) return 2f;
}
else if (attackerAttr == SkillAttribute.Dark)
{
if (targetAttr == AttributeType.Holy) return 2f;
}
}

return 1;
Expand Down

0 comments on commit 4fed628

Please sign in to comment.