diff --git a/sql/base/dbc/cmangos_fixes/Spell.sql b/sql/base/dbc/cmangos_fixes/Spell.sql index b7fd8a8eb38..7d171e7d6b4 100644 --- a/sql/base/dbc/cmangos_fixes/Spell.sql +++ b/sql/base/dbc/cmangos_fixes/Spell.sql @@ -3517,6 +3517,8 @@ UPDATE spell_template SET EffectSpellClassMask1_1=0x00000000,EffectSpellClassMas UPDATE spell_template SET EffectSpellClassMask1_1=8388608 WHERE Id IN(57870); -- Glyph of Remove Curse - wrong mask UPDATE spell_template SET EffectSpellClassMask1_2=0x01000000 WHERE Id IN(56364); +-- Glyph of Shadow - condition done with code instead - faulty mask +UPDATE spell_template SET EffectSpellClassMask1_2=0 WHERE Id IN(55689); -- fully custom, modelled after 65220 - glyph of snake trap avoidance INSERT INTO spell_template(Id, Category, Dispel, Mechanic, Attributes, AttributesEx, AttributesEx2, AttributesEx3, AttributesEx4, AttributesEx5, AttributesEx6, AttributesEx7, Stances, Stances2, StancesNot, StancesNot2, Targets, TargetCreatureType, RequiresSpellFocus, FacingCasterFlags, CasterAuraState, TargetAuraState, CasterAuraStateNot, TargetAuraStateNot, CasterAuraSpell, TargetAuraSpell, ExcludeCasterAuraSpell, ExcludeTargetAuraSpell, CastingTimeIndex, RecoveryTime, CategoryRecoveryTime, InterruptFlags, AuraInterruptFlags, ChannelInterruptFlags, ProcFlags, ProcChance, ProcCharges, MaxLevel, BaseLevel, SpellLevel, DurationIndex, PowerType, ManaCost, ManaCostPerlevel, ManaPerSecond, ManaPerSecondPerLevel, RangeIndex, Speed, ModalNextSpell, StackAmount, Totem1, Totem2, Reagent1, Reagent2, Reagent3, Reagent4, Reagent5, Reagent6, Reagent7, Reagent8, ReagentCount1, ReagentCount2, ReagentCount3, ReagentCount4, ReagentCount5, ReagentCount6, ReagentCount7, ReagentCount8, EquippedItemClass, EquippedItemSubClassMask, EquippedItemInventoryTypeMask, Effect1, Effect2, Effect3, EffectDieSides1, EffectDieSides2, EffectDieSides3, EffectRealPointsPerLevel1, EffectRealPointsPerLevel2, EffectRealPointsPerLevel3, EffectBasePoints1, EffectBasePoints2, EffectBasePoints3, EffectMechanic1, EffectMechanic2, EffectMechanic3, EffectImplicitTargetA1, EffectImplicitTargetA2, EffectImplicitTargetA3, EffectImplicitTargetB1, EffectImplicitTargetB2, EffectImplicitTargetB3, EffectRadiusIndex1, EffectRadiusIndex2, EffectRadiusIndex3, EffectApplyAuraName1, EffectApplyAuraName2, EffectApplyAuraName3, EffectAmplitude1, EffectAmplitude2, EffectAmplitude3, EffectMultipleValue1, EffectMultipleValue2, EffectMultipleValue3, EffectChainTarget1, EffectChainTarget2, EffectChainTarget3, EffectItemType1, EffectItemType2, EffectItemType3, EffectMiscValue1, EffectMiscValue2, EffectMiscValue3, EffectMiscValueB1, EffectMiscValueB2, EffectMiscValueB3, EffectTriggerSpell1, EffectTriggerSpell2, EffectTriggerSpell3, EffectPointsPerComboPoint1, EffectPointsPerComboPoint2, EffectPointsPerComboPoint3, EffectSpellClassMask1_1, EffectSpellClassMask1_2, EffectSpellClassMask1_3, EffectSpellClassMask2_1, EffectSpellClassMask2_2, EffectSpellClassMask2_3, EffectSpellClassMask3_1, EffectSpellClassMask3_2, EffectSpellClassMask3_3, SpellVisual, SpellVisual2, SpellIconID, ActiveIconID, SpellPriority, SpellName, SpellName2, SpellName3, SpellName4, SpellName5, SpellName6, SpellName7, SpellName8, SpellName9, SpellName10, SpellName11, SpellName12, SpellName13, SpellName14, SpellName15, SpellName16, Rank1, Rank2, Rank3, Rank4, Rank5, Rank6, Rank7, Rank8, Rank9, Rank10, Rank11, Rank12, Rank13, Rank14, Rank15, Rank16, ManaCostPercentage, StartRecoveryCategory, StartRecoveryTime, MaxTargetLevel, SpellFamilyName, SpellFamilyFlags, SpellFamilyFlags2, MaxAffectedTargets, DmgClass, PreventionType, StanceBarOrder, DmgMultiplier1, DmgMultiplier2, DmgMultiplier3, MinFactionId, MinReputation, RequiredAuraVision, TotemCategory1, TotemCategory2, AreaId, SchoolMask, RuneCostID, SpellMissileID, PowerDisplayId, EffectBonusCoefficient1, EffectBonusCoefficient2, EffectBonusCoefficient3, SpellDescriptionVariableID, SpellDifficultyId, IsServerSide, AttributesServerside) VALUES diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 674601885b6..bb32ea01966 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -1236,7 +1236,12 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (34865,'spell_circle_of_healing'), (34866,'spell_circle_of_healing'), (48088,'spell_circle_of_healing'), -(48089,'spell_circle_of_healing'); +(48089,'spell_circle_of_healing'), +(55680,'spell_glyph_of_prayer_of_healing'), +(55689,'spell_glyph_of_shadow'), +(57989,'spell_shadowfiend_death'), +(71132,'spell_glyph_of_shadow_word_pain'), +(55677,'spell_glyph_of_dispel_magic'); -- Paladin INSERT INTO spell_scripts(Id, ScriptName) VALUES diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp index 9d47648b9e4..7b354a4f0f9 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp @@ -65,6 +65,7 @@ struct ShadowWordDeath : public SpellScript enum { MANA_LEECH_PASSIVE = 28305, + SPELL_SHADOWFIEND_DEATH = 57989, }; // 34433 - Shadowfiend @@ -73,6 +74,7 @@ struct Shadowfiend : public SpellScript void OnSummon(Spell* spell, Creature* summon) const override { summon->CastSpell(summon, MANA_LEECH_PASSIVE, TRIGGERED_OLD_TRIGGERED); + summon->CastSpell(nullptr, SPELL_SHADOWFIEND_DEATH, TRIGGERED_OLD_TRIGGERED); summon->AI()->AttackStart(spell->m_targets.getUnitTarget()); } }; @@ -116,8 +118,13 @@ enum }; // 33206 - Pain Suppression -struct PainSuppression : public AuraScript +struct PainSuppression : public SpellScript, public AuraScript { + void OnInit(Spell* spell) const override + { + spell->SetUsableWhileStunned(spell->GetCaster()->HasAura(63248)); // Glyph of Pain Suppression + } + void OnApply(Aura* aura, bool apply) const override { if (apply) @@ -128,6 +135,16 @@ struct PainSuppression : public AuraScript // 17 - Power Word: Shield struct PowerWordShieldPriest : public AuraScript { + int32 OnAuraValueCalculate(AuraCalcData& data, int32 value) const override + { + if (data.caster && data.caster->IsPlayer()) + { + if (Aura* borrowedTime = static_cast(data.caster)->GetKnownTalentRankAuraById(1202, EFFECT_INDEX_1)) + value += (borrowedTime->GetAmount() * data.caster->SpellBaseDamageBonusDone(GetSpellSchoolMask(data.spellProto)) / 100); + } + return value; + } + void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override { Unit* caster = aura->GetTarget(); @@ -149,8 +166,23 @@ struct PowerWordShieldPriest : public AuraScript } } } + + void OnApply(Aura* aura, bool apply) const override + { + Unit* caster = aura->GetCaster(); + if (!apply || !caster || aura->GetEffIndex() != EFFECT_INDEX_0) + return; + + // Glyph of Power Word: Shield + if (Aura* glyph = caster->GetAura(55672, EFFECT_INDEX_0)) + { + int32 heal = (glyph->GetModifier()->m_amount * aura->GetAmount()) / 100; + caster->CastCustomSpell(aura->GetTarget(), 56160, &heal, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED); + } + } }; +// 64844 - Divine Hymn struct DivineHymn : public SpellScript { void OnInit(Spell* spell) const override @@ -170,6 +202,7 @@ struct DivineHymn : public SpellScript } }; +// 64904 - Hymn of Hope struct HymnOfHope : public SpellScript { void OnInit(Spell* spell) const override @@ -189,6 +222,7 @@ struct HymnOfHope : public SpellScript } }; +// 34861 - Circle of Healing struct CircleOfHealing : public SpellScript { void OnInit(Spell* spell) const override @@ -208,19 +242,6 @@ struct CircleOfHealing : public SpellScript } }; -struct PowerWordShield : public AuraScript -{ - int32 OnAuraValueCalculate(AuraCalcData& data, int32 value) const override - { - if (data.caster && data.caster->IsPlayer()) - { - if (Aura* borrowedTime = static_cast(data.caster)->GetKnownTalentRankAuraById(1202, EFFECT_INDEX_1)) - value += (borrowedTime->GetAmount() * data.caster->SpellBaseDamageBonusDone(GetSpellSchoolMask(data.spellProto)) / 100); - } - return value; - } -}; - enum LightwellData { NPC_PRIEST_LIGHTWELL_1 = 31897, @@ -240,6 +261,7 @@ enum LightwellData SPELL_PRIEST_LIGHTWELL_CHARGES = 59907, }; +// 7001 - Lightwell Renew struct LightwellRenew : public AuraScript { void OnApply(Aura* aura, bool apply) const override @@ -261,6 +283,7 @@ struct LightwellRenew : public AuraScript } }; +// 60123 - Lightwell Renew struct LightwellRelay : public SpellScript { void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override @@ -304,6 +327,7 @@ struct LightwellRelay : public SpellScript } }; +// 55673 - Glyph of Lightwell struct GlyphOfLightwell : public AuraScript { void OnApply(Aura* aura, bool apply) const override @@ -350,6 +374,17 @@ struct GuardianSpiritPriest : public AuraScript aura->GetTarget()->RemoveAurasDueToSpell(aura->GetSpellProto()->Id); remainingDamage = 0; } + + void OnApply(Aura* aura, bool apply) const override + { + if (!apply && aura->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) + { + if (Unit* caster = aura->GetCaster()) + if (caster->IsPlayer()) + if (Aura const* glyph = caster->GetAura(63231, EFFECT_INDEX_0)) + static_cast(caster)->ModifyCooldown(47788, glyph->GetAmount() * 1000); + } + } }; // 57470 - Renewed Hope @@ -472,6 +507,67 @@ struct GlyphOfSmite : public AuraScript } }; +// 55680 - Glyph of Prayer of Healing +struct GlyphOfPrayerOfHealing : public AuraScript +{ + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override + { + procData.basepoints[0] = int32(procData.damage * aura->GetAmount() / 200); // 10% each tick + procData.triggeredSpellId = 56161; // Glyph of Prayer of Healing + return SPELL_AURA_PROC_OK; + } +}; + +// 55689 - Glyph of Shadow +struct GlyphOfShadow : public AuraScript +{ + bool OnCheckProc(Aura* /*aura*/, ProcExecutionData& data) const override + { + if (data.procFlags & (PROC_FLAG_DEAL_HARMFUL_PERIODIC | PROC_FLAG_TAKE_HARMFUL_PERIODIC)) // do not proc on dots + return false; + return true; + } +}; + +// 57989 - Shadowfiend Death +struct ShadowfiendDeath : public AuraScript +{ + bool OnCheckProc(Aura* aura, ProcExecutionData& /*data*/) const override + { + return !aura->GetTarget()->IsAlive(); + } + + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override + { + if (Unit* spawner = aura->GetTarget()->GetSpawner()) + if (spawner->HasAura(58228)) // Glyph of Shadowfiend + spawner->CastSpell(nullptr, 58227, TRIGGERED_OLD_TRIGGERED); + return SPELL_AURA_PROC_OK; + } +}; + +// 71132 - Glyph of Shadow Word: Pain +struct GlyphOfShadowWordPain : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override + { + spell->SetDamage(spell->GetCaster()->GetPower(POWER_MANA) / 100); // 1% + } +}; + +// 55677 - Glyph of Dispel Magic +struct GlyphOfDispelMagic : public AuraScript +{ + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override + { + if (!aura->GetTarget()->CanAssist(procData.target)) + return SPELL_AURA_PROC_FAILED; + + procData.basepoints[0] = int32(procData.target->GetMaxHealth() * aura->GetAmount() / 100); + return SPELL_AURA_PROC_OK; + } +}; + void LoadPriestScripts() { RegisterSpellScript("spell_power_infusion"); @@ -484,7 +580,6 @@ void LoadPriestScripts() RegisterSpellScript("spell_divine_hymn"); RegisterSpellScript("spell_hymn_of_hope"); RegisterSpellScript("spell_circle_of_healing"); - RegisterSpellScript("spell_power_word_shield"); RegisterSpellScript("spell_lightwell_renew"); RegisterSpellScript("spell_lightwell_relay"); RegisterSpellScript("spell_glyph_of_lightwell"); @@ -497,4 +592,9 @@ void LoadPriestScripts() RegisterSpellScript("spell_glyph_of_shadow_word_death"); RegisterSpellScript("spell_test_of_faith"); RegisterSpellScript("spell_glyph_of_smite"); + RegisterSpellScript("spell_glyph_of_prayer_of_healing"); + RegisterSpellScript("spell_glyph_of_shadow"); + RegisterSpellScript("spell_shadowfiend_death"); + RegisterSpellScript("spell_glyph_of_shadow_word_pain"); + RegisterSpellScript("spell_glyph_of_dispel_magic"); } diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index b35ed7980f3..40a744ab40d 100755 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -10505,22 +10505,6 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) } case SPELLFAMILY_PRIEST: { - // Power Word: Shield - if (apply && m_spellProto->SpellFamilyFlags & uint64(0x0000000000000001) && m_spellProto->Mechanic == MECHANIC_SHIELD) - { - Unit* caster = GetCaster(); - if (!caster) - return; - - // Glyph of Power Word: Shield - if (Aura* glyph = caster->GetAura(55672, EFFECT_INDEX_0)) - { - Aura* shield = GetAuraByEffectIndex(EFFECT_INDEX_0); - int32 heal = (glyph->GetModifier()->m_amount * shield->GetModifier()->m_amount) / 100; - caster->CastCustomSpell(m_target, 56160, &heal, nullptr, nullptr, TRIGGERED_OLD_TRIGGERED, nullptr, shield); - } - return; - } switch (GetId()) { // Abolish Disease (remove 1 more poison effect with Body and Soul) diff --git a/src/game/Spells/UnitAuraProcHandler.cpp b/src/game/Spells/UnitAuraProcHandler.cpp index 3d5afacd3b4..1cbed8ce7e1 100644 --- a/src/game/Spells/UnitAuraProcHandler.cpp +++ b/src/game/Spells/UnitAuraProcHandler.cpp @@ -1375,17 +1375,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(ProcExecutionData& data) target = this; break; } - // Shadowfiend Death (Gain mana if pet dies with Glyph of Shadowfiend) - case 57989: - { - Unit* owner = GetOwner(); - if (!owner || owner->GetTypeId() != TYPEID_PLAYER) - return SPELL_AURA_PROC_FAILED; - - // Glyph of Shadowfiend (need cast as self cast for owner, no hidden cooldown) - owner->CastSpell(owner, 58227, TRIGGERED_OLD_TRIGGERED, castItem, triggeredByAura); - return SPELL_AURA_PROC_OK; - } // Kill Command, pet aura case 58914: { @@ -1838,23 +1827,6 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(ProcExecutionData& data) triggered_spell_id = 28810; break; } - // Glyph of Dispel Magic - case 55677: - { - if (!target->CanAssist(this)) - return SPELL_AURA_PROC_FAILED; - - basepoints[0] = int32(target->GetMaxHealth() * triggerAmount / 100); - // triggered_spell_id in spell data - break; - } - // Glyph of Prayer of Healing - case 55680: - { - basepoints[0] = int32(damage * triggerAmount / 200); // 10% each tick - triggered_spell_id = 56161; // Glyph of Prayer of Healing - break; - } // Priest T10 Healer 2P Bonus case 70770: {