diff --git a/sql/migrations/20250718071524_world.sql b/sql/migrations/20250718071524_world.sql new file mode 100644 index 000000000..2bdcbc04f --- /dev/null +++ b/sql/migrations/20250718071524_world.sql @@ -0,0 +1,20 @@ +DROP PROCEDURE IF EXISTS add_migration; +DELIMITER ?? +CREATE PROCEDURE `add_migration`() +BEGIN +DECLARE v INT DEFAULT 1; +SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20250718071524'); +IF v = 0 THEN +INSERT INTO `migrations` VALUES ('20250718071524'); +-- Add your query below. + + +UPDATE `spell_template` SET `script_name`='spell_priest_power_word_shield' WHERE `entry` IN (17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 27607); + + +-- End of migration. +END IF; +END?? +DELIMITER ; +CALL add_migration(); +DROP PROCEDURE IF EXISTS add_migration; diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index f5bfd9eda..74bab7c50 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -3895,13 +3895,13 @@ std::string ChatHandler::GetNameLink(Player* chr) const return playerLink(chr->GetName()); } -std::string ChatHandler::GetNameLink(uint32 guidLow) const -{ - std::string name; - if (sObjectMgr.GetPlayerNameByGUID(ObjectGuid(HIGHGUID_PLAYER, guidLow), name)) - return playerLink(name); - else - return playerLink(std::to_string(guidLow)); +std::string ChatHandler::GetNameLink(uint32 guidLow) const +{ + std::string name; + if (sObjectMgr.GetPlayerNameByGUID(ObjectGuid(HIGHGUID_PLAYER, guidLow), name)) + return playerLink(name); + else + return playerLink(std::to_string(guidLow)); } std::string ChatHandler::GetItemLink(ItemPrototype const* pItem) const diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 6dfe18e90..c4ef4b178 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -3875,11 +3875,6 @@ void Spell::cast(bool skipCheck) break; case SPELLFAMILY_PRIEST: { - // Power Word: Shield - // Nostalrius : Ivina : removed 27779 from cases = priest T0/T0.5 shield proc. - if (m_spellInfo->IsFitToFamily() && (m_spellInfo->Id != 27779)) - AddPrecastSpell(6788); // Weakened Soul - switch (m_spellInfo->Id) { case 15237: diff --git a/src/scripts/spells/spell_priest.cpp b/src/scripts/spells/spell_priest.cpp index 86933c2b0..b28418335 100644 --- a/src/scripts/spells/spell_priest.cpp +++ b/src/scripts/spells/spell_priest.cpp @@ -59,6 +59,28 @@ SpellScript* GetScript_PriestTouchOfWeakness(SpellEntry const*) return new PriestTouchOfWeaknessScript(); } +// 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 27607 - Power Word: Shield +struct PriestPowerWordShieldScript : SpellScript +{ + enum + { + SPELL_WEAKENED_SOUL = 6788, + }; + + void OnHit(Spell* spell, SpellMissInfo missInfo) const final + { + if (missInfo == SPELL_MISS_NONE && spell->GetUnitTarget()) + { + spell->m_caster->CastSpell(spell->GetUnitTarget(), SPELL_WEAKENED_SOUL, true); + } + } +}; + +SpellScript* GetScript_PriestPowerWordShield(SpellEntry const*) +{ + return new PriestPowerWordShieldScript(); +} + void AddSC_priest_spell_scripts() { Script* newscript; @@ -67,4 +89,9 @@ void AddSC_priest_spell_scripts() newscript->Name = "spell_priest_touch_of_weakness"; newscript->GetSpellScript = &GetScript_PriestTouchOfWeakness; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "spell_priest_power_word_shield"; + newscript->GetSpellScript = &GetScript_PriestPowerWordShield; + newscript->RegisterSelf(); }