mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
refactor(Core/Spells): Implement QAston Proc System (#11079)
* . * sql * . * . * 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * Update spell_item.cpp * Update Unit.cpp * 16 * 17 * 18 * 19 * 20 * 21 * Update Unit.cpp * REVERT UltraNIX Commit * 22 * 23 * . * . * . * warrior * warlock * shaman rogue priest paladin mage * spell item * hunter * druid * dk * war * error style * Update rev_1647677899565690722.sql * Update rev_1647677899565690722.sql * Update rev_1647677899565690722.sql * . * DOND DEL ME WAD DO DO * error 2 * . * . * . * FIX * Update SpellInfoCorrections.cpp * Update SpellInfoCorrections.cpp * . * ja genau * Update .gitignore * . * . * ., * . * . * . * . * Update Unit.cpp
This commit is contained in:
committed by
GitHub
parent
5189b43a28
commit
cbd3fd0967
@@ -310,7 +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);
|
||||
DamageInfo dmgInfo(m_caster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK);
|
||||
|
||||
uint32 absorb = dmgInfo.GetAbsorb();
|
||||
uint32 resist = dmgInfo.GetResist();
|
||||
@@ -2342,7 +2342,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 = nullptr;
|
||||
|
||||
@@ -3148,7 +3148,7 @@ void Spell::EffectSummonPet(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);
|
||||
|
||||
Player* owner = m_originalCaster->ToPlayer();
|
||||
if (!owner && m_originalCaster->ToCreature()->IsTotem())
|
||||
@@ -3722,6 +3722,7 @@ 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);
|
||||
@@ -4682,18 +4683,17 @@ void Spell::EffectResurrect(SpellEffIndex effIndex)
|
||||
void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!unitTarget || !unitTarget->IsAlive())
|
||||
{
|
||||
if (!unitTarget || !unitTarget->IsAlive() || !unitTarget->GetVictim())
|
||||
return;
|
||||
}
|
||||
|
||||
unitTarget->AddExtraAttacks(damage);
|
||||
if (unitTarget->m_extraAttacks)
|
||||
return;
|
||||
|
||||
ExecuteLogEffectExtraAttacks(effIndex, unitTarget, damage);
|
||||
unitTarget->m_extraAttacks = damage;
|
||||
|
||||
ExecuteLogEffectExtraAttacks(effIndex, unitTarget->GetVictim(), damage);
|
||||
}
|
||||
|
||||
void Spell::EffectParry(SpellEffIndex /*effIndex*/)
|
||||
@@ -5816,19 +5816,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);
|
||||
player->SetGracePeriod(j, player->IsInCombat()); // xinef: reset grace period
|
||||
--count;
|
||||
}
|
||||
}
|
||||
if (count == 0)
|
||||
count = 1;
|
||||
|
||||
// Blood Tap
|
||||
if (m_spellInfo->Id == 45529 && count > 0)
|
||||
@@ -5836,10 +5825,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) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l + 1) && player->GetCurrentRune(l + 1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
|
||||
if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RUNE_BLOOD) && (player->GetRuneCooldown(l + 1) && player->GetCurrentRune(l + 1) == RUNE_BLOOD))
|
||||
{
|
||||
// Should always update the rune with the lowest cd
|
||||
if (player->GetRuneCooldown(l) >= player->GetRuneCooldown(l + 1))
|
||||
if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l + 1))
|
||||
l++;
|
||||
player->SetRuneCooldown(l, 0);
|
||||
player->SetGracePeriod(l, player->IsInCombat()); // xinef: reset grace period
|
||||
@@ -5850,6 +5839,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)
|
||||
{
|
||||
@@ -5859,7 +5857,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->GetCurrentRune(i) == RUNE_FROST))
|
||||
{
|
||||
player->SetRuneCooldown(i, 0);
|
||||
player->SetGracePeriod(i, player->IsInCombat()); // xinef: reset grace period
|
||||
@@ -6061,7 +6059,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