Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating legacy function for player melee skill #2908

Merged
merged 2 commits into from
Apr 11, 2020
Merged
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
20 changes: 8 additions & 12 deletions Source/ACE.Server/WorldObjects/Player_Combat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,23 @@ public override Skill GetCurrentWeaponSkill()
{
var weapon = GetEquippedWeapon();

// missile weapon
if (weapon != null && weapon.CurrentWieldedLocation == EquipMask.MissileWeapon)
return GetCreatureSkill(Skill.MissileWeapons).Skill;
if (weapon?.WeaponSkill == null)
return GetHighestMeleeSkill();

if (weapon != null && weapon.WeaponSkill == Skill.TwoHandedCombat)
return Skill.TwoHandedCombat;

// hack for converting pre-MoA skills
var maxMelee = GetCreatureSkill(GetHighestMeleeSkill());
var skill = ConvertToMoASkill(weapon.WeaponSkill);

// DualWieldAlternate will be TRUE if *next* attack is offhand
if (IsDualWieldAttack && !DualWieldAlternate)
{
var weaponSkill = GetCreatureSkill(skill);
var dualWield = GetCreatureSkill(Skill.DualWield);

// offhand attacks use the lower skill level between dual wield and weapon skill
if (dualWield.Current < maxMelee.Current)
return dualWield.Skill;
if (dualWield.Current < weaponSkill.Current)
skill = Skill.DualWield;
}

return maxMelee.Skill;
//Console.WriteLine($"{Name}.GetCurrentWeaponSkill - {skill}");
return skill;
}

/// <summary>
Expand Down