Core/Misc:

* applied character database updates for the caster depenency removal
* corrected implementation of SPELL_ATTR3_SUPPRESS_CASTER_PROCS and SPELL_ATTR3_SUPPRESS_TARGET_PROCS based on master branch
* removed a duplicate SpellAuraInterruptFlags::ActionDelayed removal call
This commit is contained in:
Ovahlord committed 2022-09-12 09:15:14 +02:00
1 parent 4bb8c93df8
commit c901772640
4 files changed
+38 -35

No files matched your search

+5
View File
@@ -653,6 +653,8 @@ CREATE TABLE `character_aura` (
`maxDuration` int NOT NULL DEFAULT '0',
`remainTime` int NOT NULL DEFAULT '0',
`remainCharges` tinyint unsigned NOT NULL DEFAULT '0',
`critChance` float NOT NULL DEFAULT '0',
`applyResilience` tinyint(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`casterGuid`,`spell`,`effectMask`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Player System';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2690,6 +2692,8 @@ CREATE TABLE `pet_aura` (
`maxDuration` int NOT NULL DEFAULT '0',
`remainTime` int NOT NULL DEFAULT '0',
`remainCharges` tinyint unsigned NOT NULL DEFAULT '0',
`critChance` float NOT NULL DEFAULT '0',
`applyResilience` tinyint(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`casterGuid`,`spell`,`effectMask`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Pet System';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -3051,6 +3055,7 @@ INSERT INTO `updates` VALUES
('2021_12_31_01_characters.sql','F8E15AA6AF18DAD176ABA9B3EFCE766DF1B0ACB5','ARCHIVED','2021-12-31 18:28:45',0),
('2022_01_01_00_characters.sql','336E62A8850A3E78A1D0BD3E81FFD5769184BDF8','ARCHIVED','2022-01-01 11:04:58',0),
('2022_01_09_00_characters.sql','1420602F3A6F5AAE1CB59045C47E33A3CE8809A4','ARCHIVED','2022-01-09 00:12:22',0),
('2022_09_01_00_characters.sql','E3C0DA9995BA71ED5A267294470CD03DC51862DD','RELEASED','2022-09-01 14:51:33',0),
('custom_2017_12_21_00_characters.sql','2D5B3830D47E4BC717EC468E18E477A32B9A21BF','ARCHIVED','2019-11-06 00:17:44',0),
('custom_2018_01_07_00_characters.sql','7437B6243B3CB6FA08F6A37BB39E38930B0DCFD3','ARCHIVED','2019-11-06 00:17:44',0),
('custom_2018_03_18_00_characters.sql','8D1E81A7272F643687C67443C270D17255A9AA84','ARCHIVED','2019-11-06 00:17:44',0),
@@ -0,0 +1,7 @@
ALTER TABLE `character_aura`
ADD COLUMN `critChance` FLOAT NOT NULL DEFAULT '0' AFTER `remainCharges`,
ADD COLUMN `applyResilience` TINYINT(3) NOT NULL DEFAULT '0' AFTER `critChance`;
ALTER TABLE `pet_aura`
ADD COLUMN `critChance` FLOAT NOT NULL DEFAULT '0' AFTER `remainCharges`,
ADD COLUMN `applyResilience` TINYINT(3) NOT NULL DEFAULT '0' AFTER `critChance`;
@@ -5797,18 +5797,14 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
Unit::DealDamageMods(target, damage, &absorb);
// Set trigger flag
uint32 procAttacker = PROC_FLAG_NONE, procVictim = PROC_FLAG_NONE;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_CASTER_PROCS))
procAttacker = PROC_FLAG_DEAL_PERIODIC;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 procAttacker = PROC_FLAG_DEAL_PERIODIC;
uint32 procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 hitMask = damageInfo.GetHitMask();
if (damage)
{
hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
}
int32 overkill = damage - target->GetHealth();
@@ -5892,19 +5888,14 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
damage = damageInfo.GetDamage();
// Set trigger flag
uint32 procAttacker = PROC_FLAG_NONE, procVictim = PROC_FLAG_NONE;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_CASTER_PROCS))
procAttacker = PROC_FLAG_DEAL_PERIODIC;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 procAttacker = PROC_FLAG_DEAL_PERIODIC;
uint32 procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 hitMask = damageInfo.GetHitMask();
if (damage)
{
hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
}
int32 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
@@ -6037,11 +6028,8 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
if (GetAuraType() == SPELL_AURA_OBS_MOD_HEALTH)
return;
uint32 procAttacker = PROC_FLAG_NONE, procVictim = PROC_FLAG_NONE;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_CASTER_PROCS))
procAttacker = PROC_FLAG_DEAL_PERIODIC;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 procAttacker = PROC_FLAG_DEAL_PERIODIC;
uint32 procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
// ignore item heals
@@ -6213,19 +6201,14 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con
caster->SendSpellNonMeleeDamageLog(&damageInfo);
// Set trigger flag
uint32 procAttacker = PROC_FLAG_NONE, procVictim = PROC_FLAG_NONE;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_CASTER_PROCS))
procAttacker = PROC_FLAG_DEAL_PERIODIC;
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 procAttacker = PROC_FLAG_DEAL_PERIODIC;
uint32 procVictim = PROC_FLAG_TAKE_PERIODIC;
uint32 hitMask = createProcHitMask(&damageInfo, SPELL_MISS_NONE);
uint32 spellTypeMask = PROC_SPELL_TYPE_NO_DMG_HEAL;
if (damageInfo.damage)
{
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_TARGET_PROCS))
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
spellTypeMask |= PROC_SPELL_TYPE_DAMAGE;
}
+15 -7
View File
@@ -2533,7 +2533,8 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
// Spells with this flag cannot trigger if effect is cast on self
bool const canEffectTrigger = (!spell->m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_CASTER_PROCS) || !spell->m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_TARGET_PROCS))
&& spell->unitTarget->CanProc();
&& spell->unitTarget->CanProc()
&& (spell->CanExecuteTriggersOnHit(EffectMask) || MissCondition == SPELL_MISS_IMMUNE || MissCondition == SPELL_MISS_IMMUNE2);
// Trigger info was not filled in Spell::prepareDataForTriggerSystem - we do it now
if (canEffectTrigger && !procAttacker && !procVictim)
@@ -2566,7 +2567,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
procAttacker |= PROC_FLAG_DEAL_PERIODIC;
procVictim |= PROC_FLAG_TAKE_PERIODIC;
}
else if (spell->m_spellInfo->HasAttribute(SPELL_ATTR0_ABILITY))
else if (spell->m_spellInfo->HasAttribute(SPELL_ATTR0_IS_ABILITY))
{
if (positive)
{
@@ -2658,7 +2659,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
spellDamageInfo = std::make_unique<DamageInfo>(damageInfo, SPELL_DIRECT_DAMAGE, spell->m_attackType, hitMask);
procSpellType |= PROC_SPELL_TYPE_DAMAGE;
if (caster->GetTypeId() == TYPEID_PLAYER && !spell->m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && !spell->m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS) &&
if (caster->GetTypeId() == TYPEID_PLAYER && !spell->m_spellInfo->HasAttribute(SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT) && !spell->m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS) &&
(spell->m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || spell->m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
caster->ToPlayer()->CastItemCombatSpell(*spellDamageInfo);
}
@@ -2688,13 +2689,19 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell)
// Do triggers for unit
if (canEffectTrigger)
{
if (spell->m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_CASTER_PROCS))
procAttacker = PROC_FLAG_NONE;
if (spell->m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_TARGET_PROCS))
procVictim = PROC_FLAG_NONE;
Unit::ProcSkillsAndAuras(caster, spell->unitTarget, procAttacker, procVictim, procSpellType, PROC_SPELL_PHASE_HIT, hitMask, spell, spellDamageInfo.get(), healInfo.get());
// item spells (spell hit of non-damage spell may also activate items, for example seal of corruption hidden hit)
if (caster->GetTypeId() == TYPEID_PLAYER && (procSpellType & (PROC_SPELL_TYPE_DAMAGE | PROC_SPELL_TYPE_NO_DMG_HEAL)))
{
if (spell->m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || spell->m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)
if (!spell->m_spellInfo->HasAttribute(SPELL_ATTR0_STOP_ATTACK_TARGET) && !spell->m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS))
if (!spell->m_spellInfo->HasAttribute(SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT) && !spell->m_spellInfo->HasAttribute(SPELL_ATTR4_CANT_TRIGGER_ITEM_SPELLS))
caster->ToPlayer()->CastItemCombatSpell(*spellDamageInfo);
}
}
@@ -3636,8 +3643,8 @@ void Spell::_cast(bool skipCheck)
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_AURA_INTERRUPT_FLAGS) && !m_spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_ACTION_AURA_INTERRUPT_FLAGS))
m_originalCaster->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::ActionDelayed);
m_originalCaster->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::ActionDelayed);
Unit::ProcSkillsAndAuras(m_originalCaster, nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr);
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_CASTER_PROCS))
Unit::ProcSkillsAndAuras(m_originalCaster, nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr);
// Call CreatureAI hook OnSuccessfulSpellCast
if (Creature* caster = m_originalCaster->ToCreature())
@@ -3895,7 +3902,8 @@ void Spell::_handle_finish_phase()
}
}
Unit::ProcSkillsAndAuras(m_originalCaster, nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_FINISH, m_hitMask, this, nullptr, nullptr);
if (!m_spellInfo->HasAttribute(SPELL_ATTR3_SUPPRESS_CASTER_PROCS))
Unit::ProcSkillsAndAuras(m_originalCaster, nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_FINISH, m_hitMask, this, nullptr, nullptr);
}
void Spell::SendSpellCooldown()