fix(Scripts/Spells): Move Eye of Gruul and Soul Preserver to the same script. (#22692)

Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
Benjamin Jackson
2025-10-09 15:57:16 -04:00
committed by GitHub
parent 5c053aabe5
commit a0fd180320
3 changed files with 60 additions and 42 deletions
@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (37705, 60510);
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(37705, 'spell_item_healing_trance'),
(60510, 'spell_item_healing_trance');
-22
View File
@@ -9289,28 +9289,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
{ {
switch (auraSpellInfo->Id) switch (auraSpellInfo->Id)
{ {
// Soul Preserver
case 60510:
{
switch (getClass())
{
case CLASS_DRUID:
trigger_spell_id = 60512;
break;
case CLASS_PALADIN:
trigger_spell_id = 60513;
break;
case CLASS_PRIEST:
trigger_spell_id = 60514;
break;
case CLASS_SHAMAN:
trigger_spell_id = 60515;
break;
}
target = this;
break;
}
case 37657: // Lightning Capacitor case 37657: // Lightning Capacitor
case 54841: // Thunder Capacitor case 54841: // Thunder Capacitor
case 67712: // Item - Coliseum 25 Normal Caster Trinket case 67712: // Item - Coliseum 25 Normal Caster Trinket
+56 -20
View File
@@ -1206,27 +1206,38 @@ class spell_item_direbrew_remote_aura : public AuraScript
} }
}; };
enum EyeOfGruul enum HealingTrance
{ {
SPELL_DRUID_ITEM_HEALING_TRANCE = 37721, SPELL_HEALING_DISCOUNT = 37705,
SPELL_PALADIN_ITEM_HEALING_TRANCE = 37723, SPELL_SOUL_PRESERVER = 60510,
SPELL_PRIEST_ITEM_HEALING_TRANCE = 37706, SPELL_PRIEST_EYE_OF_GRUUL_HEALING_TRANCE = 37706,
SPELL_SHAMAN_ITEM_HEALING_TRANCE = 37722 SPELL_DRUID_EYE_OF_GRUUL_HEALING_TRANCE = 37721,
SPELL_SHAMAN_EYE_OF_GRUUL_HEALING_TRANCE = 37722,
SPELL_PALADIN_EYE_OF_GRUUL_HEALING_TRANCE = 37723,
SPELL_DRUID_SOUL_PRESERVER_HEALING_TRANCE = 60512,
SPELL_PALADIN_SOUL_PRESERVER_HEALING_TRANCE = 60513,
SPELL_PRIEST_SOUL_PRESERVER_HEALING_TRANCE = 60514,
SPELL_SHAMAN_SOUL_PRESERVER_HEALING_TRANCE = 60515,
}; };
// 37705 - Healing Discount // 37705 - Healing Discount
class spell_item_eye_of_gruul_healing_discount : public AuraScript // 60510 - Soul Preserver
class spell_item_healing_trance : public AuraScript
{ {
PrepareAuraScript(spell_item_eye_of_gruul_healing_discount); PrepareAuraScript(spell_item_healing_trance);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
return ValidateSpellInfo( return ValidateSpellInfo(
{ {
SPELL_DRUID_ITEM_HEALING_TRANCE, SPELL_PRIEST_EYE_OF_GRUUL_HEALING_TRANCE,
SPELL_PALADIN_ITEM_HEALING_TRANCE, SPELL_DRUID_EYE_OF_GRUUL_HEALING_TRANCE,
SPELL_PRIEST_ITEM_HEALING_TRANCE, SPELL_SHAMAN_EYE_OF_GRUUL_HEALING_TRANCE,
SPELL_SHAMAN_ITEM_HEALING_TRANCE SPELL_PALADIN_EYE_OF_GRUUL_HEALING_TRANCE,
SPELL_DRUID_SOUL_PRESERVER_HEALING_TRANCE,
SPELL_PALADIN_SOUL_PRESERVER_HEALING_TRANCE,
SPELL_PRIEST_SOUL_PRESERVER_HEALING_TRANCE,
SPELL_SHAMAN_SOUL_PRESERVER_HEALING_TRANCE,
}); });
} }
@@ -1235,32 +1246,57 @@ class spell_item_eye_of_gruul_healing_discount : public AuraScript
PreventDefaultAction(); PreventDefaultAction();
if (Unit* unitTarget = GetTarget()) if (Unit* unitTarget = GetTarget())
{ {
uint32 spell_id = 0; uint32 const itemSpell = GetSpellInfo()->Id;
switch (unitTarget->getClass()) uint32 spellId = 0;
if (itemSpell == SPELL_HEALING_DISCOUNT)
{ {
switch (unitTarget->getClass())
{
case CLASS_DRUID: case CLASS_DRUID:
spell_id = SPELL_DRUID_ITEM_HEALING_TRANCE; spellId = SPELL_DRUID_EYE_OF_GRUUL_HEALING_TRANCE;
break; break;
case CLASS_PALADIN: case CLASS_PALADIN:
spell_id = SPELL_PALADIN_ITEM_HEALING_TRANCE; spellId = SPELL_PALADIN_EYE_OF_GRUUL_HEALING_TRANCE;
break; break;
case CLASS_PRIEST: case CLASS_PRIEST:
spell_id = SPELL_PRIEST_ITEM_HEALING_TRANCE; spellId = SPELL_PRIEST_EYE_OF_GRUUL_HEALING_TRANCE;
break; break;
case CLASS_SHAMAN: case CLASS_SHAMAN:
spell_id = SPELL_SHAMAN_ITEM_HEALING_TRANCE; spellId = SPELL_SHAMAN_EYE_OF_GRUUL_HEALING_TRANCE;
break; break;
default: default:
return; // ignore for non-healing classes return; // ignore for non-healing classes
}
}
else if (itemSpell == SPELL_SOUL_PRESERVER)
{
switch (unitTarget->getClass())
{
case CLASS_DRUID:
spellId = SPELL_DRUID_SOUL_PRESERVER_HEALING_TRANCE;
break;
case CLASS_PALADIN:
spellId = SPELL_PALADIN_SOUL_PRESERVER_HEALING_TRANCE;
break;
case CLASS_PRIEST:
spellId = SPELL_PRIEST_SOUL_PRESERVER_HEALING_TRANCE;
break;
case CLASS_SHAMAN:
spellId = SPELL_SHAMAN_SOUL_PRESERVER_HEALING_TRANCE;
break;
default:
return; // ignore for non-healing classes
}
} }
unitTarget->CastSpell(unitTarget, spell_id, true, nullptr, aurEff); unitTarget->CastSpell(unitTarget, spellId, true, nullptr, aurEff);
} }
} }
void Register() override void Register() override
{ {
OnEffectProc += AuraEffectProcFn(spell_item_eye_of_gruul_healing_discount::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); OnEffectProc += AuraEffectProcFn(spell_item_healing_trance::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
} }
}; };
@@ -4292,7 +4328,7 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_summon_or_dismiss); RegisterSpellScript(spell_item_summon_or_dismiss);
RegisterSpellScript(spell_item_draenic_pale_ale); RegisterSpellScript(spell_item_draenic_pale_ale);
RegisterSpellAndAuraScriptPair(spell_item_direbrew_remote, spell_item_direbrew_remote_aura); RegisterSpellAndAuraScriptPair(spell_item_direbrew_remote, spell_item_direbrew_remote_aura);
RegisterSpellScript(spell_item_eye_of_gruul_healing_discount); RegisterSpellScript(spell_item_healing_trance);
RegisterSpellScript(spell_item_summon_argent_knight); RegisterSpellScript(spell_item_summon_argent_knight);
RegisterSpellScript(spell_item_instant_statue); RegisterSpellScript(spell_item_instant_statue);
// 23074 Arcanite Dragonling // 23074 Arcanite Dragonling