diff options
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b847c8f139..87dbb64a6a 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -310,8 +310,7 @@ void Spell::EffectEnvironmentalDMG(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->EnvironmentalDamage(DAMAGE_FIRE, damage); else { - DamageInfo dmgInfo(m_caster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK); - m_caster->CalcAbsorbResist(dmgInfo); + DamageInfo dmgInfo(m_caster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE); uint32 absorb = dmgInfo.GetAbsorb(); uint32 resist = dmgInfo.GetResist(); @@ -2343,7 +2342,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) int32 duration = m_spellInfo->GetDuration(); if (Player* modOwner = m_originalCaster->GetSpellModOwner()) - modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration); + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); TempSummon* summon = nullptr; @@ -3149,7 +3148,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) int32 duration = m_spellInfo->GetDuration(); if(Player* modOwner = m_originalCaster->GetSpellModOwner()) - modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration); + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); Player* owner = m_originalCaster->ToPlayer(); if (!owner && m_originalCaster->ToCreature()->IsTotem()) @@ -3723,7 +3722,6 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex) { int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false, 1 << effIndex); unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), duration/*spellInfo->GetDuration()*/); - m_originalCaster->ProcSkillsAndAuras(unitTarget, PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_HIT, PROC_HIT_INTERRUPT, nullptr, nullptr, nullptr); } ExecuteLogEffectInterruptCast(effIndex, unitTarget, curSpellInfo->Id); unitTarget->InterruptSpell(CurrentSpellTypes(i), false); @@ -4684,17 +4682,18 @@ void Spell::EffectResurrect(SpellEffIndex effIndex) void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) + { return; + } - if (!unitTarget || !unitTarget->IsAlive() || !unitTarget->GetVictim()) - return; - - if (unitTarget->m_extraAttacks) + if (!unitTarget || !unitTarget->IsAlive()) + { return; + } - unitTarget->m_extraAttacks = damage; + unitTarget->AddExtraAttacks(damage); - ExecuteLogEffectExtraAttacks(effIndex, unitTarget->GetVictim(), damage); + ExecuteLogEffectExtraAttacks(effIndex, unitTarget, damage); } void Spell::EffectParry(SpellEffIndex /*effIndex*/) @@ -5817,8 +5816,19 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) m_runesState = m_caster->ToPlayer()->GetRunesState(); uint32 count = damage; - if (count == 0) - count = 1; + if (count == 0) count = 1; + for (uint32 j = 0; j < MAX_RUNES && count > 0; ++j) + { + if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue)) + { + if (m_spellInfo->Id == 45529) + if (player->GetBaseRune(j) != RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) + continue; + player->SetRuneCooldown(j, 0); + player->SetGracePeriod(j, player->IsInCombat()); // xinef: reset grace period + --count; + } + } // Blood Tap if (m_spellInfo->Id == 45529 && count > 0) @@ -5826,10 +5836,10 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) for (uint32 l = 0; l < MAX_RUNES && count > 0; ++l) { // Check if both runes are on cd as that is the only time when this needs to come into effect - if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RUNE_BLOOD) && (player->GetRuneCooldown(l + 1) && player->GetCurrentRune(l + 1) == RUNE_BLOOD)) + if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l + 1) && player->GetCurrentRune(l + 1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB))) { // Should always update the rune with the lowest cd - if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l + 1)) + if (player->GetRuneCooldown(l) >= player->GetRuneCooldown(l + 1)) l++; player->SetRuneCooldown(l, 0); player->SetGracePeriod(l, player->IsInCombat()); // xinef: reset grace period @@ -5840,15 +5850,6 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) } } - for (uint32 j = 0; j < MAX_RUNES && count > 0; ++j) - { - if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue)) - { - player->SetRuneCooldown(j, 0); - --count; - } - } - // Empower rune weapon if (m_spellInfo->Id == 47568) { @@ -5858,7 +5859,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) for (uint32 i = 0; i < MAX_RUNES; ++i) { - if (player->GetRuneCooldown(i) && (player->GetCurrentRune(i) == RUNE_FROST)) + if (player->GetRuneCooldown(i) && (player->GetCurrentRune(i) == RUNE_FROST || player->GetCurrentRune(i) == RUNE_DEATH)) { player->SetRuneCooldown(i, 0); player->SetGracePeriod(i, player->IsInCombat()); // xinef: reset grace period @@ -6060,7 +6061,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* int32 duration = m_spellInfo->GetDuration(); if (Player* modOwner = m_originalCaster->GetSpellModOwner()) - modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration); + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); //TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; Map* map = caster->GetMap(); |