mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Spells: Implementation of QAston proc system
- Move checks from Unit::IsTriggeredAtSpellProcEvent (old system) to Aura::IsProcTriggeredOnEvent (new system) - Templatize SpellModOp param of Player::ApplySpellMod, also killed charge counter from SpellModifier and Player system for handling charges... no point in having 3 different systems doing the same thing - Automatically add default entries to spellProcMap, based on spellinfo (else auras won't proc without an entry) Based on old Unit::ProcDamageAndSpellFor - Old Unit::ProcDamageAndSpellFor renamed to Unit::ProcSkillsAndReactives and made private, will no longer handle auras. - Start making use of HealInfo::AbsorbHeal in unit calculations, add effective healing info to HealInfo struct - Changes in spell reflection system, emulates old behaviour, delaying aura drop - Removed old charge count hacks in SpellMgr::LoadSpellInfoCorrections - Removed bogus error log when procChance is 0: Some auras have initial 0 procChance but modified by SPELLMOD_CHANCE_OF_SUCCESS - Fixed TriggerAurasProcOnEvent logic that tried to trigger twice from actor. - Allow non damaging spells with DamageClass Melee or Ranged to proc character enchants. Ref issue #17034: * http://web.archive.org/web/20110309092008/http://elitistjerks.com/f47/t49865-paladin_retribution_pve/ * When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system). * 1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..) * 2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided. * Holy Vengeance is the "hidden strike" it has an apply aura effect and damage class melee. - Fixed Blood Tap interaction with Death Runes (btw, don't know what was going on with those MiscValueB, spell 45529 doesn't have any MiscValueB in SPELL_EFFECT_ACTIVATE_RUNE) - Ported some AuraEffect checks from old Unit.cpp function. added new AuraScript hook to check procs of an specific effect - Allow only AuraEffects that passed the check to proc, this won't block whole aura from proccing (and lose charges) if at least one of the effects procs, though - Changes in spell mod system (for SPELLMOD_CASTING_TIME). fixes #17558. - Added an exception for SPELLMOD_CRITICAL_CHANCE too, fixes #15193
This commit is contained in:
@@ -1343,7 +1343,8 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex)
|
||||
healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL);
|
||||
healthGain = m_caster->SpellHealingBonusTaken(m_caster, m_spellInfo, healthGain, HEAL);
|
||||
|
||||
m_caster->HealBySpell(m_caster, m_spellInfo, uint32(healthGain));
|
||||
HealInfo healInfo(m_caster, m_caster, healthGain, m_spellInfo, m_spellSchoolMask);
|
||||
m_caster->HealBySpell(healInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2032,7 +2033,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
||||
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration);
|
||||
|
||||
TempSummon* summon = NULL;
|
||||
|
||||
@@ -5180,18 +5181,8 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
|
||||
m_runesState = m_caster->ToPlayer()->GetRunesState();
|
||||
|
||||
uint32 count = damage;
|
||||
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);
|
||||
--count;
|
||||
}
|
||||
}
|
||||
if (count == 0)
|
||||
count = 1;
|
||||
|
||||
// Blood Tap
|
||||
if (m_spellInfo->Id == 45529 && count > 0)
|
||||
@@ -5199,11 +5190,12 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
|
||||
for (uint32 l = 0; l + 1 < 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->GetBaseRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetBaseRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
|
||||
if ((player->GetRuneCooldown(l) && player->GetBaseRune(l) == RUNE_BLOOD) && (player->GetRuneCooldown(l + 1) && player->GetBaseRune(l + 1) == RUNE_BLOOD))
|
||||
{
|
||||
// Should always update the rune with the lowest cd
|
||||
if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1))
|
||||
l++;
|
||||
if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l + 1))
|
||||
++l;
|
||||
|
||||
player->SetRuneCooldown(l, 0);
|
||||
--count;
|
||||
// is needed to push through to the client that the rune is active
|
||||
@@ -5214,6 +5206,15 @@ 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)
|
||||
{
|
||||
@@ -5223,7 +5224,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
|
||||
|
||||
for (uint32 i = 0; i < MAX_RUNES; ++i)
|
||||
{
|
||||
if (player->GetRuneCooldown(i) && (player->GetCurrentRune(i) == RUNE_FROST || player->GetCurrentRune(i) == RUNE_DEATH))
|
||||
if (player->GetRuneCooldown(i) && (player->GetBaseRune(i) == RUNE_FROST))
|
||||
player->SetRuneCooldown(i, 0);
|
||||
}
|
||||
}
|
||||
@@ -5357,7 +5358,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const*
|
||||
int32 duration = m_spellInfo->GetDuration();
|
||||
|
||||
if (Player* modOwner = m_originalCaster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration);
|
||||
modOwner->ApplySpellMod<SPELLMOD_DURATION>(m_spellInfo->Id, duration);
|
||||
|
||||
//TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
|
||||
Map* map = caster->GetMap();
|
||||
|
||||
Reference in New Issue
Block a user