mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-03 11:12:25 +00:00
Add Mob/Client CheckDualWield functions
This commit is contained in:
parent
8d3d3d2af2
commit
99620f8535
@ -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;
|
||||||
|
}
|
||||||
|
|||||||
@ -890,6 +890,7 @@ public:
|
|||||||
void Insight(uint32 t_id);
|
void Insight(uint32 t_id);
|
||||||
bool CheckDoubleAttack(bool tripleAttack = false);
|
bool CheckDoubleAttack(bool tripleAttack = false);
|
||||||
bool CheckDoubleRangedAttack();
|
bool CheckDoubleRangedAttack();
|
||||||
|
bool CheckDualWield();
|
||||||
|
|
||||||
//remove charges/multiple objects from inventory:
|
//remove charges/multiple objects from inventory:
|
||||||
//bool DecreaseByType(uint32 type, uint8 amt);
|
//bool DecreaseByType(uint32 type, uint8 amt);
|
||||||
|
|||||||
@ -428,16 +428,8 @@ bool Client::Process() {
|
|||||||
//you can't see your target
|
//you can't see your target
|
||||||
}
|
}
|
||||||
else if(auto_attack_target->GetHP() > -10) {
|
else if(auto_attack_target->GetHP() > -10) {
|
||||||
float DualWieldProbability = 0.0f;
|
|
||||||
|
|
||||||
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
|
|
||||||
DualWieldProbability = (GetSkill(SkillDualWield) + GetLevel() + Ambidexterity) / 400.0f; // 78.0 max
|
|
||||||
int16 DWBonus = spellbonuses.DualWieldChance + itembonuses.DualWieldChance;
|
|
||||||
DualWieldProbability += DualWieldProbability*float(DWBonus)/ 100.0f;
|
|
||||||
|
|
||||||
float random = zone->random.Real(0, 1);
|
|
||||||
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
|
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
|
||||||
if (random < DualWieldProbability) { // Max 78% of DW
|
if (CheckDualWield()) {
|
||||||
ItemInst *wpn = GetInv().GetItem(MainSecondary);
|
ItemInst *wpn = GetInv().GetItem(MainSecondary);
|
||||||
TryWeaponProc(wpn, auto_attack_target, MainSecondary);
|
TryWeaponProc(wpn, auto_attack_target, MainSecondary);
|
||||||
|
|
||||||
|
|||||||
@ -166,6 +166,7 @@ public:
|
|||||||
void CommonOutgoingHitSuccess(Mob* defender, int32 &damage, SkillUseTypes skillInUse);
|
void CommonOutgoingHitSuccess(Mob* defender, int32 &damage, SkillUseTypes skillInUse);
|
||||||
void CommonBreakInvisible();
|
void CommonBreakInvisible();
|
||||||
bool HasDied();
|
bool HasDied();
|
||||||
|
virtual bool CheckDualWield();
|
||||||
|
|
||||||
//Appearance
|
//Appearance
|
||||||
void SendLevelAppearance();
|
void SendLevelAppearance();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user