AA/Item/Spell that allow pets to flurry and critical will now

also apply to owners swarm pets consistent with live.
This commit is contained in:
KayenEQ
2014-05-07 22:46:00 -04:00
parent 6477de8c4f
commit 7b1a084d39
3 changed files with 19 additions and 6 deletions
+7 -4
View File
@@ -4226,11 +4226,13 @@ void Mob::TryPetCriticalHit(Mob *defender, uint16 skill, int32 &damage)
if (damage < 1) //We can't critical hit if we don't hit.
return;
if (!IsPet())
if (IsPet())
owner = GetOwner();
else if ((IsNPC() && CastToNPC()->GetSwarmOwner()))
owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner());
else
return;
owner = GetOwner();
if (!owner)
return;
@@ -4267,7 +4269,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack
// decided to branch this into it's own function since it's going to be duplicating a lot of the
// code in here, but could lead to some confusion otherwise
if (IsPet() && GetOwner()->IsClient()) {
if (IsPet() && GetOwner()->IsClient() || (IsNPC() && CastToNPC()->GetSwarmOwner())) {
TryPetCriticalHit(defender,skill,damage);
return;
}
@@ -4456,6 +4458,7 @@ void Mob::DoRiposte(Mob* defender) {
//Double Riposte effect, allows for a chance to do RIPOSTE with a skill specfic special attack (ie Return Kick).
//Coded narrowly: Limit to one per client. Limit AA only. [1 = Skill Attack Chance, 2 = Skill]
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1];
if(DoubleRipChance && (DoubleRipChance >= MakeRandomInt(0, 100))) {