From 0e91a0e54c4fd00c71ee4a7fd9d6a305110cbcc8 Mon Sep 17 00:00:00 2001 From: Trisjdc Date: Thu, 24 Jul 2014 03:40:05 +0100 Subject: Core/Spells: Solving the double dips in Hammer of the Righteous --- src/server/game/Spells/SpellEffects.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/server/game/Spells') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0ab4e7c9e6e..0ee494d2898 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -625,8 +625,13 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Hammer of the Righteous if (m_spellInfo->SpellFamilyFlags[1]&0x00040000) { + float min_damage = m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE); + float max_damage = m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE); + if (Player* player = m_caster->ToPlayer()) // UNIT_FIELD_MINDAMAGE/MAXDAMAGE already include damage bonuses, so try to get them without damage bonuses + player->CalculateMinMaxDamage(BASE_ATTACK, false, false, min_damage, max_damage); + + float average = (min_damage + max_damage) / 2; // Add main hand dps * effect[2] amount - float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2; int32 count = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, EFFECT_2); damage += count * int32(average * IN_MILLISECONDS) / m_caster->GetAttackTime(BASE_ATTACK); break; -- cgit v1.2.3 From 296956e06e02c06135aab6c5d86535b7e256a6b0 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Thu, 24 Jul 2014 16:14:25 +0200 Subject: Revert "Core/Spells: Death and Decay" This reverts commit 02d56e00bc256f224b7d05f90af2c0af7cb287bf. --- .../2014_07_24_08_world_spell_script_names.sql | 3 +++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 7 ------ src/server/scripts/Northrend/zone_dalaran.cpp | 6 ++--- src/server/scripts/Spells/spell_dk.cpp | 29 ++++++++++++++++++++++ 4 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 sql/updates/world/2014_07_24_08_world_spell_script_names.sql (limited to 'src/server/game/Spells') diff --git a/sql/updates/world/2014_07_24_08_world_spell_script_names.sql b/sql/updates/world/2014_07_24_08_world_spell_script_names.sql new file mode 100644 index 00000000000..16c12b70c5a --- /dev/null +++ b/sql/updates/world/2014_07_24_08_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM spell_script_names WHERE spell_id=-43265; +INSERT INTO spell_script_names VALUES +(-43265, 'spell_dk_death_and_decay'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 2205f0d4607..1894776c990 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5457,13 +5457,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const target->DealDamage(target, damage, NULL, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); break; } - // Death and Decay - if (GetSpellInfo()->SpellFamilyFlags[0] & 0x20) - { - if (caster) - target->CastCustomSpell(target, 52212, &m_amount, NULL, NULL, true, 0, this, caster->GetGUID()); - break; - } // Blood of the North // Reaping // Death Rune Mastery diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index 4cd0e929cd2..fb5e63a2301 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -202,7 +202,7 @@ class npc_minigob_manabonk : public CreatureScript me->setActive(true); } - void Reset() + void Reset() override { me->SetVisible(false); events.ScheduleEvent(EVENT_SELECT_TARGET, IN_MILLISECONDS); @@ -232,7 +232,7 @@ class npc_minigob_manabonk : public CreatureScript CharacterDatabase.CommitTransaction(trans); } - void UpdateAI(uint32 diff) + void UpdateAI(uint32 diff) override { events.Update(diff); @@ -276,7 +276,7 @@ class npc_minigob_manabonk : public CreatureScript EventMap events; }; - CreatureAI* GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const override { return new npc_minigob_manabonkAI(creature); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 84608ba42f1..1d6dcdfaa6d 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -36,6 +36,7 @@ enum DeathKnightSpells SPELL_DK_BLOOD_PRESENCE = 48266, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999, SPELL_DK_CORPSE_EXPLOSION_VISUAL = 51270, + SPELL_DK_DEATH_AND_DECAY_DAMAGE = 52212, SPELL_DK_DEATH_COIL_DAMAGE = 47632, SPELL_DK_DEATH_COIL_HEAL = 47633, SPELL_DK_DEATH_STRIKE_HEAL = 45470, @@ -445,6 +446,33 @@ class spell_dk_corpse_explosion : public SpellScriptLoader } }; +class spell_dk_death_and_decay : public SpellScriptLoader +{ + public: + spell_dk_death_and_decay() : SpellScriptLoader("spell_dk_death_and_decay") { } + + class spell_dk_death_and_decay_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_death_and_decay_AuraScript); + + void HandleDummyTick(AuraEffect const* aurEff) + { + if (Unit* caster = GetCaster()) + caster->CastCustomSpell(SPELL_DK_DEATH_AND_DECAY_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_death_and_decay_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_death_and_decay_AuraScript(); + } +}; + // -47541, 52375, 59134, -62900 - Death Coil class spell_dk_death_coil : public SpellScriptLoader { @@ -1545,6 +1573,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_blood_boil(); new spell_dk_blood_gorged(); new spell_dk_corpse_explosion(); + new spell_dk_death_and_decay(); new spell_dk_death_coil(); new spell_dk_death_gate(); new spell_dk_death_grip(); -- cgit v1.2.3