From f73630dd0ecbe65fd1020071deddf5726ba16939 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sun, 10 Feb 2019 18:43:54 +0100 Subject: [PATCH] Core/Pets: * corrected level 85 stats for Death Knight's Risen Ghoul * removed an old leftover that was causing Blood Worms to have way too much health * enabled and use Avoidance for Death Knight Ghouls used in Raise Dead and Army of the Dead --- .../custom/custom_2019_02_10_01_world.sql | 5 ++ src/server/game/Entities/Pet/Pet.cpp | 12 +++-- src/server/game/Entities/Unit/StatSystem.cpp | 9 ---- src/server/scripts/Spells/spell_pet.cpp | 54 ++++++++----------- 4 files changed, 35 insertions(+), 45 deletions(-) create mode 100644 sql/updates/world/custom/custom_2019_02_10_01_world.sql diff --git a/sql/updates/world/custom/custom_2019_02_10_01_world.sql b/sql/updates/world/custom/custom_2019_02_10_01_world.sql new file mode 100644 index 00000000000..ae120077a59 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_02_10_01_world.sql @@ -0,0 +1,5 @@ +UPDATE `pet_levelstats` SET `str`= 476, `agi`= 3343, `sta`= 546, `inte`= 69, `spi`= 116 WHERE `creature_entry`= 26125 AND `level`= 85; + +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dk_avoidance_passive'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(62137, 'spell_dk_avoidance_passive'); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 8a7119c0183..eb16755d13d 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1080,20 +1080,24 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) break; } case ENTRY_EBON_IMP: - { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE))); + SetBonusDamage(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE)); break; - } case ENTRY_ARMY_OF_THE_DEAD_GHOUL: { - SetCreateHealth(m_owner->CountPctFromMaxHealth(50)); + SetCreateHealth(m_owner->CountPctFromMaxHealth(45)); SetBonusDamage(int32(GetOwner()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f)); float minDamage = m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.05f; float maxDamage = m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.05f; SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, minDamage); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, maxDamage); + if (!HasAura(62137)) // Avoidance + CastSpell(this, 62137, true); break; } + case ENTRY_GHOUL: + if (!HasAura(62137)) // Avoidance + CastSpell(this, 62137, true); + break; } break; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index af625f7b3f4..025f2c4f13b 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1029,15 +1029,6 @@ void Guardian::UpdateMaxHealth() float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA); float multiplicator = 10.0f; - switch (GetEntry()) - { - case ENTRY_BLOODWORM: - multiplicator = 1.0f; - break; - default: - break; - } - float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth(); value *= GetModifierValue(unitMod, BASE_PCT); value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator; diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 72652442b04..26e395cfeec 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -775,48 +775,37 @@ class spell_hun_pet_passive_crit : public AuraScript } }; -class spell_dk_avoidance_passive : public SpellScriptLoader +class spell_dk_avoidance_passive : public AuraScript { -public: - spell_dk_avoidance_passive() : SpellScriptLoader("spell_dk_avoidance_passive") { } + PrepareAuraScript(spell_dk_avoidance_passive); - class spell_dk_avoidance_passive_AuraScript : public AuraScript + bool Load() override { - PrepareAuraScript(spell_dk_avoidance_passive_AuraScript); + if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } - bool Load() override + void CalculateAvoidanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = true; + if (Unit* pet = GetUnitOwner()) { - if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER) - return false; - return true; - } - - void CalculateAvoidanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& canBeRecalculated) - { - canBeRecalculated = true; - if (Unit* pet = GetUnitOwner()) + if (Unit* owner = pet->GetOwner()) { - if (Unit* owner = pet->GetOwner()) - { - // Army of the dead ghoul - if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) - amount = -90; - // Night of the dead - else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) - amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); - } + // Army of the dead ghoul + if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL) + amount = -90; + // Night of the dead + else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) + amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); } } + } - void Register() override - { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_avoidance_passive_AuraScript::CalculateAvoidanceAmount, EFFECT_0, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_dk_avoidance_passive_AuraScript(); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_avoidance_passive::CalculateAvoidanceAmount, EFFECT_0, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE); } }; @@ -1174,6 +1163,7 @@ void AddSC_pet_spell_scripts() RegisterAuraScript(spell_hun_pet_scaling_05); RegisterAuraScript(spell_hun_pet_passive_crit); + RegisterAuraScript(spell_dk_avoidance_passive); RegisterAuraScript(spell_dk_pet_scaling_01); RegisterAuraScript(spell_dk_pet_scaling_02); RegisterAuraScript(spell_dk_pet_scaling_03);