From 43671fa749d147680f178f5acf11bbb226ce4f99 Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Thu, 8 Oct 2015 19:26:04 -0400 Subject: [PATCH] Implemented SE_PC_Pet_Flurry_Chance 466 // Base1 % chance to do flurry from double attack hit. --- common/spdat.h | 2 +- zone/attack.cpp | 18 ++++++++++++++++-- zone/bonuses.cpp | 13 +++++++++++-- zone/common.h | 1 + 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index b70be171a..75c6e60c0 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -619,7 +619,7 @@ typedef enum { //#define SE_Shield_Target 463 // #define SE_PC_Pet_Rampage 464 // implemented - Base1 % chance to do rampage for base2 % of damage each melee round //#define SE_PC_Pet_AE_Rampage 465 // Would assume as above but need to confirm. -//#define SE_PC_Pet_Flurry_Chance 466 // +#define SE_PC_Pet_Flurry_Chance 466 // implemented - Base1 % chance to do flurry from double attack hit. //#define SE_DS_Mitigation_Amount 467 // //#define SE_DS_Mitigation_Percentage 468 // //#define SE_Chance_Best_in_Spell_Grp 469 // diff --git a/zone/attack.cpp b/zone/attack.cpp index 3089aa573..2f94716bf 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4763,8 +4763,15 @@ void Mob::DoMainHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int spec // A "quad" on live really is just a successful dual wield where both double attack // The mobs that could triple lost the ability to when the triple attack skill was added in Attack(target, MainPrimary, false, false, false, opts, special); - if (CanThisClassDoubleAttack() && CheckDoubleAttack()) + if (CanThisClassDoubleAttack() && CheckDoubleAttack()){ Attack(target, MainPrimary, false, false, false, opts, special); + + if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){ + int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry; + if (chance && zone->random.Roll(chance)) + Flurry(nullptr); + } + } return; } @@ -4814,8 +4821,15 @@ void Mob::DoOffHandAttackRounds(Mob *target, ExtraAttackOptions *opts, int speci GetEquipment(MaterialSecondary) != 0) { if (CheckDualWield()) { Attack(target, MainSecondary, false, false, false, opts, special); - if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()) + if (CanThisClassDoubleAttack() && GetLevel() > 35 && CheckDoubleAttack()){ Attack(target, MainSecondary, false, false, false, opts, special); + + if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){ + int chance = spellbonuses.PC_Pet_Flurry + itembonuses.PC_Pet_Flurry + aabonuses.PC_Pet_Flurry; + if (chance && zone->random.Roll(chance)) + Flurry(nullptr); + } + } } } } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 772f875e5..bcf70a873 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1423,7 +1423,12 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) if (newbon->PC_Pet_Rampage[1] < base2) newbon->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest break; - } + } + + case SE_PC_Pet_Flurry_Chance: + newbon->PC_Pet_Flurry += base1; //Chance to Flurry + break; + // to do case SE_PetDiscipline: break; @@ -3132,7 +3137,11 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (new_bonus->PC_Pet_Rampage[1] < base2) new_bonus->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest break; - } + } + + case SE_PC_Pet_Flurry_Chance: + new_bonus->PC_Pet_Flurry += effect_value; //Chance to Flurry + break; //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table if (IsAISpellEffect) { diff --git a/zone/common.h b/zone/common.h index af53e1a93..b76a2d21a 100644 --- a/zone/common.h +++ b/zone/common.h @@ -408,6 +408,7 @@ struct StatBonuses { uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs. uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success. uint32 PC_Pet_Rampage[2]; // 0= % chance to rampage, 1=damage modifier + uint32 PC_Pet_Flurry; // Percent chance flurry from double attack // AAs int8 Packrat; //weight reduction for items, 1 point = 10%