Add Mob/Client CheckDualWield functions

This commit is contained in:
Michael Cook (mackal)
2015-07-05 00:45:46 -04:00
parent 8d3d3d2af2
commit 99620f8535
4 changed files with 31 additions and 9 deletions
+28
View File
@@ -5075,3 +5075,31 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
}
}
}
bool Mob::CheckDualWield()
{
// Pets /might/ follow a slightly different progression
// although it could all be from pets having different skills than most mobs
int chance = GetSkill(SkillDualWield);
if (GetLevel() > 35)
chance += GetLevel();
chance += aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
int per_inc = spellbonuses.DualWieldChance + aabonuses.DualWieldChance + itembonuses.DualWieldChance;
if (per_inc)
chance += chance * per_inc / 100;
return zone->random.Int(1, 375) <= chance;
}
bool Client::CheckDualWield()
{
int chance = GetSkill(SkillDualWield) + GetLevel();
chance += aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
int per_inc = spellbonuses.DualWieldChance + aabonuses.DualWieldChance + itembonuses.DualWieldChance;
if (per_inc)
chance += chance * per_inc / 100;
return zone->random.Int(1, 375) <= chance;
}