From e8b5543ed722ae384e512dc9d9579449a9db7ab2 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 15 Feb 2019 21:37:31 +0100 Subject: [PATCH] Core/Spells: * Bloodshield Mastery will now stack with already existing Blood Shields up to 100% of the caster's maximum health * updated Will of the Necropolis to 4.3.4 * update Crimson Scourge proc check * silence proc console spam when using Improved Blood Presence --- .../custom/custom_2019_02_15_00_world.sql | 5 +++ src/server/game/Spells/SpellEffects.cpp | 5 ++- src/server/scripts/Spells/spell_dk.cpp | 42 +++++++++++++------ 3 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 sql/updates/world/custom/custom_2019_02_15_00_world.sql diff --git a/sql/updates/world/custom/custom_2019_02_15_00_world.sql b/sql/updates/world/custom/custom_2019_02_15_00_world.sql new file mode 100644 index 0000000000..79403604c6 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_02_15_00_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_proc` WHERE `SpellId` IN (-49219, -52284, 96171, 50371); +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Cooldown`, `Charges`, `ProcsPerMinute`, `Chance`) VALUES +(-52284, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45000, 0, 0, 0), +(96171, 15, 0x00000008, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0), +(50371, 0, 0, 0, 0, 0, 0, 1, 0, 16 | 32 | 64, 0, 0, 0, 0); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index adc894217c..0e0f087426 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2936,8 +2936,9 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (uint32 runic = std::min(uint32(m_caster->GetPower(POWER_RUNIC_POWER) / 2.5f), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(m_caster))) AddPct(totalDamagePercentMod, runic); } - // Obliterate / Blood Strike (12.5% more damage per disease) / Heart Strike (15% more damage per disease) - if (m_spellInfo->SpellFamilyFlags[1] & 0x20000 || m_spellInfo->SpellFamilyFlags[0] & 0x400000 || m_spellInfo->SpellFamilyFlags[0] & 0x1000000) + // Obliterate / Blood Strike / Blood-Caked Strike (12.5% more damage per disease) / Heart Strike (15% more damage per disease) + if (m_spellInfo->SpellFamilyFlags[1] & 0x20000 || m_spellInfo->SpellFamilyFlags[0] & 0x400000 + || m_spellInfo->SpellFamilyFlags[0] & 0x1000000 || m_spellInfo->Id == 50463) { float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue(m_caster); uint8 diseaseCount = unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), false); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 85c7f8e817..f48cefd8d6 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -46,6 +46,7 @@ enum DeathKnightSpells SPELL_DK_BLOOD_SHIELD_ABSORB = 77535, SPELL_DK_BLOOD_STRIKE = 45902, SPELL_DK_BLOOD_STRIKE_OFFHAND = 66215, + SPELL_DK_BLOOD_TAP = 45529, SPELL_DK_BUTCHERY = 50163, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999, SPELL_DK_DARK_TRANSFORMATION_DUMMY = 93426, @@ -510,6 +511,7 @@ class spell_dk_death_strike : public SpellScript void HandleDummy(SpellEffIndex /*effIndex*/) { int32 heal = 0; + if (AuraEffect* enabler = GetCaster()->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID())) { // Call CalculateAmount() to constantly fire the AuraEffect's HandleCalcAmount method @@ -526,7 +528,14 @@ class spell_dk_death_strike : public SpellScript return; if (AuraEffect const* aurEff = GetCaster()->GetAuraEffect(SPELL_DK_BLOOD_SHIELD_MASTERY, EFFECT_0)) - GetCaster()->CastCustomSpell(SPELL_DK_BLOOD_SHIELD_ABSORB, SPELLVALUE_BASE_POINT0, CalculatePct(heal, aurEff->GetAmount()), GetCaster(), true); + { + int32 bp = CalculatePct(heal, aurEff->GetAmount()); + + if (AuraEffect const* bloodShieldEffect = GetCaster()->GetAuraEffect(SPELL_DK_BLOOD_SHIELD_ABSORB, EFFECT_0)) + bp += std::min(bp + bloodShieldEffect->GetAmount(), int32(GetCaster()->GetMaxHealth())); + + GetCaster()->CastCustomSpell(SPELL_DK_BLOOD_SHIELD_ABSORB, SPELLVALUE_BASE_POINT0, bp, GetCaster(), true); + } } void Register() override @@ -1172,6 +1181,7 @@ class spell_dk_vampiric_blood : public AuraScript } }; +// Updated 4.3.4 // -52284 - Will of the Necropolis class spell_dk_will_of_the_necropolis : public AuraScript { @@ -1179,22 +1189,24 @@ class spell_dk_will_of_the_necropolis : public AuraScript bool Validate(SpellInfo const* /*spellInfo*/) override { - return ValidateSpellInfo({ SPELL_DK_WILL_OF_THE_NECROPOLIS }); + return ValidateSpellInfo( + { + SPELL_DK_WILL_OF_THE_NECROPOLIS, + SPELL_DK_BLOOD_TAP + }); } bool CheckProc(ProcEventInfo& eventInfo) { - //! HACK due to currenct proc system implementation - if (Player* player = GetTarget()->ToPlayer()) - if (player->GetSpellHistory()->HasCooldown(GetId())) - return false; - return GetTarget()->HealthBelowPctDamaged(30, eventInfo.GetDamageInfo()->GetDamage()); } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { - GetTarget()->CastSpell(GetTarget(), SPELL_DK_WILL_OF_THE_NECROPOLIS, true, nullptr, aurEff); + Unit* target = GetTarget(); + int32 bp = aurEff->GetAmount(); + target->CastCustomSpell(SPELL_DK_WILL_OF_THE_NECROPOLIS, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff); + target->GetSpellHistory()->ResetCooldown(SPELL_DK_BLOOD_TAP, true); } void Register() override @@ -1610,19 +1622,23 @@ class spell_dk_crimson_scourge : public AuraScript { PrepareAuraScript(spell_dk_crimson_scourge); - void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_DK_BLOOD_PLAGUE }); + } + + bool CheckProc(ProcEventInfo& eventInfo) { if (DamageInfo* damage = eventInfo.GetDamageInfo()) if (Unit* target = damage->GetVictim()) - if (target->GetDiseasesByCaster(GetTarget()->GetGUID(), false)) - return; + return target->HasAura(SPELL_DK_BLOOD_PLAGUE, GetTarget()->GetGUID()); - PreventDefaultAction(); + return false; } void Register() override { - OnEffectProc += AuraEffectProcFn(spell_dk_crimson_scourge::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); + DoCheckProc += AuraCheckProcFn(spell_dk_crimson_scourge::CheckProc); } };