Scripts/Spells: Moved Blessing of Faith script to spell_items

Port From (https://github.com/TrinityCore/TrinityCore/commit/af0edf5afc2bc41b87f2408868f8bc5c2a3065e3)
This commit is contained in:
hondacrx
2022-03-09 17:55:12 -05:00
parent cac831cc57
commit 9d5dd66215
2 changed files with 49 additions and 47 deletions
+49
View File
@@ -37,6 +37,12 @@ namespace Scripts.Spells.Items
//ZezzaksShard
public const uint EyeOfGrillok = 38495;
// LowerCityPrayerbook
public const uint BlessingOfLowerCityDruid = 37878;
public const uint BlessingOfLowerCityPaladin = 37879;
public const uint BlessingOfLowerCityPriest = 37880;
public const uint BlessingOfLowerCityShaman = 37881;
//Alchemiststone
public const uint AlchemistStoneExtraHeal = 21399;
public const uint AlchemistStoneExtraMana = 21400;
@@ -586,6 +592,49 @@ namespace Scripts.Spells.Items
}
}
// 37877 - Blessing of Faith
class spell_item_blessing_of_faith : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.BlessingOfLowerCityDruid, SpellIds.BlessingOfLowerCityPaladin, SpellIds.BlessingOfLowerCityPriest, SpellIds.BlessingOfLowerCityShaman);
}
void HandleDummy(uint effIndex)
{
Unit unitTarget = GetHitUnit();
if (unitTarget != null)
{
uint spellId = 0;
switch (unitTarget.GetClass())
{
case Class.Druid:
spellId = SpellIds.BlessingOfLowerCityDruid;
break;
case Class.Paladin:
spellId = SpellIds.BlessingOfLowerCityPaladin;
break;
case Class.Priest:
spellId = SpellIds.BlessingOfLowerCityPriest;
break;
case Class.Shaman:
spellId = SpellIds.BlessingOfLowerCityShaman;
break;
default:
return; // ignore for non-healing classes
}
Unit caster = GetCaster();
caster.CastSpell(caster, spellId, true);
}
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleDummy, 0, SpellEffectName.Dummy));
}
}
// Item - 13503: Alchemist's Stone
// Item - 35748: Guardian's Alchemist Stone
// Item - 35749: Sorcerer's Alchemist Stone