Implemented SE_PetMeleeMitigation - Bonus applied to pet owner. Gives AC to owner's pet.

Related AA's to be added in a seperate update.
This commit is contained in:
KayenEQ
2014-06-30 16:17:55 -04:00
committed by Arthur Ice
parent 32d20f22ef
commit 718ba3edbf
5 changed files with 29 additions and 3 deletions
+12 -2
View File
@@ -560,11 +560,21 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac
weight = (CastToClient()->CalcCurrentWeight() / 10.0);
} else if (IsNPC()) {
armor = CastToNPC()->GetRawAC();
int PetACBonus = 0;
if (!IsPet())
armor = (armor / RuleR(Combat, NPCACFactor));
else{
Mob *owner = nullptr;
owner = GetOwner();
if (owner){
PetACBonus = owner->aabonuses.PetMeleeMitigation
+ owner->itembonuses.PetMeleeMitigation +
owner->spellbonuses.PetMeleeMitigation;
}
}
armor += spellbonuses.AC + itembonuses.AC + 1;
armor += spellbonuses.AC + itembonuses.AC + PetACBonus + 1;
}
if (opts) {
@@ -4447,7 +4457,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse)
uint32 FB_Dmg = aabonuses.FinishingBlow[1] + spellbonuses.FinishingBlow[1] + itembonuses.FinishingBlow[1];
uint16 FB_Level = 0; //Get Highest Headshot Level
uint16 FB_Level = 0;
FB_Level = aabonuses.FinishingBlowLvl[0];
if (FB_Level < spellbonuses.FinishingBlowLvl[0])
FB_Level = spellbonuses.FinishingBlowLvl[0];
+14
View File
@@ -1311,6 +1311,10 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon)
break;
}
case SE_PetMeleeMitigation:
newbon->PetMeleeMitigation += base1;
break;
}
}
}
@@ -2844,6 +2848,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
break;
}
case SE_PetMeleeMitigation:
newbon->PetMeleeMitigation += effect_value;
break;
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) {
@@ -4075,6 +4083,12 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
itembonuses.GivePetGroupTarget = false;
break;
case SE_PetMeleeMitigation:
spellbonuses.PetMeleeMitigation = effect_value;
itembonuses.PetMeleeMitigation = effect_value;
aabonuses.PetMeleeMitigation = effect_value;
break;
case SE_RootBreakChance:
spellbonuses.RootBreakChance = effect_value;
aabonuses.RootBreakChance = effect_value;
+1
View File
@@ -427,6 +427,7 @@ struct StatBonuses {
uint8 HSLevel; // Max Level Headshot will be effective at.
uint32 Assassinate[2]; // Assassinate AA (Massive dmg vs humaniod w/ assassinate) 0= ? 1= Dmg
uint8 AssassinateLevel; // Max Level Assassinate will be effective at.
int32 PetMeleeMitigation; // Add AC to owner's pet.
};