Skip to content

Commit f401a67

Browse files
committed
Fix Power Word Shield not applying Weakened Soul in older patches.
Closes #3055
1 parent 0a85bfe commit f401a67

File tree

4 files changed

+54
-12
lines changed

4 files changed

+54
-12
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
DROP PROCEDURE IF EXISTS add_migration;
2+
DELIMITER ??
3+
CREATE PROCEDURE `add_migration`()
4+
BEGIN
5+
DECLARE v INT DEFAULT 1;
6+
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20250718071524');
7+
IF v = 0 THEN
8+
INSERT INTO `migrations` VALUES ('20250718071524');
9+
-- Add your query below.
10+
11+
12+
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);
13+
14+
15+
-- End of migration.
16+
END IF;
17+
END??
18+
DELIMITER ;
19+
CALL add_migration();
20+
DROP PROCEDURE IF EXISTS add_migration;

src/game/Chat/Chat.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3895,13 +3895,13 @@ std::string ChatHandler::GetNameLink(Player* chr) const
38953895
return playerLink(chr->GetName());
38963896
}
38973897

3898-
std::string ChatHandler::GetNameLink(uint32 guidLow) const
3899-
{
3900-
std::string name;
3901-
if (sObjectMgr.GetPlayerNameByGUID(ObjectGuid(HIGHGUID_PLAYER, guidLow), name))
3902-
return playerLink(name);
3903-
else
3904-
return playerLink(std::to_string(guidLow));
3898+
std::string ChatHandler::GetNameLink(uint32 guidLow) const
3899+
{
3900+
std::string name;
3901+
if (sObjectMgr.GetPlayerNameByGUID(ObjectGuid(HIGHGUID_PLAYER, guidLow), name))
3902+
return playerLink(name);
3903+
else
3904+
return playerLink(std::to_string(guidLow));
39053905
}
39063906

39073907
std::string ChatHandler::GetItemLink(ItemPrototype const* pItem) const

src/game/Spells/Spell.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3875,11 +3875,6 @@ void Spell::cast(bool skipCheck)
38753875
break;
38763876
case SPELLFAMILY_PRIEST:
38773877
{
3878-
// Power Word: Shield
3879-
// Nostalrius : Ivina : removed 27779 from cases = priest T0/T0.5 shield proc.
3880-
if (m_spellInfo->IsFitToFamily<SPELLFAMILY_PRIEST, CF_PRIEST_POWER_WORD_SHIELD>() && (m_spellInfo->Id != 27779))
3881-
AddPrecastSpell(6788); // Weakened Soul
3882-
38833878
switch (m_spellInfo->Id)
38843879
{
38853880
case 15237:

src/scripts/spells/spell_priest.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,28 @@ SpellScript* GetScript_PriestTouchOfWeakness(SpellEntry const*)
5959
return new PriestTouchOfWeaknessScript();
6060
}
6161

62+
// 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 27607 - Power Word: Shield
63+
struct PriestPowerWordShieldScript : SpellScript
64+
{
65+
enum
66+
{
67+
SPELL_WEAKENED_SOUL = 6788,
68+
};
69+
70+
void OnHit(Spell* spell, SpellMissInfo missInfo) const final
71+
{
72+
if (missInfo == SPELL_MISS_NONE && spell->GetUnitTarget())
73+
{
74+
spell->m_caster->CastSpell(spell->GetUnitTarget(), SPELL_WEAKENED_SOUL, true);
75+
}
76+
}
77+
};
78+
79+
SpellScript* GetScript_PriestPowerWordShield(SpellEntry const*)
80+
{
81+
return new PriestPowerWordShieldScript();
82+
}
83+
6284
void AddSC_priest_spell_scripts()
6385
{
6486
Script* newscript;
@@ -67,4 +89,9 @@ void AddSC_priest_spell_scripts()
6789
newscript->Name = "spell_priest_touch_of_weakness";
6890
newscript->GetSpellScript = &GetScript_PriestTouchOfWeakness;
6991
newscript->RegisterSelf();
92+
93+
newscript = new Script;
94+
newscript->Name = "spell_priest_power_word_shield";
95+
newscript->GetSpellScript = &GetScript_PriestPowerWordShield;
96+
newscript->RegisterSelf();
7097
}

0 commit comments

Comments
 (0)