Scripts/Spells: Migrate Some Scripted Spells to Scripts

Port From (https://github.com/TrinityCore/TrinityCore/commit/d72e809ecf9349d45127e743d23a8391bddabc41)
This commit is contained in:
hondacrx
2021-12-01 11:29:31 -05:00
parent c59535dc05
commit 0257f00aab
5 changed files with 174 additions and 156 deletions
+25 -1
View File
@@ -28,6 +28,10 @@ namespace Scripts.Spells.Quest
{
struct SpellIds
{
//BendingShinbone
public const uint BendingShinbone1 = 8854;
public const uint BendingShinbone2 = 8855;
//Thaumaturgychannel
public const uint ThaumaturgyChannel = 21029;
@@ -355,8 +359,28 @@ namespace Scripts.Spells.Quest
uint _despawnTime;
}
// 9712 - Thaumaturgy Channel
[Script]
class spell_q1846_bending_shinbone : SpellScript
{
void HandleScriptEffect(uint effIndex)
{
Item target = GetHitItem();
Unit caster = GetCaster();
if (!target && !caster.IsPlayer())
return;
uint spellId = RandomHelper.randChance(20) ? SpellIds.BendingShinbone1 : SpellIds.BendingShinbone2;
caster.CastSpell(caster, spellId, new CastSpellExtraArgs(TriggerCastFlags.FullMask)
.SetOriginalCastId(GetSpell().m_castId));
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleScriptEffect, 0, SpellEffectName.ScriptEffect));
}
}
[Script] // 9712 - Thaumaturgy Channel
class spell_q2203_thaumaturgy_channel : AuraScript
{
public override bool Validate(SpellInfo spellInfo)