diff options
-rw-r--r-- | sql/updates/7701_world_spell_dbc.sql | 1 | ||||
-rw-r--r-- | sql/world.sql | 2 | ||||
-rw-r--r-- | src/game/Spell.cpp | 39 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 6 |
4 files changed, 32 insertions, 16 deletions
diff --git a/sql/updates/7701_world_spell_dbc.sql b/sql/updates/7701_world_spell_dbc.sql new file mode 100644 index 00000000000..e5bcc19a098 --- /dev/null +++ b/sql/updates/7701_world_spell_dbc.sql @@ -0,0 +1 @@ +UPDATE `spell_dbc` SET `DurationIndex` = 4, `EffectImplicitTargetA1` = 25 WHERE `Id` = 61988; diff --git a/sql/world.sql b/sql/world.sql index 9629073a7ee..8cc6cd24784 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -5199,7 +5199,7 @@ INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`A (58888, 0, 0, 0, 0, 0, 0x04000000, 0, 0, 0, 1, 0, 0, 101, 0, 0, 68, 68, 0, 1, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58889, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Ritual of Souls Rank 2 - Trigger Create Soulwell (58889)'), (34145, 0, 0, 0, 0, 0, 0x04000000, 0, 0, 0, 1, 0, 0, 101, 0, 0, 80, 80, 0, 1, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29886, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Ritual of Souls Rank 1 - Trigger Create Soulwell (29886)'), (200000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8, 1, 0, -1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 'Drain Soul increased damage - serverside spell'), -(61988, 0, 0, 0x28000180, 0x10000400, 0x4, 0x10100000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 9, 13, 0, '-1', 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Divine Shield Exclude Aura - 61988'), +(61988, 0, 0, 0x28000180, 0x10000400, 0x4, 0x10100000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 4, 13, 0, '-1', 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Divine Shield Exclude Aura - 61988'), (42876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 9275 reward serverside spell'), (44987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 11521 reward serverside spell'), (48803, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Quest 12214 reward serverside spell'), diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0f097f12ef4..c0948ce3bdd 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1415,7 +1415,6 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) if (m_preCastSpell) { // Special spell id - // TODO: Handle all of special spells in one place? if(m_preCastSpell==61988) { //Cast Forbearance @@ -1423,14 +1422,9 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) // Cast Avenging Wrath Marker m_caster->CastSpell(unit,61987, true, m_CastItem); } - // Avenging Wrath Marker - else if (m_preCastSpell==61987) - { - // Cast unknown spell (client will use to determine if Divine Shield is castable) - m_caster->CastSpell(unit,61988, true, m_CastItem); - } - else if (sSpellStore.LookupEntry(m_preCastSpell)) - m_caster->CastSpell(unit,m_preCastSpell, true, m_CastItem); + if (sSpellStore.LookupEntry(m_preCastSpell)) + // Blizz seems to just apply aura without bothering to cast + m_caster->AddAura(m_preCastSpell, unit); } // spells with this flag can trigger only if not selfcast (eviscerate for example) @@ -4498,7 +4492,15 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_MOVING; } - if(Unit *target = m_targets.getUnitTarget()) + Unit *target; + + // In pure self-cast spells, the client won't send any unit target + if (m_targets.getTargetMask() == TARGET_FLAG_SELF || m_targets.getTargetMask() & TARGET_FLAG_CASTER) // TARGET_FLAG_SELF == 0, remember! + target = m_caster; + else + target = m_targets.getUnitTarget(); + + if (target) { // target state requirements (not allowed state), apply to self also if(!m_IsTriggeredSpell && m_spellInfo->TargetAuraStateNot && target->HasAuraState(AuraState(m_spellInfo->TargetAuraStateNot), m_spellInfo, m_caster)) @@ -4510,6 +4512,11 @@ SpellCastResult Spell::CheckCast(bool strict) if(m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell)) return SPELL_FAILED_TARGET_AURASTATE; + // Special exclude - Hand of Protection, Divine Protection, Divine Shield cannot be cast on target after it used Avenging Wrath + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->Mechanic == MECHANIC_IMMUNE_SHIELD) + if (target->HasAura(61987)) // Avenging Wrath Marker + return SPELL_FAILED_TARGET_AURASTATE; + if(!m_IsTriggeredSpell && target == m_caster && m_spellInfo->AttributesEx & SPELL_ATTR_EX_CANT_TARGET_SELF) return SPELL_FAILED_BAD_TARGETS; @@ -4578,11 +4585,15 @@ SpellCastResult Spell::CheckCast(bool strict) else return SPELL_FAILED_BAD_TARGETS; } - // Lay on Hands - cannot be casted on paladin after using Avenging Wrath - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN - && m_spellInfo->SpellFamilyFlags[0] & 0x0008000) - if (target->HasAura(61988)) // Avenging Wrath Marker (Not existing spell) + // Lay on Hands - cannot be self-cast on paladin with Forbearance or after using Avenging Wrath + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[0] & 0x0008000) + { + if (target->HasAura(61987)) // Avenging Wrath Marker + return SPELL_FAILED_TARGET_AURASTATE; + + if (target->HasAura(25771)) // Forbearance (we could test for the immune shield marker 61988 instead) return SPELL_FAILED_TARGET_AURASTATE; + } } } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index a5640ad4106..d563535b138 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4757,7 +4757,11 @@ void Spell::EffectHealMaxHealth(uint32 /*i*/) if(m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN) // Lay on Hands { if (m_caster && m_caster->GetGUID() == unitTarget->GetGUID()) - m_caster->CastSpell(m_caster, 25771, true); + { + m_caster->CastSpell(m_caster, 25771, true); // Forbearance + m_caster->CastSpell(m_caster, 61988, true); // Immune shield marker (serverside) + m_caster->CastSpell(m_caster, 61987, true); // Avenging Wrath marker + } addhealth = m_caster->GetMaxHealth(); } |